SQL Commands Quiz

Last Updated :
Discuss
Comments

Question 1

Which SQL command category would you use to implement role-based access control in a database?

  • DDL

  • DML

  • DCL

  • TCL

Question 2

What is the primary purpose of the SAVEPOINT command in TCL?

  • To permanently save transaction changes

  • To create a rollback point within a transaction

  • To terminate a transaction immediately

  • To grant temporary permissions

Question 3

Which DDL command would permanently remove both table structure and data?

  • TRUNCATE

  • DELETE

  • DROP

  • ALTER

Question 4

What distinguishes the LOCK command from data manipulation operations?

  • It controls concurrent access to database objects

  • It creates duplicate copies of database records

  • It modifies existing values in database tables

  • It validates data against integrity rules

Question 5

Which SQL command would you use to retrieve only unique values from a query result?

  • GROUP BY

  • HAVING

  • DISTINCT

  • WHERE

Question 6

What happens when a ROLLBACK command is executed without a SAVEPOINT?

  • Only the last operation is undone

  • All changes in the current transaction are undone

  • The database reverts to its last backup

  • Nothing happens

Question 7

Which DQL feature allows filtering of grouped data after aggregation?

  • WHERE

  • ORDER BY

  • HAVING

  • JOIN

Question 8

What is the critical difference between CHAR and VARCHAR in DDL?

  • CHAR supports Unicode, VARCHAR doesn't

  • VARCHAR has larger maximum storage

  • CHAR is fixed-length, VARCHAR is variable-length

  • CHAR allows binary data

Question 9

Which command combination would you use to modify a table column's data type?

  • UPDATE + SET

  • ALTER + DROP

  • CHANGE + COLUMN

  • ALTER + MODIFY

Question 10

In transaction management, what does the COMMIT command guarantee?

  • Data is backed up

  • All queries are optimized

  • Locks are released immediately

  • Changes become permanent

There are 10 questions to complete.

Take a part in the ongoing discussion