RSS Feed

Multiple Choice Questions - SQL Truncate

Multiple Choice Questions - SQL Truncate

1. Truncate removes all the rows from a table and does not log the individual row deletions.

A) True
B) False

2. TRUNCATE TABLE removes all the rows from a table, but ……… remain.

A) table columns
B) constraints
C) table structure
D) indexes
E) all of above

3. If the table contains an identity column, the counter for that column is reset to the seed value defined for the column. If no seed was defined, the default value ….. is used.

A) 0
B) 1
D) None of above

4. Truncate can be used on a table that is referenced by a FOREIGN KEY constraint.

A) True
B) False

5. You can truncate a table that has a foreign key that references itself.

A) True
B) False

6. If you use …….. in your code, TRUNCATE can be rolled back.

A) Triggers
B) Views
C) Transactions
D) Functions

7. Truncate table statement locks .......

A) each data page
B) the table
C) each individual row it is deleting
D) all of above

8. The Truncate statement will leave empty data pages for the table and its indexes but Delete on the other hand is guaranteed to leave zero data pages behind.

A) True
B) False

9. Truncate table can be used on a table with indexed view.

A) True
B) False

10. Which of the below syntax of Truncate is correct:

    [ { database_name .[ schema_name ] . | schema_name . } ]
[ ; ]
B) TRUNCATE TABLE table_name;
C) TRUNCATE table_name;
D) All of above