Consider the following database tables. Based on the given tables, Write an SQL query to retrieve...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Consider the following database tables. Based on the given tables, Write an SQL query to retrieve the average rating for each author. Include the author's name and the average rating in the view, and rename the average rating field as "AverageRating". Sort the result by the average rating in descending order. If necessary, you can create tables. Table: Books Book ID 1 2 3 4 Table: Reviews User ID 1001 1002 1003 1004 Table: Users User ID 1001 1002 1003 1004 Title To Kill a Mockingbird Pride and Prejudice The Great Gatsby 1984 Book ID 1 2 3 4 Username alice123 bob456 charlie789 david321 Author Harper Lee Jane Austen F. Scott Fitzgerald George Orwell Rating 4.5 4.2 3.9 4.7 Consider the following database tables. Based on the given tables, Write an SQL query to retrieve the average rating for each author. Include the author's name and the average rating in the view, and rename the average rating field as "AverageRating". Sort the result by the average rating in descending order. If necessary, you can create tables. Table: Books Book ID 1 2 3 4 Table: Reviews User ID 1001 1002 1003 1004 Table: Users User ID 1001 1002 1003 1004 Title To Kill a Mockingbird Pride and Prejudice The Great Gatsby 1984 Book ID 1 2 3 4 Username alice123 bob456 charlie789 david321 Author Harper Lee Jane Austen F. Scott Fitzgerald George Orwell Rating 4.5 4.2 3.9 4.7
Expert Answer:
Answer rating: 100% (QA)
emailID first name AUTHOR TOPIC topic name last name N 1 technical ... View the full answer
Related Book For
Posted Date:
Students also viewed these databases questions
-
Al, Barbara, Carol, and Dave have joined together to purchase two season tickets to the Giants home football games. Because there are eight home games, each person will get tickets to two games. Each...
-
Why would the probability of an employer offering retiree health insurance increase with the number of employees for large firms over 300 workers. Support your answer with scholarly resources.
-
Two-dimensional array operations: Movie Ratings program ** You have recently collected reviews from four movie reviewers where the reviewers are numbered 1-4. Each reviewer has rated six movies where...
-
An autoglass company located in Detroit produces mirrors for automobiles. The company supplies auto mirrors to a nearby Ford (The Ford Motor Company, Dearborn, MI) plant. The demand for mirrors from...
-
A space probe is to be placed in a circular orbit of 9000-km radius about the planet Venus in a specified plane. As the probe reaches A, the point of its original trajectory closest to Venus, it is...
-
There have been several attempts to represent the thermodynamic relations geometrically, the best known of these being Koenigs thermodynamic square shown in the figure. There is a systematic way of...
-
The price of a share is \(\$ 40\), and it is incremented in \(6 \%\) or it goes down in \(5 \%\) every three months. If the risk-free interest rate is \(8 \%\) per year, continuously compounded,...
-
Records kept at Bostons Brigham Hospital show an average of 1.4 maternity patients per hour check in during the 8 P.M. to 2 A.M. shift (that is, = 1.4 check-ins per hour). Assume that maternity...
-
During the spin cycle the time dependent angular speed of a washing machine drum is given by the equation ( t ) = at + bt 2 - ct 4 where a = 2.8 rad/s 2 , b = 0.35 rad/s 3 and c = 0.035 rad/s 5 . At...
-
You work in the human resources department of your company helping new employees fill out the necessary paperwork to get their first paycheck. There are a number of decisions that employees must make...
-
Write a small but complete High Order program that evaluates to a closure with a non-empty environment (that is, at least one non-primitive). Racket Language
-
A employee wants to choose a non-complying super fund and he asks you for general guidance. Explain the differences between a complying and non-complying fund. How this might affect the employee's...
-
There are two parts to this week's posting: Part 1 - How are is your stock portfolio doing, and did you modify your investment portfolio in Week 5? Part 2 - In the final section of your posting for...
-
Long-term care insurance policies (LTCI) offer inflation protection options that ensure benefits keep up with the increasing long-term care costs. These options can include automatic compound...
-
Mrs Young changes employers at age 46. She is given $8500 as her vested benefits in the company's pension plan. She invests this money in a registered retirement savings plan paying 8%, compounded...
-
Part B: Research ASX listed company Integrated Reporting Framework (a) Your text discusses the International Integrated Reporting Framework. (b)* According to Gleeson-White (2014, p.216), "When...
-
For businesses facing complex and turbulent businessenvironments, which of the following is true? Goals and objectives that are uncertain preventopportunism Traditional strategic controls are usually...
-
Suppose the index goes to 18 percent in year 5. What is the effective cost of the unrestricted ARM?
-
Write a SQL CREATE TABLE statement to create the PET_OWNER table, with OwnerID as a surrogate key. Justify your choices of column properties. PET_OWNER (OwnerID, OwnerLastName, OwnerFirstName,...
-
How do you create a new E-R diagram in the MySQL Workbench?
-
Write SQL statements to insert data into the PetWeight column you created in question 3.47. Use the PetWeight from the PET_3 table. PET_OWNER ( OwnerID , OwnerLastName, OwnerFirstName, OwnerPhone,...
-
If, during a stride, the stretch causes her center of mass to lower by \(10 \mathrm{~mm}\), what is the stored energy? A. \(3.0 \mathrm{~J}\) B. \(6.0 \mathrm{~J}\) C. \(9.0 \mathrm{~J}\) D. \(12...
-
A \(1.00 \mathrm{~kg}\) block is attached to a horizontal spring with spring INT constant \(2500 \mathrm{~N} / \mathrm{m}\). The block is at rest on a frictionless surface. A \(10.0 \mathrm{~g}\)...
-
We can make a static measurement to deduce the spring constant to use in the model. If a \(61 \mathrm{~kg}\) woman stands on a low wall with her full weight on the ball of one foot and the heel free...
Study smarter with the SolutionInn App