INSTRUCTOR:
NUSRAT JAHAN
SENIOR LECTURER, SWE, DIU.
SE223
LECTURE 2
Introduction
• • SQL is abbreviation for Structured Query Language
• • A Database Language that communicates with
• Relational Database
• • Can be divided into more specific language
• – DDL
• – DML
• – DCL
• – TCL
12/04/2023Database
2
DDL
• • DDL is abbreviation for Data Definition Language
• • Used to define the database structure or schema
• • CREATE - to create objects in the database
• • ALTER - alters the structure of the database
• • DROP - delete objects from the database
• • TRUNCATE - remove all records from a table
• • COMMENT - add comments to the data dictionary
• • RENAME - rename an object
12/04/2023Database
DML
DML is abbreviation for Data Manipulation Language
• Used to manipulate data within schema objects
• SELECT - retrieve data from the a database
• INSERT - insert data into a table
• UPDATE - updates existing data within a table
• DELETE - deletes all records from a table, the space for the
records remain
• MERGE - UPSERT operation (Insert or Update)
• CALL - call a Stored-Procedure
12/04/2023Database
4
DCL
• DCL is abbreviation for Data Control Language
• Used to define roles and permissions to access database
• GRANT - gives user's access privileges to database
• REVOKE - withdraw access privileges given with the GRANT
command
TCL
TCL is abbreviation for Transactional Control Language
• Used to manage the changes made by DML statements
• COMMIT - save work done
ROLLBACK - restore database to original since the last
COMMIT
Thanks
12/04/2023Database