Last answered:

03 Apr 2023

Posted on:

05 Dec 2021

0

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.

2 answers ( 0 marked as helpful)
Posted on:

08 Jan 2023

1

i don't think you should use OR in this situation but rather use the AND operator

Posted on:

03 Apr 2023

1

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.

Submit an answer