Last answered:

07 Dec 2021

Posted on:

09 Nov 2021

0

Resolved: Difference between IN and OR operators

Can you please explain the difference between in and or operator like why to use in operator when we are having or is it only because of the fast execution(speed) or any other reasons too?

2 answers ( 1 marked as helpful)
Posted on:

16 Nov 2021

1

clean code :code that is focused and understandable, which means it must be
readable, logical, and changeable
good code is not the one computers understand; it is the one
humans can understand
bref / Dont write spaghetti code ,
thanks....

Instructor
Posted on:

07 Dec 2021

2

Hi Sreya and Mahmoud!

Thanks for reaching out!

@ Mahmoud: Thank you for contributing to this thread with your explanation.

@ Sreya: Also, in SQL, the AND & OR operators are used for filtering the data and getting precise results based on conditions. The SQL AND & OR operators are also used to combine multiple conditions. These
two operators can be combined to test for multiple conditions in a SELECT, INSERT, UPDATE, or DELETE statement. The IN operator allows you to specify multiple values in a WHERE clause.
The IN operator is a shorthand for multiple OR conditions.

Hope this helps.
Best,
Martin

Submit an answer