TDM 19000: Week 4 Questions — Summer 2026

Introduction to SQL queries

Dataset

%sql sqlite:////anvil/projects/tdm/data/movies_and_tv/imdb2024/imdb2Aug2026.db

Question 1

  1. How many people from the IMDB database were born in the same year as you?

  2. How many were born in the year that Dr Ward was born (1976)?

  3. Find your favorite actor or actress in the IMDB database. Check their nconst on www.imdb.com (in the URL for their page) and compare it with their entry in the name table. What year were they born?

Question 2

In which years was the tvSeries House of Cards broadcast? Hint: You likely need to limit the results so that the titleType is tvSeries.

Question 3

  1. Consider the tvSeries The West Wing. How many episodes of this tvSeries aired altogether?

  2. Now, consider your favorite tvSeries: how many episodes does your favorite show have?

Question 4

During the years 1980 to 1990, how many people (from the name table) were born in each year?

Question 5

  1. Lookup the nconst for Whoopi Goldberg on IMDB from the URL of her www.imdb.com webpage. Using her nconst, how many entries does she have in the principals table?

  2. She appears altogether with 6 different types of category, namely: actress, archive_footage, director, producer, self, writer. How many times does she appear in each type of these categories?

Question 6

How many titles have Adventure as one of the genres? In which year did the most titles appear, with Adventure as one of the genres?

Question 7

  1. Who was the Director of the movie Say Anything…​? Hint: Start by finding the movie title Say Anything…​ in the basics table. Then join the basics table to the crew table, to find out which person was the director of Say Anything…​. (P.S. This is Dr Ward’s all-time favorite movie.)

  2. Starting with only the nconst of this Director, use (only one) SQL query to find their name and also the titles of all of the movies that they have directed in their career.

Question 8

  1. Join the basics table and the ratings table, to see how many rows have tvEpisode as the titleType and have more than 200000 votes.

  2. How many episodes of The West Wing had rating 9 or higher?

Question 9

Which of George Clooney’s movies are the most popular? (By "popularity", you can choose to either analyze the ratings or the number of votes; either way is OK with us! Just be sure to explain what you did in your solution.)

Question 10

Identify the six most popular episodes of the show Grey’s Anatomy (where "popular" denotes a high rating).

Question 11

Use LIKE to analyze the primaryTitle of all IMDB titles: First determine how many titles have Batman anywhere in the title, and then determine how many titles have Superman anywhere in the title? Which one occurs more often?

Question 12

During the years 2000 to 2020, how many people (from the name table) died in each year? For each year, show the number of people who died in each year. It probably makes the most sense to sort your results by year.

Submitting your Work

Once you have completed the questions, save your Jupyter notebook. You can then download the notebook and submit it to Gradescope.

Items to submit
  • firstname_lastname_week4.ipynb

You must double check your .ipynb after submitting it in gradescope. A very common mistake is to assume that your .ipynb file has been rendered properly and contains your code, markdown, and code output even though it may not. Please take the time to double check your work. See here for instructions on how to double check this.

You will not receive full credit if your .ipynb file does not contain all of the information you expect it to, or if it does not render properly in Gradescope. Please ask a TA if you need help with this.