Notice the WHERE clause in the DELETE statement. The WHERE clause specifies which record (s) should be deleted. If you omit the WHERE clause, all records in the table will be deleted! It is possible to delete all rows in a table without deleting the table. This means that the table structure, attributes, and indexes will be intact:. Second, use the if exists option if you want PostgreSQL to issue .... MySQL ON DELETE CASCADE Example. Let us understand how we can use the ON DELETE CASCADE clause in the MySQL table. First, we are going to create two tables named Employee and Payment. Both tables are related through a foreign key with on delete cascade operation.. FOREIGN KEY ON DELETE CASCADE ON UPDATE CASCADE : Foreign Keys « Table « MySQL Tutorial. MySQL Tutorial. Table. Foreign Keys. mysql> mysql> CREATE TABLE Models -> ( -> ModelID SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT, -> Name VARCHAR (40) NOT NULL, -> PRIMARY KEY (ModelID) -> ); Query OK, 0 rows affected (0.02 sec) mysql> mysql>.