SlideShare a Scribd company logo
About Me
Md. Selim Hossain
Lecturer
Dept. of CSE
UTTARA UNIVERSITY
House#05, Section#06,
Road#15, Uttara, Dhaka-1230.
Md. Selim Hossain 1
Database
Management
System
(DBMS)
Md. Selim Hossain 2
Topics for Today
Md. Selim Hossain 3
Data Definition Language (DDL)
Data Manipulation Language
(DML)
Md. Selim Hossain 4
SQL statements are divided into two major
categories:
Data Definition Language (DDL) and
Data Manipulation Language (DML).
Md. Selim Hossain 5
Data Definition Language (DDL)
• DDL statements are used to build and modify
the structure of tables and other objects in
the database.
• DDL is a sub-language of SQL used to create
and manipulate objects in a database. DDL
provides the following statements to
manipulate the object in database:
CREATE, ALTER, DROP, TRUNCATE, RENAME
Md. Selim Hossain 6
Data Definition Language (DDL)
CREATE statement
(to create objects in the database):
• The CREATE statement in SQL creates a
component in a relational database
management system (RDBMS).
• The CREATE command is used to establish a
new database, table, index, or stored
procedure.
Md. Selim Hossain 7
CREATE TABLE statement
• A commonly used CREATE command is the
CREATE TABLE command. The typical usage is:
CREATE TABLE [table name] ( [column
definitions] ) [table parameters]
Md. Selim Hossain 8
CREATE TABLE statement
• An example of statement to create a table
named employees with a few columns is:
Md. Selim Hossain 9
CREATE TABLE statement
Note: The full structure of table can be viewed
with the DESC command.
DESC <TABLE_NAME>
Md. Selim Hossain 10
DROP statement
• The DROP statement destroys an existing
database, table, index, or view.
• A DROP statement in SQL removes a
component from a relational database
management system (RDBMS).
• Drop statement is used to delete an existing
object from the database. It can also be used
to delete any column from a table.
Md. Selim Hossain 11
DROP statement
• The DROP statement is distinct from the
DELETE and TRUNCATE statements, in that
DELETE and TRUNCATE do not remove the
table itself. For example, a DELETE statement
might delete some (or all) data from a table
while leaving the table itself in the database,
whereas a DROP statement removes the
entire table from the database.
Md. Selim Hossain 12
DROP statement
Md. Selim Hossain 13
DROP statement
The typical usage is simply:
• For example, the command to drop a table
named employees is:
Md. Selim Hossain 14
ALTER statement
• The ALTER statement modifies an existing
database object or, Alter statement is used to
modify the structure of an existing object.
• Below alteration can be done on a table:
o Addition of new columns
o Deletion of existing columns
o Changing the data type of columns
o Changing the size of columns
Md. Selim Hossain 15
ALTER statement
• The typical usage is:
Md. Selim Hossain 16
ALTER statement
Note: To change the data type of a column,
the column must be empty.
Md. Selim Hossain 17
RENAME statement
Rename statement is used to rename an
existing object from a database
Md. Selim Hossain 18
RENAME statement
• The RENAME statement is used to rename a
database table.
Md. Selim Hossain 19
TRUNCATE statement
• The TRUNCATE statement is used to delete all
data from a table. It's much faster than
DELETE.
Md. Selim Hossain 20
Data Manipulation Language (DML)
• A data manipulation language (DML) is a
family of syntax elements similar to a
computer programming language used for
selecting, inserting, deleting and updating
data in a database.
Md. Selim Hossain 21
Data Manipulation Language (DML)
 DML also known as query language
Two classes of languages
 Procedural – user specifies what data is
required and how to get those data
 Nonprocedural – user specifies what data is
