SlideShare une entreprise Scribd logo
1  sur  13
INTRODUCTION
 SQL commands are instructions
used to communicate with the
database to perform specific task
that work with data.
 SQL commands can be used not
only for searching the database but
also to perform various other
functions for example, you can
create tables, add data to tables, or
modify data, drop the table, set
DATA MANIPULATION LANGUAGE
 A DATA MANIPULATION
LANGUAGE (DML) is a set of syntax that
contains SQL commands that are used for
storing, retrieving, modifying, and deleting
data.
 These commands are:
SELECT
INSERT
UPDATE
DELETE.
SELECT COMMAND
USE
 Select command is used to view records from
the table. To view all columns and all rows * can
be specified with select statement.
 If user needs to view only certain fields or
columns, then by specifying the names of those
certain fields, columns user can acquire its
output.
SYNTAX
 SELECT * from table_name.
 SELECT <Column_name> from table_name.
TABLE T QUERY RESULT
C1 C2 SELECT * FROM T; C1 C2
1 a 1 a
2 b 2 b
C1 C2 SELECT C1 FROM T; C1
1 a 1
2 b 2
C1 C2 SELECT * FROM T WHERE C1
=1;
C1 C2
1 a
1 a
2 b
EXAMPLE
DELETE COMMAND
USE
 Delete command is used to delete records in the
table.
 In SQL, Delete is used to delete rows in the
table.
 It is possible to delete all rows in a table without
deleting the table.
 This means that table structure, attributes and
indexes will be intact.
NOTE
 Be very careful when deleting records, you
SYNTAX
• DELETE * from table_name [WHERE CONDITION]
(if where condition is not used all rows in the table are
removed)
EXAMPLE
• DELETE from customer
WHERE CustomerName=‘Anil Khade’ AND
ContactName=‘Vikrant Kedare’
TABLE NAME: person
Sr no. P_id p_name
1 120 Jack
2 121 Rose
3 122 Ram
4 123 Sita
 If you want to delete row 1 then,
DELETE * person WHERE p_name=‘Jack’;
1st Row will be deleted.
Sr no. p_id p_name
2 121 Rose
3 122 Ram
4 123 Sita
EXAMPLE
UPDATE COMMAND
USE
 An SQL UPDATE statement changes the data of
one or more records in a table.
 Either all the rows can be updated, or a subset may
be chosen using a condition.
SYNTAX
UPDATE table_name SET column_name = valu
e [, column_name = value ...]
[WHERE condition]
EXAMPLE
 UPDATE employee SET location ='Mysore'
WHERE id = 101;
Table Name: person
p_id p_name
1 121 Jack
2 122 Rose
3 123 Ram
 If you want to update row 1 then,
UPDATE person SET p_name=‘Sita’
WHERE id = 121;
p_id p_name
1 121 Sita
2 122 Rose
3 123 Ram
EXAMPLE
INSERT COMMAND
USE
 An SQL INSERT statement adds one or more
records to any single table in a relational
database.
SYNTAX
 INSERT INTO table_name
VALUES (value1, value2, value3,...valueN);
EXAMPLE
 INSERT INTO person
VALUES (124, ‘Laxman’);
Table Name:person
p_id p_name
1 121 Jack
2 122 Rose
3 123 Ram
 If you want to insert data in 4th row then,
INSERT INTO person
Values(124, ‘Sita’);
p_id p_name
1 121 Jack
2 122 Rose
3 123 Ram
4 124 Sita
EXAMPLE
Commands of DML in SQL

Contenu connexe

Tendances

Sql queries presentation
Sql queries presentationSql queries presentation
Sql queries presentationNITISH KUMAR
 
Aggregate functions
Aggregate functionsAggregate functions
Aggregate functionssinhacp
 
Types Of Join In Sql Server - Join With Example In Sql Server
Types Of Join In Sql Server - Join With Example In Sql ServerTypes Of Join In Sql Server - Join With Example In Sql Server
Types Of Join In Sql Server - Join With Example In Sql Serverprogrammings guru
 
SQL Queries Information
SQL Queries InformationSQL Queries Information
SQL Queries InformationNishant Munjal
 
introdution to SQL and SQL functions
introdution to SQL and SQL functionsintrodution to SQL and SQL functions
introdution to SQL and SQL functionsfarwa waqar
 
