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
How many persons are not body builders?
assistant
SELECT count(*) FROM people WHERE people_id NOT IN (SELECT People_ID FROM body_builder)
human
What is the name of the body builder with the greatest body weight?
assistant
SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Weight DESC LIMIT 1
human
What are the names of body builders whose total score is higher than 300?
assistant
SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Total > 300
human
How many body builders are there?
assistant
SELECT count(*) FROM body_builder
human
List the names and origins of people who are not body builders.
assistant
SELECT Name , birth_place FROM people EXCEPT SELECT T1.Name , T1.birth_place FROM people AS T1 JOIN body_builder AS T2 ON T1.people_id = T2.people_id
human
What are the names of body builders?
assistant
SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ;