Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Language: SQL Pseudocode (SELECT, GROUPBY and JOIN) The following three data tables describe the authors/clients, book titles, and sales to publishers for a certain literary

Language: SQL Pseudocode (SELECT, GROUPBY and JOIN) The following three data tables describe the authors/clients, book titles, and sales to publishers for a certain literary agency:

clients

cid first_name last_name sign_date agent
jsmith Jane Smith 2001-03-04 Nelson
adory April Dory 2001-03-04 Paige
shu Simon Hu 2003-01-29 Paige
jsmith2 Jane Smith 2006-11-09 Nelson
lortiz Lorena Ortiz 2010-09-26 Nelson

titles

title author genre word_count
The House on the Hill jsmith contemporary 106789
The Blue Diary jsmith contemporary 95019
Dragon Eaters adory fantasy 135501
Silent Wizards adory fantasy 126038
Forbidden Alchemy adory fantasy 111666
My Fathers Piano shu memoir 101365
Blueberry Pastures jsmith2 contemporary 95019
Sudden Confinement jsmith2 horror 95134
Rubi Saves the World lortiz young adult 76045

sales

title rights advance royalty
The House on the Hill domestic first print 15000 0.125
Dragon Eaters domestic first print 12000 0.100
Dragon Eaters foreign markets 5000 0.050
Dragon Eaters audio 4000 0.075
Blueberry Pastures domestic first print 15000 0.125
My Fathers Piano domestic first print 14500 0.100
My Fathers Piano foreign markets 14500 0.100
Rubi Saves the World domestic first print 13500 0.110
Rubi Saves the World audio 6000 0.060

Question: Find the number of books from each genre that each agent represents. The resulting table should by sorted by agent, and include agent, genre, and count. Provide a SQL-style pseudocode strategy (using relational data concepts such as SELECT, WHERE, GROUP BY, and JOIN) for solving the problem.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Sams Teach Yourself Beginning Databases In 24 Hours

Authors: Ryan Stephens, Ron Plew

1st Edition

067232492X, 978-0672324925

More Books

Students also viewed these Databases questions

Question

7. Discuss the advantages of embedded learning.

Answered: 1 week ago