Page 1

DATA MANIPULATION LANGUAGE SQL QUERIES 1 2 3 4

Introduction INSERT UPDATE DELETE

Contents

1.Introduction DML (Data Manipulation Language) commands are used for managing data in Database. DML commands are not auto-committed and hence changes due to these commands are not permanent to database. They can be rolled back. In SQL INSERT,UPDATE and DELETE are the DML commands.

INSERT INSERT command is used to insert new records in a table. Example: INSERT INTO (ALL COLUMNS) IN TABLE

INSERT INTO customer VALUES ('John','Adam','13 BAKE STREET','London','United Kingdom','12-AUG-87'); Example: INSERT INTO (SPECIFIC COLUMNS) IN TABLE

INSERT INTO customer (First_Name,Last_Name,Birth_Date) VALUES('Larry','Hall’,'12-JUN-1990');

Get More Lecture notes and Computer Science Study Kit Android app from: http://computer-science-study-kit.blogspot.in/


DATA MANIPULATION LANGUAGE SQL QUERIES

3 UPDATE The UPDATE command is used to update records in a table. Example: UPDATE COMMAND (BEFORE UPDATE) CUSTOMER TABLE FIRST_NAME LAST_NAME ADDRESS John

Adam

Larry

Hall

13 BAKE STREET

CITY

COUNTRY

London

United Kingdom

Mumbai

BIRTH_DATE 12-AUG-87 12-JUN-90

Amsterdam

Paul

UPDATE customer SET ADDRESS='34 VILLE PARLE',COUNTRY='India' WHERE FIRST_NAME='Larry'; CUSTOMER TABLE (AFTER UPDATE)

FIRST_NAME LAST_NAME ADDRESS CITY

COUNTRY BIRTH_DATE

John

Adam

13 BAKE STREET

London

United Kingdom

12-AUG-87

Larry

Hall

34 VILLE PARLE

Mumbai

India

12-JUN-90

Paul

Amsterdam

Get More Lecture notes and Computer Science Study Kit Android app from: http://computer-science-study-kit.blogspot.in/


DATA MANIPULATION LANGUAGE SQL QUERIES 4 DELETE The DELETE command is used to delete records in a table. Example: DELETE COMMAND CUSTOMER TABLE CUSTOMER TABLE (BEFORE DELETE) FIRST_NAME LAST_NAME John

Adam

Larry

Hall

ADDRESS 13 BAKE STREET 34 VILLE PARLE

Paul

CITY London Mumbai

COUNTRY BIRTH_DATE United 12-AUG-87 Kingdom India

12-JUN-90

Amsterdam

DELETE FROM customer WHERE FIRST_NAME='Paul'; CUSTOMER TABLE (AFTER DELETE)

FIRST_NAME LAST_NAME ADDRESS CITY COUNTRY BIRTH_DATE 13 BAKE United John Adam London 12-AUG-87 STREET Kingdom 34 VILLE Larry Hall Mumbai India 12-JUN-90 PARLE

Get More Lecture notes and Computer Science Study Kit Android app from: http://computer-science-study-kit.blogspot.in/


DATA MANIPULATION LANGUAGE SQL QUERIES Get Free Computer Science Study Kit Android App From

OR

For more lecture notes and Computer Science Study Kit Android app visit us at http://computer-science-study-kit.blogspot.in/ We will be happy to have your comments and ideas about these notes and app also and if you find these notes helpful, please do share them with your friends and colleagues.

Get More Lecture notes and Computer Science Study Kit Android app from: http://computer-science-study-kit.blogspot.in/


Data Manipulation Language  

DML (Data Manipulation Language) commands are used for managing data in Database. DML commands are not auto-committed and hence changes due...

Advertisement
Read more
Read more
Similar to
Popular now
Just for you