Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Aggregation Part of the Exercise . Select the maximum price of any item ordered in the items_ordered table. Hint: Select the maximum price only. .

Aggregation Part of the Exercise

. Select the maximum price of any item ordered in the items_ordered table. Hint: Select the maximum price only.

. Select the average price of all of the items ordered that were purchased in the month of Dec.

. What is the total number of rows in the items_ordered table?

. For all of the tents that were ordered in the items_ordered table, what is the price of the lowest tent? Hint: Your query should return the price only.

Group By Exercises

. How many people are in each unique state in the customers table? Select the state and display the number of people in each. Hint: count is used to count rows in a column, sum works on numeric data only.

. From the items_ordered table, select the item, maximum price, and minimum price for each specific item in the table. Hint: The items will need to be broken up into separate groups.

. How many orders did each customer make? Use the items_ordered table. Select the customerid, number of orders they made, and the sum of their orders.

Having Clause Exercise

. How many people are in each unique state in the customers table that have more than one person in the state? Select the state and display the number of how many people are in each if it's greater than 1.

. From the items_ordered table, select the item, maximum price, and minimum price for each specific item in the table. Only display the results if the maximum price for one of the items is greater than 190.00.

. How many orders did each customer make? Use the items_ordered table. Select the customerid, number of orders they made, and the sum of their orders if they purchased more than 1 item.

Ordered By Exercises

. Select the lastname, firstname, and city for all customers in the customers table. Display the results in Ascending Order based on the lastname.

. Same thing as exercise #1, but display the results in Descending order.

. Select the item and price for all of the items in the items_ordered table that the price is greater than 10.00. Display the results in Ascending order based on the price.

IN an BETWEEN Exercises

Select the date, item, and price from the items_ordered table for all of the rows that have a price value ranging from 10.00 to 80.00.

Select the first name, city, and state from the customers table for all of the rows where the state value is either: Arizona, Washington, Oklahoma, Colorado, or Hawaii.

Submit your Queries in a Texfile

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

SQL Server Query Performance Tuning

Authors: Sajal Dam, Grant Fritchey

4th Edition

1430267429, 9781430267423

More Books

Students also viewed these Databases questions

Question

What are Fatty acids?

Answered: 1 week ago

Question

What are Electrophoresis?

Answered: 1 week ago