






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







SQL> create table Studentt(stuid number(5) primary key,name char(10),Dept varchar(10),marks number(5)); Table created. SQL> desc Studentt Name Null? Type
STUID NOT NULL NUMBER(5) NAME CHAR(10) DEPT VARCHAR2(10) MARKS NUMBER(5) SQL> insert into Studentt values(&stuid,'&name','&Dept',&marks); Enter value for stuid: 100 Enter value for name: Sachin Enter value for dept: SITE Enter value for marks: 400 old 1: insert into Studentt values(&stuid,'&name','&Dept',&marks) new 1: insert into Studentt values(100,'Sachin','SITE',400) 1 row created.
Enter value for stuid: 101 Enter value for name: Dravid Enter value for dept: SCOPE Enter value for marks: 450 old 1: insert into Studentt values(&stuid,'&name','&Dept',&marks) new 1: insert into Studentt values(101,'Dravid','SCOPE',450) 1 row created. SQL> / Enter value for stuid: 102 Enter value for name: Yuvaraj Enter value for dept: SITE Enter value for marks: 490 old 1: insert into Studentt values(&stuid,'&name','&Dept',&marks) new 1: insert into Studentt values(102,'Yuvaraj','SITE',490) 1 row created. SQL> / Enter value for stuid: 103 Enter value for name: Saurav Enter value for dept: SCOPE Enter value for marks: 470 old 1: insert into Studentt values(&stuid,'&name','&Dept',&marks) new 1: insert into Studentt values(103,'Saurav','SCOPE',470) 1 row created. SQL> / Enter value for stuid: 104
old 1: insert into Sports values(&stuid,'&sportname') new 1: insert into Sports values(102,'Football') 1 row created. SQL> / Enter value for stuid: 103 Enter value for sportname: Cricket old 1: insert into Sports values(&stuid,'&sportname') new 1: insert into Sports values(103,'Cricket') 1 row created. SQL> / Enter value for stuid: 104 Enter value for sportname: Basketball old 1: insert into Sports values(&stuid,'&sportname') new 1: insert into Sports values(104,'Basketball') 1 row created. SQL> select sum(marks) from Studentt; SUM(MARKS)
2190 SQL> select MAX(marks) as marks from Studentt where marks<(select max(marks) from Studentt); MARKS
470
SQL> select * from Studentt CROSS JOIN Sports; STUID NAME DEPT MARKS STUID SPORTNAME
100 Sachin SITE 400 100 Cricket 100 Sachin SITE 400 101 Tennis 100 Sachin SITE 400 102 Football 100 Sachin SITE 400 103 Cricket 100 Sachin SITE 400 104 Basketball 101 Dravid SCOPE 450 100 Cricket 101 Dravid SCOPE 450 101 Tennis 101 Dravid SCOPE 450 102 Football 101 Dravid SCOPE 450 103 Cricket 101 Dravid SCOPE 450 104 Basketball 102 Yuvaraj SITE 490 100 Cricket STUID NAME DEPT MARKS STUID SPORTNAME
102 Yuvaraj SITE 490 101 Tennis 102 Yuvaraj SITE 490 102 Football 102 Yuvaraj SITE 490 103 Cricket 102 Yuvaraj SITE 490 104 Basketball 103 Saurav SCOPE 470 100 Cricket 103 Saurav SCOPE 470 101 Tennis 103 Saurav SCOPE 470 102 Football 103 Saurav SCOPE 470 103 Cricket 103 Saurav SCOPE 470 104 Basketball 104 Kaif ECE 380 100 Cricket 104 Kaif ECE 380 101 Tennis
begin update Studentt set marks = marks+markk where stuid = stuid1; end; /