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
10Activity

Table Of Contents

0 of .
Results for:
No results containing your search query
P. 1
oracle10g

oracle10g

Ratings: (0)|Views: 249 |Likes:
Published by hareeshkumar426

More info:

Published by: hareeshkumar426 on Feb 22, 2012
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

12/23/2012

pdf

text

original

 
 
INTRODUCTION
SQL is divided into the following
Data Definition Language (DDL)
Data Manipulation Language (DML)
Data Retrieval Language (DRL)
Transaction Control Language (TCL)
Data Control Language (DCL)DDL-- create, alter, drop, truncate, renameDML-- insert, update, deleteDRL-- selectTCL-- commit, rollback, savepointDCL-- grant, revokeCREATE TABLE SYNTAXCreate table <
table_name
> (
col1 datatype1, col2 datatype2 …coln datatypen
);Ex: SQL> create table student (no number (2), name varchar (10), marks number (3));INSERTThis will be used to insert the records into table.We have two methods to insert.
By value method
By address methoda) USING VALUE METHOD Syntax:insert into <
table_name
) values (
value1, value2, value3 …. Valuen
); Ex:SQL> insert into student values (1, ’sudha’, 100); SQL> insert into student values (2, ’saketh’, 200);
© Copy rights are reserved.1
 
 To insert a new record again you have to type entire insert command, if there are lot of records this will be difficult.This will be avoided by using address method.b) USING ADDRESS METHOD Syntax:insert into <
table_name
) values
(&col1, &col2, &col3 …. &coln
);This will prompt you for the values but for every insert you have to use forward slash. Ex:SQL> insert into student values (&no, '&name', &marks);Enter value for no: 1Enter value for name: JaganEnter value for marks: 300old 1: insert into student values(&no, '&name', &marks)new 1: insert into student values(1, 'Jagan', 300)SQL> /Enter value for no: 2Enter value for name: NarenEnter value for marks: 400old 1: insert into student values(&no, '&name', &marks)new 1: insert into student values(2, 'Naren', 400)c) INSERTING DATA INTO SPECIFIED COLUMNS USING VALUE METHOD Syntax:insert into <
table_name
)(
col1, col2, col3 … Coln
) values (
value1, value2, value3….Valuen
); Ex:SQL> insert into student (no, name) values (3, ’Ramesh’); SQL> insert into student (no, name) values (4, ’Madhu’);
© Copy rights are reserved.2
 
d) INSERTING DATA INTO SPECIFIED COLUMNS USING ADDRESS METHOD Syntax:insert into <
table_name
)(
col1, col2, col3 … coln
) values
(&col1, &col2 ….&coln);
This will prompt you for the values but for every insert you have to use forward slash. Ex:SQL> insert into student (no, name) values (&no, '&name');Enter value for no: 5Enter value for name: Visuold 1: insert into student (no, name) values(&no, '&name')new 1: insert into student (no, name) values(5, 'Visu')SQL> /Enter value for no: 6Enter value for name: Rattuold 1: insert into student (no, name) values(&no, '&name')new 1: insert into student (no, name) values(6, 'Rattu')SELECTING DATASyntax:Select * from <
table_name
>;-- here * indicates all columnsorSelect
col1, col2, … coln
from <
table_name
>;Ex: SQL> select * from student; NO NAME MARKS--- ------ --------1 Sudha 1002 Saketh 2001 Jagan 3002 Naren 4003 Ramesh4 Madhu5 Visu
© Copy rights are reserved.3

Activity (10)

You've already reviewed this. Edit your review.
1 hundred reads
sourav09 added this note
i can not download this document can u mail it to me please to sougatasarkarstar@yahoo.co.in
sourav09 liked this
sourav09 liked this
sourav09 liked this
Divya Shetty liked this
sourav09 liked this
Divya Shetty liked this
sourav09 liked this
elinzola 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)//-->