SlideShare a Scribd company logo
1 of 17
DML & DCL
Command
Submitted by:-
Rajneesh
Class- MCA 2nd sem
Roll No.-2209401015
CONTENT-
• SQL
• Introduction of DCL and DML
• Statement of DCL and DML
• Conclusion
Structured Query Language (SQL)
• SQL (Structured Query Language) is a language to operate databases; it
includes Database Creation, Database Deletion, Fetching Data Rows,
Modifying & Deleting Data rows, etc.
• Types of SQL Statements-
1. DML(Data Manipulation Language)
2. DDL(Data Definition Language)
3. DCL(DataControl Language)
Introduction of DML
• The DML commands in StructuredQuery Language change the data present
in the SQL database. We can easily access, store, modify, update and delete
the existing records from the database using DML commands.
• Four Main types of DML commands
1. SELECTCommand
2. INSERT Command
3. UPDATE Command
4. DELETECommand
SELECT DML Command
• SELECT is the most important data manipulation command in Structured Query
Language.The SELECT command shows the records of the specified table. It also
shows the particular record of a particular column by using the WHERE clause.
• Syntax:
SELECT * FROM table_name;
• Example:
SELECT * FROM Student;
• Output:-
INSERT DML Command
• The INSERT INTO command in SQL allows the database users to insert one
or more records into the SQL table.
• Syntax:
INSERT INTOTable_Name VALUES(Value_1,Value_2,Value_3, .....,Value_N);
• Example
• You can create a record in CUSTOMERS table by using this syntax also.
 INSERT INTOCUSTOMERS VALUES (6, PRATIK, 24, KANPUR);
OUTPUT:-
UPDATE DML Command
• SQL UPDATE statement is used to change the data of the records held by
tables. Which rows is to be update, it is decided by a condition.To specify
condition, we useWHERE clause.
• Syntax:
UPDATE table_name SET column_name = expression WHERE conditions .
• Example
• Example: here we are going to update an entry in the source table.
 UPDATE students SET User_Name = 'beinghuman' WHERE Student_Id = '3' ;
• OUTPUT:-
DELETE DML Command
• The SQL DELETE statement is used to delete rows from a table. Generally
DELETE statement removes one or more records from a table.
• Syntax:
DELETE FROM table_name [WHERE condition];
• Example
• Example of delete with WHERE clause is given below:
DELETE FROM EMPLOYEE WHERE ID=101;
• OUTPUT:-
Introduction of DCL
• Data Control Language (DCL) deals with the commands used in SQL that
permit a user to access, modify or work on the different privileges in order to
control the database. It allows the database owner to give access, revoke
access, and change the given permissions as and when required. DCL is
basically used for enforcing data security.
• Types of DCL Commands in SQL
• Two types of DCL commands can be used by the user in SQL.
1. REVOKE Command
2. GRANT Command
GRANT DCL Command
• GRANT, as the name itself suggests, provides.This command allows the
administrator to provide particular privileges or permissions over a database
object, such as a table, view, or procedure. It can provide user access to
perform certain database or component operations.
• In simple language, the GRANT command allows the user to implement
other SQL commands on the database or its objects.The primary function
of the GRANT command in SQL is to provide administrators the ability to
ensure the security and integrity of the data is maintained in the database.
Implementing GRANT Statement
• Consider a scenario where you are the database administrator, and a
student table is in the database. Suppose you want a specific user Aman to
only SELECT (read)/ retrieve the data from the student table.Then you can
use GRANT in the below GRANT statement.
GRANT SELECT ON student TO Aman;
• This command will allow Aman to implement the SELECT queries on the
student table.This will enable the user to read or retrieve information from
the student table.
REVOKE DCL Command
• As the name suggests, revoke is to take away.The REVOKE command
enables the database administrator to remove the previously provided
privileges or permissions from a user over a database or database object,
such as a table, view, or procedure.The REVOKE commands prevent the
user from accessing or performing a specific operation on an element in the
database.
• In simple language, the REVOKE command terminates the ability of the
user to perform the mentioned SQL command in the REVOKE query on the
database or its component.The primary reason for implementing the
REVOKE query in the database is to ensure the data's security and integrity.
Implementing REVOKE Statement
• Consider a scenario where the user is the database administrator. In the
above implementation of the GRANT command, the user Aman was
provided permission to implement a SELECT query on the student table
that allowed Aman to read or retrieve the data from the table. Due to
certain circumstances, the administrator wants to revoke the
abovementioned permission.To do so, the administrator can implement the
below REVOKE statement:
REVOKE SELECT ON student FROM Aman;
• This will stop the user Aman from implementing the SELECT query on the
student table.The user may be able to implement other queries in the
database..
CONCLUSION
Understanding the role of DCL in managing permissions and DML in data
manipulation is fundamental for effective database management. By
implementing best practices and avoiding common mistakes, data security
and integrity can be upheld, ensuring the reliability of the database.

More Related Content

Similar to DML & DCL.pptx

our company has an opening for a junior database administrator. As a.pdf
our company has an opening for a junior database administrator. As a.pdfour company has an opening for a junior database administrator. As a.pdf
our company has an opening for a junior database administrator. As a.pdf
arshiartpalace
 
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptxMy lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
EliasPetros
 
Lecture on DBMS & MySQL.pdf v. C. .
Lecture on DBMS & MySQL.pdf v.  C.     .Lecture on DBMS & MySQL.pdf v.  C.     .
Lecture on DBMS & MySQL.pdf v. C. .
MayankSinghRawat6
 
Sql grant, revoke, privileges and roles
Sql grant, revoke, privileges and rolesSql grant, revoke, privileges and roles
Sql grant, revoke, privileges and roles
Vivek Singh
 

Similar to DML & DCL.pptx (20)

Relational Database Language.pptx
Relational Database Language.pptxRelational Database Language.pptx
Relational Database Language.pptx
 
our company has an opening for a junior database administrator. As a.pdf
our company has an opening for a junior database administrator. As a.pdfour company has an opening for a junior database administrator. As a.pdf
our company has an opening for a junior database administrator. As a.pdf
 
ppt.pdf
ppt.pdfppt.pdf
ppt.pdf
 
SQL commands
SQL commandsSQL commands
SQL commands
 
sql.pptx
sql.pptxsql.pptx
sql.pptx
 
Sql queries
Sql queriesSql queries
Sql queries
 
Database Management System (DBMS).pptx
Database Management System (DBMS).pptxDatabase Management System (DBMS).pptx
Database Management System (DBMS).pptx
 
Oracle sql material
Oracle sql materialOracle sql material
Oracle sql material
 
Database language
Database languageDatabase language
Database language
 
Basics of dml queries
Basics of dml queriesBasics of dml queries
Basics of dml queries
 
SQL(DDL & DML)
SQL(DDL & DML)SQL(DDL & DML)
SQL(DDL & DML)
 
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptxMy lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
 
IM02: Database Language
IM02: Database LanguageIM02: Database Language
IM02: Database Language
 
Lecture on DBMS & MySQL.pdf v. C. .
Lecture on DBMS & MySQL.pdf v.  C.     .Lecture on DBMS & MySQL.pdf v.  C.     .
Lecture on DBMS & MySQL.pdf v. C. .
 
STRUCTURED QUERY LANGUAGE
STRUCTURED QUERY LANGUAGESTRUCTURED QUERY LANGUAGE
STRUCTURED QUERY LANGUAGE
 
Group Members
Group MembersGroup Members
Group Members
 
Sql grant, revoke, privileges and roles
Sql grant, revoke, privileges and rolesSql grant, revoke, privileges and roles
Sql grant, revoke, privileges and roles
 
Types of sql commands by naveen kumar veligeti
Types of sql commands by naveen kumar veligetiTypes of sql commands by naveen kumar veligeti
Types of sql commands by naveen kumar veligeti
 
intro for sql
intro for sql intro for sql
intro for sql
 
Data Ware Housing through SQL concept
Data Ware Housing through SQL conceptData Ware Housing through SQL concept
Data Ware Housing through SQL concept
 

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
 

Recently uploaded (20)

Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
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
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
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
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
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
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
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
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 

