SlideShare a Scribd company logo
Sanjivani Rural Education Society’s
Sanjivani College of Engineering, Kopargaon-423 603
(An Autonomous Institute, Affiliated to Savitribai Phule Pune University, Pune)
NACC ‘A’ Grade Accredited, ISO 9001:2015 Certified
Department of Computer Engineering
(NBA Accredited)
Prof. Monika Agrawal
Assistant Professor
E-mail : agrawalmonikacomp@sanjivani.org.in
Contact No: 8770361037
Course:CO210
Database Management System
Unit 2
Lecture-01 Introduction
Content
s
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 2
Characteristics of SQL
SQL Data Types
Data Definition Language
Data Manipulation Language
Data Control Language
Transaction Control Language
What is SQL ?
•SQL stands for Structured Query Language
•SQL lets you access and manipulate databases
•SQL became a standard of the American National Standards Institute (ANSI)
in 1986, and of the International Organization for Standardization (ISO) in
1987
•SQL widely used Non procedural language.
Characteristics of SQL
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 3
SQL is easy to learn.
SQL is used to access data from relational database management systems.
SQL can execute queries against the database.
SQL is used to describe the data.
SQL is used to define the data in the database and manipulate it when needed.
SQL is used to create and drop the database and table.
SQL is used to create a view, stored procedure, function in a database.
SQL allows users to set permissions on tables, procedures, and views.
Advantages SQL
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 4
• High Speed.
• No coding needed.
• Well defined standards.
• Portability.
• Non Procedurally – SQL DML is Non Procedural.
• Interactive language.
• Multiple data views.
Database Tables
• A database most often contains one or more tables.
• Each table is identified by a name (e.g. "Customers" or "Orders"), and contain
records (rows) with data.
• The table above contains five records (one for each customer) and seven columns (CustomerID,
CustomerName, ContactName, Address, City, PostalCode, and Country).
Rules to write commands:
• Table names cannot exceed 20 characters.
• Name of the table must be unique.
• Field names also must be unique.
• The field list and filed length must be enclosed in parentheses.
• The user must specify the field length and type.
• The field definitions must be separated with commas.
• SQL statements must end with a semicolon.
SQL (Cont.)
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 6
• Example: Find the name of the customer with customer-id 192-83-7465
select
from
where
customer.customername
customer
customer.customerid =
‘192-83-7465’
• Application programs generally access databases through one of
• Language extensions to allow embedded SQL
• Application program interface (e.g., ODBC/JDBC) which allow SQL
queries to be sent to a database
SQL Data Types
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 7
• char(n). Fixed length character string, with user-specified length n.
• varchar(n). Variable length character strings, with user-specified maximum
length n.
• int. Integer (a finite subset of the integers that is machine-dependent). Signed
range is from -2147483648 to 2147483647. Unsigned range is from 0 to
4294967295.
• smallint. Small integer (a machine-dependent subset of the integer domain
type). Signed range is from -32768 to 32767. Unsigned range is from 0 to 65535.
• float(p,d). Fixed point number, with user-specified precision of p digits,
with
n digits to the right of decimal point.
• real, double precision. Floating point and double-precision floating point
numbers, with machine-dependent precision.
• float(n). Floating point number, with user-specified precision of at least n
digits.
Database Languages
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 8
Data Definition Language
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 9
• DDL or Data Definition Language actually consists of the SQL
commands that can be used to define the database schema.
• It simply deals with descriptions of the database schema and is used
to create and modify the structure of database objects in the database.
• DDL is a set of SQL commands used to create, modify, and delete
database structures but not data.
List of DDL commands:
•CREATE: This command is used to create the database or its objects (like
table, index, function, views, store procedure, and triggers).
•DROP: This command is used to delete objects from the database.
•ALTER: This is used to alter the structure of the database.
•TRUNCATE: This is used to remove all records from a table, including all
spaces allocated for the records are removed.
•COMMENT: This is used to add comments to the data dictionary.
•RENAME: This is used to rename an object existing in the database.
Data Definition Language(Cont.)
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 10
Specification notation for defining the database schema
Example: create table account (
account-number
balance
char(10),
integer)
DDL compiler generates a set of tables stored in a data dictionary
Data dictionary contains metadata (i.e., data about data)
Database schema
Data storage and definition language
Specifies the storage structure and access methods used
Integrity constraints
Domain constraints
Referential integrity (references constraint in SQL)
Assertions
Authorization
Data Manipulation Language (DML)
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 11
Language for accessing and manipulating the data organized by the
appropriate data model
DML also known as query language
Two classes of languages
Procedural – user specifies what data is required and how to get
those data
Declarative (nonprocedural) – user specifies what data is required
without specifying how to get those data
SQL is the most widely used query language
List of DML commands:
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 12
•INSERT: It is used to insert data into a table.
•UPDATE: It is used to update existing data within a table.
•DELETE: It is used to delete records from a database table.
•LOCK: Table control concurrency.
•CALL: Call a PL/SQL or JAVA subprogram.
•EXPLAIN PLAN: It describes the access path to data.
DQL
• We can define DQL as follows it is a component of SQL
statement that allows getting data from the database and
imposing order upon it.
• It includes the SELECT statement.
• When a SELECT is fired against a table or tables the result is
compiled into a further temporary table, which is displayed or
perhaps received by the program i.e. a front-end.
List of DQL:
•SELECT: It is used to retrieve data from the database.
DCL
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 13
DCL includes commands such as GRANT and REVOKE which mainly deal
with the rights, permissions, and other controls of the database system.
GRANT: This command gives users access privileges to the database.
Syntax:
GRANT SELECT, UPDATE ON MY_TABLE TO SOME_USER, ANOTHER_USER;
REVOKE: This command withdraws the user’s access privileges given by using
the GRANT command.
Syntax:
REVOKE SELECT, UPDATE ON MY_TABLE FROM USER1, USER2;
TCL
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 14
Transactions group a set of tasks into a single execution unit.
 Each transaction begins with a specific task and ends when all the
