From the course: MySQL Data Analysis

Unlock this course with a free trial

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

Common CASE operators

Common CASE operators - MySQL Tutorial

From the course: MySQL Data Analysis

Common CASE operators

- [Instructor] Now we're going to talk about which logical operators you can use inside a case statement and then we'll do a demo using a bunch of those operators together. The key thing to note here is all of the logical operators that you're familiar with in a where condition, you can also use inside your case statement. We've got equals, does not equal, greater than, less than, greater than equal to, less than equal to, between, like and in. Here's a query that uses a number of these operators. I'm going to jump into Workbench and walk you through it. Alright, so in this case example, I'm trying to figure out a good film to recommend to my niece. We walk through a few different cases here and first we say when rental duration is less than or equal to four days, then the rental is too short. I want her to have a little more time with the rental. When rental rate is greater than or equal to 3.99, then it's too expensive. We don't want her paying too much. When rating in NC17 or R…

Contents