Question: Considering the following 4 tables: Please help with these SQL queries: Find the descriptions of items which have not been rated by any user. List
Considering the following 4 tables:



Please help with these SQL queries:
- Find the descriptions of items which have not been rated by any user.
- List the category and current price for all items costing more than 100, ordered by ascending category and, within category, by descending price.
- Find the names of pairs of users who have bought the same item, removing pairs such as (x,x), and keeping only one of (x,y) and (y,x) for user names x and y.
- Find the names of users and descriptions of items such that the user bought the item for a price greater than the current price.
- For each item which has at least two ratings, find the average rating for the item.
- For each user, find the descriptions of items they have bought but not rated.
Table user id, name) Result Grid | 2 id name W N H Smith John Tina 4 Sam NULL NULL Table item (id, description, category, price) price 8.99 5.50 Result Grid 3 e Filter Rows: id description category 5 The Hobbit book 6 White Fang book 7 Chair furniture 8 Sofa furniture 9 Shirt clothing 10 Shoes clothing Fridge appliances 12 Dishwasher appliances 39.99 545.00 50.99 150.50 645.00 399.99 NULL NULL NULL NULL Table buys (user, item, price) primary key(user, item), foreign key(user) references user(id). foreign key(item) references item(id) Result Grid 1 Filter Rows: user item price 0 00 un W WN N N ++ OSSOL00 8 8.99 545.00 50.99 645.00 545.00 150.50 399.99 5.50 39.99 NULL 4 4 7 HULL NULL Table rates (user, item, rating) primary key(user, item), foreign key(user) references user(id), foreign key(item) references item(id) Result Grid 1 e Filter Rc user item rating 5 5 8 w 5 5 HN N N M M M tt at E Evo 8 4 NULL 13 10 12 5 6 3 7 NULL 2 NULL NULL
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
