From the course: Data Analysis: Investigate with SQL
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Fifth query breakdown: Using the IN and AND operators - SQL Tutorial
From the course: Data Analysis: Investigate with SQL
Fifth query breakdown: Using the IN and AND operators
- Let's take a closer look at query number five, which we composed in the last video, and focus on the where clause. If you recall, this query gave us only the messages that were sent by the people we identified on our short list of suspects. We're focused on the where clause because this is where we've made a modification in our criteria. We included the AND operator, and introduced a brand new operator called the IN operator. So, this area I've highlighted is saying, in addition to the messages that we sent between 10-20 and 10-25, I'm only interested in those sent by a specific set of people, the persons of interest we identified earlier. We specified these people using the IN operator, which contains the primary key numbers of each person on our suspect list. The sender ID field corresponds to the people who sent text messages, and by specifying the numbers, 32, 38, 100, 105, and 106, we are limiting our results…
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.