{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

HW06 - 1 Using equality joins select the students the names...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
1) Using equality joins: select the students, the names of their majors, and their grades select student.std_lname, student.std_fname, major.maj_desc, grade.GR_T01, grade.GR_T02, grade.GR_HW01, grade.GR_HW02, grade.GR_HW03, grade.GR_HW04, grade.GR_HW05, grade.GR_HW06, grade.GR_HW07, grade.GR_HW08, grade.GR_HW09, grade.GR_HW10, grade.GR_Q01, grade.GR_Q02, grade.GR_Q03, grade.GR_Q04, grade.GR_Q05, grade.GR_BONUS from student inner join major on student.maj_code = major.maj_code inner join grade on student.std_code = grade.std_code 2) Using an outer join: select all of the students and the names of their majors (if available) select student.std_lname, student.std_fname, major.maj_desc from student left outer join major on student.maj_code = major.maj_code where major.maj_desc is not null 3) Using an outer join: select all of the students and their grades (if available) select student.std_lname, student.std_fname, grade.GR_T01, grade.GR_T02, grade.GR_HW01, grade.GR_HW02, grade.GR_HW03, grade.GR_HW04, grade.GR_HW05, grade.GR_HW06, grade.GR_HW07, grade.GR_HW08, grade.GR_HW09, grade.GR_HW10, grade.GR_Q01, grade.GR_Q02, grade.GR_Q03, grade.GR_Q04, grade.GR_Q05, grade.GR_BONUS from student inner join grade on student.std_code = grade.std_code 4) Using outer joins: select the students, the names of their majors (if available), and the their grades (if available) select student.std_lname, student.std_fname, major.maj_desc, grade.GR_T01, grade.GR_T02, grade.GR_HW01, grade.GR_HW02, grade.GR_HW03,
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
grade.GR_HW04, grade.GR_HW05, grade.GR_HW06, grade.GR_HW07, grade.GR_HW08, grade.GR_HW09, grade.GR_HW10, grade.GR_Q01, grade.GR_Q02, grade.GR_Q03, grade.GR_Q04, grade.GR_Q05, grade.GR_BONUS from student left outer join grade on student.std_code = grade.std_code left outer join major on student.maj_code = major.maj_code where major.maj_desc is not null OR grade.GR_T01 is not null OR grade.GR_T02 is not null OR grade.GR_HW01 is not null OR grade.GR_HW02 is not null OR grade.GR_HW03 is not null OR grade.GR_HW04 is not null OR grade.GR_HW05 is not null OR grade.GR_HW06 is not null OR grade.GR_HW07 is not null OR grade.GR_HW08 is not null OR grade.GR_HW09 is not null OR grade.GR_HW10 is not null OR grade.GR_Q01 is not null OR grade.GR_Q02 is not null OR grade.GR_Q03 is not null OR grade.GR_Q04 is not null OR grade.GR_Q05 is not null OR grade.GR_BONUS is not null / 5) Using equality joins: select the majors, the name of the school they belong to, and their advisors’ names select maj_desc, sch_name, adv_lname, adv_fname from major inner join school on major.sch_code = school.sch_code
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}