SQL DELETE StatementThe SQL DELETE statement is used to delete rows from a table. Generally, DELETE statement removes one or more records form a table. Syntax Sample TableEMPLOYEE
Deleting Single RecordDelete the row from the table EMPLOYEE where EMP_NAME = 'Kristen'. This will delete only the fourth row. Query Output: After executing this query, the EMPLOYEE table will look like:
Deleting Multiple RecordDelete the row from the EMPLOYEE table where AGE is 30. This will delete two rows(first and third row). Query Output: After executing this query, the EMPLOYEE table will look like:
Delete all of the recordsDelete all the row from the EMPLOYEE table. After this, no records left to display. The EMPLOYEE table will become empty. Syntax Query Output: After executing this query, the EMPLOYEE table will look like:
Note: Using the condition in the WHERE clause, we can delete single as well as multiple records. If you want to delete all the records from the table, then you don't need to use the WHERE clause. Next TopicDBMS SQL View
|