Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Based on the three tables and the attributes below, answer the question for Requ

ID: 3726632 • Letter: B

Question

Based on the three tables and the attributes below, answer the question for Requirement A and write SQL commands for Requirements B to E to retrieve the data from the database.

Required:

a. What are the foreign keys in the Sales table?

b. How many sales transactions were made in March, 2017?

c. Which sales transactions were made by the employee whose ID is ‘S2038’ in the system?

d. List the inventory items with purchase price larger than $6,500.

e. Write a query to find out the dollar amount of each sales transaction.

Inventory Salesltems Sales InventoryID Name BeverageType Caffeinated Flavored PurchasePrice InvoicelD InventoryID Quantity UnitPrice InvoiceID InvoiceDate OrderDate CustomerID EmployeeID CustomerPO OO

Explanation / Answer

a. InvoiceID and InventoryID

b. Select count(InvoiceID) from Sales where Month(OrderDate) = 'March' and year(OrderDate) = 2017;

c. Select * from Sales where EmployeeID = 'S2038';

d. Select * from Inventory where PurchasePrice > 6500;

e. Select InvoiceID,InventoryID,(Quantity*UnitPrice) as Amount from SalesItems;

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote