Dml and ddl

1,328 views
955 views

Published on

Dml and ddl

Published in: Education, Technology, Travel
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,328
On SlideShare
0
From Embeds
0
Number of Embeds
27
Actions
Shares
0
Downloads
73
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Dml and ddl

  1. 1. DML • DML is abbreviation of Data Manipulation Language. It is used to retrieve, store, modify, delete, insert and update data in database. • Examples: SELECT, UPDATE, INSERT statements
  2. 2. Usage & Commands • • • • • • • • • • • • SELECT - retrieve data from a database Syntax SELECT column_name,column_name FROM table_name; INSERT - insert data into a table Syntax INSERT INTO table_name VALUES (value1,value2,value3,etc...); UPDATE - updates existing data within a table Syntax UPDATE table_name SET column1=value1,column2=value2,... WHERE some_column=some_value; DELETE - deletes all records from a table, the space for the records remain Syntax DELETE FROM table_name WHERE some_column=some_value;
  3. 3. DDL • DDL is abbreviation of Data Definition Language. It is used to create and modify the structure of database objects in database. • Examples: CREATE, ALTER, DROP statements
  4. 4. Usage & commands • • • • • • • • • • • • • • • • • • CREATE - to create objects in the database. Syntax CREATE TABLE table_name ( column_name1 data_type(size), column_name2 data_type(size), column_name3 data_type(size), etc... ); ALTER - alters the structure of the database Syntax ALTER TABLE table_name ADD column_name datatype; DROP - delete objects from the database Syntax DROP TABLE table_name; TRUNCATE - remove all records from a table, including all spaces allocated for the records are removed Syntax TRUNCATE TABLE table_name; COMMENT - add comments to the data dictionary Syntax -- text_of_comment RENAME - rename an object Syntax RENAME TABLE old table name TO new table name;
  5. 5. If this presentation helped you, please visit our page facebook.com/baabtra and like it. Thanks in advance. www.baabtra.com | www.massbaab.com |www.baabte.com
  6. 6. Contact Us Emarald Mall (Big Bazar Building) Mavoor Road, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 Start up Village Eranakulam, Kerala, India. Email: info@baabtra.com NC Complex, Near Bus Stand Mukkam, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550

×