Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please provide mySQL codes for 1-7. Use the cape_codd database for questions 1-6. 1. Write a SQL query that displays the sum of the QuantityOnHand

image text in transcribed
image text in transcribed
Please provide mySQL codes for 1-7.
Use the cape_codd database for questions 1-6. 1. Write a SQL query that displays the sum of the QuantityOnHand column from the inventory table where the SKU is 100100 or 100200. Use a column alias of TanksinStock for the aggregate column. 2. Write a SQL query that displays the number of the rows in the retail_order table. Use a column alias of NumberOfOrders for the aggregate column 3. Write a SQL query that displays the number of rows in the catalog_sku_2015 table where CatalogPage is not null. Use a column alias of ItemsInCatalog for the aggregate column. 4. Write a SQL query that displays the number of rows of the inventory table where QuantityOnHand is greater than or equal to 500. Use a column alias of WellStocked for the aggregate column. 5. Write a SQL query that displays the average of the OrderTotal column from the retail_order table. Use a column alias of AverageOrderAmount for the aggregate column. 6. Write a SQL query that displays the min and max of the OrderTotal column in the retail_order table. Use a column alias of SmallestOrderAmount for the min and LargestOrderAmount for the max. Use the vrg database for question 7. 7. Write a SQL query that displays the TransactionID column and the difference between the Sales Price and Acquistion Price columns from the trans table. Use a column alias of ProfitAmount for the calculated column. Remove rows where the difference between the Sales Price and AcquisitionPrice is NULL

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_2

Step: 3

blur-text-image_3

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

Graph Databases

Authors: Ian Robinson, Jim Webber, Emil Eifrem

1st Edition

1449356265, 978-1449356262

More Books

Students also viewed these Databases questions

Question

Record the transactions in SE 5 in the general journal for 2011.

Answered: 1 week ago

Question

Evaluate three pros and three cons of e-prescribing

Answered: 1 week ago