Practice · Science & Space · Medium
Count Egypt’s satellites by purpose. Return purpose and a column named n, most common purpose first, then purpose alphabetically for ties.
Runs in your browser. No signup needed.
Use satellites. GROUP BY purpose.
SELECT purpose, COUNT(*) AS n
FROM satellites
GROUP BY purpose
ORDER BY n DESC, purpose;
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.
Egypt’s satellite programme is split between Earth-observation craft (agriculture, water, urban monitoring) and communications satellites like Nilesat 301 and Tiba-1. (Space in Africa)