DEV Community

Luckshvadhan B
Luckshvadhan B

Posted on

Filter Assignments

Get movies with rental rate greater than 3
Filter films where rental_rate is greater than 3

Get movies with rental rate greater than 3 and replacement cost less than 20
Apply two conditions using AND on rental_rate and replacement_cost

Get movies rated PG or rental rate 0.99
Use OR condition between rating and rental_rate

Get first 10 movies sorted by rental rate descending
Order by rental_rate in descending order and limit to 10

Skip first 5 and get next 3 movies by rental rate ascending
Use offset 5 and limit 3 after sorting by rental_rate ascending

Skip first 5 and get next 3 movies by rental rate ascending
Same as above using offset and limit with ascending order

Get movies with rental duration between 3 and 7
Use between condition on rental_duration

Get movies where title starts with A and ends with e
Use pattern matching with LIKE for starting A and ending e

Find customers without email
Filter where email is NULL

Get movies from 2006 with rate 2.99 or 3.99 and title starts with S limit 5
Apply multiple conditions with AND and OR and limit results to 5

Get 10 customers after skipping 20 sorted by last name
Sort by last_name and use offset 20 and limit 10

Get top 5 movies by replacement cost skipping highest
Order by replacement_cost descending skip first then limit 5

Find rentals between two dates
Use between on rental_date from given start to end date

Get actors whose last name contains man
Use LIKE with pattern containing man

Find movies where special features is NULL
Filter rows where special_features is NULL

Find movies with rental duration more than 7
Use greater than condition on rental_duration

Get first 10 movies with rate 2.99 or 4.99 rating R and title contains L
Combine multiple conditions and limit to 10

Find movies starting with A or B and ending with s
Use LIKE with OR for starting letters and ending pattern

Find movies containing Man Men or Woman
Use multiple LIKE conditions combined with OR

Top comments (0)