Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

      

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. Salesltems Sales Inventory V InventoryID V InvoicelD 8 InventoryID 8 InvoiceID Name InvoiceDate OrderDate Quantity UnitPrice BeverageType Caffeinated CustomerID Flavored EmployeelD PurchasePrice CustomerPO 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. 81 Complete this question by entering your answers in the tabs below. Required A Required B Required C Required D Required E Required B What are the foreign keys in the Sales table? (Indicate your answers by selecting an "X" next to the applicable amounts.) InvoicelD InvoiceDate OrderDate CustomerID EmployeelD CustomerPO Required A Required B Required C Required D Required E How many sales transactions were made in March, 2017? SELECT COUNT InvoicelD FROM Sales WHERE InvoiceDate BETWEEN #3/1/2017# AND #3/31/2017# Required A Required B Required C Required D Required E Which sales transactions were made by the employee whose ID is 'S203 SELECT FROM Sales WHERE EmployeelD 'S2038' Required A Required B Required C Required D Required E List the inventory items with purchase price larger than $6,500. SELECT InvoicelD InvoiceDate FROM Sales WHERE PurchasePrice > 6500 Required A Required B Required C Required D Required E Write a query to find out the dollar amount of each sales transaction. SELECT SUM ([Quantity] * ]) AS Amount FROM WHERE Sales GROUP BY

Step by Step Solution

3.32 Rating (152 Votes )

There are 3 Steps involved in it

Step: 1

a As per the given tables the table for sales lacks any key The table for sales ha... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Organizational Behavior Key Concepts, Skills & Best Practices

Authors: Angelo Kinicki, Mel Fugate

5th edition

78137209, 978-0078137204

More Books

Students also viewed these Accounting questions

Question

1. Follow directions the first time.

Answered: 1 week ago

Question

Calculate the missing values

Answered: 1 week ago