From the course: Complete Guide to SQL for Data Engineering: from Beginner to Advanced

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Combining conditions with AND and OR

Combining conditions with AND and OR

- [Instructor] Assume that you want to study, but whenever you want to study, you want to have the free time and a course available. If both of these things are available to you, a free time and course, then only you will study. Now this is nothing but a situation of a logical conditioning. Exactly, many times in your business you get into those conditioning and at that time, SQL can help you to retrieve the data based on those conditions. And it can be done using logical operators. The two most common logical operators in SQL is AND and OR. As the name suggests, AND operator, it's something which try to pull the values or become true when the left hand side condition and the right hand side condition, both condition are true. For example, you say you study when course is available and when free time is also available. Now imagine that in this situation, if you have a free time but course is not available or you have…

Contents