Sharon Thomas

This blog was started in loving memory of Christ Kengeri Campus,Bangalore and now dedicated to all my students ...

Saturday, December 11, 2010

SQL SESSION 1

Session 1 : Client Master
Client_no
Name
City
Pincode
State
Bal_Due
C00001
Ivan Bayross
Bombay
400054
Maharashtra
15000
C00002
Vandana saitwal
Madras
600001
Tamil Nadu
0
C00003
Pramada Jaguse
Bombay
400057
Maharashtra
5000
C00004
Basu Navindgi
Bombay
400056
Maharashtra
0
C00005
Avi Sreedharan
Delhi
100001
New elhi
2000

Problems:
1. Create the table client master as detailed above with assuming data type and size.
2. Insert the above detailed records_master table.
3. Update the table client master and set the name as ‘Ravi Sreedharan’ of client_no ‘C00005’.
4. Update the table client master and set the Bal_due with 10% up of client_no ‘C00003’.
5. Delete all records of client master.

Solution:

1. Create the table client master as detailed above with assuming data type and size.

2. Insert the above detailed records_master table.

3. Update the table client master and set the name as ‘Ravi Sreedharan’ of client_no ‘C00005’.

UPDATE Client_Master
SET [Names] = 'Ravi Sreedharan'
WHERE Client_No='C00005';

 4. Update the table client master and set the Bal_due with 10% up of client_no ‘C00003’.

UPDATE Client_Master
SET Bal_Due = Bal_Due+(Bal_Due*0.1)
WHERE Client_No='C00003';

5. Delete all records of client master.

DELETE *
FROM Client_Master

No comments:

Post a Comment