SlideShare a Scribd company logo
1 of 12
DATABASE MANAGEMENT
SYSTEMS
1
Topics Covered
1. DDL
2. DML
3. DCL
2
1. DDL Commands
DDL:
Data Definition
Language
 CREATE
 ALTER
 DROP
 RENAME
 DELETE
 SELECT
DCL:
DML:
Data Manipulation Language
 INSERT
 UPDATE
Data Control Language
 GRANT
 REVOKE
 COMMIT (TCL)
 ROLLBACK (TCL) 3
1.1 DDL: Create
CREATE TABLE
CUSTOMER1(
ID Number(2),
NAME NVARCHAR2 (20),
AGE INT,
ADDRESS NVARCHAR2
(30) ,
SALARY DECIMAL (10, 2)
create table cust_temp as
select id, name from
customer1;
CREATE TABLE STUDENT2
(
ID INT NOT NULL,
NAME VARCHAR(20) NOT
NULL,
AGE INT NOT NULL, 4
1.2 DDL: Alter
 ALTER TABLE table_nameADD column_name
datatype;
 ALTER TABLE table_name DROP COLUMN
column_name;
 ALTER TABLE table_name MODIFY COLUMN
column_name datatype;
 ALTER TABLE table_name MODIFY column_name
datatype NOT NULL; 5
1.3 DDL Command: DROP &
Rename
 Drop table student;
 Rename student1 to student2;
 TRUNCATE TABLE customer1;
6
2. DML: Data Manipulation Language
 INSERT
 UPDATE
 DELETE
 SELECT
7
2.1 DML Example: Insert, Select,
Update
insert into customer1values(90, 'Codd',60,'San Fransisco',
150000);
insert into customer1 values(&id,
'&name',&age,'&address',&salary);
SELECT * FROM EMPLOYEE
UPDATE Customer1 set ID=18, WHERE Name='henry D
k
E
o
L
r
t
E
h
T
'
;
E
FROM
Customer1 WHERE Name='Henry Korth' AND age=60;
8
3. DCL: Data Control Language
 GRANT : used to grant or give the privileges.
 REVOKE : used to avoid or object the privileges.
 COMMIT: used to save the data permanently.
 ROLL BACK : Used to revert changes in the
transactions since the last commit or rollback
command was issued
9
3.1 DCL: Commit
DELETE FROM
CUSTOMERS
WHEREAGE = 25;
SQL> COMMIT;
10
3.2 Rollback
 ROLLBACK command is the transactional
command used to undo transactions that have
not already been saved to the database.
 This command can only be used to undo
transactions since the last COMMIT or
ROLLBACK command was issued.
 DELETE FROM CUSTOMERS WHERE AGE =
25; 11
3.3 DCL : Grant & Revoke
create user korth identified by henry
🞑 Connect as system/ora10g
GRANT SELECT, INSERT, UPDATE, DELETE
ON Emp_Det TO korth;
REVOKE DELETE ON Emp_details FROM
12

More Related Content

Similar to Module4.4_DDL_DML_DCL_ for beginners .pptx

hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptxhjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
EliasPetros
 
BCS4L1-Database Management lab.pdf
BCS4L1-Database Management lab.pdfBCS4L1-Database Management lab.pdf
BCS4L1-Database Management lab.pdf
KeerthanaP37
 
Introduction to sql new
Introduction to sql newIntroduction to sql new
Introduction to sql new
SANTOSH RATH
 

Similar to Module4.4_DDL_DML_DCL_ for beginners .pptx (20)

sql.pptx
sql.pptxsql.pptx
sql.pptx
 
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...
 
Basic sql Commands
Basic sql CommandsBasic sql Commands
Basic sql Commands
 
Rdbms day3
Rdbms day3Rdbms day3
Rdbms day3
 
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptxhjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
 
6_SQL.pdf
6_SQL.pdf6_SQL.pdf
6_SQL.pdf
 
Sql
SqlSql
Sql
 
BCS4L1-Database Management lab.pdf
BCS4L1-Database Management lab.pdfBCS4L1-Database Management lab.pdf
BCS4L1-Database Management lab.pdf
 
Introduction to sql
Introduction to sqlIntroduction to sql
Introduction to sql
 
Chapter 4 Structured Query Language
Chapter 4 Structured Query LanguageChapter 4 Structured Query Language
Chapter 4 Structured Query Language
 
DBMS.pdf
DBMS.pdfDBMS.pdf
DBMS.pdf
 
Introduction to sql new
Introduction to sql newIntroduction to sql new
Introduction to sql new
 
SQL express course for begginers
   SQL express course for begginers   SQL express course for begginers
SQL express course for begginers
 
Oracle sql material
Oracle sql materialOracle sql material
Oracle sql material
 
Les09
Les09Les09
Les09
 
SQL Queries Information
SQL Queries InformationSQL Queries Information
SQL Queries Information
 
SQL Quick Reference Card
SQL Quick Reference CardSQL Quick Reference Card
SQL Quick Reference Card
 
Les09 (using ddl statements to create and manage tables)
Les09 (using ddl statements to create and manage tables)Les09 (using ddl statements to create and manage tables)
Les09 (using ddl statements to create and manage tables)
 
Oraclesql
OraclesqlOraclesql
Oraclesql
 
sql statements & joins
sql statements & joinssql statements & joins
sql statements & joins
 

Recently uploaded

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 

Recently uploaded (20)

Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 

Module4.4_DDL_DML_DCL_ for beginners .pptx

  • 3. 1. DDL Commands DDL: Data Definition Language  CREATE  ALTER  DROP  RENAME  DELETE  SELECT DCL: DML: Data Manipulation Language  INSERT  UPDATE Data Control Language  GRANT  REVOKE  COMMIT (TCL)  ROLLBACK (TCL) 3
  • 4. 1.1 DDL: Create CREATE TABLE CUSTOMER1( ID Number(2), NAME NVARCHAR2 (20), AGE INT, ADDRESS NVARCHAR2 (30) , SALARY DECIMAL (10, 2) create table cust_temp as select id, name from customer1; CREATE TABLE STUDENT2 ( ID INT NOT NULL, NAME VARCHAR(20) NOT NULL, AGE INT NOT NULL, 4
  • 5. 1.2 DDL: Alter  ALTER TABLE table_nameADD column_name datatype;  ALTER TABLE table_name DROP COLUMN column_name;  ALTER TABLE table_name MODIFY COLUMN column_name datatype;  ALTER TABLE table_name MODIFY column_name datatype NOT NULL; 5
  • 6. 1.3 DDL Command: DROP & Rename  Drop table student;  Rename student1 to student2;  TRUNCATE TABLE customer1; 6
  • 7. 2. DML: Data Manipulation Language  INSERT  UPDATE  DELETE  SELECT 7
  • 8. 2.1 DML Example: Insert, Select, Update insert into customer1values(90, 'Codd',60,'San Fransisco', 150000); insert into customer1 values(&id, '&name',&age,'&address',&salary); SELECT * FROM EMPLOYEE UPDATE Customer1 set ID=18, WHERE Name='henry D k E o L r t E h T ' ; E FROM Customer1 WHERE Name='Henry Korth' AND age=60; 8
  • 9. 3. DCL: Data Control Language  GRANT : used to grant or give the privileges.  REVOKE : used to avoid or object the privileges.  COMMIT: used to save the data permanently.  ROLL BACK : Used to revert changes in the transactions since the last commit or rollback command was issued 9
  • 10. 3.1 DCL: Commit DELETE FROM CUSTOMERS WHEREAGE = 25; SQL> COMMIT; 10
  • 11. 3.2 Rollback  ROLLBACK command is the transactional command used to undo transactions that have not already been saved to the database.  This command can only be used to undo transactions since the last COMMIT or ROLLBACK command was issued.  DELETE FROM CUSTOMERS WHERE AGE = 25; 11
  • 12. 3.3 DCL : Grant & Revoke create user korth identified by henry 🞑 Connect as system/ora10g GRANT SELECT, INSERT, UPDATE, DELETE ON Emp_Det TO korth; REVOKE DELETE ON Emp_details FROM 12