From the course: SQL for Non-Programmers
Unlock the full course today
Join today to access over 23,100 courses taught by industry experts.
Filtering your data with multiple conditions - SQL Tutorial
From the course: SQL for Non-Programmers
Filtering your data with multiple conditions
We have learned to filter our data with a single condition. But oftentimes, we will want to include more than one condition. Expanding from a single condition to multiple conditions in your WHERE clause is easy. Within the same WHERE clause, which is always placed after the FROM clause, we can include as many filter conditions as we need. After your first filter condition, you can add the word AND plus the additional filter condition. You can repeat this process as many times as needed depending on the filters you need to apply. Let's see what this looks like in SLS. Expanding on our previous query, we can include multiple conditions in our WHERE clause. Let's say that in addition to understanding top orders in the bath products category, management asks us to provide bath product sales reports for a few employees in particular, starting with Clement Carry. We can add an additional filter using an AND operator. So right after the FROM clause we will add WHERE product category equals…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Getting started with SQL5m 33s
-
(Locked)
Retrieving data with SELECT7m 19s
-
(Locked)
Formatting your query5m 40s
-
(Locked)
Putting order to your data with ORDER BY6m 52s
-
(Locked)
Filtering your data with WHERE5m 9s
-
(Locked)
Filtering your data with multiple conditions8m 5s
-
(Locked)
Challenge: Practice with basic commands1m 40s
-
(Locked)
Solution: Basic commands solved4m 9s
-
-
-
-
-