human
Schema:
gymnast (Gymnast_ID, Floor_Exercise_Points, Pommel_Horse_Points, Rings_Points, Vault_Points, Parallel_Bars_Points, Horizontal_Bar_Points, Total_Points)
people (People_ID, Name, Age, Height, Hometown)
Please answer with SQL.
assistant
Sure, I understand.
human
How many distinct hometowns did these people have?
assistant
SELECT count(DISTINCT Hometown) FROM people
human
What are the names of gymnasts?
assistant
SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID
human
List the total points of gymnasts in descending order.
assistant
SELECT Total_Points FROM gymnast ORDER BY Total_Points DESC
human
List the names of gymnasts in ascending order by their heights.
assistant
SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Height ASC
human
List the names of the top 5 oldest people.
assistant
SELECT Name FROM People ORDER BY Age DESC LIMIT 5
human
What are the names of people in ascending alphabetical order?
assistant
SELECT Name FROM People ORDER BY Name ASC ;