There are two methods to delete all the records from the table
1. TRUNCATE: TRUNCATE is faster than DELETE. If there is no foreign key in the table and used to delete quickly then use TRUNCATE. Structure of TRUNCATE is given below.
TRUNCATE TABLE table_name;
for above statement query will be:
TRUNCATE TABLE users;
2. DELETE: DELETE is slower than TRUNCATE and used to delete all the rows or one by one row from the given table.
Structure of DELETE is given below.
DELETE FROM table_name WHERE [condition];
for delete all the rows use above query without WHERE clause.
FOR above statement query will be
DELETE FROM users;
Omitting WHERE USE the bank database and complete the following tasks using the [ mysql prompt: 1. Delete all the recor...