9/11/2023
In our last blog post we have gone through in detail on DDL (Data Definition Language), DML (Data Manipulation Language), DCL (Data Control Language), DQL (Data Query Language) and TCL (Transaction Control Language) is fundamental in SQL (Structured Query Language), which are the key components and sub-languages of Structured Query Language (SQL).
Please read the blog on DDL, DML, DCL, DQL and TCL and their common commands. Click here to go to the blog.
Test your understanding of SQL sub-languages – DDL, DML, DCL, DQL and TCL and their commands with these multiple-choice questions (MCQs).
A. Data Description Language
B. Data Definition Language
C. Data Deletion Language
D. Data Design Language
Answer: B
Explanation: DDL stands for Data Definition Language. DDL commands are used to define and manage the structure of the database. CREATE, ALTER, DROP and TRUNCATE are the commands of Data Definition Language (DDL).
A. CREATE
B. ALTER
C. DROP
D. TRUNCATE
Answer: D
Explanation: The TRUNCATE command is used to remove all records (rows) from a table without changing its structure. Remember, Records are also referred to as rows. Each row represents a single record in a database table.
A. To define database objects
B. To manipulate or modify stored data
C. To control user access
D. To query and retrieve data
Answer: B
Explanation: DML (Data Manipulation Language) is used to manipulate or modify the stored data in the database. INSERT, UPDATE and DELETE are the commands of DML (Data Manipulation Language).
A. SELECT
B. INSERT
C. UPDATE
D. DELETE
Answer: B
Explanation: The INSERT command is used to add new records (rows) into a table.
A. To create tables and views
B. To manipulate data
C. To set permissions and access control
D. To query data
Answer: C
Explanation: DCL (Data Control Language) commands are used to set permissions and access control for users. GRANT and REVOKE are the commands of DCL (Data Control Language).
A. GRANT
B. REVOKE
C. CREATE
D. ALTER
Answer: A
Explanation: The GRANT command allows setting specific permissions for users to perform actions on database objects.
A. Data Description Language
B. Data Definition Language
C. Data Deletion Language
D. Data Query Language
Answer: D
Explanation: DQL stands for Data Query Language, which is responsible for querying and retrieving data from the database. SELECT is a command of Data Query Language (DQL).
A. CREATE
B. ALTER
C. INSERT
D. SELECT
Answer: D
Explanation: The SELECT command is used to retrieve data from one or multiple tables.
A. To define database objects
B. To manipulate or modify stored data
C. To set permissions and access control
D. To manage and control transactions
Answer: D
Explanation: TCL (Transaction Control Language) commands are used to manage and control transactions in the database.
A. COMMIT
B. ROLLBACK
C. SAVEPOINT
D. GRANT
Answer: A
Explanation: The COMMIT command is used to save all the changes made in a transaction. COMMIT, ROLLBACK and SAVEPOINT are the commands of the Transaction Control Language (TCL).
A. Structured Query Language
B. Sequential Query Language
C. System Query Language
D. Standard Query Language
Answer: A
Explanation: SQL stands for Structured Query Language. SQL is used for managing and querying databases.
A. DDL (Data Definition Language)
B. DML (Data Manipulation Language)
C. DCL (Data Control Language)
D. DQL (Data Query Language)
Answer: C
Explanation: DCL (Data Control Language) commands are used for setting permissions and access control in SQL. GRANT and REVOKE are the commands of DCL (Data Control Language).
A. INSERT
B. UPDATE
C. SELECT
D. DELETE
Answer: C
Explanation: The SELECT command is used to retrieve date from specific columns from a table.
A. To commit changes to the database
B. To undo changes made in a transaction
C. To retrieve data from tables
D. To create new database objects
Answer: B
Explanation: The ROLLBACK command is used to undo changes made in a transaction and revert the database to its previous state.
A. CREATE
B. ALTER
C. DROP
D. TRUNCATE
Answer: C
Explanation: The DROP command is used to permanently remove a table and its data from the database.
Don’t forget to read our detailed blog on DDL (Data Definition Language), DML (Data Manipulation Language), DCL (Data Control Language), DQL (Data Query Language) and TCL (Transaction Control Language) and their common commands. Click here to visit the blog page.