Loading Now

findTheActor

You are the director of Stars company, and you store information about your actors, your films in there relations below:

The Film table is a list of all films potentially in stock.

  • film_id (smallint): A surrogate primary key used to uniquely identify each film in the table.
  • title (varchar[255]): The title of the film.

The Actor table lists information for all actors.

  • actor_id (smallint): A surrogate primary key used to uniquely identify each actor in the table.
  • first_name (varchar[50]): The actor’s first name.
  • last_name (varchar[50]): The actor’s last name.
  • last_update (timestamp): The time that the row was created or most recently updated.

The Film_Actor table is used to support a many-to-many relationship between films and actors. For each actor in a given film, there will be one row in the Film_Actor table listing the actor and film.

  • actor_id (smallint): A foreign key identifying the actor.
  • film_id (smallint): A foreign key identifying the film.
  • last_update (timestamp): The time that the row was created or most recently updated.

Use subqueries to display all actors who appear in the film ACADEMY DINOSAUR

Your should sort the given results table in ascending order by the first_name, last_name of actors.

Example: For the following data:

Table Actor:

actor_id first_name last_name last_update
1 PENELOPE GUINESS 2006-02-15 04:34:33
2 NICK WAHLBERG 2006-02-15 04:34:33
3 ED CHASE 2006-02-15 04:34:33
4 JENNIFER DAVIS 2006-02-15 04:34:33
5 JOHNNY LOLLOBRIGIDA 2006-02-15 04:34:33

Table Film:

film_id title
1 ACADEMY DINOSAUR
2 ACE GOLDFINGER
3 ADAPTATION HOLES

Table Film_Actor:

actor_id film_id last_update
1 1 2006-02-15 05:05:03
4 1 2006-02-15 05:05:03
1 3 2006-02-15 05:05:03
2 3 2006-02-15 05:05:03

the output should be:

first_name last_name
JENNIFER DAVIS
PENELOPE GUINESS

Input/ Output:

  • [execution time limit] 2 seconds 
  • [input] Data of 3 the tables: Actor, Film, Film_Actor
  • [output] The table should have 2 columns first_name, last_name. Your should sort the given results table in ascending order by the first_name, last_name of actors.

 

Post Comment

Contact