SQL sublanguage: DDL (Data Definition Language)
The TRUNCATE
keyword allows us to remove all records from a table but doesn't delete the table itself.
The syntax for truncating a table:
TRUNCATE TABLE table_name;
Additional reference material if needed: https://www.w3schools.com/sql/sql_drop_table.asp
NOTE: The documentation in W3 schools has a TRUNCATE demo under the DROP TABLE demo.
Song Table Diagram:
title | artist |
---|---|
'Let it be' | 'Beatles' |
'Imagine' | 'Beatles' |
'Kashmir' | 'Led Zeppelin' |