Monday, April 18, 2011

DATABASE MANIPULATION LANGUAGE - COMMANDS



insert into STUDENTDB (SN,ROLLNO,NAME,M1,M2,M3,M4,M5,M6) values(1,'O9BC001','ANISH',80,76,85,98,84,90)
insert into STUDENTDB (SN,ROLLNO,NAME,M1,M2,M3,M4,M5,M6) values(2,'O9BC005','ABILASH',46,66,89,56,74,60)
insert into STUDENTDB (SN,ROLLNO,NAME,M1,M2,M3,M4,M5,M6) values(3,'O9BC037','JAMES',84,73,85,88,74,50)
insert into STUDENTDB (SN,ROLLNO,NAME,M1,M2,M3,M4,M5,M6) values(4,'O9BC041','RAMESH',65,56,45,78,67,66)
insert into STUDENTDB (SN,ROLLNO,NAME,M1,M2,M3,M4,M5,M6) values(5,'O9BC055','SARAVANAN',67,76,56,73,65,73)
select * from STUDENTDB

update STUDENTDB set TOTAL=M1+M2+M3+M4+M5+M6

select * from STUDENTDB

update STUDENTDB set DEPT='CSE'

select * from STUDENTDB

update STUDENTDB set DOB='1991-10-26' where ROLLNO='O9BC001'
update STUDENTDB set DOB='1991-5-29' where ROLLNO='O9BC005'
update STUDENTDB set DOB='1992-1-15' where ROLLNO='O9BC037'
update STUDENTDB set DOB='1992-2-6' where ROLLNO='O9BC041'
update STUDENTDB set DOB='1991-9-26' where ROLLNO='O9BC055'

select NAME from STUDENTDB

select ROLLNO from STUDENTDB

select TOTAL from STUDENTDB

select count (distinct NAME) from STUDENTDB


select * from STUDENTDB where TOTAL >= (select AVG(TOTAL) from STUDENTDB)


select * from STUDENTDB where TOTAL >=300 and NAME like ‘A%’



Your's friendly,
[MOHANRAM.G],
ADMIN...

0 comments:

Post a Comment