SlideShare a Scribd company logo
2
Most read
13
Most read
16
Most read
Class Presentation
• SQL
• (DDL & DML)
• Submitted By: Submitted To:
• Sharad Dubey Vani Mam
•
SQL
• SQL is Structured Query Language, which is a
computer language for storing, manipulating
and retrieving data stored in a relational
database.
• SQL was the first commercial language
introduced for E.F Codd's Relational model.
• Today almost all RDBMS ( MySql, Oracle,
Infomix, Sybase, MS Access) uses SQL as the
standard database language..
• SQL functions fit into two broad categories :
–Data definition language (DDL)
–Data manipulation language (DML)
• Based on relational algebra, but not entirely
identical.
–Relations  Tables
–Tuples  Rows
–Attributes  Columns
DML
• Data Manipulation Language (DML)
statements are used for managing data within
database.
• DML commands are not auto-committed. It
means changes are not permanent to
database, they can be rolled back.
Command Description
insert to insert a new row
update to update existing row
delete to delete a row
merge merging two rows or two tables
DML Commands
Insert Command
• Insert command is used to insert data into a
table.
• Following is its general syntax,
INSERT into table-name values(data1,data2.)
• For e.g.-
Consider a table Student with following fields.
S_id S_Name age
• INSERT into Student values(101,'Adam',15);
The above command will insert a record
into Student table.
S_id S_Name age
101 Adam 15
Update Command
• Update command is used to update a row of a
table.
• Following is its general syntax,
UPDATE table-name set column-name = value
where condition;
S_id S_Name age
101 Adam 15
102 Alex 18
103 chris 14
• UPDATE Student set s_name='Abhi',age=17
where s_id=103;
The above command will update two columns
of a record.
S_id S_Name age
101 Adam 15
102 Alex 18
103 Abhi 17
Delete command
• Delete command is used to delete data from a
table. Delete command can also be used with
condition to delete a particular row.
• Following is its general syntax,
DELETE from table-name ;
• Example to Delete all Records from a Table:
DELETE from Student;
The above command will delete all the records
from Student table.
Example to Delete a particular Record from a
Table
S_id S_Name age
101 Adam 15
102 Alex 18
103 Abhi 17
• Consider the following Student table
DELETE from Student where s_id=103;
The above command will delete the record
where s_id is 103 from Student table.
S_id S_Name age
101 Adam 15
102 Alex 18
DDL
• Data Definition Language (DDL) statements
are used to define the database structure or
schema.
• All DDL commands are auto-committed. That
means it saves all the changes permanently in
the database.
DDL Commands
Command Description
create to create new table or database
alter for alteration
truncate delete data from table
drop to drop a table
rename to rename a table
Create Command
• Create is a DDL command used to create a
table or a database.
• Following is the Syntax,
create database database-name;
• Example for Creating Database,
create database Test;
Alter Command
• Alter command is used for alteration of table
structures. There are various uses
of alter command, such as,
to add a column to existing table
to rename any existing column
to change datatype of any column or to
modify its size.
alter is also used to drop a column
Truncate Command
• Truncate command removes all records from
a table. But this command will not destroy the
table's structure. When we apply truncate
command on a table its Primary key is
initialized.
• Following is its Syntax,
truncate table table-name;
Drop Command
• Drop query completely removes a table from
database. This command will also destroy the
table structure.
• Following is its Syntax,
drop table table-name;
• For Example-
drop table Student;
Rename Command
• Rename command is used to rename a table.
• Following is its Syntax,
rename table old-table-name to new-table-name;
• For Example-
rename table Student to Student-record;
The above query will rename Student table
to Student-record.
SQL(DDL & DML)

More Related Content

What's hot (20)

PPTX
DATABASE CONSTRAINTS
sunanditaAnand
 
PPTX
SQL - Structured query language introduction
Smriti Jain
 
PPTX
DDL And DML
pnp @in
 
PPT
Entity Relationship Diagram
Shakila Mahjabin
 
PPTX
Relational algebra ppt
GirdharRatne
 
PPTX
Join
Kanchana Rani G
 
PPTX
database language ppt.pptx
Anusha sivakumar
 
PPTX
4. plsql
Amrit Kaur
 
PPTX
Normalization in DBMS
Prateek Parimal
 
PPTX
Joins And Its Types
Wings Interactive
 
PDF
Dbms Notes Lecture 9 : Specialization, Generalization and Aggregation
BIT Durg
 
PPTX
DBMS Keys
Tarun Maheshwari
 
PPT
Joins in SQL
Vigneshwaran Sankaran
 
