Question:Consider the following tables:
Books |
---|
BookId |
BookName |
AuthorId |
SubjectId |
PopularityRating |
Language |
(the popularity of the book on a scale of 1 to 10)
(Language such as French, English, German etc)
(such as History, Geography, Mathematics etc)
Authors |
---|
AuthorId |
AuthorName |
Country |
What is the query to determine how many books, with a popularity rating of more than 7, have been written on each subject?
A select subject,count(*) as Books from books,subjects where books.popularityrating > 7 group by subjects.subject
B select subject,count(*) as Books from books,subjects where books. authorid=subjects. authorid and books. popularityrating > 7 group by subjects.subject
C select subject,count(*) as Books from books,subjects where books.subjectid=subjects.subjectid and books.popularityrating = 7 group by subjects.subject
D select subject,count(*) as Books from books,subjects where books.subjectid=subjects.subjectid and books.popularityrating > 7 group by subjects.subject