add

About Me

My photo
Oracle Apps - Techno Functional consultant

Tuesday, June 21

DML Commands

1. INSERT 2.UPDATE 3. DELETE

1. INSERT
=========
IT CAN BE USED INH 3 WAYS

1. to insert single row
=======================

syntax:
======
insert into tablename values(val1,...);

to insert student details
========================
insert into student values(101,'raju','oracle',1200,'12-jan-2008');



2. to insert particular colunm values
=====================================
syntax:
======
insert into tablename(col1,,...)
values(val1....);

to insert sno,sname,course
=========================
insert into student(sno,sname,course)
values(102,'rajesh','vb');


3. to insert multiple rows
=========================
syntax:
======
insert into student values
(&colname,.........);

insert into student values(&sno,'&sname','&course',&fees,'&dop');


UPDATE COMMAND
==============

1.To chage data by condition
==========================
update tablename set colname=value ;

to increase fees by 200rs for oracle course
=-==========================================
update student set fees=fees+200 where course like 'oracle';


2. to change multiple values in a table
======================================
update tablename set colname=value;

ex:
increase all student fees by 1000;
===================================
update student set fees=fees+1000;


3. delete

1. to delete 101 record from student table
==========================================
delete from student where sno=101;

2. to delete all records from student table
===========================================
delete from student;

No comments: