In-Class Assessment

Basic SQL Queries: SELECT, WHERE, ORDER BY, LIMIT

Back to Course

In-Class Assessment: Basic SQL Queries

Assessment Overview

This timed assessment tests your understanding of fundamental SQL operations. You'll work with a real IMDB movies database to demonstrate your skills in data retrieval, filtering, sorting, and limiting results.

12
Questions
0
Total Points
--:--
Time Elapsed
0
Current Score

Database Schema: IMDB Movies

You'll be working with the movies table from the IMDB Top 1000 dataset. This table contains comprehensive information about popular movies including ratings, cast, and production details.

Column NameData TypeDescriptionExample Values
idINTEGERPrimary key, auto-increment1, 2, 3, 4
posterTEXTURL link to movie poster image'https://m.media-amazon.com/...'
titleTEXTMovie title/name'The Shawshank Redemption', 'The Godfather'
yearINTEGERYear the movie was released1994, 2008, 1972
rating_certTEXTMovie rating certificate'A', 'UA', 'PG-13', 'R'
runtimeINTEGERMovie duration in minutes142, 175, 152
genreTEXTMovie genre(s), comma-separated'Drama', 'Action, Crime, Drama'
imdb_scoreREALIMDB rating (0.0 to 10.0)9.3, 9.2, 9.0
overviewTEXTMovie plot summary/description'Two imprisoned men bond over...'
meta_scoreINTEGERMetacritic score (0-100)80, 100, 84
directorTEXTDirector's full name'Frank Darabont', 'Christopher Nolan'
star1TEXTFirst lead actor/actress'Tim Robbins', 'Marlon Brando'
star2TEXTSecond lead actor/actress'Morgan Freeman', 'Al Pacino'
star3TEXTThird lead actor/actress'Bob Gunton', 'James Caan'
star4TEXTFourth lead actor/actress'William Sadler', 'Diane Keaton'
votesINTEGERNumber of IMDB user votes2343110, 1620367
grossINTEGERBox office gross earnings (USD)28341469, 134966411

Quick Reference: SQL Operators

Comparison Operators:

  • = Equal to
  • != or <> Not equal
  • > Greater than
  • < Less than
  • >= Greater than or equal
  • <= Less than or equal

Pattern Matching & Logic:

  • LIKE '%pattern%' Contains text
  • BETWEEN x AND y Range (inclusive)
  • AND Both conditions true
  • OR Either condition true
  • ORDER BY col ASC/DESC Sort results
  • LIMIT n Restrict row count

Assessment Instructions

Complete all 12 questions below using the movies table. Each question tests specific SQL skills and is worth different point values. You'll receive immediate feedback and can see your progress in real-time.

Table: movies

Loading...

Execute a query to see results

In-Class Assessment: Basic SQL Queries — Questions

  1. Q18pts
    Select the title and imdb_score of all movies
  2. Q210pts
    Find all movies where the imdb_score is greater than 8.5
  3. Q310pts
    Select movies released in the year 2019
  4. Q412pts
    Find the top 10 highest-rated movies, ordered by imdb_score in descending order
  5. Q512pts
    Select only the title and director of movies with runtime greater than 150 minutes
  6. Q610pts
    Find all movies directed by 'Christopher Nolan'
  7. Q712pts
    Get the 5 most recent movies, ordered by year in descending order
  8. Q815pts
    Find movies with imdb_score between 7.0 and 8.0 (inclusive)
  9. Q915pts
    Select the title, genre, and imdb_score of Action movies, ordered by score from highest to lowest
  10. Q1012pts
    Find the bottom 3 lowest-rated movies (lowest imdb_score first)
  11. Q1115pts
    Select movies where the title contains the word 'The' (case-sensitive)
  12. Q1218pts
    Get the title and year of movies released before 2000, ordered by year from oldest to newest, limit to 8 results

Click any question above to navigate. Complete all questions to finish the assessment.

0 / 12 Questions Complete
Assessment Progress0 of 12 questions completed • 0/0 points