Shipment Database Exercise

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

Supplier (SNo, sname, scountry, discount)

Commodity (CNo, cname, origin)


Retailer (RNo, rname, town)
Shipments (RNo, CNo, SNo, shipmentdate, no_of_cases, weight)

Supplier
SNo sname scountry discount
S1 Able France 5
S2 Bakar France 5
S3 Charlie Italy 10
S4 David Spain 15
S5 Edward Germany 5
S6 Figaro Germany 10

Shipment
RNo CNo SNo shipmentdate no_of_cases weight
R1 C2 S4 12/03/94 110 7
R1 C2 S1 12/03/94 95 5
R2 C1 S1 14/02/94 80 4
R3 C2 S6 01/02/94 45 2
R3 C2 S5 09/03/94 35 1
R3 C4 S5 05/01/94 75 3
R2 C4 S5 11/01/94 95 5
R5 C5 S3 22/03/94 120 7
R5 C6 S2 23/12/94 110 7
R5 C3 S6 12/02/94 150 8
R6 C2 S4 18/01/94 90 5
R7 C1 S3 19/01/94 55 4
R7 C2 S3 27/02/94 85 6
R7 C6 S5 02/04/94 100 6
R2 C1 S5 15/02/94 45 3
R4 C3 S5 17/03/94 55 4
R7 C5 S5 02/03/94 80 6

Commodity
CNo cname origin
C1 Coffee Brazil
C2 Coffee Java
C3 Tea China
C4 Coffee Costa Rica
Retailer
RNo rname town
R1 Smith Reading
R2 Jones Slough
R3 Pearson Maidenhead
R4 Howitt Colchester
R5 Adams Chelmsford
R6 Philips Leatherhead
R7 Walker Stevenage

Data Definition Language


1. Modify Retailer table, add a new column address after the rname column.
Verify it.
2. Modify Retailer table, add two new columns: tel and remark. Verify it.
3. Rename the column SNo in the Supplier table to SupplierNo. Verify it.
4. Modify the cname data type of Commodity table to varchar(40). Verify it.
5. Modify the primary key of Shipments table to (RNo,CNo,SNo,shipmentdate)
6. Rename the Supplier table to Vendor. Verify it.

Select Statement
1. List all suppliers details from Supplier table.
2. List sname and scountry from Supplier table.
3. List sname and scountry from Supplier table where the supplier(s) is from
France.
4. List all shipments details from Shipment table.
5. List all shipments where the weight must at least 6.
6. List all shipments which supplied by Edward.
7. List all shipments that will send to Smith.
8. List all retailer(s) whose name starts with P.

You might also like