Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Inserting and updating NULLs
Conditions in UPDATE and DELETE
10. DELETE with conditions: AND, OR
Updating the list of columns in one query
Using values from another column
Return rows in INSERT, UPDATE, DELETE
Summary

Instruction

Great! You can also use more than one condition in DELETE statements.

The statement below removes all the English exam data for students with no date for an oral or written English exam:

DELETE FROM exam
WHERE subject = 'English' 
  AND (written_exam_date IS NULL 
    OR oral_exam_date IS NULL);

Notice that we used both the AND and OR operators in the WHERE clause.

Exercise

Our university is not accredited to conduct exams in Spanish and Mathematics. Delete all records for these exams.