Practice · Industry · Hard
Group the companies by the century they were founded in, and return century (as a number, e.g. 19 or 21) and companies (the count), earliest century first.
Runs in your browser. No signup needed.
Use companies. The century is (founded_year / 100) + 1 with integer division — e.g. 1898 → 19, 2008 → 21.
SELECT (founded_year / 100) + 1 AS century, COUNT(*) AS companies
FROM companies
GROUP BY century
ORDER BY century;
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.
Some of Egypt’s biggest listed firms are strikingly old — Telecom Egypt traces to 1854 and the National Bank of Egypt to 1898, alongside 21st-century fintechs like Fawry. (company filings)