Workspace
Scott Inglis/

Intermediate SQL

0
Beta
Spinner

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).

Unknown integration
DataFrameavailable as
books
variable
-- Select all entries from the reviews table
SELECT * 
FROM cinema.films
LIMIT 100
This query is taking long to finish...Consider adding a LIMIT clause or switching to Query mode to preview the result.

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.

Unknown integration
DataFrameavailable as
df
variable
SELECT *
FROM cinema.reviews
WHERE imdb_score > 8.5
This query is taking long to finish...Consider adding a LIMIT clause or switching to Query mode to preview the result.

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

Unknown integration
DataFrameavailable as
df
variable
SELECT *
FROM cinema.films
WHERE country = 'Germany'
	AND release_year > 2010
This query is taking long to finish...Consider adding a LIMIT clause or switching to Query mode to preview the result.

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

Unknown integration
DataFrameavailable as
df
variable
SELECT *
FROM cinema.films
WHERE budget BETWEEN 1000000 AND 5000000
This query is taking long to finish...Consider adding a LIMIT clause or switching to Query mode to preview the result.

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.

Unknown integration
DataFrameavailable as
df
variable
SELECT *
FROM cinema.films
WHERE title LIKE '%Alien%'
This query is taking long to finish...Consider adding a LIMIT clause or switching to Query mode to preview the result.

Use WHERE IN to filter for multiple conditions.

Unknown integration
DataFrameavailable as
df
variable
SELECT *
FROM cinema.films
WHERE release_year IN (1990, 2000)
This query is taking long to finish...Consider adding a LIMIT clause or switching to Query mode to preview the result.

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

Unknown integration
DataFrameavailable as
df
variable
SELECT *
FROM cinema.films
WHERE budget IS NULL
This query is taking long to finish...Consider adding a LIMIT clause or switching to Query mode to preview the result.
‌
‌
‌
  • AI Chat
  • Code