In the following exercises, you will use the data in the TAL Distributors database shown in Figure

Question:

In the following exercises, you will use the data in the TAL Distributors database shown in Figure 2-1 in Chapter 2. (If you use a computer to complete these exercises, use a copy of the original TAL Distributors database so you will still have the original data when you complete Chapter 4.) In each step, use SQL to obtain the desired results. You can use a DBMS to complete the exercises using a computer, or you can simply write the SQL command to complete each step. Check with your instructor if you are uncertain about which approach to take.

1. List the number and name of all customers.

2. List the complete Item table.

3. List the number and name of every customer represented by rep 15.

4. List the number and name of all customers that are represented by rep 15 and that have credit limits of $10,000.

5. List the number and name of all customers that are represented by rep 15 or that have credit limits of $10,000.

6. For each order, list the order number, order date, number of the customer that placed the order, and name of the customer that placed the order.

7. List the number and name of all customers represented by Megan Gradey.

8. How many customers have a credit limit of $15,000?

9. Find the total of the balances for all customers represented by rep 30.

10. Give the item number, description, and on-hand value (OnHand * Price) for each item in category GME.

11. List all columns and all rows in the Item table. Sort the results by Item description.

12. List all columns and all rows in the Item table. Sort the results by item number within category.
13. List the category and the sum of the number of items on hand. Group the results by category, and order the records by category.
14. Create a new table named Toy to contain the columns ItemNum, Description, OnHand, and Price for all rows on which the category is TOY.
15. In the Toy table, change the description of item DL51 to €œClassic Train Set.€
16. In the Toy table, delete every row on which the price is greater than $120.
17. There are two ways to create the query in Step 12. Write the SQL command that you used and then write the alternate command that also would obtain the correct result.
18. How would you modify the query in Step 6 to limit retrieval to only orders that were placed on 10/15/2015?

Figure 2-1

Rep City RepNum LastName FirstName Street Campos Gradey Tian State PostalCode Commission Rate $23,457.50 $41,317.00 $27,789.25 $0.00 Rafael 724 Vinca Dr. 632 Liatris St. Grove CA CA 15 90092 90085 0.06 Megan Hui 30 Fullton 0.08 1785 Tyler Ave. Northfield CA | 267 Oakley St. 45 90098 0,06 60 Sefton

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Concepts of Database Management

ISBN: 978-1285427102

8th edition

Authors: Philip J. Pratt, Mary Z. Last

Question Posted: