1sf/bird-sql-train-with-schema huggingface dataset:
Database: superstore
Tables: people, product, central_superstore, east_superstore, south_superstore, west_superstore
Columns (table index, column name): -1, *, 0, Customer ID, 0, Customer Name, 0, Segment, 0, Country, 0, City, 0, State, 0, Postal Code, 0, Region, 1, Product ID, 1, Product Name, 1, Category, 1, Sub-Category, 1, Region, 2, Row ID, 2, Order ID, 2, Order Date, 2, Ship Date, 2, Ship Mode, 2, Customer ID, 2, Region, 2, Product ID, 2, Sales, 2, Quantity, 2, Discount, 2, Profit, 3, Row ID, 3, Order ID, 3, Order Date, 3, Ship Date, 3, Ship Mode, 3, Customer ID, 3, Region, 3, Product ID, 3, Sales, 3, Quantity, 3, Discount, 3, Profit, 4, Row ID, 4, Order ID, 4, Order Date, 4, Ship Date, 4, Ship Mode, 4, Customer ID, 4, Region, 4, Product ID, 4, Sales, 4, Quantity, 4, Discount, 4, Profit, 5, Row ID, 5, Order ID, 5, Order Date, 5, Ship Date, 5, Ship Mode, 5, Customer ID, 5, Region, 5, Product ID, 5, Sales, 5, Quantity, 5, Discount, 5, Profit
Question: List the customer's name from the South region with a standard class ship mode and sales greater than the 88% of the average sales of all orders.
Evidence: sales greater than the 88% of the average sales of all orders refers to Sales > avg(Sales) * 0.88; South region refers to south_superstore
SQL: SELECT DISTINCT T2.`Customer Name` FROM south_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T2.Region = 'South' AND T1.`Ship Mode` = 'Standard Class' AND 100 * T1.Sales / ( SELECT AVG(Sales) FROM south_superstore ) > 88
Database: superstore
Tables: people, product, central_superstore, east_superstore, south_superstore, west_superstore
Columns (table index, column name): -1, *, 0, Customer ID, 0, Customer Name, 0, Segment, 0, Country, 0, City, 0, State, 0, Postal Code, 0, Region, 1, Product ID, 1, Product Name, 1, Category, 1, Sub-Category, 1, Region, 2, Row ID, 2, Order ID, 2, Order Date, 2, Ship Date, 2, Ship Mode, 2, Customer ID, 2, Region, 2, Product ID, 2, Sales, 2, Quantity, 2, Discount, 2, Profit, 3, Row ID, 3, Order ID, 3, Order Date, 3, Ship Date, 3, Ship Mode, 3, Customer ID, 3, Region, 3, Product ID, 3, Sales, 3, Quantity, 3, Discount, 3, Profit, 4, Row ID, 4, Order ID, 4, Order Date, 4, Ship Date, 4, Ship Mode, 4, Customer ID, 4, Region, 4, Product ID, 4, Sales, 4, Quantity, 4, Discount, 4, Profit, 5, Row ID, 5, Order ID, 5, Order Date, 5, Ship Date, 5, Ship Mode, 5, Customer ID, 5, Region, 5, Product ID, 5, Sales, 5, Quantity, 5, Discount, 5, Profit
Question: Among the customers from Indiana, what is the percentage of their purchased orders in the Central region with no discount?
Evidence: Indiana refers to State = 'Indiana'; no discount refers to Discount = 0; percentage = divide(sum(Discount) when Discount = 0, count(Discount)) as percentage
SQL: SELECT CAST(SUM(CASE  WHEN T2.Discount = 0 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T2.Region = 'Central' AND T1.State = 'Indiana'
Database: shooting
Tables: incidents, officers, subjects
Columns (table index, column name): -1, *, 0, case_number, 0, date, 0, location, 0, subject_statuses, 0, subject_weapon, 0, subjects, 0, subject_count, 0, officers, 1, case_number, 1, race, 1, gender, 1, last_name, 1, first_name, 1, full_name, 2, case_number, 2, race, 2, gender, 2, last_name, 2, first_name, 2, full_name
Question: Among all the male officers, what is the percentage of them are White?
Evidence: male refers to gender = 'M'; white refers to race = 'W'; percentage = divide(count(officers where race = 'W'), count(officers)) where gender = 'M' * 100%
SQL: SELECT CAST(SUM(IIF(race = 'W', 1, 0)) AS REAL) * 100 / COUNT(case_number) FROM officers WHERE gender = 'M'
Database: shooting
Tables: incidents, officers, subjects
Columns (table index, column name): -1, *, 0, case_number, 0, date, 0, location, 0, subject_statuses, 0, subject_weapon, 0, subjects, 0, subject_count, 0, officers, 1, case_number, 1, race, 1, gender, 1, last_name, 1, first_name, 1, full_name, 2, case_number, 2, race, 2, gender, 2, last_name, 2, first_name, 2, full_name
Question: What is the percentage of the cases involved more than 3 officers from year 2010 to 2015?
Evidence: more than 3 officers refers to officer_count > 3; from year 2010 to 2015 refers to date between '2010-01-01' and '2015-12-31'; percentage = divide(count(case_number where officer_count > 3), count(case_number)) where date between '2010-01-01' and '2015-12-31' * 100%
SQL: SELECT CAST(SUM(IIF(officer_count > 3, 1, 0)) AS REAL) * 100 / COUNT(case_number) FROM incidents WHERE STRFTIME('%Y', date) BETWEEN '2010' AND '2015'
Database: shooting
Tables: incidents, officers, subjects
Columns (table index, column name): -1, *, 0, case_number, 0, date, 0, location, 0, subject_statuses, 0, subject_weapon, 0, subjects, 0, subject_count, 0, officers, 1, case_number, 1, race, 1, gender, 1, last_name, 1, first_name, 1, full_name, 2, case_number, 2, race, 2, gender, 2, last_name, 2, first_name, 2, full_name
Question: In which year has the greatest number of cases where Handgun was used as weapon?
Evidence: year refers to year(date); the greatest number of cases refers to max(count(case_number)); OS Spray was used as weapon refers to subject_weapon = 'OS Spray'
SQL: SELECT STRFTIME('%Y', date) FROM incidents WHERE subject_weapon = 'Handgun' GROUP BY STRFTIME('%Y', date) ORDER BY COUNT(case_number) DESC LIMIT 1
Database: shooting
Tables: incidents, officers, subjects
Columns (table index, column name): -1, *, 0, case_number, 0, date, 0, location, 0, subject_statuses, 0, subject_weapon, 0, subjects, 0, subject_count, 0, officers, 1, case_number, 1, race, 1, gender, 1, last_name, 1, first_name, 1, full_name, 2, case_number, 2, race, 2, gender, 2, last_name, 2, first_name, 2, full_name
Question: Among the cases dismissed by the grand jury disposition, what percentage of cases is where the subject is injured?
Evidence: dismissed by the grand jury disposition refers to grand_jury_disposition = 'No Bill'; the subject is injured refers to subject_statuses = 'injured'; percentage = divide(count(incidents where subject_statuses = 'injured'), count(incidents)) where grand_jury_disposition = 'No Bill' * 100%
SQL: SELECT CAST(SUM(subject_statuses = 'Injured') AS REAL) * 100 / COUNT(case_number) FROM incidents WHERE grand_jury_disposition = 'No Bill'
Database: shooting
Tables: incidents, officers, subjects
Columns (table index, column name): -1, *, 0, case_number, 0, date, 0, location, 0, subject_statuses, 0, subject_weapon, 0, subjects, 0, subject_count, 0, officers, 1, case_number, 1, race, 1, gender, 1, last_name, 1, first_name, 1, full_name, 2, case_number, 2, race, 2, gender, 2, last_name, 2, first_name, 2, full_name
Question: Did the number of cases with Vehicle as subject weapon increase or decrease from year 2007 to 2008. State the difference.
Evidence: number of cases refers to count(case_number); with Vehicle as subject weapon refers to subject_weapon = 'Vehicle'; year 2007 refers to date between '2007-01-01' and '2007-12-31'; year 2008 refers to date between '2008-01-01' and '2008-12-31'
SQL: SELECT SUM(IIF(STRFTIME('%Y', date) = '2007', 1, 0)) - SUM(IIF(STRFTIME('%Y', date) = '2008', 1, 0)) FROM incidents WHERE subject_weapon = 'Vehicle'
Database: shooting
Tables: incidents, officers, subjects
Columns (table index, column name): -1, *, 0, case_number, 0, date, 0, location, 0, subject_statuses, 0, subject_weapon, 0, subjects, 0, subject_count, 0, officers, 1, case_number, 1, race, 1, gender, 1, last_name, 1, first_name, 1, full_name, 2, case_number, 2, race, 2, gender, 2, last_name, 2, first_name, 2, full_name
Question: Among the 'Handgun' weapon used by subject, how many percent were 'Shoot and Miss'?
Evidence: 'Handgun' weapon refers to subject_weapon = 'Handgun'; 'Shoot and Miss' refers to subject_statuses = 'Shoot and Miss'; percent = divide(count(incidents where subject_statuses = 'Shoot and Miss'), count(incidents)) where subject_weapon = 'Handgun' * 100%
SQL: SELECT CAST(SUM(subject_statuses = 'Shoot and Miss') AS REAL) * 100 / COUNT(case_number) FROM incidents WHERE subject_weapon = 'Handgun'
Database: shooting
Tables: incidents, officers, subjects
Columns (table index, column name): -1, *, 0, case_number, 0, date, 0, location, 0, subject_statuses, 0, subject_weapon, 0, subjects, 0, subject_count, 0, officers, 1, case_number, 1, race, 1, gender, 1, last_name, 1, first_name, 1, full_name, 2, case_number, 2, race, 2, gender, 2, last_name, 2, first_name, 2, full_name
Question: Who are the officers involved in cases that are voted as 'No Bill'. List their last name and gender.
Evidence: voted as 'No Bill' refers to grand_jury_disposition = 'No Bill'
SQL: SELECT T2.last_name, T2.gender FROM incidents AS T1 INNER JOIN officers AS T2 ON T1.case_number = T2.case_number WHERE T1.grand_jury_disposition = 'No Bill'
Database: shooting
Tables: incidents, officers, subjects
Columns (table index, column name): -1, *, 0, case_number, 0, date, 0, location, 0, subject_statuses, 0, subject_weapon, 0, subjects, 0, subject_count, 0, officers, 1, case_number, 1, race, 1, gender, 1, last_name, 1, first_name, 1, full_name, 2, case_number, 2, race, 2, gender, 2, last_name, 2, first_name, 2, full_name
Question: Which are the cases where the subject are female. List the case number, subject status and weapon.
Evidence: female refers to gender = 'F'; weapon refers to subject_weapon
SQL: SELECT T1.case_number, T1.subject_statuses, T1.subject_weapon FROM incidents AS T1 INNER JOIN subjects AS T2 ON T1.case_number = T2.case_number WHERE T2.gender = 'F'
Database: shooting
Tables: incidents, officers, subjects
Columns (table index, column name): -1, *, 0, case_number, 0, date, 0, location, 0, subject_statuses, 0, subject_weapon, 0, subjects, 0, subject_count, 0, officers, 1, case_number, 1, race, 1, gender, 1, last_name, 1, first_name, 1, full_name, 2, case_number, 2, race, 2, gender, 2, last_name, 2, first_name, 2, full_name
Question: From the cases where the subject are male, list the case number and the location and subject status.
Evidence: male refers to gender = 'M'
SQL: SELECT T1.case_number, T1.location, T1.subject_statuses FROM incidents AS T1 INNER JOIN subjects AS T2 ON T1.case_number = T2.case_number WHERE T2.gender = 'M'
Database: shooting
Tables: incidents, officers, subjects
Columns (table index, column name): -1, *, 0, case_number, 0, date, 0, location, 0, subject_statuses, 0, subject_weapon, 0, subjects, 0, subject_count, 0, officers, 1, case_number, 1, race, 1, gender, 1, last_name, 1, first_name, 1, full_name, 2, case_number, 2, race, 2, gender, 2, last_name, 2, first_name, 2, full_name
Question: For case(s) where officer 'Evenden, George' is in charged, state the case number and the grand jury disposition?
Evidence: officer 'Evenden, George' refers to full_name = 'Evenden, George'
SQL: SELECT T1.case_number, T1.grand_jury_disposition FROM incidents AS T1 INNER JOIN officers AS T2 ON T1.case_number = T2.case_number WHERE T2.first_name = 'George' AND T2.last_name = 'Evenden'
Database: shooting
Tables: incidents, officers, subjects
Columns (table index, column name): -1, *, 0, case_number, 0, date, 0, location, 0, subject_statuses, 0, subject_weapon, 0, subjects, 0, subject_count, 0, officers, 1, case_number, 1, race, 1, gender, 1, last_name, 1, first_name, 1, full_name, 2, case_number, 2, race, 2, gender, 2, last_name, 2, first_name, 2, full_name
Question: For case number '134472-2015', list the last name of the officers involved and state the subject statuses.
SQL: SELECT T2.last_name, T1.subject_statuses FROM incidents AS T1 INNER JOIN officers AS T2 ON T1.case_number = T2.case_number WHERE T1.case_number = '134472-2015'
Database: shooting
Tables: incidents, officers, subjects
Columns (table index, column name): -1, *, 0, case_number, 0, date, 0, location, 0, subject_statuses, 0, subject_weapon, 0, subjects, 0, subject_count, 0, officers, 1, case_number, 1, race, 1, gender, 1, last_name, 1, first_name, 1, full_name, 2, case_number, 2, race, 2, gender, 2, last_name, 2, first_name, 2, full_name
Question: From the cases where the subject were deceased, list the subject's last name, gender, race and case number.
Evidence: subject were deceased refers to subject_statuses = 'Deceased'
SQL: SELECT T2.last_name, T2.gender, T2.race, T2.case_number FROM incidents AS T1 INNER JOIN subjects AS T2 ON T1.case_number = T2.case_number WHERE T1.subject_statuses = 'Deceased'
Database: shooting
Tables: incidents, officers, subjects
Columns (table index, column name): -1, *, 0, case_number, 0, date, 0, location, 0, subject_statuses, 0, subject_weapon, 0, subjects, 0, subject_count, 0, officers, 1, case_number, 1, race, 1, gender, 1, last_name, 1, first_name, 1, full_name, 2, case_number, 2, race, 2, gender, 2, last_name, 2, first_name, 2, full_name
Question: What is the percentage of subject who are female used the Vehicle as weapon?
Evidence: female refers to gender = 'F'; use Vehicle as weapon refers to subject_weapon = 'Vehicle'; percentage = divide(count(case_number where subject_weapon = 'Vehicle'), count(case_number)) where gender = 'F' * 100%
SQL: SELECT CAST(SUM(T1.subject_weapon = 'Vehicle') AS REAL) * 100 / COUNT(T1.case_number) FROM incidents T1 INNER JOIN subjects T2 ON T1.case_number = T2.case_number WHERE T2.gender = 'F'
Database: shooting
Tables: incidents, officers, subjects
Columns (table index, column name): -1, *, 0, case_number, 0, date, 0, location, 0, subject_statuses, 0, subject_weapon, 0, subjects, 0, subject_count, 0, officers, 1, case_number, 1, race, 1, gender, 1, last_name, 1, first_name, 1, full_name, 2, case_number, 2, race, 2, gender, 2, last_name, 2, first_name, 2, full_name
Question: From the 'Injured' statuses of the subject, what is the ratio of weapons used are knife against handgun?
Evidence: the 'Shoot and Miss' status refers to subject_statuses = 'Shoot and Miss'; knife refers to subject_weapon = 'knife'; toy handgun refers to subject_weapon = 'toy handgun'; ratio = divide(count(case_number where subject_weapon = 'knife'), count(case_number where subject_weapon = 'toy handgun')) where subject_statuses = 'Shoot and Miss'
SQL: SELECT CAST(SUM(T1.subject_weapon = 'Knife') AS REAL) * 100 / SUM(T1.subject_weapon = 'Handgun') FROM incidents AS T1 INNER JOIN subjects AS T2 ON T1.case_number = T2.case_number WHERE T1.subject_statuses = 'Injured'
Database: shooting
Tables: incidents, officers, subjects
Columns (table index, column name): -1, *, 0, case_number, 0, date, 0, location, 0, subject_statuses, 0, subject_weapon, 0, subjects, 0, subject_count, 0, officers, 1, case_number, 1, race, 1, gender, 1, last_name, 1, first_name, 1, full_name, 2, case_number, 2, race, 2, gender, 2, last_name, 2, first_name, 2, full_name
Question: List all cases from the year 2012 in which the subject was deceased
Evidence: case refers to case_number; year 2012 refers to date between '2012-01-01' and '2012-12-31'; subject was deceased refers to subject_statuses = 'Deceased'
SQL: SELECT case_number FROM incidents WHERE STRFTIME('%Y', date) > '2011' AND subject_statuses = 'Deceased'
Database: shooting
Tables: incidents, officers, subjects
Columns (table index, column name): -1, *, 0, case_number, 0, date, 0, location, 0, subject_statuses, 0, subject_weapon, 0, subjects, 0, subject_count, 0, officers, 1, case_number, 1, race, 1, gender, 1, last_name, 1, first_name, 1, full_name, 2, case_number, 2, race, 2, gender, 2, last_name, 2, first_name, 2, full_name
Question: Of all male officers, what percentage are black officers?
Evidence: male refers to gender = 'M'; black refers to race = 'B'; percentage = divide(count(officers where race = 'B'), count(officers)) where gender = 'M' * 100%
SQL: SELECT CAST(SUM(race = 'B') AS REAL) * 100 / COUNT(case_number) FROM officers WHERE gender = 'M'
Database: shooting
Tables: incidents, officers, subjects
Columns (table index, column name): -1, *, 0, case_number, 0, date, 0, location, 0, subject_statuses, 0, subject_weapon, 0, subjects, 0, subject_count, 0, officers, 1, case_number, 1, race, 1, gender, 1, last_name, 1, first_name, 1, full_name, 2, case_number, 2, race, 2, gender, 2, last_name, 2, first_name, 2, full_name
Question: How many incidents in which the subject's weapon was a vehicle were investigated by a female officer?
Evidence: subject's weapon was a vehicle refers to subject_weapon = 'Vehicle'; female refers to gender = 'F'
SQL: SELECT COUNT(T1.case_number) FROM incidents AS T1 INNER JOIN officers AS T2 ON T1.case_number = T2.case_number WHERE T1.subject_weapon = 'Vehicle' AND T2.gender = 'F'
Database: shooting
Tables: incidents, officers, subjects
Columns (table index, column name): -1, *, 0, case_number, 0, date, 0, location, 0, subject_statuses, 0, subject_weapon, 0, subjects, 0, subject_count, 0, officers, 1, case_number, 1, race, 1, gender, 1, last_name, 1, first_name, 1, full_name, 2, case_number, 2, race, 2, gender, 2, last_name, 2, first_name, 2, full_name
Question: In how many cases where the subject was a female was the subject's status listed as Deceased?
Evidence:  female refers to gender = 'F'; subject's status listed as Deceased refers to subject_statuses = 'Deceased'
SQL: SELECT COUNT(T1.case_number) FROM incidents AS T1 INNER JOIN subjects AS T2 ON T1.case_number = T2.case_number WHERE T2.gender = 'F' AND T1.subject_statuses = 'Deceased'
Database: shooting
Tables: incidents, officers, subjects
Columns (table index, column name): -1, *, 0, case_number, 0, date, 0, location, 0, subject_statuses, 0, subject_weapon, 0, subjects, 0, subject_count, 0, officers, 1, case_number, 1, race, 1, gender, 1, last_name, 1, first_name, 1, full_name, 2, case_number, 2, race, 2, gender, 2, last_name, 2, first_name, 2, full_name
Question: Of the black officers, how many of them investigated cases between the years 2010 and 2015?
Evidence: black refers to race = 'B'; between the years 2010 and 2015 refers to date between '2010-01-01' and '2015-12-31'; case refers to case_number
SQL: SELECT COUNT(T1.case_number) FROM officers AS T1 INNER JOIN incidents AS T2 ON T2.case_number = T1.case_number WHERE T1.race = 'B' AND T2.date BETWEEN '2010-01-01' AND '2015-12-31'
Database: shooting
Tables: incidents, officers, subjects
Columns (table index, column name): -1, *, 0, case_number, 0, date, 0, location, 0, subject_statuses, 0, subject_weapon, 0, subjects, 0, subject_count, 0, officers, 1, case_number, 1, race, 1, gender, 1, last_name, 1, first_name, 1, full_name, 2, case_number, 2, race, 2, gender, 2, last_name, 2, first_name, 2, full_name
Question: How many instances were found in June 2015?
Evidence: in June 2015 refers to date between '2015-06-01' and '2015-06-30'; record number refers to case_number
SQL: SELECT COUNT(case_number) FROM incidents WHERE date BETWEEN '2015-06-01' AND '2015-06-30'
Database: shooting
Tables: incidents, officers, subjects
Columns (table index, column name): -1, *, 0, case_number, 0, date, 0, location, 0, subject_statuses, 0, subject_weapon, 0, subjects, 0, subject_count, 0, officers, 1, case_number, 1, race, 1, gender, 1, last_name, 1, first_name, 1, full_name, 2, case_number, 2, race, 2, gender, 2, last_name, 2, first_name, 2, full_name
Question: How many people were injured between 2006 and 2014 as a result of a handgun?
Evidence: injured refers to subject_statuses = 'injured'; between 2006 and 2014 refers to date between '2006-01-01' and '2013-12-31'; handgun refers to subject_weapon = 'handgun'; where the incidents took place refers to location
SQL: SELECT COUNT(location) FROM incidents WHERE subject_weapon = 'Handgun' AND subject_statuses = 'Injured' AND date BETWEEN '2006-01-01' AND '2013-12-31'
Database: shooting
Tables: incidents, officers, subjects
Columns (table index, column name): -1, *, 0, case_number, 0, date, 0, location, 0, subject_statuses, 0, subject_weapon, 0, subjects, 0, subject_count, 0, officers, 1, case_number, 1, race, 1, gender, 1, last_name, 1, first_name, 1, full_name, 2, case_number, 2, race, 2, gender, 2, last_name, 2, first_name, 2, full_name
Question: What is the most common type of weapon that causes death?
Evidence: the most common type of weapon refers to max(count(subject_weapon)); causes death refers to subject_statuses = 'Deceased'
SQL: SELECT subject_weapon FROM incidents WHERE subject_statuses = 'Deceased' GROUP BY subject_weapon ORDER BY COUNT(case_number) DESC LIMIT 1
Database: shooting
Tables: incidents, officers, subjects
Columns (table index, column name): -1, *, 0, case_number, 0, date, 0, location, 0, subject_statuses, 0, subject_weapon, 0, subjects, 0, subject_count, 0, officers, 1, case_number, 1, race, 1, gender, 1, last_name, 1, first_name, 1, full_name, 2, case_number, 2, race, 2, gender, 2, last_name, 2, first_name, 2, full_name
Question: What is the proportion of white males and females in the police force?
Evidence: white refers to race = 'W'; male refers to gender = 'M'; female refers to gender = 'F'; proportion of white males = divide(count(officers where race = 'W' and gender = 'M'), count(officers)) * 100%; proportion of white females = divide(count(officers where race = 'W' and gender = 'F'), count(officers)) * 100%
SQL: SELECT CAST(SUM(gender = 'M') AS REAL) / SUM(gender = 'F') FROM officers WHERE race = 'W'
Database: shooting
Tables: incidents, officers, subjects
Columns (table index, column name): -1, *, 0, case_number, 0, date, 0, location, 0, subject_statuses, 0, subject_weapon, 0, subjects, 0, subject_count, 0, officers, 1, case_number, 1, race, 1, gender, 1, last_name, 1, first_name, 1, full_name, 2, case_number, 2, race, 2, gender, 2, last_name, 2, first_name, 2, full_name
Question: How many more black female victims than white female victims were discovered?
Evidence: black refers to race = 'B'; female refers to gender = 'F'; white refers to race = 'W'; result = subtract(count(victims where race = 'B'), count(victims where race = 'W')) where gender = 'F'
SQL: SELECT SUM(race = 'B') - SUM(race = 'W') FROM subjects WHERE gender = 'F'
Database: shooting
Tables: incidents, officers, subjects
Columns (table index, column name): -1, *, 0, case_number, 0, date, 0, location, 0, subject_statuses, 0, subject_weapon, 0, subjects, 0, subject_count, 0, officers, 1, case_number, 1, race, 1, gender, 1, last_name, 1, first_name, 1, full_name, 2, case_number, 2, race, 2, gender, 2, last_name, 2, first_name, 2, full_name
Question: What percentage of deaths were caused by rifles?
Evidence: rifle refers to subject_weapon = 'rifles'; death refers to subject_statuses = 'Deceased'; percentage = divide(count(incidents where subject_weapon = 'rifles'), count(incidents)) where subject_statuses = 'Deceased' * 100%
SQL: SELECT CAST(SUM(subject_statuses = 'Deceased') AS REAL) * 100 / COUNT(case_number) FROM incidents WHERE subject_weapon = 'Rifle'
Database: shooting
Tables: incidents, officers, subjects
Columns (table index, column name): -1, *, 0, case_number, 0, date, 0, location, 0, subject_statuses, 0, subject_weapon, 0, subjects, 0, subject_count, 0, officers, 1, case_number, 1, race, 1, gender, 1, last_name, 1, first_name, 1, full_name, 2, case_number, 2, race, 2, gender, 2, last_name, 2, first_name, 2, full_name
Question: Which type of weapon was used to attack the victim in the record number 031347-2015? What is the victim's race and gender?
Evidence: type of weapon refers to subject_weapon; record number 031347-2015 refers to case_number = '031347-2015'
SQL: SELECT T1.subject_weapon, T2.race, T2.gender FROM incidents AS T1 INNER JOIN subjects AS T2 ON T1.case_number = T2.case_number WHERE T1.case_number = '031347-2015'