Question: 6. (10 pts) write a SQL query to display the id and name of all the products that belong to the category with id =

 6. (10 pts) write a SQL query to display the id

6. (10 pts) write a SQL query to display the id and name of all the products that belong to the category with id = 1.

7. (15 pts) write a SQL query to display the total number of different products belonging to category 1 (categoryId =1), and their average price.

8. (20 pts) write a SQL query to display the id and name of each category, with the number of products that belong to the category.

9. (25 pts) write a SQL query to display the id and name of each category, with the number of products that belong to the category, and make sure ALL categories appear, even those with no products.

The following is a database design about receipts. A receipt represents a sale, and belongs to a store. A receipt has many receipt item's, where each item is for a product, and has a quantity. Each product belongs to exactly one category. The relational schema diagram is shown as follows: Receipt ld IssuedOn Storeld Store Id Name Receipt_Item Receiptld Productld Quantity Product Category ld Name Categoryld Price ld Name

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!