Query in WILDCARD CHARACTERS assignment
///extract another list containing the names of employees that do not contain "Jack".///
I believe for answering this question, both first_name & last_name shoud be taken into query as there is no specification given in the question.
- query should read as below:
SELECT * FROM employees
WHERE first_name NOT LIKE ('%Jack%') OR last_name NOT LIKE ('%JACK%');
- please confirm.
you have taken only first_name in
your workings.
SELECT * FROM employees
WHERE first_name NOT LIKE ('%Jack%');
Thanks in Advance.
i don't think you should use OR in this situation but rather use the AND operator
I am agree with the @Hisham that you should use AND in this situation because
OR condition gives records of all the employees whose last_name does not contain JACK including with the employees whose first_name is JACK.
But AND condition gives records of employees whose complete name doesn't contain JACK.