We continue from the two tables in lab3 part 2, and practice with functions and the GROUP BY statement.The data in each table should be as below
Table Product:
PROD_ID | PROD_NAME | PROD_PRICE | PROD_VENDOR |
1101 | Table | 100 | 2 |
1102 | Chair | 80 | 3 |
1103 | Armchair | 90 | 2 |
1104 | Nightstand | 110 | 1 |
1105 | Bed | 200 | 3 |
1106 | Dresser | 150 | 3 |
1107 | Daybed | 190 | 2 |
1108 | Ash Table | 120 | 2 |
1109 | Cherry Table | 130 | 2 |
1110 | Table - High | 100 | 2 |
1111 | Office Chair | 110 | 3 |
Table Vendor:
VEND_ID | VEND_NAME | VEND_ST |
1 | Green Way Inc | GA |
2 | Forrest LLC | NC |
3 | AmeriMart | NC |
Please write the SQL script and providescreenshots of results for thesebelow queries. Please include the SQL in textformat, and all screenshots in one singledocument.
- Find the total number of table products
- Find the average price of all tables
- Find the total number of products from each vendor
- Find the average prices by vendors (please include vendor namesin the query result)
- Find the average prices by states