From the course: Quick Start Guide to SQL

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Logical conditions

Logical conditions

- [Instructor] Now let's learn about the logical conditions that can be applied in WHERE. There are three logical conditions: AND, OR, NOT. There are used when we give multiple conditions in WHERE. If we are taking two or more conditions and they are separated by AND, it returns true only if both conditions are true or otherwise it returns a false. This is the table for AND. As we see, true and true returns a true. If one or more conditions are false, then it returns a false, like in this example, it's a false and the other one is a true. Then it returns false. Or if both of them are false, then the output would be a false and it does return any row. Now if it's a true and the other one is a null, then it returns null. But if it's a false, and a null, then it returns a false. Now, let's take an example to understand this better. Let's head to Live SQL. Here let's take a look at a table. SELECT * FROM…

Contents