Intermediate SQL
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 databases 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.
Selecting Data
-- Add your own queries here
SELECT *
FROM cinema.reviews
LIMIT 5Explore Datasets
Use the descriptions, films, people, reviews, and roles tables to explore the data and practice your skills!
- Which titles in the
reviewstable have an IMDB score higher than 8.5? - Select all titles from Germany released after 2010 from the
filmstable. - Calculate a count of all movies by country using the
filmstable.
COUNT ()
SELECT COUNT(film_id) AS count_film_id
FROM cinema.reviews;COUNT(field_name) returns the number of records containing a value in a field. In this example, that field is film_id.
COUNT(*) te dice cuántos registros hay en una tabla. Sin embargo, si desea contar la cantidad de valores que no faltan en un campo en particular, puede llamar a COUNT() solo en ese campo.
-- Count the number of records in the people table
SELECT COUNT (*) AS count_records
FROM cinema.people-- Count the number of birthdates in the people table
SELECT COUNT (birthdate) AS count_birthdate
FROM cinema.people;-- Count the records for languages and countries represented in the films table
SELECT COUNT (language) AS count_languages,
COUNT (country) AS count_countries
FROM cinema.filmsSELECT DISTINCT