Including Constraints -Oracle Data base
Including Constraints -Oracle Data base Including Constraints -Oracle Data base
Including Constraints -Oracle Data base Salman Memon
 
SQL-RDBMS Queries and Question Bank
SQL-RDBMS Queries and Question BankSQL-RDBMS Queries and Question Bank
SQL-RDBMS Queries and Question BankMd Mudassir
 
SQL - DML and DDL Commands
SQL - DML and DDL CommandsSQL - DML and DDL Commands
SQL - DML and DDL CommandsShrija Madhu
 
Function in PL/SQL
Function in PL/SQLFunction in PL/SQL
Function in PL/SQLPooja Dixit
 
80 different SQL Queries with output
80 different SQL Queries with output80 different SQL Queries with output
80 different SQL Queries with outputNexus
 
Constraints In Sql
Constraints In SqlConstraints In Sql
Constraints In SqlAnurag
 

Tendances (20)

SQL commands
SQL commandsSQL commands
SQL commands
 
Joins in SQL
Joins in SQLJoins in SQL
Joins in SQL
 
SQL(DDL & DML)
SQL(DDL & DML)SQL(DDL & DML)
SQL(DDL & DML)
 
Sql queries presentation
Sql queries presentationSql queries presentation
Sql queries presentation
 
Sql select
Sql select Sql select
Sql select
 
Aggregate functions
Aggregate functionsAggregate functions
Aggregate functions
 
Sql tutorial
Sql tutorialSql tutorial
Sql tutorial
 
Sql commands
Sql commandsSql commands
Sql commands
 
SQL Functions
SQL FunctionsSQL Functions
SQL Functions
 
Types Of Join In Sql Server - Join With Example In Sql Server
Types Of Join In Sql Server - Join With Example In Sql ServerTypes Of Join In Sql Server - Join With Example In Sql Server
Types Of Join In Sql Server - Join With Example In Sql Server
 
SQL Queries Information
SQL Queries InformationSQL Queries Information
SQL Queries Information
 
Sql commands
Sql commandsSql commands
Sql commands
 
introdution to SQL and SQL functions
introdution to SQL and SQL functionsintrodution to SQL and SQL functions
introdution to SQL and SQL functions
 
Including Constraints -Oracle Data base
Including Constraints -Oracle Data base Including Constraints -Oracle Data base
Including Constraints -Oracle Data base
 
Sql operators & functions 3
Sql operators & functions 3Sql operators & functions 3
Sql operators & functions 3
 
SQL-RDBMS Queries and Question Bank
SQL-RDBMS Queries and Question BankSQL-RDBMS Queries and Question Bank
SQL-RDBMS Queries and Question Bank
 
SQL - DML and DDL Commands
SQL - DML and DDL CommandsSQL - DML and DDL Commands
SQL - DML and DDL Commands
 
Function in PL/SQL
Function in PL/SQLFunction in PL/SQL
Function in PL/SQL
 
80 different SQL Queries with output
80 different SQL Queries with output80 different SQL Queries with output
80 different SQL Queries with output
 
Constraints In Sql
Constraints In SqlConstraints In Sql
Constraints In Sql
 

Similaire à Commands of DML in SQL

Similaire à Commands of DML in SQL (20)

Babitha2.mysql
Babitha2.mysqlBabitha2.mysql
Babitha2.mysql
 
Babitha2 Mysql
Babitha2 MysqlBabitha2 Mysql
Babitha2 Mysql
 
Oraclesql
OraclesqlOraclesql
Oraclesql
 
Oracle: DML
Oracle: DMLOracle: DML
Oracle: DML
 
Oracle : DML
Oracle : DMLOracle : DML
Oracle : DML
 
Prabu's sql quries
Prabu's sql quries Prabu's sql quries
Prabu's sql quries
 
ii bcom dbms SQL Commands.docx
ii bcom dbms SQL Commands.docxii bcom dbms SQL Commands.docx
ii bcom dbms SQL Commands.docx
 
SQL Tutorial for Beginners
SQL Tutorial for BeginnersSQL Tutorial for Beginners
SQL Tutorial for Beginners
 
06.01 sql select distinct
06.01 sql select distinct06.01 sql select distinct
06.01 sql select distinct
 
Sql
SqlSql
Sql
 
Oracle SQL AND PL/SQL
Oracle SQL AND PL/SQLOracle SQL AND PL/SQL
Oracle SQL AND PL/SQL
 
