Home »
SQL »
SQL MCQs
MCQ | SQL – Commands: DDL, DML, DCL, TCL, DQL
SQL Commands MCQ: This section contains the Multiple-Choice Questions & Answers on SQL Commands: DDL, DML, DCL, TCL, DQL.
Submitted by Anushree Goswami, on October 24, 2021
SQL Commands (DDL, DML, DCL, TCL, DQL) MCQs
1. Types of SQL Commands are –
- DDL
- DML
- DCL
- All of the above
Answer: D) All of the above
Explanation:
Types of SQL Commands are DDL, DML, DCL & TCL.
Discuss this Question
2. Full form of DDL is –
- Data Describe Language
- Definition Data Language
- Data Definition Language
- Data Distinct Language
Answer: C) Data Definition Language
Explanation:
Full form of DDL is Data Definition Language.
Discuss this Question
3. Commands that comes under DDL is/are –
- CREATE
- DROP
- TRUNCATE
- All of the above
Answer: D) All of the above
Explanation:
Commands that come under DDL are CREATE, ALTER, DROP, TRUNCATE & RENAME.
Discuss this Question
4. Full form of DML is –
- Data Multiplication Language
- Data Manipulation Language
- Data Modify Language
- Data Mapping Language
Answer: B) Data Manipulation Language
Explanation:
Full form of DML is Data Manipulation Language.
Discuss this Question
5. Which of the following is/are TRUE about DDL command?
- Our data is stored in a table that is described by the schema, thus DDL commands deal with the schema.
- With the DDL commands, any structural changes can be made to the table, including creation, deletion, and alteration.
- Both A. and B.
- None of the above
Answer: C) Both A. and B.
Explanation:
In the case of DDL commands:
- Our data is stored in a table that is described by the schema, thus DDL commands deal with the schema.
- With the DDL commands, any structural changes can be made to the table, including creation, deletion, and alteration.
Discuss this Question
6. Command that comes under DML is/are –
- ROLLBACK
- GRANT
- UPDATE
- All of the above
Answer: C) UPDATE
Explanation:
Commands that comes under DML are INSERT, SELECT, UPDATE & DELETE.
Discuss this Question
7. Select the correct statement.
- With the DDL commands, any structural changes can be made to the table, including creation, deletion, and alteration.
- With the DML commands, any structural changes can be made to the table, including creation, deletion, and alteration.
- With the DCL commands, any structural changes can be made to the table, including creation, deletion, and alteration.
- With the TCL commands, any structural changes can be made to the table, including creation, deletion, and alteration.
Answer: A) With the DDL commands, any structural changes can be made to the table, including creation, deletion, and alteration
Explanation:
With the DDL commands, any structural changes can be made to the table, including creation, deletion, and alteration.
Discuss this Question
8. Full form of DCL is -
- Data Control Language
- Data Commit Language
- Data Common Language
- Data Concatenate Language
Answer: A) Data Control Language
Explanation:
Full form of DCL is Data Control Language.
Discuss this Question
9. Command that comes under DCL is/are -
- GRANT
- REVOKE
- Both A. and B.
- None of the above
Answer: C) Both A. and B.
Explanation:
Commands that comes under DCL are GRAND & REVOKE.
Discuss this Question
10. Full form of TCL is -
- Transaction Common Language
- Transaction Commit Language
- Transaction Concatenate Language
- Transaction Control Language
Answer: D) Transaction Control Language
Explanation:
Full form of TCL is Transaction Control Language.
Discuss this Question
11. Commands that come under TCL is/are -
- COMMIT
- ROLLBACK
- SAVEPOINT
- All of the above
Answer: D) All of the above
Explanation:
Commands that comes under TCL are COMMIT, ROLLBACK & SAVEPOINT.
Discuss this Question
12. What is TRUE about SAVEPOINT?
- Following the completion of a transaction, it must be executed to save all the operations performed in the transaction.
- A transaction can be rolled back to its last saved state.
- A specific part of a transaction can be given a name
- None of the above
Answer: C) A specific part of a transaction can be given a name
Explanation:
In the case of the SAVEPOINT command, a specific part of a transaction can be given a name.
Discuss this Question
13. Following the completion of a transaction, it must be executed to save all the operations performed in the transaction. Here we are talking about which command?
- REVOKE
- COMMIT
- ROLLBACK
- SAVE
Answer: B) COMMIT
Explanation:
Following the completion of a transaction, the COMMIT command must be executed to save all the operations performed in the transaction.
Discuss this Question
14. Difference between GRAND & REVOKE command is/are?
- The GRANT command can be used to grant a user access to databases and tables whereas The REVOKE command can be used to revoke all access privileges already assigned to the user.
- The REVOKE command can be used to grant a user access to databases and tables whereas The GRANT command can be used to revoke all access privileges already assigned to the user.
- A transaction can be rolled back to its last saved state.
- None of the above
Answer: A) The GRANT command can be used to grant a user access to databases and tables whereas The REVOKE command can be used to revoke all access privileges already assigned to the user
Explanation:
The GRANT command can be used to grant a user access to databases and tables whereas The REVOKE command can be used to revoke all access privileges already assigned to the user.
Discuss this Question
15. Which of the following statement(s) is/are TRUE about DCL?
- The DCL commands in SQL allow us to control which users have access to the data stored in SQL tables.
- There will be certain privileges that each user has; consequently, the data can be accessed by them.
- The DCL commands in SQL allow us to grant privileges to a user on the SQL database and its table(s), or revoke privileges that have already been granted.
- All of the above
Answer: D) All of the above
Explanation:
About DCL Commands –
- The DCL commands in SQL allow us to control which users have access to the data stored in SQL tables.
- There will be certain privileges that each user has; consequently, the data can be accessed by them.
- The DCL commands in SQL allow us to grant privileges to a user on the SQL database and its table(s), or revoke privileges that have already been granted.
Discuss this Question
16. The table records can be retrieved using which command?
- RETRIEVE
- SELECT
- CREATE
- ALTER
Answer: B) SELECT
Explanation:
The table records can be retrieved using the SELECT command.
Discuss this Question
17. Which command will remove the records from the table, but not affect the structure of the table?
- REMOVE
- DELETE
- DROP
- TRUNCATE
Answer: B) DELETE
Explanation:
The TRUNCATE command will remove the records from the table, but not affect the structure of the table.
Discuss this Question
18. The records and structure of a table may be removed or deleted from the database using which command?
- REMOVE
- DELETE
- DROP
- TRUNCATE
Answer: C) DROP
Explanation:
The records and structure of a table may be removed or deleted from the database using the DROP command.
Discuss this Question
19. Select the correct statement.
- DDL consist of 4 commands
- DCL consist of 2 commands
- TCL consist of 5 commands
- DML consist of 3 commands
Answer: B) DCL consist of 2 commands
Explanation:
- DDL consist of 5 commands, i.e., CREATE, ALTER, DROP, TRUNCATE & RENAME.
- DML consist of 4 commands, i.e., SELECT, INSERT, UPDATE & DELETE.
- DCL consist of 2 commands, i.e., GRANT & REVOKE.
- TCL consist of 3 commands, i.e., COMMIT, ROLLBACK & SAVEPOINT.
Discuss this Question
20. Which of the following is TRUE about TCL?
- Transactions can be saved to the database and rolled back with the help of TCL commands in SQL.
- There will be certain privileges that each user has; consequently, the data can be accessed by them using TCL.
- Our data is stored in a table that is described by the schema, thus TCL commands deal with the schema.
- SQL TCL commands can be used to perform any kind of retrieval or manipulation of the data present in SQL tables.
Answer: A) Transactions can be saved to the database and rolled back with the help of TCL commands in SQL
Explanation:
Transactions can be saved to the database and rolled back with the help of TCL commands in SQL.
Discuss this Question