Work on Order database on the following queries using SQL statements. Copy and p
ID: 3862536 • Letter: W
Question
Work on Order database on the following queries using SQL statements. Copy and past 1) query question, and 2) SQL statement.
1. Display the total cost for each order that has been placed and rename the output columns.
2. Retrieve the average, highest, and lowest price of each product finish.
3. Display customer IDs who have made less than 2 orders.
4. Display the order IDs and the number of product types placed for each order.
PLEASE FINSIH ALL THE QUERIES. REVIEW FOR EXAM!!!!
Create a view for customer in New York and Florida.
Explanation / Answer
1. Select cust.id, ord.COUNT(OrderId) from Customer as cust, Order as ord GROUP BY CustomerID;
2. SELECT MIN(PRICE) AS MinPrice, MAX(PRICE) AS MaxPrice FROM (SELECT PRICE FROM PRICES LIMIT 10) tmp;
3. Select cust.id from Customer as cust where order<2;
4. SELECT customer_name, COUNT(DISTINCT product_ID) as products_count FROM customer_table INNER JOIN orders_table ON customer_table.customer_ID = orders_table.customer_ID GROUP BY customer_table.customer_ID, customer_name HAVING COUNT(DISTINCT product_ID) > 10;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.