Write an OQL query that, for each major, computes the number of students who have that major. Use the Student class de?ned in (14.14)

What will be an ideal response?



SELECT Major: M, count: count(S2.Id)
FROM StudentExt S, StudentExt S2, S.Major M
WHERE M IN S2.Major
GROUP BY M


We could also write this query using nested queries as follows:

SELECT DISTINCT Major: M,
count: count(SELECT S2.Id
FROM StudentExt S2
WHERE M IN S2.Major)
FROM StudentExt S, S.Major M

Computer Science & Information Technology

You might also like to view...

Show how to return the store allocated by this statement to the heap manager for reallocation.

Given the type definitions: ``` const int STRING_SIZE = 20; struct ListNode { char item[STRING_SIZE]; int count; ListNode * link; }; ListNode *head = new ListNode[10]; ```

Computer Science & Information Technology

A relational database has the ability to create relationships between two:

A) files. B) tables. C) fields. D) forms.

Computer Science & Information Technology

Dwight has a computer game, StarGazer, which he plays at work. StarGazer has a secret feature—it pops up an image of a spreadsheet on the screen any time he hits Shift-T on his keyboard, so that it looks like the user is actually working. Dwight uses this feature any time his boss walks by while he is playing StarGazer. What is this "feature" of StarGazer called?

What will be an ideal response?

Computer Science & Information Technology

Which of the following regulates the use and disclosure of individuals' personal health information?

a. Sarbanes-Oxley b. HIPAA c. PCI DDS d. Orange Book

Computer Science & Information Technology