Specify the following queries in SQL on the database schema of Figure 1.2.

(a) Retrieve the names and major departments of all straight-A students (students who have a grade of A in all their courses).

(b) Retrieve the names and major departments of all students who do not have any grade of A in any of their courses.

(a) SELECT Name, Major
FROM STUDENT
WHERE NOT EXISTS ( SELECT *
FROM GRADE_REPORT
WHERE StudentNumber= STUDENT.StudentNumber AND NOT(Grade='A'))

(b) SELECT Name, Major
FROM STUDENT
WHERE NOT EXISTS ( SELECT *
FROM GRADE_REPORT
WHERE StudentNumber= STUDENT.StudentNumber AND Grade='A' )

Computer Science & Information Technology

You might also like to view...

A ________ is a PowerPoint presentation with multiple pictures organized similarly to a traditional album

Fill in the blank(s) with correct word

Computer Science & Information Technology

Which of the following is true of parenthesis in Microsoft Excel 2016??

A. ?Excel uses parenthesis in formulas to interpret them correctly. B. ?Excel displays text and numbers only within parenthesis. C. ?The parenthesis function in Excel returns a random number between 0 and 1. D. ?The formulas in Excel always begin with an open parenthesis.

Computer Science & Information Technology