Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Based on the three tables and the attributes below, write SQL commands for each question to retrieve the data from the database. 00 Inventory *

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Based on the three tables and the attributes below, write SQL commands for each question to retrieve the data from the database. 00 Inventory * InventoryID Name BeverageType Caffeinated Flavored Purchase Price Salesitems * InvoiceID 8 InventoryID Quantity UnitPrice Sales 8 InvoiceID InvoiceDate OrderDate CustomerID EmployeeID 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. Required A Required B Required C Required D Required E What are the foreign keys in the Sales table? (Select "Yes" if the attribute is a foreign key in the Sales table, and "No" if it is not a foreign key.) 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 FROM WHERE BETWEEN #3/1/2017# AND #3/31/2017# Which sales transactions were made by the employee whose ID is 'S2038' in the system? SELECT FROM WHERE 'S2038' Write a query to find out the dollar amount of each sales transaction. SELECT SUM ([Quantity] * 1) AS Amount FROM WHERE Sales GROUP BY

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Database Security

Authors: Alfred Basta, Melissa Zgola

1st Edition

1435453905, 978-1435453906

More Books

Students also viewed these Databases questions