SlideShare a Scribd company logo
DM
L
DATA
M
ANIPULATION
LANGUAGE
INTRODUCTION
SQL (Structured Query Language) is the standard language used for the
manipulation and accessing databases.
SQL is divided into two parts :
1. DML (Data Manipulation Language)
2. DDL (Data Definition Languagae)
DATA MANIPULATION LANGUAGE
DML COMMANDS
 Insert- Insert is used to add a new row to a table
SYNTAX :
INSERT INTO tablename [(field list)] VALUES (value list)
Field list is optional
 If field list is omitted, values expected for all columns (except IDENTITY)
INSERT
INSERT SINGLE ROW EXAMPLES
1.INSERT INTO Students(StudentID)
VALUES(‘s01’)
2.INSERT INTO Courses(Department,
CourseNumber)
VALUES(‘CS’,’C01’)
3.INSERT INTO Courses
VALUES(‘CS’,’C01’,’SQL Projects’,5,)
ASSIGNING NULL VALUES
If Null is acceptable for a column
 Omit field from field list; Or
 Use NULL in Value list
Assume Course description is optional:
INSERT INTO Courses
VALUES(‘CIS’,’282’,’SQL Projects’,5,Null)
INSERT INTO Courses(Department, CourseNumber,
Title, Credits)
VALUES(‘CIS’,’282’,’SQL Projects’,5)
UPDATE
Update is used to change an existing row
Can change one, some or all rows in a table or view
 A WHERE clause is used to specify specific rows to change
 Multiple conditions require a logical operator
SYNTAX :
UPDATE tablename SET field1 = value1,field2 = value2
WHERE field=value
UPDATE EXAMPLES
Assign value to zip code for 2nd
publisher:
UPDATE publishers
SET pub_zip = 20006
WHERE pub_id = 0877
Change publisher name to add ‘Ltd.’ for any Massachusetts publisher:
UPDATE publishers
SET pub_name = pub_name + ‘Ltd.’
WHERE pub_state = ‘ma’
DELETE
Delete removes one or more rows from the table
 No field list is included
 May specify which rows to remove by adding WHERE clause
Delete Syntax
DELETE FROM tablename WHERE condition
DELETE EXAMPLES
DELETE FROM Publishers
WHERE pub_state <>’ca’
DELETE FROM Publishers
WHERE pub_zip IS NULL OR
pub_state = ‘wa’
DELETE FROM Publishers

More Related Content

PPT
PPTX
1. dml select statement reterive data
PPT
Les01 (retrieving data using the sql select statement)
PPTX
SQL Data Manipulation
PPT
Sql DML
PPTX
Basic SQL Statments
1. dml select statement reterive data
Les01 (retrieving data using the sql select statement)
SQL Data Manipulation
Sql DML
Basic SQL Statments

What's hot (19)

PPTX
Sql.pptx
PPT
SQL Queries
PPTX
Data Manipulation Language
PPTX
Statements,joins and operators in sql by thanveer danish melayi(1)
PPT
Class diagram
PPT
ALL ABOUT SQL AND RDBMS
PPTX
Introduction to structured query language (sql) (1)
PPTX
Sql fundamentals
PPT
Sql dml & tcl 2
PPTX
Uml Diagrams for Web Developers
PPT
4.o o design tools=uml -_lecture 4
PPTX
What is UML (Unified Modeling Language)?
PPT
UML Diagram Assignment Help, UML Diagram Homework Help
PDF
Introduction to the Relational Model and SQL
PDF
SQL Overview
PPTX
Commands of DML in SQL
PPTX
Introduction to the Unified Modeling Language (UML)
PPT
Fundamentals of Software Engineering
Sql.pptx
SQL Queries
Data Manipulation Language
Statements,joins and operators in sql by thanveer danish melayi(1)
Class diagram
ALL ABOUT SQL AND RDBMS
Introduction to structured query language (sql) (1)
Sql fundamentals
Sql dml & tcl 2
Uml Diagrams for Web Developers
4.o o design tools=uml -_lecture 4
What is UML (Unified Modeling Language)?
UML Diagram Assignment Help, UML Diagram Homework Help
Introduction to the Relational Model and SQL
SQL Overview
Commands of DML in SQL
Introduction to the Unified Modeling Language (UML)
Fundamentals of Software Engineering
Ad

Viewers also liked (20)

PDF
database slide 1
PPT
J2EE - Practical Overview
PPT
Evolving the Web into a Global Database - Advances and Applications.
PDF
Database slide
PPTX
Public Cloud Platforms for .NET Developers
PPTX
Writing High Quality Code in C#
PPT
Nakov - .NET Framework Overview - English
PDF
RMAN best practices for RAC
PPT
14. Defining Classes
PDF
Payroll system
PPT
0. Course Introduction
PPTX
Oracle database 12c new features
DOCX
Thesis about Computerized Payroll System for Barangay Hall, Dita
PPTX
HBase Vs Cassandra Vs MongoDB - Choosing the right NoSQL database
PPTX
Computerized payroll system
PPTX
Payroll Management System
PPS
Database Design Slide 1
DOCX
Computer science project work
PPT
Payroll management
PDF
Payroll Management System SRS
database slide 1
J2EE - Practical Overview
Evolving the Web into a Global Database - Advances and Applications.
Database slide
Public Cloud Platforms for .NET Developers
Writing High Quality Code in C#
Nakov - .NET Framework Overview - English
RMAN best practices for RAC
14. Defining Classes
Payroll system
0. Course Introduction
Oracle database 12c new features
Thesis about Computerized Payroll System for Barangay Hall, Dita
HBase Vs Cassandra Vs MongoDB - Choosing the right NoSQL database
Computerized payroll system
Payroll Management System
Database Design Slide 1
Computer science project work
Payroll management
Payroll Management System SRS
Ad

