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...

The ________ may be used to read information from a file.

A) cout object B) the stream insertion operator C) file.in macro D) stream extraction operator E) None of the above

Computer Science & Information Technology

When several worksheets are grouped, inserting a row ________

A) inserts it only into the first worksheet in the group B) inserts it into all of the worksheets in the group C) displays an error message D) fails to insert a row into any of the worksheets in the group

Computer Science & Information Technology

The following is an example of a meta tag: In this meta tag example, _____ is the value for thenameattribute.?

A. ?Jordan Wells B. ?content C. ?meta D. ?author

Computer Science & Information Technology

?In what state is sending unsolicited e-mail illegal?

A. ?Florida B. ?Washington C. ?Maine D. ?New York

Computer Science & Information Technology