1<br />Using ORACLE®<br />Data Manipulation Language<br />(Populating our sample database) <br /> and Transaction Control ...
2<br />DATA DEFINATION LANGUAGE<br />DML is used for manipulation the data contained in a table.<br />Just as how DDL comm...
3<br />INSERT COMAND<br />The INSERT command is used to insert records into the table.<br />The basic syntax of the INSERT...
4<br />UPDATE COMAND<br />The UPDATE command is used to modify the records that have been already inserted into the table....
5<br />UPDATE USING SUBQUERIES<br />We can update the value of a row to be set to values of another row using subqueries :...
6<br />DELETE COMAND<br />The DELECT command can be used to delete a set of records that are inserted in a column.<br />A ...
7<br />TRANSACTION CONTROL LANGUAGE<br />A TRANSACTION is a set of DML statements that cause a consistent change on data o...
THANK YOU<br />8<br />THANK YOU FOR VIEWING THIS PRESENTATION<br />FOR MORE PRESENTATIONS AND VIDEOS ON ORACLE AND DATAMIN...
Upcoming SlideShare
Loading in...5
×

Oracle : DML

3,577

Published on

Oracle : DML

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
3,577
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "Oracle : DML"

  1. 1. 1<br />Using ORACLE®<br />Data Manipulation Language<br />(Populating our sample database) <br /> and Transaction Control Language<br />
  2. 2. 2<br />DATA DEFINATION LANGUAGE<br />DML is used for manipulation the data contained in a table.<br />Just as how DDL commands can be used to CREATE,ALTER and DROP objects DML can be used to INSERT , UPDATE and DELETE data from the objects.DML commands only affect the data and not the structure of the table.<br />DML contains 3 commands:<br />INSERT : Used to insert a new record into the table.<br />UPDATE : Used to update the records already inserted into the table.<br />DELETE : Used to delete records already inserted into the table.<br />
  3. 3. 3<br />INSERT COMAND<br />The INSERT command is used to insert records into the table.<br />The basic syntax of the INSERT command is :<br />INSERT INTO TABLE_NAME(colm1_name,…[colmn_name]) <br /> VALUES ( colm1_val,…[colmn_val]);<br />EXAMPLE : <br />INSERT INTO InfoTable(name,age,phone) VALUES (‘steve’,50,9988776655);<br />The above syntax is used when we only want to insert specified column values.If we are inserting a row containing all the columns value or intend to insert NULL values in remaining columns we can discard the column list after table name as:<br />INSERT INTO TABLE_NAME VALUES(value…[value]..[NULL]);<br />The NULL keyword is used to insert a null values into the column.<br />
  4. 4. 4<br />UPDATE COMAND<br />The UPDATE command is used to modify the records that have been already inserted into the table. We use a WHERE clause to target a particular set of columns to be updated in absence of which all rows in the table will be updated.<br />SYNTAX:<br />UPDATE TABLE_NAME<br />SET column = new_value,…. We can update multiple columns at a time.<br /> …..[column = new value]<br />WHERE [condition ….]; WHERE condition limits the rows being updated.<br />EXAMPLE :<br />UPDATE InfoTable <br />SET age = 40 ,<br /> phone = 9988000000<br />WHERE name = ‘steve’; <br />
  5. 5. 5<br />UPDATE USING SUBQUERIES<br />We can update the value of a row to be set to values of another row using subqueries :<br />SYNTAX:<br />UPDATE TABLE_NAME<br />SET column = [subquery]…<br /> …..column = value<br />WHERE (condition);<br />EXAMPLE :<br />UPDATE InfoTable<br />SET phone= (SELECT phone FROM InfoTable WHERE name = ‘bill’)<br />WHERE age = 40;<br />
  6. 6. 6<br />DELETE COMAND<br />The DELECT command can be used to delete a set of records that are inserted in a column.<br />A WHERE clause is used to narrow the set of rows to be deleted in absence of which all the rows in the table will be deleted. To delete all rows we can also use the TRUNCATE command.<br />SYNTAX:<br />DELETE [FROM] TABLE_NAME<br />WHERE (condition..);<br />EXAMPLE:<br />DELETE FROM InfoTable<br />WHERE name = ‘bill’;<br />DELETE FROM InfoTable;Entire table contents deleted<br />
  7. 7. 7<br />TRANSACTION CONTROL LANGUAGE<br />A TRANSACTION is a set of DML statements that cause a consistent change on data or it can be a single DDL / DCL command .<br />The transaction begins when a DML command is entered and ends when COMMIT or ROLLBACK occurs. Since DCL and DDL commands are committed as soon as been entered only 1 such command is in a transaction.<br />TCL statements are used to control transactions.<br />There are three TL commands:<br />
  8. 8. THANK YOU<br />8<br />THANK YOU FOR VIEWING THIS PRESENTATION<br />FOR MORE PRESENTATIONS AND VIDEOS ON ORACLE AND DATAMINING ,<br />please visit: <br />www.dataminingtools.net<br />

×