Similar to database slide (20)

PPT
Lab_04.ppt opreating system of computer lab
PPTX
Unit - II.pptx
PPTX
Introduction to SQl Commands.pptxhhjhvvb
PPTX
MIS 301 RELATIONAL DATABASE MANAGEMENT SYSTEM 10,11&12.pptx
PPTX
Himani uppal-221302130 WP ppt.pptx
PPTX
SQL - DML and DDL Commands
PPTX
SQL commands
PPT
Sqlbysandeep
PPTX
SQL commands in database managemant systems
PDF
SQL Basics, DDL, DML, DQL, Learn The BAsics Of SQL.pdf
PPTX
What is SQL Server?
PPTX
SQL-SHORT-NOTES.pptx
PPTX
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
PPTX
Fundamentals of Database management system Lab Manual.pptx
PDF
SQL_NOTES.pdf
PPTX
oracle heusiwjwkw hsushwjwsoosw usuwjsja
PPTX
database language ppt.pptx
PPTX
GFGC CHIKKABASUR ( DML COMMANDS )
PPTX
SQLBasic to advance for the beggineers.pptx
PPTX
Lab_04.ppt opreating system of computer lab
Unit - II.pptx
Introduction to SQl Commands.pptxhhjhvvb
MIS 301 RELATIONAL DATABASE MANAGEMENT SYSTEM 10,11&12.pptx
Himani uppal-221302130 WP ppt.pptx
SQL - DML and DDL Commands
SQL commands
Sqlbysandeep
SQL commands in database managemant systems
SQL Basics, DDL, DML, DQL, Learn The BAsics Of SQL.pdf
What is SQL Server?
SQL-SHORT-NOTES.pptx
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
Fundamentals of Database management system Lab Manual.pptx
SQL_NOTES.pdf
oracle heusiwjwkw hsushwjwsoosw usuwjsja
database language ppt.pptx
GFGC CHIKKABASUR ( DML COMMANDS )
SQLBasic to advance for the beggineers.pptx

Recently uploaded (20)

PDF
Electronic commerce courselecture one. Pdf
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
cuic standard and advanced reporting.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Spectroscopy.pptx food analysis technology
PPTX
A Presentation on Artificial Intelligence
PPTX
sap open course for s4hana steps from ECC to s4
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Electronic commerce courselecture one. Pdf
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Review of recent advances in non-invasive hemoglobin estimation
Encapsulation_ Review paper, used for researhc scholars
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
The AUB Centre for AI in Media Proposal.docx
Per capita expenditure prediction using model stacking based on satellite ima...
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Approach and Philosophy of On baking technology
Building Integrated photovoltaic BIPV_UPV.pdf
cuic standard and advanced reporting.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Spectroscopy.pptx food analysis technology
A Presentation on Artificial Intelligence
sap open course for s4hana steps from ECC to s4
The Rise and Fall of 3GPP – Time for a Sabbatical?
NewMind AI Weekly Chronicles - August'25-Week II
Agricultural_Statistics_at_a_Glance_2022_0.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...

database slide

  • 2. INTRODUCTION SQL (Structured Query Language) is the standard language used for the manipulation and accessing databases. SQL is divided into two parts : 1. DML (Data Manipulation Language) 2. DDL (Data Definition Languagae)
  • 4. DML COMMANDS  Insert- Insert is used to add a new row to a table SYNTAX : INSERT INTO tablename [(field list)] VALUES (value list) Field list is optional  If field list is omitted, values expected for all columns (except IDENTITY) INSERT
  • 5. INSERT SINGLE ROW EXAMPLES 1.INSERT INTO Students(StudentID) VALUES(‘s01’) 2.INSERT INTO Courses(Department, CourseNumber) VALUES(‘CS’,’C01’) 3.INSERT INTO Courses VALUES(‘CS’,’C01’,’SQL Projects’,5,)
  • 6. ASSIGNING NULL VALUES If Null is acceptable for a column  Omit field from field list; Or  Use NULL in Value list Assume Course description is optional: INSERT INTO Courses VALUES(‘CIS’,’282’,’SQL Projects’,5,Null) INSERT INTO Courses(Department, CourseNumber, Title, Credits) VALUES(‘CIS’,’282’,’SQL Projects’,5)
  • 7. UPDATE Update is used to change an existing row Can change one, some or all rows in a table or view  A WHERE clause is used to specify specific rows to change  Multiple conditions require a logical operator SYNTAX : UPDATE tablename SET field1 = value1,field2 = value2 WHERE field=value
  • 8. UPDATE EXAMPLES Assign value to zip code for 2nd publisher: UPDATE publishers SET pub_zip = 20006 WHERE pub_id = 0877 Change publisher name to add ‘Ltd.’ for any Massachusetts publisher: UPDATE publishers SET pub_name = pub_name + ‘Ltd.’ WHERE pub_state = ‘ma’
  • 9. DELETE Delete removes one or more rows from the table  No field list is included  May specify which rows to remove by adding WHERE clause Delete Syntax DELETE FROM tablename WHERE condition
  • 10. DELETE EXAMPLES DELETE FROM Publishers WHERE pub_state <>’ca’ DELETE FROM Publishers WHERE pub_zip IS NULL OR pub_state = ‘wa’ DELETE FROM Publishers