0% found this document useful (0 votes)
41 views3 pages

Lab Task-5: Supplier - Parts Database

This document provides tables of supplier, parts, and order data and queries to run on the data. The supplier table lists 5 suppliers with IDs, names, and cities. The parts table lists 6 parts with IDs, names, and colors. The orders table lists orders from suppliers including supplier ID, part ID, and quantity. 13 queries are provided to retrieve information from the tables like supplier names for parts not from Paris or suppliers of only red and green parts.

Uploaded by

sana
Copyright
© © All Rights Reserved
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)
41 views3 pages

Lab Task-5: Supplier - Parts Database

This document provides tables of supplier, parts, and order data and queries to run on the data. The supplier table lists 5 suppliers with IDs, names, and cities. The parts table lists 6 parts with IDs, names, and colors. The orders table lists orders from suppliers including supplier ID, part ID, and quantity. 13 queries are provided to retrieve information from the tables like supplier names for parts not from Paris or suppliers of only red and green parts.

Uploaded by

sana
Copyright
© © All Rights Reserved
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/ 3

Lab Task- 5

SUPPLIER –
PARTS DATABASE
Dt: 12-8-19

Note:
• Each student can change its own data of tables.
• Outputs should be different for each student.
• Submit the Record on Sat – 17-8-19
• According to the question each output should take
screenshots and take printouts and stick to the
record page beside to the each query or question.

1. SUPPLIER( SID, SNAME,CITY)


2. PARTS ( PID, PNAME, COLOR)
3. ORDERS ( SID, PID, QUANTITY)
/* SUPPLIER DATABASE */

SID SNAME CITY


------ ----------------- -----
s1 smith london

s2 jones paris
s3 blake paris
s4 clark london
s5 adams athens

/* PARTS TABLE */

PID PNAME COLOR


------ ----------------------
p2 bolt green
p3 screw blue
p4 screw red
p5 cam blue
p6 cog red

/*ORDERS TABLE */

SID PID QUANTITY


----- ------ -----------------
s1 p1 300
s1 p2 200
s1 p3 400
s1 p4 200
s1 p5 100
s1 p6 100
s2 p1 300
s2 p2 400
s3 p2 200
/* QUERIES */
1. Get Sid, sname for non Paris parts.
2. Get full details of all suppliers.
3. Get the total no. of suppliers.
4. Get maximum and Minimum Quantity for part p2.
5. For each part supply gets the part no.
and total shipment quantity.
6. Get part number for all parts supplied
by more than one supplier.
7. Get supplier names for suppliers who
supplied at least one red part.
8. Get the names of the suppliers who supply the part p2.
9. Get the supplier names for suppliers who do
not supply part p2. 10.Get snames who supply all
parts.
11. Get pname for parts supplied by xyz
supplier and by no one else.
12. Find the sid of suppliers who supply red or
green parts.
13. Find the sid of suppliers who supply both
red and green parts.

You might also like