tasks in the group are successfully completed.
If any of the tasks fail, the transaction fails.
Therefore, a transaction has only two results: success or failure.
COMMIT: Commits a Transaction.
Syntax:
COMMIT;
ROLLBACK: Rollbacks a transaction in case of any error occurs.
Syntax:
ROLLBACK;
SAVEPOINT: Sets a save point within a transaction.
Syntax:
SAVEPOINT SAVEPOINT_NAME;

More Related Content

PPTX
Introduction to SQL, SQL*Plus
Chhom Karath
 
PPTX
SQL Commands
Sachidananda M H
 
PPTX
Relational Database Language.pptx
Sheethal Aji Mani
 
PPTX
Using Basic Structured Query Language lo1.pptx
TsedaleBayabil
 
PPTX
SQL Training courses.pptx
irfanakram32
 
PPTX
Structures Query Language btech data science
htihor40
 
PPTX
Lecture - MY-SQL/ SQL Commands - DDL.pptx
umershah0263
 
PPTX
SQL commands in database managemant systems
pmselvaraj
 
Introduction to SQL, SQL*Plus
Chhom Karath
 
SQL Commands
Sachidananda M H
 
Relational Database Language.pptx
Sheethal Aji Mani
 
Using Basic Structured Query Language lo1.pptx
TsedaleBayabil
 
SQL Training courses.pptx
irfanakram32
 
Structures Query Language btech data science
htihor40
 
Lecture - MY-SQL/ SQL Commands - DDL.pptx
umershah0263
 
SQL commands in database managemant systems
pmselvaraj
 

Similar to Introduction to Structured Query Language (20)

PPTX
Structured query language(sql)ppt
Gowarthini
 
PDF
Structures query language ___PPT (1).pdf
tipurple7989
 
PDF
SQL_NOTES.pdf
AnshumanDwivedi14
 
