Question: A sql-6-9.sql file has been opened for you. Write each of the following tasks as a SQL statement in a new line (remember that you

A sql-6-9.sql file has been opened for you.

Write each of the following tasks as a SQL statement in a new line (remember that you can source the file to compare the output reference):

Use the e_store database

Join the products and the reviews tables that would output this:

----+------------+-----------+ | id | name | avg_stars | +----+------------+-----------+ | 2 | Smartphone | 2.3333 | | 3 | PC | 3.0000 | +----+------------+-----------+ 2 rows in set (0.01 sec) 

THIS IS WHAT I PUT BUT I GOT

[Error]: Task 2. Expected: Join the products and the reviews tables

USE e_store;

SELECT products.id, name, AVG(stars) FROM products JOIN reviews ON products.id = product_id GROUP BY name, price, stock;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!