Practice · Art & Cinema · Medium

A lifetime in years

For cultural figures whose death year is known, return name and age at death (death_year − birth_year) as age, oldest age first, top 5.

Runs in your browser. No signup needed.

What you are given

cultural_figures(name, birth_year, death_year). Exclude living/unknown with WHERE death_year IS NOT NULL.

Starting point

SELECT name, death_year - birth_year AS age
FROM cultural_figures
WHERE death_year IS NOT NULL
ORDER BY age DESC
LIMIT 5;

The reference solution is checked automatically when you run your query on the practice page — results are compared row by row, and order matters for this one.

Did you know

Some birth/death dates for Golden-Age stars like Umm Kulthum are genuinely disputed — the knowledge base flags those rather than picking a side. (Wikipedia)

More Art & Cinema challenges

Open it in the playground →