![Case Study: Alumni Database](https://data.docslib.org/img/3a60ab92a6e30910dab9bd827208bcff-1.webp)
<p> THE UNIVERSITY OF TEXAS AT DALLAS SCHOOL OF MANAGEMENT MIS 6326: DATABASE MANAGEMENT SYSTEMS SPRING 2000</p><p>Solution Key for Practice SQL Problems (HW#6)</p><p>1. Display the names of all the suppliers. SELECT NAME FROM SUPPLIERS;</p><p>2. For each quotation, display the part number, the supplier number, and the price quoted by that supplier. SELECT PARTNO, SUPPNO, PRICE FROM QUOTATIONS;</p><p>3. Display the part number, price, and quantity-on-order for all quotations from supplier # 61. SELECT PARTNO, PRICE, QONORDER FROM QUOTATIONS WHERE SUPPNO=61;</p><p>4. Display the part number for all parts that have a quantity on hand of at least 1000. SELECT PARTNO FROM INVENTORY WHERE QONHAND>=1000;</p><p>5. Display part number, price quoted, delivery time, and quantity on order on all quotations from suppliers with supplier numbers 51, 53, or 57. SELECT PARTNO, PRICE, DELIVERY_TIME, QONORDER FROM QUOTATIONS WHERE SUPPNO IN (51, 53, 57);</p><p>6. Display all information on those suppliers whose names have the string 'Parts' in it. SELECT * FROM SUPPLIERS WHERE NAME LIKE '%PARTS%';</p><p>7. Display the part number, price quoted, and quantity on order for quotations from all suppliers on those parts for which supplier # 61 has quoted a price. SELECT PARTNO, PRICE, QONORDER FROM QUOTATIONS WHERE PARTNO IN ( SELECT PARTNO FROM QUOTATIONS WHERE SUPPNO=61);</p><p>8. Display the total cost for each part that has been ordered from 'Eagle Hardware'. Include the part number and delivery time associated with each part. SELECT PARTNO, DELIVERY_TIME, PRICE*QONORDER AS TOTAL_COST FROM QUOTATIONS, SUPPLIERS WHERE SUPPLIERS.SUPPNO=QUOTATIONS.SUPPNO AND SUPPLIERS.NAME='EAGLE HARDWARE';</p><p>9. Display the supplier number and part number for those parts whose total order cost is less than $50.00. SELECT SUPPNO, PARTNO FROM QUOTATIONS WHERE PRICE*QONORDER<50;</p><p>10. Display the total amount needed to pay for all the parts ordered from the supplier 'Titanic Parts'. SELECT SUM(PRICE*QONORDER) AS TOTAL_AMOUNT FROM QUOTATIONS, SUPPLIERS WHERE SUPPLIERS.SUPPNO=QUOTATIONS.SUPPNO AND SUPPLIER.NAME='TITANIC PARTS';</p>
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages1 Page
-
File Size-