- Delete command is used to delete records from the database table.
- We must have to use WHERE clause with the DELETE command.
- If DELETE command is given without WHERE clause, it will delete all the records from the table.
- By using WHERE clause we can delete any specific record.
Syntax:
-
DELETE FROM <table name> [ WHERE <condition> ];
Example:
-
DELETE FROM student;
-
DELETE FROM student WHERE std_rno=10;
- The first command will delete all the records from the student table.
- Second command will delete record of student having roll number 10