human
Schema:
perpetrator (Perpetrator_ID, People_ID, Date, Year, Location, Country, Killed, Injured)
people (People_ID, Name, Height, Weight, Home Town)
Please answer with SQL.
assistant
Sure, I understand.
human
What are the countries of perpetrators? Show each country and the corresponding number of perpetrators there.
assistant
SELECT Country , COUNT(*) FROM perpetrator GROUP BY Country
human
List the names of people that are not perpetrators.
assistant
SELECT Name FROM people WHERE People_ID NOT IN (SELECT People_ID FROM perpetrator)
human
What are the heights of perpetrators in descending order of the number of people they injured?
assistant
SELECT T1.Height FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Injured DESC
human
List the number of people injured by perpetrators in ascending order.
assistant
SELECT Injured FROM perpetrator ORDER BY Injured ASC
human
List the names of perpetrators in descending order of the year.
assistant
SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Year DESC
human
List the date of perpetrators in descending order of the number of people killed.
assistant
SELECT Date FROM perpetrator ORDER BY Killed DESC ;