Consider a table Employees with 1000 rows. What will be the number of rows after running the following SQL commands separately?
1. DELETE FROM Employees;
2. TRUNCATE TABLE Employees;
Choose the correct pair of row counts after each command.
Both DELETE and TRUNCATE remove all rows, but their behavior differs in other ways.
Both DELETE and TRUNCATE remove all rows from the table, so the row count becomes zero after either command.
Which statement correctly describes the transaction behavior of DELETE and TRUNCATE commands?
Think about whether these commands are logged in transactions.
Both DELETE and TRUNCATE are transactional in most modern databases and can be rolled back if used inside a transaction.
Which of the following DROP commands will cause a syntax error?
Check the correct syntax for dropping tables.
The DROP command requires specifying the object type like TABLE or DATABASE. 'DROP Employees;' is missing the object type and causes a syntax error.
Which statement best explains why TRUNCATE is usually faster than DELETE when removing all rows from a large table?
Think about how logging affects performance.
TRUNCATE is faster because it deallocates entire data pages and logs minimal information, while DELETE logs each row deletion, making it slower.
After running DROP TABLE Employees;, what will happen if you try to query SELECT * FROM Employees;?
Think about what DROP does to a table.
DROP removes the table and its data completely. Querying it afterward causes an error because the table does not exist.