COMPUTERS SQL
COMPUTERS SQL COMPUTERS SQL
COMPUTERS SQL
 
Commands
CommandsCommands
Commands
 
Creating database using sql commands
Creating database using sql commandsCreating database using sql commands
Creating database using sql commands
 
Sql basics v2
Sql basics v2Sql basics v2
Sql basics v2
 
Sql dml & tcl 2
Sql   dml & tcl 2Sql   dml & tcl 2
Sql dml & tcl 2
 
Oracle naveen Sql
Oracle naveen   SqlOracle naveen   Sql
Oracle naveen Sql
 
Oracle naveen Sql
Oracle naveen   SqlOracle naveen   Sql
Oracle naveen Sql
 
SQL
SQLSQL
SQL
 
SQL : Structured Query Language
SQL : Structured Query LanguageSQL : Structured Query Language
SQL : Structured Query Language
 

Dernier

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 

Dernier (20)

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 

Commands of DML in SQL

  • 1.
  • 2. INTRODUCTION  SQL commands are instructions used to communicate with the database to perform specific task that work with data.  SQL commands can be used not only for searching the database but also to perform various other functions for example, you can create tables, add data to tables, or modify data, drop the table, set
  • 3. DATA MANIPULATION LANGUAGE  A DATA MANIPULATION LANGUAGE (DML) is a set of syntax that contains SQL commands that are used for storing, retrieving, modifying, and deleting data.  These commands are: SELECT INSERT UPDATE DELETE.
  • 4. SELECT COMMAND USE  Select command is used to view records from the table. To view all columns and all rows * can be specified with select statement.  If user needs to view only certain fields or columns, then by specifying the names of those certain fields, columns user can acquire its output. SYNTAX  SELECT * from table_name.  SELECT <Column_name> from table_name.
  • 5. TABLE T QUERY RESULT C1 C2 SELECT * FROM T; C1 C2 1 a 1 a 2 b 2 b C1 C2 SELECT C1 FROM T; C1 1 a 1 2 b 2 C1 C2 SELECT * FROM T WHERE C1 =1; C1 C2 1 a 1 a 2 b EXAMPLE
  • 6. DELETE COMMAND USE  Delete command is used to delete records in the table.  In SQL, Delete is used to delete rows in the table.  It is possible to delete all rows in a table without deleting the table.  This means that table structure, attributes and indexes will be intact. NOTE  Be very careful when deleting records, you
  • 7. SYNTAX • DELETE * from table_name [WHERE CONDITION] (if where condition is not used all rows in the table are removed) EXAMPLE • DELETE from customer WHERE CustomerName=‘Anil Khade’ AND ContactName=‘Vikrant Kedare’
  • 8. TABLE NAME: person Sr no. P_id p_name 1 120 Jack 2 121 Rose 3 122 Ram 4 123 Sita  If you want to delete row 1 then, DELETE * person WHERE p_name=‘Jack’; 1st Row will be deleted. Sr no. p_id p_name 2 121 Rose 3 122 Ram 4 123 Sita EXAMPLE
  • 9. UPDATE COMMAND USE  An SQL UPDATE statement changes the data of one or more records in a table.  Either all the rows can be updated, or a subset may be chosen using a condition. SYNTAX UPDATE table_name SET column_name = valu e [, column_name = value ...] [WHERE condition] EXAMPLE  UPDATE employee SET location ='Mysore' WHERE id = 101;
  • 10. Table Name: person p_id p_name 1 121 Jack 2 122 Rose 3 123 Ram  If you want to update row 1 then, UPDATE person SET p_name=‘Sita’ WHERE id = 121; p_id p_name 1 121 Sita 2 122 Rose 3 123 Ram EXAMPLE
  • 11. INSERT COMMAND USE  An SQL INSERT statement adds one or more records to any single table in a relational database. SYNTAX  INSERT INTO table_name VALUES (value1, value2, value3,...valueN); EXAMPLE  INSERT INTO person VALUES (124, ‘Laxman’);
  • 12. Table Name:person p_id p_name 1 121 Jack 2 122 Rose 3 123 Ram  If you want to insert data in 4th row then, INSERT INTO person Values(124, ‘Sita’); p_id p_name 1 121 Jack 2 122 Rose 3 123 Ram 4 124 Sita EXAMPLE