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?
Aselect subject,count(*) as Books from books,subjects where books.popularityrating > 7 group by subjects.subject
Bselect subject,count(*) as Books from books,subjects where books. authorid=subjects. authorid and books. popularityrating > 7 group by subjects.subject
Cselect subject,count(*) as Books from books,subjects where books.subjectid=subjects.subjectid and books.popularityrating = 7 group by subjects.subject
Dselect subject,count(*) as Books from books,subjects where books.subjectid=subjects.subjectid and books.popularityrating > 7 group by subjects.subject