Download presentation
Presentation is loading. Please wait.
Published byGeoffrey Turner Modified over 5 years ago
1
ITEC 3220M Using and Designing Database Systems
Instructor: Prof. Z. Yang Course Website: Office: Tel 3049
2
Advanced Structured Query Language (SQL)
Chapter 8 Advanced Structured Query Language (SQL)
3
Exercise Write SQL codes to create the following tables CUSTOMER
ORDER_LINE Customer_ID Customer_Name City State 1 Value Furniture Plano TX 2 Home furnishings Albany NY 3 Eastern Furniture Carteret NJ 4 Furniture Gallery Order_ID Product_ID Quan 1001 1 2 1002 3 5 1003
4
Exercise (Cont’d) ORDER_P PRODUCT_P Order_ID Order_Date Customer_ID
1001 21-Oct-2000 1 1002 4 1003 22-Oct-2000 2 PRODUCT_P Product_ID Description Product_finish Standard_price 1 End Table Cherry 175 2 Coffee Table Natural Ash 200 3 Computer Desk 375
5
Exercise (Cont’d) Use SQL to design the following queries:
How many different items were ordered on order number 1001? List product ID and standard price for all desks and all tables that cost more than $200. What furniture is not made of cherry?
6
Exercise (Cont’d) Use SQL to design the following queries:
List all the customers who live in FL, TX and CA. Find only states with more than one customer. What are order numbers that have included furniture finished in natural Ash. What are the names of all customers who have placed orders?
7
Exercise (Cont’d) Use SQL to design the following queries:
For each customer who has placed an order, what is the customer’s name and order number? Which customers have not placed any order for computer desk? List the product name and price with the highest standard price.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.