DDL, DQL, DML, DCL & TCL Commands | Database Management System (DBMS) - Computer Science Engineering (CSE) PDF Download

Introduction


Structured Query Language(SQL) as we all know is the database language by the use of which we can perform certain operations on the existing database and also we can use this language to create a database. SQL uses certain commands like Create, Drop, Insert, etc. to carry out the required tasks. 

These SQL commands are mainly categorized into four categories as: 

  • DDL: Data Definition Language
  • DQL: Data Query Language
  • DML: Data Manipulation Language
  • DCL: Data Control Language
  •  TCL: Transaction Control Language

Now, we will see all of these in detail.
DDL, DQL, DML, DCL & TCL Commands | Database Management System (DBMS) - Computer Science Engineering (CSE)

DDL (Data Definition Language)

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. These commands are normally not used by a general user, who should be accessing the database via an application.
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.

DQL (Data Query Language)

DQL statements are used for performing queries on the data within schema objects. The purpose of the DQL Command is to get some schema relation based on the query passed to it. 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. This command allows getting the data out of the database to perform operations with it. 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.

DML(Data Manipulation Language): 

The SQL commands that deals with the manipulation of data present in the database belong to DML or Data Manipulation Language and this includes most of the SQL statements. It is the component of the SQL statement that controls access to data and to the database. Basically, DCL statements are grouped with DML statements.
List of DML commands: 

  • 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.

DCL (Data Control Language)

DCL includes commands such as GRANT and REVOKE which mainly deal with the rights, permissions, and other controls of the database system.
List of  DCL commands: 

  • GRANT: This command gives users access privileges to the database.
  • REVOKE: This command withdraws the user’s access privileges given by using the GRANT command.

TCL (Transaction Control Language)

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 successfully complete. If any of the tasks fail, the transaction fails. Therefore, a transaction has only two results: success or failure. You can explore more about transactions here. Hence, the following TCL commands are used to control the execution of a transaction: 

  • COMMIT: Commits a Transaction.
  • ROLLBACK: Rollbacks a transaction in case of any error occurs.
  • SAVEPOINT: Sets a save point within a transaction.
  • SET TRANSACTION: Specifies characteristics for the transaction.
The document DDL, DQL, DML, DCL & TCL Commands | Database Management System (DBMS) - Computer Science Engineering (CSE) is a part of the Computer Science Engineering (CSE) Course Database Management System (DBMS).
All you need of Computer Science Engineering (CSE) at this link: Computer Science Engineering (CSE)
62 videos|66 docs|35 tests

Top Courses for Computer Science Engineering (CSE)

FAQs on DDL, DQL, DML, DCL & TCL Commands - Database Management System (DBMS) - Computer Science Engineering (CSE)

1. What are the different types of commands in Computer Science Engineering related to DDL, DQL, DML, DCL, and TCL?
Ans. In Computer Science Engineering, there are different types of commands related to DDL (Data Definition Language), DQL (Data Query Language), DML (Data Manipulation Language), DCL (Data Control Language), and TCL (Transaction Control Language).
2. What is the purpose of DDL commands in Computer Science Engineering?
Ans. DDL commands in Computer Science Engineering, such as CREATE, ALTER, and DROP, are used to define the structure and schema of a database. They are used to create, modify, and delete database objects like tables, indexes, and views.
3. How are DQL commands useful in Computer Science Engineering?
Ans. DQL commands in Computer Science Engineering, such as SELECT, are used to query and retrieve data from a database. They allow users to fetch specific information from one or multiple tables based on specified conditions.
4. What is the role of DML commands in Computer Science Engineering?
Ans. DML commands in Computer Science Engineering, such as INSERT, UPDATE, and DELETE, are used to manipulate and modify the data within a database. They allow users to insert new records, update existing records, or delete unwanted records from tables.
5. How are DCL and TCL commands significant in Computer Science Engineering?
Ans. DCL (Data Control Language) commands in Computer Science Engineering, such as GRANT and REVOKE, are used to control user access and privileges to the database objects. TCL (Transaction Control Language) commands, such as COMMIT and ROLLBACK, are used to manage and control transactions within the database. They ensure data integrity and consistency in multi-step operations.
62 videos|66 docs|35 tests
Download as PDF
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

Objective type Questions

,

MCQs

,

Free

,

DML

,

mock tests for examination

,

DQL

,

DDL

,

Exam

,

Viva Questions

,

DCL & TCL Commands | Database Management System (DBMS) - Computer Science Engineering (CSE)

,

DCL & TCL Commands | Database Management System (DBMS) - Computer Science Engineering (CSE)

,

Summary

,

Semester Notes

,

DCL & TCL Commands | Database Management System (DBMS) - Computer Science Engineering (CSE)

,

Sample Paper

,

DQL

,

DDL

,

Previous Year Questions with Solutions

,

past year papers

,

ppt

,

pdf

,

DQL

,

DDL

,

DML

,

study material

,

Important questions

,

DML

,

Extra Questions

,

practice quizzes

,

shortcuts and tricks

,

video lectures

;