Given the structure and contents of the SaleCo database shown in Figure below, use SQL commands to answer problems: SaleCo Database A) Write the SQL code that will create the table structure for table: INVOICE. Note: INV_NUMBER is the Primary Key CUS_CODE is the Foreign Key that references the CUSTOMER table B) Write the SQL code to enter two rows in the table CUSTOMER table. C) Write a SQL to compute and display for each Customer the Total Purchases, Number of Purchases and Average Purchases when the Total Purchases are more than 5000 dollars. D) Write a SQL to compute and display for each Product the Total Orders by Value, Number of Orders and Average Orders by Value, in descending order of Average Orders and the Product’s vendor (V_Name) is ‘Dell’. E) Write SQL code to list all vendors and the number of products they supply.
Given the structure and contents of the SaleCo
SaleCo Database
A) Write the SQL code that will create the table structure for table: INVOICE.
Note:
- INV_NUMBER is the Primary Key
CUS_CODE is the Foreign Key that references the CUSTOMER table
B) Write the SQL code to enter two rows in the table CUSTOMER table.
C) Write a SQL to compute and display for each Customer the Total Purchases, Number of Purchases and Average Purchases when the Total Purchases are more than 5000 dollars.
D) Write a SQL to compute and display for each Product the Total Orders by Value, Number of Orders and Average Orders by Value, in descending order of Average Orders and the Product’s vendor (V_Name) is ‘Dell’.
E) Write SQL code to list all vendors and the number of products they supply.


Trending now
This is a popular solution!
Step by step
Solved in 2 steps









