SQL help required -


i have question asks:

make list of data stored in da_students, da_enrolments , da_courses. write query makes columns appear once in output, rows sorted students' first name ascending , course_id descending students grouped course (without using group clause) , generated first/ last names( fname.., lname...) not appear in output.

the current code have is:

select * da_students     full join da_enrolments on student_id = student_student_id      full join da_courses on course_course_id = course_id order first_name asc, course_id desc; 

any please?

to start with: sorting thing not explained. looks indented obfuscate. sort student name , course have students grouped course in end, means order course , student.

then: "generated first/last names ... not appear in output". what? how generated? aren't simple columns in students table? showing in output or not: state want show in select clause. other columns not shown of course.

as "make list of data stored in da_students, da_enrolments , da_courses": means students, courses plus associtated enrolements:

from da_students s cross join da_courses c left join da_enrolments e on e.student_id = s.student_id , e.course_id = c.course_id 

as "write query makes columns appear once in output": means, don't

select * 

nor

select s.student_id, e.student_id, ... 

but only

select s.student_id, ... 

so show student id once.


Comments