Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword or section
Like this
20Activity
0 of .
Results for:
No results containing your search query
P. 1
Dbms Lab Programs

Dbms Lab Programs

Ratings: (0)|Views: 4,396 |Likes:
Published by sbalajisathya
dbms lab manual program queries

sql queries

nested quereies
dbms lab manual program queries

sql queries

nested quereies

More info:

Categories:Types, Reviews
Published by: sbalajisathya on Nov 06, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

05/17/2013

pdf

text

original

 
DDL COMMANDSCREATE COMMAND
:SQL> create table sub (name varchar(8),age number(5),mark1 number(4),mark2 number(4),2 mark3 number(4));Table created.
DESC COMMAND
:SQL> desc sub;Name Null? Type----------------------------------------- -------- ----------------------------NAME VARCHAR2(8)AGE NUMBER(5)MARK1 NUMBER(4)MARK2 NUMBER(4)MARK3 NUMBER(4)
ALTER COMMAND:
1)
ADD COMMAND
:SQL> alter table sub add(total number(6));Table altered.SQL> desc sub;Name Null? Type----------------------------------------- -------- ----------------------------NAME VARCHAR2(8)AGE NUMBER(5)MARK1 NUMBER(4)MARK2 NUMBER(4)MARK3 NUMBER(4)TOTAL NUMBER(6)
RENAME COMMAND
:SQL> rename sub to subha;Table renamed.SQL> desc subha;Name Null? Type-------------------------- --------------- -------- ------------NAME VARCHAR2(8)AGE NUMBER(5)MARK1 NUMBER(4)MARK2
 
2)
MODIFY COMMAND
:SQL> alter table sub modify(mark3 number(6));Table altered.SQL> desc sub;Name Null? Type----------------------------------------- -------- ----------------------------NAME VARCHAR2(8)AGE NUMBER(5)MARK1 NUMBER(4)MARK2 NUMBER(4)MARK3 NUMBER(6)TOTAL NUMBER(4)MARK3 NUMBER(6)TOTAL NUMBER(6)
TRUNCATE COMMAND
:SQL> truncate table subha;Table truncated.SQL> desc sub;ERROR:ORA-04043: object sub does not exist
DROP COMMAND
:SQL> drop table subha;Table dropped.SQL> desc subha;ERROR:ORA-04043: object subha does not exist
 
DQL COMMANDS
SQL> create table sub (name varchar(8),age number(5),mark1 number(4),mark2 number(4),2 mark3 number(4));Table created.SQL> insert into sub values('&name','&age','&mark1','&mark2','&mark3');Enter value for name: sachinEnter value for age: 12Enter value for mark1: 90Enter value for mark2: 90Enter value for mark3: 90old 1: insert into sub values('&name','&age','&mark1','&mark2','&mark3')new 1: insert into sub values('sachin','12','90','90','90')1 row created.SQL> /Enter value for name: sachinEnter value for age: 22Enter value for mark1: 90Enter value for mark2: 89Enter value for mark3: 78old 1: insert into sub values('&name','&age','&mark1','&mark2','&mark3')new 1: insert into sub values('sachin','22','90','89','78')1 row created.SQL> /Enter value for name: ranjanEnter value for age: 21Enter value for mark1: 89Enter value for mark2: 78Enter value for mark3: 80old 1: insert into sub values('&name','&age','&mark1','&mark2','&mark3')new 1: insert into sub values('ranjan','21','89','78','80')1 row created.

Activity (20)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
9754506777 liked this
Hunny Topiwala liked this
Hunny Topiwala liked this
mskumar_me liked this
mskumar_me liked this
kyoobum liked this

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->