Practice Logical Operators with Sakila
Practice Logical Operators with Sakila Data Science Project
Advanced SQL

Practice Logical Operators with Sakila

In this project, we will delve into the core principles of SQL queries, focusing on logical operators and their applications in data filtering. Your objective will be to understand how to craft effective queries that evaluate conditions. Through practical exercises, you’ll enhance your skills in selecting data based on specific criteria, ultimately empowering you to perform insightful analyses and uncover meaningful patterns in the dataset.
Start this project
Practice Logical Operators with SakilaPractice Logical Operators with Sakila
Project Created by

Vidhi Shah

Project Activities

All our Data Science projects include bite-sized activities to test your knowledge and practice in an environment with constant feedback.

All our activities include solutions with explanations on how they work and why we chose them.

codevalidated

Select All Active Customers

Retrieve all active customers from the customer table.

Your result should match the following :

codevalidated

Find Customers with Long Names

Fetch customers whose first name is longer than 10 characters from the customer table.

Your result should match the following :

codevalidated

Identify Films with Specific Ratings

Fetch all the films with a rating of PG or G from the film table.

Your result should match the following :

codevalidated

List High Rental Rate Films

Show the titles of films with a rental rate greater than or equal to 4.99 from the film table.

Your result should match the following :

codevalidated

Find Active Customers with Specific IDs

Fetch all active customers with customer IDs 5, 10, or 15 from the customer table.

Your result should match the following :

codevalidated

Identify Films with Particular Characteristics

List all films that are either rated G with a length over 120 minutes, or rated PG with a rental duration of 5 days.

Your result should match the following :

codevalidated

Identify Specific Payment Records

Find all payments that are either less than \$2 or greater than \$10, but not exactly \$7.99 from the payment table.

Your result should match the following :

codevalidated

Find recent high-cost payments

Fetch the customer_id and amount for all payments made after 1st January 2005 with an amount greater than 7.00, excluding those paid by staff with a staff_id equal to 1.

Your result should match the following :

multiplechoice

Which of the following SQL conditions will return true for values that are either strictly less than 0, strictly greater than 100, or exactly 50?

codevalidated

Films with Extreme Rental Rates

Show films with a rental rate less than \$1 or greater than \$5, and a replacement cost not equal to \$19.99.

Your result should match the following :

codevalidated

Actors with Specific Film Appearances

Retrieve the actor_id and film_id from the film_actor table where the actor_id is either greater than 50 and an odd number, or the film_id is between 100 and 150 but not divisible by 5.

Your result should match the following :

codevalidated

Inventory with Even IDs and Odd Film IDs

Retrieve inventory_id, film_id, and store_id from the inventory table where both inventory_id and film_id are either even or odd numbers, but exclude any records where store_id is greater than 2.

Your result should match the following :

codevalidated

Actors with Multiple Length Conditions

Retrieve the actor_id, first_name, and last_name for actors whose first_name has exactly 5 characters and last_name has more than 6 characters. The actor_id must also be greater than 30 but should not be divisible by 4.

Your result should match the following :

codevalidated

Films with Specific Rental Rates and IDs

Retrieve the film_id and title of films where the rental_rate is less than \$2 or greater than \$6, and the replacement_cost is greater than \$10 but not equal to \$19.99. Exclude films where the film_id is divisible by 11.

Your result should match the following :

Practice Logical Operators with SakilaPractice Logical Operators with Sakila
Project Created by

Vidhi Shah

As a Project Author at DataWars, I dive into the world of data science and AI/ML with a millennial flair, constantly intrigued by the inner workings of technology. While I'm not crunching numbers, you'll find me cheering for my favorite cricket team.

As a Project Author at DataWars, I dive into the world of data science and AI/ML with a millennial flair, constantly intrigued by the inner workings of technology. While I'm not crunching numbers, you'll find me cheering for my favorite cricket team.

This project is part of

Advanced SQL

Explore other projects