human
Schema:
body_builder (Body_Builder_ID, People_ID, Snatch, Clean_Jerk, Total)
people (People_ID, Name, Height, Weight, Birth_Date, Birth_Place)
Please answer with SQL.
assistant
Sure, I understand.
human
What are the birthdays of people in ascending order of height?
assistant
SELECT Birth_Date FROM People ORDER BY Height ASC
human
What are the birth date and birth place of the body builder with the highest total points?
assistant
SELECT T2.Birth_Date , T2.Birth_Place FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Total DESC LIMIT 1
human
List each birth place along with the number of people from there.
assistant
SELECT Birth_Place , COUNT(*) FROM people GROUP BY Birth_Place
human
How many distinct birth places are there?
assistant
SELECT count(DISTINCT Birth_Place) FROM people
human
What are the birth places that are shared by at least two people?
assistant
SELECT Birth_Place FROM people GROUP BY Birth_Place HAVING COUNT(*) >= 2
human
What is the most common birth place of people?
assistant
SELECT Birth_Place FROM people GROUP BY Birth_Place ORDER BY COUNT( * ) DESC LIMIT 1 ;