required without specifying how to get
those data
Md. Selim Hossain 22
Data Manipulation Language (DML)
• DML is a sub-language of SQL. It is used to
manipulate the data stored in a table.
• DML provides the following statements for
data manipulation:
INSERT
UPDATE
DELETE
Md. Selim Hossain 23
Data Manipulation Language (DML)
INSERT Statement
• INSERT statement is used to insert a new
record into a table.
Md. Selim Hossain 24
Data Manipulation Language (DML)
INSERT Statement
• Example
• Consider a table 'EMP' having columns
named EMPNO, NAME, SAL and JOB. We can
be used the below INSERT statement to insert
a new record to it.
Md. Selim Hossain 25
UPDATE Statement
• Update statement is used to update an
existing record in a table.
Md. Selim Hossain 26
UPDATE Statement
• If the where clause of omitted, the statement
will update all the values in the particular
column.
Md. Selim Hossain 27
UPDATE Statement
• Note: IS NULL is used for assignment and =NULL
is used to recognize.
Md. Selim Hossain 28
DELETE Statement
• Delete Statement is used to delete records from
a table.
Md. Selim Hossain 29
DELETE Statement
Md. Selim Hossain 30
DELETE Statement
• Below statement will delete all records from
the table.
Md. Selim Hossain 31
Md. Selim Hossain
Thank you
32

More Related Content

PPTX
DDL And DML
PPTX
Data Manipulation Language (DML).pptx
PPTX
Data Manipulation Language
PPT
Data dictionary
PPTX
Ddl &amp; dml commands
PPT
Lecture 01 introduction to database
PPTX
Types Of Keys in DBMS
DDL And DML
Data Manipulation Language (DML).pptx
Data Manipulation Language
Data dictionary
Ddl &amp; dml commands
Lecture 01 introduction to database
Types Of Keys in DBMS

What's hot (20)

PPTX
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
PPT
Dbms presentaion
PPTX
Database constraints
PPTX
database language ppt.pptx
PDF
Normalization in DBMS
PPTX
Data Modeling Basics
PPT
Constraints In Sql
PDF
Introduction to SQL
PPTX
Database Management System
PPTX
Introduction to SQL
PPTX
Integrity Constraints
PPT
Types Of Join In Sql Server - Join With Example In Sql Server
PPTX
DATABASE CONSTRAINTS
PPT
Data Models.ppt
PPT
Data Base Management System
PPTX
Relational model
PPT
Database Keys
PPT
11 Database Concepts
PDF
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
Dbms presentaion
Database constraints
database language ppt.pptx
Normalization in DBMS
Data Modeling Basics
Constraints In Sql
Introduction to SQL
Database Management System
Introduction to SQL
Integrity Constraints
Types Of Join In Sql Server - Join With Example In Sql Server
DATABASE CONSTRAINTS
Data Models.ppt
Data Base Management System
Relational model
Database Keys
11 Database Concepts
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Ad

Viewers also liked (17)

PDF
How to Earn the Attention of Today's Buyer
PDF
25 Discovery Call Questions
PDF
Behind the Scenes: Launching HubSpot Tokyo
PDF
Add the Women Back: Wikipedia Edit-a-Thon
PPT
Error reporting in php
PPTX
String Manipulation in PHP
PDF
Unlocking The Value Of Your Information
PDF
SQL JOIN Explained Visually
PPT
4 Value Of Information
PPT
Php Error Handling
DOC
Mis mcq
PPTX
View of data DBMS
PDF
Be Helpie! gente que ayuda a gente a través de su afición
PPTX
Php string function
PPT
SQL Tutorial - How To Create, Drop, and Truncate Table
PDF
3 reasons to stop, think, sleep | London Business School
How to Earn the Attention of Today's Buyer
25 Discovery Call Questions
Behind the Scenes: Launching HubSpot Tokyo
Add the Women Back: Wikipedia Edit-a-Thon
Error reporting in php
String Manipulation in PHP
Unlocking The Value Of Your Information
SQL JOIN Explained Visually
4 Value Of Information
Php Error Handling
Mis mcq
View of data DBMS
Be Helpie! gente que ayuda a gente a través de su afición
Php string function
SQL Tutorial - How To Create, Drop, and Truncate Table
3 reasons to stop, think, sleep | London Business School
Ad