PPTX
What is SQL Server?
CPD INDIA
 
PPTX
HPD SQL Training - Beginner - 20220916.pptx
PatriceRochon1
 
PPTX
Lecture 2 sql {basics date type, constrains , integrity types etc.}
Shubham Shukla
 
PDF
Unit 3 rdbms study_materials-converted
gayaramesh
 
PPTX
Unit - II.pptx
MrsSavitaKumbhare
 
PPTX
Islamic University Previous Year Question Solution 2018 (ADBMS)
Rakibul Hasan Pranto
 
PPTX
Introduction to Database SQL & PL/SQL
Collaboration Technologies
 
PPTX
20190326165338_ISYS6508-PPT5-W5-S6-R0.pptx
FayChan8
 
DOC
Sql server
Puja Gupta
 
PPTX
1 August part 1basic SQL Lab PPT FORMAT.pptx
nainaniritika04
 
PDF
Database Systems - Introduction to SQL (Chapter 3/1)
Vidyasagar Mundroy
 
PPT
Dbms ii mca-ch7-sql-2013
Prosanta Ghosh
 
PDF
Top SQL Questions to Crack Data Interviews Easily
sagarheddurshettyvio
 
PPT
Less07 schema
Imran Ali
 
PPTX
Introduction to SQl Commands.pptxhhjhvvb
DeepakSingh99214
 
PDF
Sql tutorial
Rumman Ansari
 
PDF
Introduction to the Structured Query Language SQL
Harmony Kwawu
 
Structured query language(sql)ppt
Gowarthini
 
Structures query language ___PPT (1).pdf
tipurple7989
 
SQL_NOTES.pdf
AnshumanDwivedi14
 
What is SQL Server?
CPD INDIA
 
HPD SQL Training - Beginner - 20220916.pptx
PatriceRochon1
 
Lecture 2 sql {basics date type, constrains , integrity types etc.}
Shubham Shukla
 
Unit 3 rdbms study_materials-converted
gayaramesh
 
Unit - II.pptx
MrsSavitaKumbhare
 
Islamic University Previous Year Question Solution 2018 (ADBMS)
Rakibul Hasan Pranto
 
Introduction to Database SQL & PL/SQL
Collaboration Technologies
 
20190326165338_ISYS6508-PPT5-W5-S6-R0.pptx
FayChan8
 
Sql server
Puja Gupta
 
1 August part 1basic SQL Lab PPT FORMAT.pptx
nainaniritika04
 
Database Systems - Introduction to SQL (Chapter 3/1)
Vidyasagar Mundroy
 
Dbms ii mca-ch7-sql-2013
Prosanta Ghosh
 
Top SQL Questions to Crack Data Interviews Easily
sagarheddurshettyvio
 
Less07 schema
Imran Ali
 
Introduction to SQl Commands.pptxhhjhvvb
DeepakSingh99214
 
Sql tutorial
Rumman Ansari
 
Introduction to the Structured Query Language SQL
Harmony Kwawu
 
Ad

More from agrawalmonikacomp (20)

PPT
Introduction to MongoDB CRUD Operations.ppt
agrawalmonikacomp
 
PPT
Lecture 2 Difference between NoSQL and SQL.ppt
agrawalmonikacomp
 
PPTX
Lecture 1-Introduction of NoSQL in DBMS.pptx
agrawalmonikacomp
 
PPT
Lecture 6 Failure Classification in DBMS.ppt
agrawalmonikacomp
 
PPT
Lecture 5 Deadlocks in Database Systems.ppt
agrawalmonikacomp
 
PPT
Lecture 1-Introduction to Database Transactions.ppt
agrawalmonikacomp
 
PPTX
Learning of 3NF BCNF Normal Forms in DBMS.pptx
agrawalmonikacomp
 
PPTX
First Normal Form, Second Normal Form.pptx
agrawalmonikacomp
 
PPTX
Learning of L2 Codd's Rules 7-12 in DBMS.pptx
agrawalmonikacomp
 
