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 –

  1. DDL
  2. DML
  3. DCL
  4. 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 –

  1. Data Describe Language
  2. Definition Data Language
  3. Data Definition Language
  4. 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 –

  1. CREATE
  2. DROP
  3. TRUNCATE
  4. 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 –

  1. Data Multiplication Language
  2. Data Manipulation Language
  3. Data Modify Language
  4. 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?

  1. Our data is stored in a table that is described by the schema, thus DDL commands deal with the schema.
  2. With the DDL commands, any structural changes can be made to the table, including creation, deletion, and alteration.
  3. Both A. and B.
  4. None of the above

Answer: C) Both A. and B.

Explanation:

In the case of DDL commands:

  1. Our data is stored in a table that is described by the schema, thus DDL commands deal with the schema.
  2. 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 –

  1. ROLLBACK
  2. GRANT
  3. UPDATE
  4. 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.

  1. With the DDL commands, any structural changes can be made to the table, including creation, deletion, and alteration.
  2. With the DML commands, any structural changes can be made to the table, including creation, deletion, and alteration.
  3. With the DCL commands, any structural changes can be made to the table, including creation, deletion, and alteration.
  4. 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 -

  1. Data Control Language
  2. Data Commit Language
  3. Data Common Language
  4. 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 -

  1. GRANT
  2. REVOKE
  3. Both A. and B.
  4. 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 -

  1. Transaction Common Language
  2. Transaction Commit Language
  3. Transaction Concatenate Language
  4. 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 -

  1. COMMIT
  2. ROLLBACK
  3. SAVEPOINT
  4. 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?

  1. Following the completion of a transaction, it must be executed to save all the operations performed in the transaction.
  2. A transaction can be rolled back to its last saved state.
  3. A specific part of a transaction can be given a name
  4. 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?

  1. REVOKE
  2. COMMIT
  3. ROLLBACK
  4. 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?

  1. 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.
  2. 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.
  3. A transaction can be rolled back to its last saved state.
  4. 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?

  1. The DCL commands in SQL allow us to control which users have access to the data stored in SQL tables.
  2. There will be certain privileges that each user has; consequently, the data can be accessed by them.
  3. 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.
  4. All of the above

Answer: D) All of the above

Explanation:

About DCL Commands –

  1. The DCL commands in SQL allow us to control which users have access to the data stored in SQL tables.
  2. There will be certain privileges that each user has; consequently, the data can be accessed by them.
  3. 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?

  1. RETRIEVE
  2. SELECT
  3. CREATE
  4. 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?

  1. REMOVE
  2. DELETE
  3. DROP
  4. 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?

  1. REMOVE
  2. DELETE
  3. DROP
  4. 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.

  1. DDL consist of 4 commands
  2. DCL consist of 2 commands
  3. TCL consist of 5 commands
  4. DML consist of 3 commands

Answer: B) DCL consist of 2 commands

Explanation:

  1. DDL consist of 5 commands, i.e., CREATE, ALTER, DROP, TRUNCATE & RENAME.
  2. DML consist of 4 commands, i.e., SELECT, INSERT, UPDATE & DELETE.
  3. DCL consist of 2 commands, i.e., GRANT & REVOKE.
  4. TCL consist of 3 commands, i.e., COMMIT, ROLLBACK & SAVEPOINT.

Discuss this Question


20. Which of the following is TRUE about TCL?

  1. Transactions can be saved to the database and rolled back with the help of TCL commands in SQL.
  2. There will be certain privileges that each user has; consequently, the data can be accessed by them using TCL.
  3. Our data is stored in a table that is described by the schema, thus TCL commands deal with the schema.
  4. 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





Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.