human
Schema:
mountain (Mountain_ID, Name, Height, Prominence, Range, Country)
climber (Climber_ID, Name, Country, Time, Points, Mountain_ID)
Please answer with SQL.
assistant
Sure, I understand.
human
Please show the countries and the number of climbers from each country.
assistant
SELECT Country , COUNT(*) FROM climber GROUP BY Country
human
How many climbers are there?
assistant
SELECT count(*) FROM climber
human
How many distinct countries are the climbers from?
assistant
SELECT COUNT(DISTINCT Country) FROM climber
human
Show the names of climbers and the heights of mountains they climb.
assistant
SELECT T1.Name , T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID
human
Show names of climbers and the names of mountains they climb.
assistant
SELECT T1.Name , T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID
human
What are the times used by climbers who climbed mountains in the country of Uganda?
assistant
SELECT T1.Time FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID WHERE T2.Country = "Uganda" ;