V.
1. Create database CPO and the following tables which contain the following
associated fields.
Customer(cid char(5), cname char(20), city char(20))
Product (pidchar(5), pname char(15), color char (10), weight integer, price
integer)
Orders(oid char(5), cid char(5), qty integer)
2 . Fill the following data into the tables.
Customer Product
cid cname city pid pname color weight price
C1 Smith London
P1 Bolt Green 17 200
C2 James Paris
P2 Nut Red 12 300
C3 John London
C4 Jennifer Rome P3 Cam Blue 12 200
C5 Blake Athens P4 Cog Red 19 150
C6 Jones Paris P5 Screw Blue 17 100
C7 Clark Rome P6 glass Gray 20 250
Order
oid cid pid qty
OR1 C2 P1 100
OR2 C1 P1 100
OR3 C3 P2 300
OR4 C6 P3 200
OR5 C2 P5 700
OR6 C4 P6 900
Write SQL statement for the following problems using the tables create in (1).
(3) Updatethe color of product to ‘White’ which is ordered by customer ‘Jones’.
(4) Get the details information for the product which order number ‘OR6’.
(5) Delete all tuples in the customer whose city is ‘London’.
(6) Get all order where the product‘s price is in the range 150 and 200 inclusive.
(7) Get all details of order.