Skip to content
New Workbook
Sign up
Intermediate SQL

Intermediate SQL Sandbox

👋 Welcome to your new workspace! You can use this interactive notebook to take notes, explore the course data, and practice your SQL skills!

The films, people, reviews, and roles tables from Intermediate SQL are available for you to query in the SQL cell below! Click inside the cell and press "Run" to execute the pre-written query or write your own query!

Note that the tables are stored in a schema named cinema. To access each table, you must add "cinema." before the table name (e.g., cinema.reviews).

Spinner
DataFrameavailable as
books
variable
-- Select all entries from the reviews table
SELECT * 
FROM cinema.films
LIMIT 100

Click "Add markdown" to add and edit text cells for notes, and "Add SQL" to continue practicing your queries!

Intermediate SQL Interactive Cheat Sheet

Below are some interactive examples of things you learned from the course. Bookmark this page as a reference and a place to experiment with queries!

Filtering

Use WHERE to filter records in a table.

Spinner
DataFrameavailable as
df
variable
SELECT *
FROM cinema.reviews
WHERE imdb_score > 8.5

Use AND and OR in combination with WHERE for more specific filtering.

Spinner
DataFrameavailable as
df
variable
SELECT *
FROM cinema.films
WHERE country = 'Germany'
	AND release_year > 2010

Use BETWEEN to filter for records within a specified range (inclusive).

Spinner
DataFrameavailable as
df
variable
SELECT *
FROM cinema.films
WHERE budget BETWEEN 1000000 AND 5000000

Use LIKE and NOT LIKE to filter records for (or without) a pattern. The % wildcard matches one, zero, or many characters. The _ wildcard matches a single character.

Spinner
DataFrameavailable as
df
variable
SELECT *
FROM cinema.films
WHERE title LIKE '%Alien%'

Use WHERE IN to filter for multiple conditions.

Spinner
DataFrameavailable as
df
variable
SELECT *
FROM cinema.films
WHERE release_year IN (1990, 2000)

Use NULL in your queries to find or filter out records with missing values.

Spinner
DataFrameavailable as
df
variable
SELECT *
FROM cinema.films
WHERE budget IS NULL