Skip to content
SQLSimplified
FreshersQuestion 47 of 50

Pattern Matching in Titles

Problem

A user is trying to find a movie but only remembers that the word "Protocol" is part of the title. Find the title and director of all movies whose title contains the word "Protocol".

Database Schema

Table: movies

  • id (INT): Unique identifier for the movie.
  • title (VARCHAR): Title of the movie.
  • genre (VARCHAR): Genre of the movie.
  • release_year (INT): The year the movie was released.
  • director (VARCHAR): Director of the movie.
  • budget_millions (INT): Movie budget in millions of dollars.

Table: actors

  • id (INT): Unique identifier for the actor.
  • name (VARCHAR): Name of the actor.
  • birth_year (INT): Birth year of the actor.
  • primary_movie_id (INT): Foreign key referencing the movie they are best known for.

Table: ratings

  • id (INT): Unique identifier for the rating.
  • movie_id (INT): Foreign key referencing the movie.
  • source (VARCHAR): The source of the rating (e.g., Critics, Audience).
  • score (DECIMAL): Numeric score.

Try It

Loading playground environment...

Hint

Solution