# PDF Archive

Easily share your PDF documents with your contacts, on the Web and Social Networks.

## ch4TAL .pdf

Original filename: ch4TAL.pdf
Title: Microsoft Word - Answers to TAL Distributors Exercises SQL Chapter 4(1)
Author: Eric

This PDF 1.7 document has been generated by / Microsoft: Print To PDF, and has been sent on pdf-archive.com on 04/10/2016 at 18:14, from IP address 129.81.x.x. The current document download page has been viewed 7211 times.
File size: 673 KB (7 pages).
Privacy: public file

### Document preview

1.
SELECT ITEMNUM, DESCRIPTION, PRICE
FROM ITEM;

2.
SELECT *
FROM ORDERS;

3.
SELECT CUSTOMERNAME
FROM CUSTOMER
WHERE CREDITLIMIT &gt;= 10000;

4.

SELECT ORDERNUM
FROM ORDERS
WHERE CUSTOMERNUM = '126'
AND ORDERDATE = #10/15/2015#;
5.
SELECT CUSTOMERNUM, CUSTOMERNAME
FROM CUSTOMER
WHERE REPNUM = '30'
OR REPNUM = '45';

6.
SELECT ITEMNUM, DESCRIPTION
FROM ITEM
WHERE NOT (CATEGORY = 'PZL');
or
SELECT ITEMNUM, DESCRIPTION
FROM ITEM
WHERE CATEGORY &lt;&gt; 'PZL';

7.
SELECT ITEMNUM, DESCRIPTION, ONHAND
FROM ITEM
WHERE ONHAND &gt;= 20
AND ONHAND &lt;= 40;
or
SELECT ITEMNUM, DESCRIPTION, ONHAND
FROM ITEM
WHERE ONHAND BETWEEN 20 AND 40;

8.
SELECT ITEMNUM, DESCRIPTION, ONHAND * PRICE AS ONHAND_VALUE
FROM ITEM
WHERE CATEGORY = 'TOY';

9.
SELECT ITEMNUM, DESCRIPTION, ONHAND * PRICE AS ON_HAND_VALUE
FROM ITEM
WHERE ONHAND * PRICE &gt;= 1500;

10.
SELECT ITEMNUM, DESCRIPTION
FROM ITEM
WHERE CATEGORY IN ('GME', 'PZL');

11.
In Access:
SELECT CUSTOMERNUM, CUSTOMERNAME
FROM CUSTOMER
WHERE CUSTOMERNAME LIKE ‘C*’;

12.
SELECT *
FROM ITEM
ORDER BY DESCRIPTION;

13.
SELECT *
FROM ITEM
ORDER BY STOREHOUSE, ITEMNUM;

14.
SELECT COUNT(*)
FROM CUSTOMER
WHERE BALANCE &gt; CREDITLIMIT;

15.
SELECT SUM(BALANCE)
FROM CUSTOMER
WHERE REPNUM = '15'
AND BALANCE &lt; CREDITLIMIT;

16.
SELECT ITEMNUM, DESCRIPTION, (PRICE*ONHAND) AS On_Hand_Value
FROM ITEM
WHERE ONHAND &gt;
(SELECT AVG(ONHAND)
FROM ITEM);

17.
SELECT MIN(PRICE)
FROM ITEM;

18.
SELECT ITEMNUM, DESCRIPTION, PRICE
FROM ITEM
WHERE PRICE =
(SELECT MIN(PRICE)
FROM ITEM);

19.
SELECT REPNUM, SUM(BALANCE)
FROM CUSTOMER
GROUP BY REPNUM
ORDER BY REPNUM;

20.
SELECT REPNUM, SUM(BALANCE)
FROM CUSTOMER
GROUP BY REPNUM
HAVING SUM(BALANCE) &gt; 5000
ORDER BY REPNUM;

23. [Critical Thinking]
SELECT ITEMNUM, DESCRIPTION, .9*PRICE AS DISCOUNTED_PRICE
FROM ITEM;