Apprenticeship Interview Questions

1,214 apprenticeship interview questions shared by candidates

The primary difference between `DELETE` and `TRUNCATE` in SQL lies in their usage and performance. `DELETE` is used to remove specific rows from a table using a condition, supports rollback within a transaction, and logs each deleted row, making it slower for large datasets. It also activates triggers associated with the table. On the other hand, `TRUNCATE` is used to remove all rows from a table, retains the table structure, and operates much faster due to minimal logging. It does not support conditions or activate triggers, making it ideal for quickly clearing entire tables.
avatar

GRADUATE APPRENTICESHIP TRAINEE

Interviewed at Cisco

4.1
Dec 15, 2024

The primary difference between `DELETE` and `TRUNCATE` in SQL lies in their usage and performance. `DELETE` is used to remove specific rows from a table using a condition, supports rollback within a transaction, and logs each deleted row, making it slower for large datasets. It also activates triggers associated with the table. On the other hand, `TRUNCATE` is used to remove all rows from a table, retains the table structure, and operates much faster due to minimal logging. It does not support conditions or activate triggers, making it ideal for quickly clearing entire tables.

Viewing 981 - 990 interview questions

Glassdoor has 1,214 interview questions and reports from Apprenticeship interviews. Prepare for your interview. Get hired. Love your job.