Welcome to the Treehouse Community
Looking to learn something new?
Database: how to remove more than one actors?
In the exercise for removing data in - Remove actors with the first name "Yuri", "Walter" and "Victor".
My input is:
DELETE FROM actors WHERE name LIKE ("Yuri%" AND "Walter%" AND "Victor%);
Is the the correct format?
Steven Parker215,954 Points
You can't combine just terms with
AND is for requiring all conditions at once,
OR is for any one of the conditions.
But you can combine complete expressions:
... name LIKE "Yuri%" OR name LIKE "Walter%" OR name LIKE "Victor%";
Matthew Wilkes4,810 Points
I used the below and this seemed to work for me:
DELETE FROM actors WHERE name IN ("Yuri", "Walter", "Victor")
Kate McPherson2,149 Points
In case anyone is looking for the same answer that I have been looking for regarding how to leave out the entries like "Yuriko" - you need to leave a space between the text and the % wildcard.
Instead of "Yuri%" it needs to be "Yuri %". You can do the same with Victor to leave out any Victorias.