To delete only the record of the existing created table with a special condition. Then we can use a ' DELETE TABLE ' statement.
The basic syntax of the DELETE TABLE statement is given below –
DELETE FROM table_name where [CONDITION];
DELETE FROM regions WHERE region_id = 1;
Here regions is a table name and region_id is column_name.
In this statement, we have given a condition region_id = 1. Hence it will delete only records whose region_id=1 from the regions table.
But if we do not include the where condition in the statement.
Then it will delete all the records of the regions table.
DELETE FROM table_name;
DELETE FROM regions;
This statement will work similarly to a truncate statement. The only difference is that the delete statement will not free up space while the truncate will free up space.
Best learning portal that provides you great learning experience of various technologies with modern compilation tools and technique
Don't hesitate to give us a call or send us a contact form message