RSS Feed

Multiple Choice Questions on SQL Truncate

Multiple Choice Questions on SQL Truncate

1) Which category Delete query exits?

a) DDL
b) DML
c) TCL
d) BPL

2) Can we use Where condition in Truncate?

a) True
b) False

3) What is not true about truncate?

a) Truncate delete the record from the table
b) Truncate fires trigger after deleting the record
c) Truncate is used to delete a record
d) It runs trigger after deletion

4) Does Truncate maintain log?

a) True
b) False

5) Which one is faster to delete a table?

a) Truncate
b) Delete
c) Remove
d) None of the above

6) What are the restrictions while using Truncate?

a) Foreign Key only,
b) No restrictions
c) Foreign key, participation in indexed view
d) None of the above

7) Does truncate retain Identity?

a) Never retains Identity
b) Reset to the seed value
c) No Change on Identity
d) None of the above

8) Truncate statement locks whole Table or a single Row at a time?

a) Both
b) Only Row
c) Table
d) None of the above

9) Can Truncate be used in Views?

a) True
b) False

10) What is true about truncate with Foreign key?

a) It will delete the rows from both the tables (child as well as parent)
b) It will not delete even if CASCADE ON DELETE option is given with parent table
c) It will delete even if CASCADE ON DELETE option is given with parent table
d) All are true

11) TRUNCATE can’t be used if you have Replication/ CDC enabled for the table, is it true?

a) True
b) False

Answers