CARVIEW |
SQL Commands Quiz
Quiz on SQL Commands
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
In DML, what distinguishes the LOCK command from other DML operations?
It modifies data values
It controls concurrent access to tables
It creates backup copies
It enforces data integrity constraints
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
CHAR is fixed-length, VARCHAR is variable-length
VARCHAR has larger maximum storage
CHAR allows binary data
Question 9
Which command combination would you use to modify a table column's data type?
UPDATE + SET
ALTER + MODIFY
CHANGE + COLUMN
ALTER + DROP
Question 10
In transaction management, what does the COMMIT command guarantee?
Data is backed up
Changes become permanent
Locks are released immediately
All queries are optimized
There are 10 questions to complete.