Similar to Data Definition and Data Manipulation Language-DDL & DML (20)

PDF
SQL_NOTES.pdf
PPTX
BWU_BTA_22_403_Aishika Majumdar and all about cse
PPTX
lovely
PPTX
SQL(DDL & DML)
PPTX
Data base
PPTX
SQL-SHORT-NOTES.pptx
PPTX
dbms gdjdjdjehdhdjjdjdudjdjdjdhhdhdbdhdhdh
PPTX
dbms (3436737839399388838388383860).pptx
PPTX
CapCut Pro 6.0.0.2434 Crack For PC Free Download [2025]
PPTX
Rekordbox DJ 7.1.1 Crack Free Download (Latest)
PDF
Web app development_my_sql_08
PPTX
Relational Database Language.pptx
PDF
SQL Basics, DDL, DML, DQL, Learn The BAsics Of SQL.pdf
PPT
Mysql
PPTX
Ddl vs dml
PPTX
SQL2.pptx
PPTX
Lecture - MY-SQL/ SQL Commands - DDL.pptx
PPT
Sql Commands_Dr.R.Shalini.ppt
PPTX
Structured Query Language
SQL_NOTES.pdf
BWU_BTA_22_403_Aishika Majumdar and all about cse
lovely
SQL(DDL & DML)
Data base
SQL-SHORT-NOTES.pptx
dbms gdjdjdjehdhdjjdjdudjdjdjdhhdhdbdhdhdh
dbms (3436737839399388838388383860).pptx
CapCut Pro 6.0.0.2434 Crack For PC Free Download [2025]
Rekordbox DJ 7.1.1 Crack Free Download (Latest)
Web app development_my_sql_08
Relational Database Language.pptx
SQL Basics, DDL, DML, DQL, Learn The BAsics Of SQL.pdf
Mysql
Ddl vs dml
SQL2.pptx
Lecture - MY-SQL/ SQL Commands - DDL.pptx
Sql Commands_Dr.R.Shalini.ppt
Structured Query Language

Recently uploaded (20)

PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
TR - Agricultural Crops Production NC III.pdf
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
Pharma ospi slides which help in ospi learning
PDF
Complications of Minimal Access Surgery at WLH
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Basic Mud Logging Guide for educational purpose
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
PPH.pptx obstetrics and gynecology in nursing
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
Institutional Correction lecture only . . .
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
STATICS OF THE RIGID BODIES Hibbelers.pdf
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
TR - Agricultural Crops Production NC III.pdf
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Pharma ospi slides which help in ospi learning
Complications of Minimal Access Surgery at WLH
O7-L3 Supply Chain Operations - ICLT Program
Basic Mud Logging Guide for educational purpose
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Abdominal Access Techniques with Prof. Dr. R K Mishra
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPH.pptx obstetrics and gynecology in nursing
Pharmacology of Heart Failure /Pharmacotherapy of CHF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Microbial disease of the cardiovascular and lymphatic systems
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Microbial diseases, their pathogenesis and prophylaxis
Institutional Correction lecture only . . .
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf

Data Definition and Data Manipulation Language-DDL & DML

  • 1. About Me Md. Selim Hossain Lecturer Dept. of CSE UTTARA UNIVERSITY House#05, Section#06, Road#15, Uttara, Dhaka-1230. Md. Selim Hossain 1
  • 3. Topics for Today Md. Selim Hossain 3
  • 4. Data Definition Language (DDL) Data Manipulation Language (DML) Md. Selim Hossain 4
  • 5. SQL statements are divided into two major categories: Data Definition Language (DDL) and Data Manipulation Language (DML). Md. Selim Hossain 5
  • 6. Data Definition Language (DDL) • DDL statements are used to build and modify the structure of tables and other objects in the database. • DDL is a sub-language of SQL used to create and manipulate objects in a database. DDL provides the following statements to manipulate the object in database: CREATE, ALTER, DROP, TRUNCATE, RENAME Md. Selim Hossain 6
  • 7. Data Definition Language (DDL) CREATE statement (to create objects in the database): • The CREATE statement in SQL creates a component in a relational database management system (RDBMS). • The CREATE command is used to establish a new database, table, index, or stored procedure. Md. Selim Hossain 7
  • 8. CREATE TABLE statement • A commonly used CREATE command is the CREATE TABLE command. The typical usage is: CREATE TABLE [table name] ( [column definitions] ) [table parameters] Md. Selim Hossain 8
  • 9. CREATE TABLE statement • An example of statement to create a table named employees with a few columns is: Md. Selim Hossain 9
  • 10. CREATE TABLE statement Note: The full structure of table can be viewed with the DESC command. DESC <TABLE_NAME> Md. Selim Hossain 10
  • 11. DROP statement • The DROP statement destroys an existing database, table, index, or view. • A DROP statement in SQL removes a component from a relational database management system (RDBMS). • Drop statement is used to delete an existing object from the database. It can also be used to delete any column from a table. Md. Selim Hossain 11
  • 12. DROP statement • The DROP statement is distinct from the DELETE and TRUNCATE statements, in that DELETE and TRUNCATE do not remove the table itself. For example, a DELETE statement might delete some (or all) data from a table while leaving the table itself in the database, whereas a DROP statement removes the entire table from the database. Md. Selim Hossain 12
  • 14. DROP statement The typical usage is simply: • For example, the command to drop a table named employees is: Md. Selim Hossain 14
  • 15. ALTER statement • The ALTER statement modifies an existing database object or, Alter statement is used to modify the structure of an existing object. • Below alteration can be done on a table: o Addition of new columns o Deletion of existing columns o Changing the data type of columns o Changing the size of columns Md. Selim Hossain 15
  • 16. ALTER statement • The typical usage is: Md. Selim Hossain 16
  • 17. ALTER statement Note: To change the data type of a column, the column must be empty. Md. Selim Hossain 17
  • 18. RENAME statement Rename statement is used to rename an existing object from a database Md. Selim Hossain 18
  • 19. RENAME statement • The RENAME statement is used to rename a database table. Md. Selim Hossain 19
  • 20. TRUNCATE statement • The TRUNCATE statement is used to delete all data from a table. It's much faster than DELETE. Md. Selim Hossain 20
  • 21. Data Manipulation Language (DML) • A data manipulation language (DML) is a family of syntax elements similar to a computer programming language used for selecting, inserting, deleting and updating data in a database. Md. Selim Hossain 21
  • 22. Data Manipulation Language (DML)  DML also known as query language Two classes of languages  Procedural – user specifies what data is required and how to get those data  Nonprocedural – user specifies what data is required without specifying how to get those data Md. Selim Hossain 22
  • 23. Data Manipulation Language (DML) • DML is a sub-language of SQL. It is used to manipulate the data stored in a table. • DML provides the following statements for data manipulation: INSERT UPDATE DELETE Md. Selim Hossain 23
  • 24. Data Manipulation Language (DML) INSERT Statement • INSERT statement is used to insert a new record into a table. Md. Selim Hossain 24
  • 25. Data Manipulation Language (DML) INSERT Statement • Example • Consider a table 'EMP' having columns named EMPNO, NAME, SAL and JOB. We can be used the below INSERT statement to insert a new record to it. Md. Selim Hossain 25
  • 26. UPDATE Statement • Update statement is used to update an existing record in a table. Md. Selim Hossain 26
  • 27. UPDATE Statement • If the where clause of omitted, the statement will update all the values in the particular column. Md. Selim Hossain 27
  • 28. UPDATE Statement • Note: IS NULL is used for assignment and =NULL is used to recognize. Md. Selim Hossain 28
  • 29. DELETE Statement • Delete Statement is used to delete records from a table. Md. Selim Hossain 29
  • 31. DELETE Statement • Below statement will delete all records from the table. Md. Selim Hossain 31