Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For each of the queries below, write only one query that answers the question. Your query results must clearly provide the answer. All query results

For each of the queries below, write only one query that answers the question. Your query results must clearly provide the answer. All query results must show text values rather than identifiers. For example, when showing a department in the results, it should show 'Fitness' instead of its corresponding ID value, 2:
How many rows of data are stored for each table in the database? List the name of each table followed by the number of rows it has.
Which products are considered high-priced products? A high-priced product has a price exceeding $100.00. List the names and prices of the high-priced products.
List all orders placed by customers in the state of Florida. Note: The state abbreviation for Florida is 'FL'. Include the customers first names, last names, city, and segment, along with the order ID and order date.
List all products that fall in one of the following categories: 'Computers', 'Toys', 'Tennis & Racquet'. Include the products names, category, department, and price.
TerpBuy is considering reducing its product offerings. Which products have not yet been sold? Include the name, category, and department for each such product.
List the names of all cities from where orders are shipped. Also, for such cities, find the number of orders for which shipping was delayed. Sort the list of cities in order from the highest to the least number of shipping orders.
How many customers are there in each segment? Show the most popular segment at the top of the result. Incorporate a column alias in the result.
How many orders were placed in the first quarter of 2021? Note: A quarter consists of three months. Incorporate a column alias in the result. You can refer to the documentation on date functions provided here.
List in alphabetical order all states supporting multiple customer segments.
To help the commercial sales department with its marketing, find all customers in the corporate segment who have not placed any orders. Include each customers first name, last name, street, city, state, and zip code. Sort the results by the last name first and then by the first name.
There has been a recall of the product Nike Mens Free 5.0+ Running Shoe. TerpBuy would have to offer a discount coupon to all customers who purchased this product. Find all orders that included this product as a part of the purchase. For all such orders, list the customers first names, last names, street, state, zip code, and order date. Each customer can be offered only one discount coupon. Hence, do not list the same customer more than once.
Premium customers are those customers who have placed orders with order amounts greater than the average order amount. For each customer, find the first and last names, and the order amount for all orders that exceeded the average order amount.

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

Learning MySQL Get A Handle On Your Data

Authors: Seyed M M Tahaghoghi

1st Edition

0596529465, 9780596529468

More Books

Students also viewed these Databases questions