PPTX
Learning of Codd's Rules 0-6 in DBMS.pptx
agrawalmonikacomp
 
PPTX
Learning of PL-SQL Introduction in DBMS.pptx
agrawalmonikacomp
 
PPTX
SQL Indexes Creation and Use in DBMS.pptx
agrawalmonikacomp
 
PPTX
SQL Aggregate functions Learning in DBMS.pptx
agrawalmonikacomp
 
PPTX
Basic SQL Queries with Clauses Learning.pptx
agrawalmonikacomp
 
PPTX
Basic SQL commands and explanation .pptx
agrawalmonikacomp
 
PPTX
Data Definition Language Commands in DBMS
agrawalmonikacomp
 
PPTX
Weak Entity Sets in Database Management System.pptx
agrawalmonikacomp
 
PPTX
Learning Cardinalities and Relationships.pptx
agrawalmonikacomp
 
PPTX
Entity Relationship Model in Database Systems
agrawalmonikacomp
 
PPTX
DBMS Languages in Database Management System
agrawalmonikacomp
 
Introduction to MongoDB CRUD Operations.ppt
agrawalmonikacomp
 
Lecture 2 Difference between NoSQL and SQL.ppt
agrawalmonikacomp
 
Lecture 1-Introduction of NoSQL in DBMS.pptx
agrawalmonikacomp
 
Lecture 6 Failure Classification in DBMS.ppt
agrawalmonikacomp
 
Lecture 5 Deadlocks in Database Systems.ppt
agrawalmonikacomp
 
Lecture 1-Introduction to Database Transactions.ppt
agrawalmonikacomp
 
Learning of 3NF BCNF Normal Forms in DBMS.pptx
agrawalmonikacomp
 
First Normal Form, Second Normal Form.pptx
agrawalmonikacomp
 
Learning of L2 Codd's Rules 7-12 in DBMS.pptx
agrawalmonikacomp
 
Learning of Codd's Rules 0-6 in DBMS.pptx
agrawalmonikacomp
 
Learning of PL-SQL Introduction in DBMS.pptx
agrawalmonikacomp
 
SQL Indexes Creation and Use in DBMS.pptx
agrawalmonikacomp
 
SQL Aggregate functions Learning in DBMS.pptx
agrawalmonikacomp
 
Basic SQL Queries with Clauses Learning.pptx
agrawalmonikacomp
 
Basic SQL commands and explanation .pptx
agrawalmonikacomp
 
Data Definition Language Commands in DBMS
agrawalmonikacomp
 
Weak Entity Sets in Database Management System.pptx
agrawalmonikacomp
 
Learning Cardinalities and Relationships.pptx
agrawalmonikacomp
 
Entity Relationship Model in Database Systems
agrawalmonikacomp
 
DBMS Languages in Database Management System
agrawalmonikacomp
 
Ad

Recently uploaded (20)

PDF
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
PPTX
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
PPTX
NOI Hackathon - Summer Edition - GreenThumber.pptx
MartinaBurlando1
 
PDF
1.Natural-Resources-and-Their-Use.ppt pdf /8th class social science Exploring...
Sandeep Swamy
 
PPTX
Nursing Management of Patients with Disorders of Ear, Nose, and Throat (ENT) ...
RAKESH SAJJAN
 
PPTX
PPTs-The Rise of Empiresghhhhhhhh (1).pptx
academysrusti114
 
PPTX
Understanding operators in c language.pptx
auteharshil95
 
PPTX
How to Manage Global Discount in Odoo 18 POS
Celine George
 
PDF
7.Particulate-Nature-of-Matter.ppt/8th class science curiosity/by k sandeep s...
Sandeep Swamy
 
DOCX
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
PPTX
Care of patients with elImination deviation.pptx
AneetaSharma15
 
PDF
Sunset Boulevard Student Revision Booklet
jpinnuck
 
