C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
SQL DELETEThe SQL DELETE statement is used to delete rows from a table. Generally DELETE statement removes one or more records from a table. SQL DELETE SyntaxLet's see the Syntax for the SQL DELETE statement: DELETE FROM table_name [WHERE condition]; Here table_name is the table which has to be deleted. The WHERE clause in SQL DELETE statement is optional here. SQL DELETE ExampleLet us take a table, named "EMPLOYEE" table.
Example of delete with WHERE clause is given below: DELETE FROM EMPLOYEE WHERE ID=101; Resulting table after the query:
Another example of delete statement is given below DELETE FROM EMPLOYEE; Resulting table after the query:
It will delete all the records of EMPLOYEE table. It will delete the all the records of EMPLOYEE table where ID is 101. The WHERE clause in the SQL DELETE statement is optional and it identifies the rows in the column that gets deleted. WHERE clause is used to prevent the deletion of all the rows in the table, If you don't use the WHERE clause you might loss all the rows. Invalid DELETE Statement for ORACLE databaseYou cannot use * (asterisk) symbol to delete all the records. DELETE * FROM EMPLOYEE; Topics of SQL DELETE Statement
SQL DELETE TABLE
How to delete the table and what is the difference between DELETE and TRUNCATE statement? SQL DELETE ROWHow to delete a row from the database? SQL DELETE All RowsHow to delete all the rows of a table? SQL DELETE Duplicate RowsHow to use distinct keyword to delete all the duplicate rows from the table? SQL DELETE DATABASEThere is not used DELETE statement to delete the database. But, there is used DROP statement to delete the database. SQL DELETE VIEWHow to delete the view from the database? SQL DELETE JOINHow to use delete statement with INNER JOIN?
Next TopicSQL Delete Table
|