PPTX
Aggregate function
Rayhan Chowdhury
 
PPTX
Data Manipulation Language
Jas Singh Bhasin
 
PPTX
Sql subquery
Raveena Thakur
 
PPTX
DBMS: Types of keys
Bharati Ugale
 
PPT
Types Of Join In Sql Server - Join With Example In Sql Server
programmings guru
 
PPT
Aggregate functions
sinhacp
 
DATABASE CONSTRAINTS
sunanditaAnand
 
SQL - Structured query language introduction
Smriti Jain
 
DDL And DML
pnp @in
 
Entity Relationship Diagram
Shakila Mahjabin
 
Relational algebra ppt
GirdharRatne
 
database language ppt.pptx
Anusha sivakumar
 
4. plsql
Amrit Kaur
 
Normalization in DBMS
Prateek Parimal
 
Joins And Its Types
Wings Interactive
 
Dbms Notes Lecture 9 : Specialization, Generalization and Aggregation
BIT Durg
 
DBMS Keys
Tarun Maheshwari
 
Joins in SQL
Vigneshwaran Sankaran
 
Aggregate function
Rayhan Chowdhury
 
Data Manipulation Language
Jas Singh Bhasin
 
Sql subquery
Raveena Thakur
 
DBMS: Types of keys
Bharati Ugale
 
Types Of Join In Sql Server - Join With Example In Sql Server
programmings guru
 
Aggregate functions
sinhacp
 

Similar to SQL(DDL & DML) (20)

DOCX
unit-5 sql notes.docx
RaviRajput416403
 
PPTX
SQL: Data Definition Language(DDL) command
sonali sonavane
 
PPTX
Unit - II.pptx
MrsSavitaKumbhare
 
PPTX
SQL commands in database managemant systems
pmselvaraj
 
PPTX
Lecture - MY-SQL/ SQL Commands - DDL.pptx
umershah0263
 
PPTX
SQL commands powerpoint presentation. Ppt
umadevikakarlapudi
 
PPTX
Himani uppal-221302130 WP ppt.pptx
MohitYadav889220
 
DOCX
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...
SakkaravarthiS1
 
PDF
SQL Queries - DDL Commands
ShubhamBauddh
 
PDF
SQL_NOTES.pdf
AnshumanDwivedi14
 
PPTX
Introduction to SQl Commands.pptxhhjhvvb
DeepakSingh99214
 
PPTX
DBMS UNIT-2.pptx ggggggggggggggggggggggg
Praveen Kumar
 
PPTX
DBMS: Week 05 - Introduction to SQL Query
RashidFaridChishti
 
PPTX
SQL-SHORT-NOTES.pptx
PratheeshKumarN
 
PPTX
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
EliasPetros
 
PPTX
Lab2 ddl commands
Balqees Al.Mubarak
 
PDF
Dms 22319 micro project
ARVIND SARDAR
 
PPTX
DBMSLab_SQL_4thsem_CI_17163544545446962.pptx
dgfs55437
 
PPTX
MIS 301 RELATIONAL DATABASE MANAGEMENT SYSTEM 10,11&12.pptx
KrishnaRoy45
 
unit-5 sql notes.docx
RaviRajput416403
 
SQL: Data Definition Language(DDL) command
sonali sonavane
 
Unit - II.pptx
MrsSavitaKumbhare
 
SQL commands in database managemant systems
pmselvaraj
 
Lecture - MY-SQL/ SQL Commands - DDL.pptx
umershah0263
 
SQL commands powerpoint presentation. Ppt
umadevikakarlapudi
 
Himani uppal-221302130 WP ppt.pptx
MohitYadav889220
 
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...
SakkaravarthiS1
 
SQL Queries - DDL Commands
ShubhamBauddh
 
SQL_NOTES.pdf
AnshumanDwivedi14
 
Introduction to SQl Commands.pptxhhjhvvb
DeepakSingh99214
 
DBMS UNIT-2.pptx ggggggggggggggggggggggg
Praveen Kumar
 
DBMS: Week 05 - Introduction to SQL Query
RashidFaridChishti
 
SQL-SHORT-NOTES.pptx
PratheeshKumarN
 
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
EliasPetros
 
Lab2 ddl commands
Balqees Al.Mubarak
 
Dms 22319 micro project
ARVIND SARDAR
 
DBMSLab_SQL_4thsem_CI_17163544545446962.pptx
dgfs55437
 
MIS 301 RELATIONAL DATABASE MANAGEMENT SYSTEM 10,11&12.pptx
KrishnaRoy45
 
Ad

Recently uploaded (20)

