🚀 November has started! SQLtest.online stays free thanks to donations from people like you. Help us reach this month's goal early so the site keeps running without interruptions. Support now →
SQL code copied to buffer
Task 9:

Actors Duets

MySQL
Find acting duos who have appeared together in more than five films.
Output the result as a table with columns: 
    - actor_id, first_name, last_name - identifier, first and last name of the first actor, 
    - actor_id, first_name, last_name - identifier, first and last name of the second actor,
    - films_together - the number of films in which they starred together.

In each line, we first display the actor with the last name higher in alphabetical order. Sort the results in descending order of number of collaborations, then by the last name of the first actor.
Expected result Columns: 7 · Rows: 6
actor_id first_name last_name actor_id first_name last_name films_together

Sample rows open after wrong checks: 0 of 3

Write your query below and click "Check it!". Tables are described in the right pane.

Tutorial
The query result will appear here. Ctrl+Enter - Run query