PDF
Types of Literary Text: Poetry and Prose
kaelandreabibit
 
PPTX
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
PDF
Landforms and landscapes data surprise preview
jpinnuck
 
PPTX
TEF & EA Bsc Nursing 5th sem.....BBBpptx
AneetaSharma15
 
PPTX
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
PPTX
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
PPTX
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
PDF
The Picture of Dorian Gray summary and depiction
opaliyahemel
 
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
NOI Hackathon - Summer Edition - GreenThumber.pptx
MartinaBurlando1
 
1.Natural-Resources-and-Their-Use.ppt pdf /8th class social science Exploring...
Sandeep Swamy
 
Nursing Management of Patients with Disorders of Ear, Nose, and Throat (ENT) ...
RAKESH SAJJAN
 
PPTs-The Rise of Empiresghhhhhhhh (1).pptx
academysrusti114
 
Understanding operators in c language.pptx
auteharshil95
 
How to Manage Global Discount in Odoo 18 POS
Celine George
 
7.Particulate-Nature-of-Matter.ppt/8th class science curiosity/by k sandeep s...
Sandeep Swamy
 
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
Care of patients with elImination deviation.pptx
AneetaSharma15
 
Sunset Boulevard Student Revision Booklet
jpinnuck
 
Types of Literary Text: Poetry and Prose
kaelandreabibit
 
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
Landforms and landscapes data surprise preview
jpinnuck
 
TEF & EA Bsc Nursing 5th sem.....BBBpptx
AneetaSharma15
 
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
The Picture of Dorian Gray summary and depiction
opaliyahemel
 