PPTX
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
PDF
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
PPTX
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
PPTX
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
PDF
Dimensions of Societal Planning in Commonism
StefanMz
 
PDF
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
PPTX
How to Handle Salesperson Commision in Odoo 18 Sales
Celine George
 
PDF
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
PDF
LAW OF CONTRACT ( 5 YEAR LLB & UNITARY LLB)- MODULE-3 - LEARN THROUGH PICTURE
APARNA T SHAIL KUMAR
 
PPTX
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
PDF
community health nursing question paper 2.pdf
Prince kumar
 
PDF
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
PDF
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
PPTX
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
PDF
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
PPTX
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
PPTX
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
PPTX
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
PDF
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
PPT
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
Dimensions of Societal Planning in Commonism
StefanMz
 
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
How to Handle Salesperson Commision in Odoo 18 Sales
Celine George
 
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
LAW OF CONTRACT ( 5 YEAR LLB & UNITARY LLB)- MODULE-3 - LEARN THROUGH PICTURE
APARNA T SHAIL KUMAR
 
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
community health nursing question paper 2.pdf
Prince kumar
 
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
Ad

SQL(DDL & DML)

  • 1. Class Presentation • SQL • (DDL & DML) • Submitted By: Submitted To: • Sharad Dubey Vani Mam •
  • 2. SQL • SQL is Structured Query Language, which is a computer language for storing, manipulating and retrieving data stored in a relational database. • SQL was the first commercial language introduced for E.F Codd's Relational model. • Today almost all RDBMS ( MySql, Oracle, Infomix, Sybase, MS Access) uses SQL as the standard database language..
  • 3. • SQL functions fit into two broad categories : –Data definition language (DDL) –Data manipulation language (DML) • Based on relational algebra, but not entirely identical. –Relations  Tables –Tuples  Rows –Attributes  Columns
  • 4. DML • Data Manipulation Language (DML) statements are used for managing data within database. • DML commands are not auto-committed. It means changes are not permanent to database, they can be rolled back.
  • 5. Command Description insert to insert a new row update to update existing row delete to delete a row merge merging two rows or two tables DML Commands
  • 6. Insert Command • Insert command is used to insert data into a table. • Following is its general syntax, INSERT into table-name values(data1,data2.) • For e.g.- Consider a table Student with following fields. S_id S_Name age
  • 7. • INSERT into Student values(101,'Adam',15); The above command will insert a record into Student table. S_id S_Name age 101 Adam 15
  • 8. Update Command • Update command is used to update a row of a table. • Following is its general syntax, UPDATE table-name set column-name = value where condition; S_id S_Name age 101 Adam 15 102 Alex 18 103 chris 14
  • 9. • UPDATE Student set s_name='Abhi',age=17 where s_id=103; The above command will update two columns of a record. S_id S_Name age 101 Adam 15 102 Alex 18 103 Abhi 17
  • 10. Delete command • Delete command is used to delete data from a table. Delete command can also be used with condition to delete a particular row. • Following is its general syntax, DELETE from table-name ; • Example to Delete all Records from a Table: DELETE from Student; The above command will delete all the records from Student table.
  • 11. Example to Delete a particular Record from a Table S_id S_Name age 101 Adam 15 102 Alex 18 103 Abhi 17 • Consider the following Student table
  • 12. DELETE from Student where s_id=103; The above command will delete the record where s_id is 103 from Student table. S_id S_Name age 101 Adam 15 102 Alex 18
  • 13. DDL • Data Definition Language (DDL) statements are used to define the database structure or schema. • All DDL commands are auto-committed. That means it saves all the changes permanently in the database.
  • 14. DDL Commands Command Description create to create new table or database alter for alteration truncate delete data from table drop to drop a table rename to rename a table
  • 15. Create Command • Create is a DDL command used to create a table or a database. • Following is the Syntax, create database database-name; • Example for Creating Database, create database Test;
  • 16. Alter Command • Alter command is used for alteration of table structures. There are various uses of alter command, such as, to add a column to existing table to rename any existing column to change datatype of any column or to modify its size. alter is also used to drop a column
  • 17. Truncate Command • Truncate command removes all records from a table. But this command will not destroy the table's structure. When we apply truncate command on a table its Primary key is initialized. • Following is its Syntax, truncate table table-name;
  • 18. Drop Command • Drop query completely removes a table from database. This command will also destroy the table structure. • Following is its Syntax, drop table table-name; • For Example- drop table Student;
  • 19. Rename Command • Rename command is used to rename a table. • Following is its Syntax, rename table old-table-name to new-table-name; • For Example- rename table Student to Student-record; The above query will rename Student table to Student-record.