DML & DCL.pptx

  • 1. DML & DCL Command Submitted by:- Rajneesh Class- MCA 2nd sem Roll No.-2209401015
  • 2. CONTENT- • SQL • Introduction of DCL and DML • Statement of DCL and DML • Conclusion
  • 3. Structured Query Language (SQL) • SQL (Structured Query Language) is a language to operate databases; it includes Database Creation, Database Deletion, Fetching Data Rows, Modifying & Deleting Data rows, etc. • Types of SQL Statements- 1. DML(Data Manipulation Language) 2. DDL(Data Definition Language) 3. DCL(DataControl Language)
  • 4. Introduction of DML • The DML commands in StructuredQuery Language change the data present in the SQL database. We can easily access, store, modify, update and delete the existing records from the database using DML commands. • Four Main types of DML commands 1. SELECTCommand 2. INSERT Command 3. UPDATE Command 4. DELETECommand
  • 5. SELECT DML Command • SELECT is the most important data manipulation command in Structured Query Language.The SELECT command shows the records of the specified table. It also shows the particular record of a particular column by using the WHERE clause. • Syntax: SELECT * FROM table_name; • Example: SELECT * FROM Student; • Output:-
  • 6. INSERT DML Command • The INSERT INTO command in SQL allows the database users to insert one or more records into the SQL table. • Syntax: INSERT INTOTable_Name VALUES(Value_1,Value_2,Value_3, .....,Value_N); • Example
  • 7. • You can create a record in CUSTOMERS table by using this syntax also.  INSERT INTOCUSTOMERS VALUES (6, PRATIK, 24, KANPUR); OUTPUT:-
  • 8. UPDATE DML Command • SQL UPDATE statement is used to change the data of the records held by tables. Which rows is to be update, it is decided by a condition.To specify condition, we useWHERE clause. • Syntax: UPDATE table_name SET column_name = expression WHERE conditions . • Example
  • 9. • Example: here we are going to update an entry in the source table.  UPDATE students SET User_Name = 'beinghuman' WHERE Student_Id = '3' ; • OUTPUT:-
  • 10. DELETE DML Command • The SQL DELETE statement is used to delete rows from a table. Generally DELETE statement removes one or more records from a table. • Syntax: DELETE FROM table_name [WHERE condition]; • Example
  • 11. • Example of delete with WHERE clause is given below: DELETE FROM EMPLOYEE WHERE ID=101; • OUTPUT:-
  • 12. Introduction of DCL • Data Control Language (DCL) deals with the commands used in SQL that permit a user to access, modify or work on the different privileges in order to control the database. It allows the database owner to give access, revoke access, and change the given permissions as and when required. DCL is basically used for enforcing data security. • Types of DCL Commands in SQL • Two types of DCL commands can be used by the user in SQL. 1. REVOKE Command 2. GRANT Command
  • 13. GRANT DCL Command • GRANT, as the name itself suggests, provides.This command allows the administrator to provide particular privileges or permissions over a database object, such as a table, view, or procedure. It can provide user access to perform certain database or component operations. • In simple language, the GRANT command allows the user to implement other SQL commands on the database or its objects.The primary function of the GRANT command in SQL is to provide administrators the ability to ensure the security and integrity of the data is maintained in the database.
  • 14. Implementing GRANT Statement • Consider a scenario where you are the database administrator, and a student table is in the database. Suppose you want a specific user Aman to only SELECT (read)/ retrieve the data from the student table.Then you can use GRANT in the below GRANT statement. GRANT SELECT ON student TO Aman; • This command will allow Aman to implement the SELECT queries on the student table.This will enable the user to read or retrieve information from the student table.
  • 15. REVOKE DCL Command • As the name suggests, revoke is to take away.The REVOKE command enables the database administrator to remove the previously provided privileges or permissions from a user over a database or database object, such as a table, view, or procedure.The REVOKE commands prevent the user from accessing or performing a specific operation on an element in the database. • In simple language, the REVOKE command terminates the ability of the user to perform the mentioned SQL command in the REVOKE query on the database or its component.The primary reason for implementing the REVOKE query in the database is to ensure the data's security and integrity.
  • 16. Implementing REVOKE Statement • Consider a scenario where the user is the database administrator. In the above implementation of the GRANT command, the user Aman was provided permission to implement a SELECT query on the student table that allowed Aman to read or retrieve the data from the table. Due to certain circumstances, the administrator wants to revoke the abovementioned permission.To do so, the administrator can implement the below REVOKE statement: REVOKE SELECT ON student FROM Aman; • This will stop the user Aman from implementing the SELECT query on the student table.The user may be able to implement other queries in the database..
  • 17. CONCLUSION Understanding the role of DCL in managing permissions and DML in data manipulation is fundamental for effective database management. By implementing best practices and avoiding common mistakes, data security and integrity can be upheld, ensuring the reliability of the database.