Introduction to Structured Query Language

  • 1. Sanjivani Rural Education Society’s Sanjivani College of Engineering, Kopargaon-423 603 (An Autonomous Institute, Affiliated to Savitribai Phule Pune University, Pune) NACC ‘A’ Grade Accredited, ISO 9001:2015 Certified Department of Computer Engineering (NBA Accredited) Prof. Monika Agrawal Assistant Professor E-mail : [email protected] Contact No: 8770361037 Course:CO210 Database Management System Unit 2 Lecture-01 Introduction
  • 2. Content s DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 2 Characteristics of SQL SQL Data Types Data Definition Language Data Manipulation Language Data Control Language Transaction Control Language
  • 3. What is SQL ? •SQL stands for Structured Query Language •SQL lets you access and manipulate databases •SQL became a standard of the American National Standards Institute (ANSI) in 1986, and of the International Organization for Standardization (ISO) in 1987 •SQL widely used Non procedural language.
  • 4. Characteristics of SQL DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 3 SQL is easy to learn. SQL is used to access data from relational database management systems. SQL can execute queries against the database. SQL is used to describe the data. SQL is used to define the data in the database and manipulate it when needed. SQL is used to create and drop the database and table. SQL is used to create a view, stored procedure, function in a database. SQL allows users to set permissions on tables, procedures, and views.
  • 5. Advantages SQL DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 4 • High Speed. • No coding needed. • Well defined standards. • Portability. • Non Procedurally – SQL DML is Non Procedural. • Interactive language. • Multiple data views.
  • 6. Database Tables • A database most often contains one or more tables. • Each table is identified by a name (e.g. "Customers" or "Orders"), and contain records (rows) with data. • The table above contains five records (one for each customer) and seven columns (CustomerID, CustomerName, ContactName, Address, City, PostalCode, and Country).
  • 7. Rules to write commands: • Table names cannot exceed 20 characters. • Name of the table must be unique. • Field names also must be unique. • The field list and filed length must be enclosed in parentheses. • The user must specify the field length and type. • The field definitions must be separated with commas. • SQL statements must end with a semicolon.
  • 8. SQL (Cont.) DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 6 • Example: Find the name of the customer with customer-id 192-83-7465 select from where customer.customername customer customer.customerid = ‘192-83-7465’ • Application programs generally access databases through one of • Language extensions to allow embedded SQL • Application program interface (e.g., ODBC/JDBC) which allow SQL queries to be sent to a database
  • 9. SQL Data Types DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 7 • char(n). Fixed length character string, with user-specified length n. • varchar(n). Variable length character strings, with user-specified maximum length n. • int. Integer (a finite subset of the integers that is machine-dependent). Signed range is from -2147483648 to 2147483647. Unsigned range is from 0 to 4294967295. • smallint. Small integer (a machine-dependent subset of the integer domain type). Signed range is from -32768 to 32767. Unsigned range is from 0 to 65535. • float(p,d). Fixed point number, with user-specified precision of p digits, with n digits to the right of decimal point. • real, double precision. Floating point and double-precision floating point numbers, with machine-dependent precision. • float(n). Floating point number, with user-specified precision of at least n digits.
  • 10. Database Languages DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 8
  • 11. Data Definition Language DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 9 • DDL or Data Definition Language actually consists of the SQL commands that can be used to define the database schema. • It simply deals with descriptions of the database schema and is used to create and modify the structure of database objects in the database. • DDL is a set of SQL commands used to create, modify, and delete database structures but not data.
  • 12. List of DDL commands: •CREATE: This command is used to create the database or its objects (like table, index, function, views, store procedure, and triggers). •DROP: This command is used to delete objects from the database. •ALTER: This is used to alter the structure of the database. •TRUNCATE: This is used to remove all records from a table, including all spaces allocated for the records are removed. •COMMENT: This is used to add comments to the data dictionary. •RENAME: This is used to rename an object existing in the database.
  • 13. Data Definition Language(Cont.) DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 10 Specification notation for defining the database schema Example: create table account ( account-number balance char(10), integer) DDL compiler generates a set of tables stored in a data dictionary Data dictionary contains metadata (i.e., data about data) Database schema Data storage and definition language Specifies the storage structure and access methods used Integrity constraints Domain constraints Referential integrity (references constraint in SQL) Assertions Authorization
  • 14. Data Manipulation Language (DML) DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 11 Language for accessing and manipulating the data organized by the appropriate data model DML also known as query language Two classes of languages Procedural – user specifies what data is required and how to get those data Declarative (nonprocedural) – user specifies what data is required without specifying how to get those data SQL is the most widely used query language
  • 15. List of DML commands: DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 12 •INSERT: It is used to insert data into a table. •UPDATE: It is used to update existing data within a table. •DELETE: It is used to delete records from a database table. •LOCK: Table control concurrency. •CALL: Call a PL/SQL or JAVA subprogram. •EXPLAIN PLAN: It describes the access path to data.
  • 16. DQL • We can define DQL as follows it is a component of SQL statement that allows getting data from the database and imposing order upon it. • It includes the SELECT statement. • When a SELECT is fired against a table or tables the result is compiled into a further temporary table, which is displayed or perhaps received by the program i.e. a front-end. List of DQL: •SELECT: It is used to retrieve data from the database.
  • 17. DCL DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 13 DCL includes commands such as GRANT and REVOKE which mainly deal with the rights, permissions, and other controls of the database system. GRANT: This command gives users access privileges to the database. Syntax: GRANT SELECT, UPDATE ON MY_TABLE TO SOME_USER, ANOTHER_USER; REVOKE: This command withdraws the user’s access privileges given by using the GRANT command. Syntax: REVOKE SELECT, UPDATE ON MY_TABLE FROM USER1, USER2;
  • 18. TCL DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 14 Transactions group a set of tasks into a single execution unit.  Each transaction begins with a specific task and ends when all the tasks in the group are successfully completed. If any of the tasks fail, the transaction fails. Therefore, a transaction has only two results: success or failure. COMMIT: Commits a Transaction. Syntax: COMMIT; ROLLBACK: Rollbacks a transaction in case of any error occurs. Syntax: ROLLBACK; SAVEPOINT: Sets a save point within a transaction. Syntax: SAVEPOINT SAVEPOINT_NAME;