sign in
 
   
 
 
 
   
  SQL Tutorial: (Based on M.G. University - MSc Computer Science)  
 
SQL Lab Practice - 1
 
   
  Create the following tables  


Table - I ( CLIENT_MASTER )
Data for Client_Master
Client_No
Name
City
Pincode
Bal_due
C00001
SMITHA JAIN
Mumbai
400054
15000
C00002
VANDANA  RAO
Chennai
780001
0
C00003
PREM PUJARI
Mumbai
400057
5000
C00004
BASU NATH
Mumbai
400056
0
C00005
RAVI SHANKAR
Delhi
100001
2000
C00006
ROOPA
Mumbai
400050
0


Table - II ( SALE_ORDER )
Data for Sale_Order
Order_No
Order_Date
Client_No
Salesman_No
Dely_Date
Order_Status
O19001
12-Jan-13
C00001
S00001
20-Jan-13
In process
O19002
25-Jan-13
C00002
S00002
27-Jan-13
Cancelled
O46865
18-Feb-13
C00003
S00003
20-Feb-13
Fulfilled
O19003
03-Apr-13
C00001
S00001
07-Apr-13
Fulfilled
O46866
20-May-13
C00004
S00002
07-Apr-13
Cancelled
O19008
24-May-13
C00005
S00004
26-May-13
In process

Write SQL commands for the following:

1.

List all details from the client_master table for clients whose Bal_due = 0.

2.

Update table client_master, Change city of Client_no C00004 to Jaipur.

3.

Retrieve records of clients residing in Mumbai.

4.

Find the name and address of customer who has placed Order_no 'O19003' and 'O19002' respectively.

5.

Construct English like sentence from the table client_master ({Customer name} live in the city of {city}).

6.

List the client_no, name, city and pincode of clients whose Order_status is "In process".