ADVERTISEMENT
ADVERTISEMENT

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

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.


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.


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.


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.


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.

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.


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.


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.


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.


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.


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.


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.


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.


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.


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.

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.


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.


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.


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.

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.


ADVERTISEMENT
ADVERTISEMENT


Comments and Discussions!



ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.