[go: up one dir, main page]

0% found this document useful (0 votes)
30 views1 page

Chapter5 Exercise5

The document outlines the creation of a database named CPO with three tables: Customer, Product, and Orders, each containing specified fields. It provides sample data to be filled into these tables and lists several SQL statements to perform various operations, such as updating product color, retrieving product details based on order number, deleting customers from a specific city, and querying orders based on product price. The SQL tasks focus on manipulating and retrieving data from the created tables.

Uploaded by

Phone Pyae
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)
30 views1 page

Chapter5 Exercise5

The document outlines the creation of a database named CPO with three tables: Customer, Product, and Orders, each containing specified fields. It provides sample data to be filled into these tables and lists several SQL statements to perform various operations, such as updating product color, retrieving product details based on order number, deleting customers from a specific city, and querying orders based on product price. The SQL tasks focus on manipulating and retrieving data from the created tables.

Uploaded by

Phone Pyae
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/ 1

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.

You might also like