0% found this document useful (0 votes)
32 views2 pages

CS 631 - DBMS Design

This document provides instructions for a homework assignment on relational algebra and SQL. Students are asked to create a Mail-Order database with sample data, then write relational algebra and SQL queries to retrieve information from the database for 10 different questions. The questions ask students to return names of parts under $20, customer pairs with the same zip code, customers who only ordered from employees in Wichita, employee names and total 1995 sales, customers with the most orders, most ordered parts by quantity, parts and their number of orders sorted by orders, average order wait time in days, customers with longest wait times, and orders over $100 with wait time.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views2 pages

CS 631 - DBMS Design

This document provides instructions for a homework assignment on relational algebra and SQL. Students are asked to create a Mail-Order database with sample data, then write relational algebra and SQL queries to retrieve information from the database for 10 different questions. The questions ask students to return names of parts under $20, customer pairs with the same zip code, customers who only ordered from employees in Wichita, employee names and total 1995 sales, customers with the most orders, most ordered parts by quantity, parts and their number of orders sorted by orders, average order wait time in days, customers with longest wait times, and orders over $100 with wait time.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

CS 631 DBMS Design RA/SQL Homework Dr. Assadipour Given the Mail-Order database on the following page. a.

. Create the database and insert the data into each table. b. For each of the following queries, give the RA and SQL statements. Make sure you show all the work and display the result of each query.

1. Get the names of parts that cost less than 20.00. 2. Get the pairs of customer number values of customers having the same zip code. 3. Get the names of customers who have ordered parts ONLY from employees living in Wichita. 4. Get the names of employees along with their total sales for the year 1995. 5. Get the names of customers who have placed the highest number of orders. 6. Get the names of parts that have been ordered the most (in terms of quantity ordered, not number of orders) 7. Ger the names of parts along with the number of orders they appear in, sorted in decreasing order of the number of orders. 8. Get the average waiting time for all orders in number of days. The waiting time for an order is defined as the difference between the shipped date and received date. 9. Get the names of customers who had to wait the longest for their orders to be shipped. 10. For all orders greater than 100.00, get the order number and the waiting time for the order.

You might also like