DELETE StudentWHERE stu_id < 10;/*person_id is a primary key */
Discuss in Forum
DELETE EmployeeWHERE Emp_id=101;/*person_id is a primary key */
The ‘TRUNCATE’ keyword in MySQL is used to delete all the rows from the table and also free the space containing the table. Its syntax is: TRUNCATE TABLE my_table. This deletes all rows from my_table.
When it comes to single table ‘UPDATE’ and ‘DELETE’ operations, the qualification of a column name with the table name is not necessary. So the table name qualifier can be omitted.
DELETE FROM Student WHERE Student_id= 0050;
The ‘DELETE’ operation is being performed in the statement. The table names are ‘x’ and ‘y’. The column name is ‘col’. The rows from left join of x and y get deleted according to the condition given.