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. Required: a. What

Based on the three tables and the attributes below, write SQL commands for each question to retrieve the data from the database.image text in transcribed

Required:

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

image text in transcribed

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

image text in transcribed

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

image text in transcribed

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

image text in transcribed

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

image text in transcribed \begin{tabular}{|l|l|} \hline InvoicelD \\ \hline InvoiceDate \\ \hline OrderDate \\ \hline CustomerlD \\ \hline EmployeelD \\ \hline CustomerPO \\ \hline \end{tabular} \begin{tabular}{|l|l|l|l|l|l|l|} \hline SELECT & & & SUM & ([Quantity] & & ]) AS Amount \\ \hline FROM & & & & & \\ \hline WHERE & Sales & & & & \\ \hline GROUP BY & & & & \\ \hline \end{tabular} \begin{tabular}{|l|l|} \hline InvoicelD \\ \hline InvoiceDate \\ \hline OrderDate \\ \hline CustomerlD \\ \hline EmployeelD \\ \hline CustomerPO \\ \hline \end{tabular} \begin{tabular}{|l|l|l|l|l|l|l|} \hline SELECT & & & SUM & ([Quantity] & & ]) AS Amount \\ \hline FROM & & & & & \\ \hline WHERE & Sales & & & & \\ \hline GROUP BY & & & & \\ \hline \end{tabular}

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

Culture Audit In Financial Services Reporting On Behaviour To Conduct Regulators

Authors: Dr Roger Miles

1st Edition

1789667755, 978-1789667752

More Books

Students also viewed these Accounting questions