SQL Oracle Java JSP JDBC PHP MORE

Oracle query for delete record from table

To delete records in a table from database DELETE statement is used.

Oracle DELETE Syntax

DELETE FROM table_name WHERE some_column=some_value;

Here WHERE clause specifies which record is to be deleted. If you not used the WHERE clause, all records will be deleted.

How to Delete All Data from a table

To delete all the data from a table the query is

DELETE FROM table_name;

or

DELETE * FROM table_name;

Oracle Delete Example: On one condition

DELETE FROM students
WHERE name = 'mitra';

Oracle Delete Example: On multiple conditions

DELETE FROM students
WHERE last_name = 'Mitra'
AND student_id > 3;

Oracle Delete Example: On one condition

DELETE FROM students WHERE name = 'mitra';

Example

DELETE * FROM Student;