Skip to content
SQL CODES
Intermediate SQL Queries
Here you can access every table used in the course. To access each table, you will need to specify the cinema schema in your queries (e.g., cinema.reviews for the reviews table.
Note: When using sample integrations such as those that contain course data, you have read-only access. You can run queries, but cannot make any changes such as adding, deleting, or modifying the data (e.g., creating tables, views, etc.).
Take Notes
Add notes about the concepts you've learned and SQL cells with queries you want to keep.
SELECT COUNT(*) AS row_count FROM people;
DataFrameas
movie_info
variable
-- Add your own queries here
SELECT *
FROM cinema.reviews
LIMIT 5Explore Datasets
Use the tables to explore the data and practice your skills!
- Select the
film_id,imdb_score, andnum_votesin thereviewstable.- Filter your results for records where:
- The
imdb_scoreis greater than 8. - The number of votes (
num_votes) is more than 1 million (1000000).
- The
- Filter your results for records where:
- Return the average cost to make a movie (
budget) by thecountryof origin in thefilmstable.- Exclude
NULLvalues in thebudgetcolumn. - Order your results by the average budget in descending order.
- Exclude
- Return the
language, totalbudget(aliased astotal_budget), and totalgross(aliased astotal_gross) from thefilmstable.- Filter the records for films with a duration greater than 90.
- Only include languages where the total gross is over 1 million (1000000).
- Order your results by the total gross in descending order.
DataFrameas
df
variable
-- Simple filtering of numeric values
-- As you learned in the previous exercise, the WHERE clause can also be used to filter numeric records, such as years or ages.
-- For example, the following query selects all details for films with a budget over ten thousand dollars:
SELECT *
FROM cinema.films
WHERE budget > 10000;DataFrameas
df1
variable