Chinastark/bird_dataset huggingface dataset:
Database: superstore
Question: Calculate the percentage of ordered office supplies products in the central and the south superstore.
Evidence: office supplies products refers to Category = 'Office Supplies'; central refers to Region = 'Central'; south superstore refers to Region = 'South'; percentage = divide(SUM(Product ID where Category = 'Office Supplies'), count(Product ID)) * 100 where Region = 'Central' OR Region = 'South'
SQL: SELECT CAST(SUM(CASE  WHEN T3.Category = 'Office Supplies' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T3.Category) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID`
Database: superstore
Question: What is the ratio between customers who live in Texas and customers who live in Indiana?
Evidence: live in Texas refers to State = 'Texas'; live in Indiana refers to State = 'Indiana'; Ratio = divide(sum(State = 'Texas'), sum(State = 'Indiana'))
SQL: SELECT CAST(SUM(CASE  WHEN State = 'Texas' THEN 1 ELSE 0 END) AS REAL) * 100 / SUM(CASE  WHEN State = 'Indiana' THEN 1 ELSE 0 END) FROM people
Database: superstore
Question: Among the orders in Central superstore, which art product were ordered the most?
Evidence: art product refers to Sub-Category = 'Art'; the most refers to max(order_number)
SQL: SELECT T2.`Product Name` FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Sub-Category` = 'Art' GROUP BY T2.`Product Name` ORDER BY COUNT(T2.`Product ID`) DESC LIMIT 1
Database: superstore
Question: Among the customers in South superstore, which customers ordered more than 3 times in 2015? State the name of the customers.
Evidence: name of the customers refers to Customer_Name; in 2015 refers to "Order Date" BETWEEN '2015-01-01' AND '2015-12-31'; more than 3 times refers to count(Order_ID) > 3
SQL: SELECT DISTINCT T2.`Customer Name` FROM south_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE STRFTIME('%Y', T1.`Order Date`) = '2015' GROUP BY T2.`Customer Name` HAVING COUNT(T2.`Customer Name`) > 3
Database: superstore
Question: State the highest profit made by Anna Chung's orders in the Central Superstore.
Evidence: highest profit refers to max(Profit)
SQL: SELECT MAX(T2.Profit) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Customer Name` = 'Anna Chung'
Database: superstore
Question: How many orders were made by Corey Roper in 2015?
SQL: SELECT COUNT(T2.`Customer ID`) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Customer Name` = 'Corey Roper' AND STRFTIME('%Y', T2.`Ship Date`) = '2015'
Database: superstore
Question: Calculate the difference between the total sales in the East superstore and the total sales in the West superstore.
Evidence: East superstore refers to Region = 'East'; West superstore refers to Region = 'West'; difference = subtract(sum(Sales) when Region = 'East', sum(Sales) when Region = 'West')
SQL: SELECT SUM(T1.Sales) - SUM(T2.Sales) AS difference FROM east_superstore AS T1 INNER JOIN west_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID`
Database: superstore
Question: What are the names of the ordered products that have profit deficiency in central superstore?
Evidence: names of the ordered products refers to Product Name; deficiency refers to profit value is negative; profit > 0
SQL: SELECT DISTINCT T2.`Product Name` FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.Region = 'Central' AND T1.Profit < 0
Database: superstore
Question: In west superstore, what is the name and the shipping mode of the product that was ordered with the shortest shipment time?
Evidence: name refers to "Product Name"; shipping mode refers to Ship Mode; shortest shipment time refers to min(subtract(Ship Date, Order Date))
SQL: SELECT DISTINCT T2.`Product Name`, T1.`Ship Mode` FROM west_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.Region = 'West' ORDER BY T1.`Ship Date` - T1.`Order Date` LIMIT 1
Database: superstore
Question: How many orders of O'Sullivan Plantations 2-Door Library in Landvery Oak in central superstore were shipped through the shipping mode with the fastest delivery speed?
Evidence: 'O'Sullivan Cherrywood Estates Traditional Bookcase' is the "Product Name"; shipping mode with the fastest delivery speed refers to "Ship Mode" = 'First Class'
SQL: SELECT COUNT(DISTINCT T1.`Order ID`) FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Product Name` = 'O''Sullivan Plantations 2-Door Library in Landvery Oak' AND T2.Region = 'Central' AND T1.`Ship Mode` = 'First Class'
Database: superstore
Question: What is the name of the corporate customer from Rhode Island who had the highest number of orders in 2016 from the east superstore?
Evidence: corporate customer refers to Segment = 'Corporate'; Rhode Island refers to State = 'Rhode Island'; in 2016 refers to "Order Date" BETWEEN '2016-01-01' AND '2016-12-31'; east superstore refers to Region = 'East'; highest number of orders refers to max(order_number); name of corporate customer refers to "Customer Name"
SQL: SELECT T2.`Customer Name` FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T2.Segment = 'Corporate' AND T2.State = 'Rhode Island' AND T2.Region = 'East' AND STRFTIME('%Y', T1.`Order Date`) = '2016' GROUP BY T2.`Customer Name` ORDER BY COUNT(T2.`Customer Name`) DESC LIMIT 1
Database: superstore
Question: Among the orders with sales value of no less than 5,000 in west superstore, how many were bought by the customers in California?
Evidence: customers in California refers to State = 'California'; orders with sales value of no less than 5,000 refers to Sales > = 5,000
SQL: SELECT COUNT(DISTINCT T1.`Order ID`) FROM west_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` INNER JOIN people AS T3 ON T3.`Customer ID` = T1.`Customer ID` WHERE T1.Sales > 5000 AND T3.State = 'California' AND T2.Region = 'West'
Database: superstore
Question: In which segment does the customer who purchased the product from the east superstore with the highest original price belong?
Evidence: highest original price refers to max(divide(Sales, subtract(1, Discount)))
SQL: SELECT T2.Segment FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T1.Region = 'East' ORDER BY (T1.Sales / (1 - T1.Discount)) DESC LIMIT 1
Database: superstore
Question: What is the shipment duration for order number CA-2011-134103?
Evidence: shipment duration = subtract("Ship Date", "Order Date"); order number CA-2011-134103 refers to "Order ID" = 'CA-2011-134103'
SQL: SELECT DISTINCT strftime('%J', `Ship Date`) - strftime('%J', `Order Date`) AS duration FROM central_superstore WHERE `Order ID` = 'CA-2011-134103'
Database: superstore
Question: How many orders with a quantity greater than 5 have been shipped by the fastest delivery method?
Evidence: orders with a quantity greater than 5 refers to Quantity > 5; shipped by the fastest delivery method refers to Ship Mode = 'First Class'
SQL: SELECT COUNT(DISTINCT `Order ID`) FROM central_superstore WHERE Quantity > 5 AND `Ship Mode` = 'First Class'
Database: superstore
Question: Please list any three orders that caused a loss to the company.
Evidence: caused a loss to the company refers to Profit < 0
SQL: SELECT `Order ID` FROM central_superstore WHERE Profit < 0 LIMIT 3
Database: superstore
Question: Which product did Phillina Ober buy?
Evidence: product refers to "Product Name"
SQL: SELECT DISTINCT T3.`Product Name` FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T1.`Customer Name` = 'Phillina Ober'
Database: superstore
Question: Who was the customer in the South Region superstore who bought the most “Hon Multipurpose Stacking Arm Chairs"?
Evidence: customer refers to "Customer Name"; “Hon Multipurpose Stacking Arm Chairs" is the "Product Name";
SQL: SELECT T2.`Customer Name` FROM south_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T3.`Product Name` = 'Hon Multipurpose Stacking Arm Chairs' GROUP BY T2.`Customer Name` ORDER BY COUNT(T2.`Customer Name`) DESC LIMIT 1
Database: superstore
Question: What is the profit from selling the "O'Sullivan Living Dimensions 2-Shelf Bookcases"?
Evidence: "O'Sullivan Living Dimensions 2-Shelf Bookcases" refers to "Product Name"
SQL: SELECT DISTINCT T1.Profit FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Product Name` = 'O''Sullivan Living Dimensions 2-Shelf Bookcases'
Database: superstore
Question: How many of the "Hon Pagoda Stacking Chairs" have been sold in total in the west superstore?
Evidence: Hon Pagoda Stacking Chairs' is the "Product Name"; west superstore refers to Region = 'West'
SQL: SELECT SUM(T1.Quantity) FROM west_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Product Name` = 'Hon Pagoda Stacking Chairs'
Database: superstore
Question: How many orders purchased by Aaron Bergman have been delivered with the slowest shipping speed?
Evidence: slowest shipping speed refers to "Ship Mode" = 'Standard Class'
SQL: SELECT COUNT(*) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Customer Name` = 'Aaron Bergman' AND T2.`Ship Mode` = 'Standard Class'
Database: superstore
Question: What is the original price of the "Black Avery Flip-Chart Easel Binder"?
Evidence: "Black Avery Flip-Chart Easel Binder" is the "Product Name"; original price = divide(Sales, subtract(1, Discount))
SQL: SELECT T1.Sales / (1 - T1.Discount) FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Product Name` = 'Blackstonian Pencils'
Database: superstore
Question: What is the name of the product that Aimee Bixby bought?
Evidence: name of the product refers to "Product Name"
SQL: SELECT DISTINCT T3.`Product Name` FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T2.`Customer Name` = 'Aimee Bixby'
Database: superstore
Question: Indicate the profit of product Sauder Camden County Barrister Bookcase, Planked Cherry Finish.
Evidence: Sauder Camden County Barrister Bookcase, Planked Cherry Finish' refers to "Product Name"
SQL: SELECT DISTINCT T1.Profit FROM south_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Product Name` = 'Sauder Camden County Barrister Bookcase, Planked Cherry Finish'
Database: superstore
Question: How many furniture products had been shipped by standard class in the East superstore?
Evidence: furniture products refers to Category = 'Furniture'; shipped by standard class refers to "Ship Mode" = 'Standard Class'
SQL: SELECT COUNT(T2.Category) FROM east_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T1.`Ship Mode` = 'Standard Class'
Database: superstore
Question: What is the highest profit order in the East superstore of customers from Houston, Texas?
Evidence: highest profit refers to max(Profit); Houston, Texas refers to City = 'Houston' and State = 'Texas'
SQL: SELECT T1.`Order ID` FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T2.City = 'Houston' AND T2.State = 'Texas' ORDER BY T1.Profit DESC LIMIT 1
Database: superstore
Question: How many furniture products were ordered at central superstore?
Evidence: furniture products refers to Category = 'Furniture'
SQL: SELECT COUNT(*) FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.Category = 'Furniture'
Database: superstore
Question: What are the names of the products that had been shipped in March 2013 at central superstore?
Evidence: names of the products refers to Product Name; shipped in March 2013 refers to "Ship Date" = '2013-03%'
SQL: SELECT DISTINCT T2.`Product Name` FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE strftime('%Y-%m', T1.`Ship Date`) = '2013-03'
Database: superstore
Question: How many orders were made by customers who live in Texas at the Central superstore?
Evidence: customer live in Texas refers to State = 'Texas'
SQL: SELECT COUNT(DISTINCT T2.`Order ID`) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.State = 'Texas'
Database: superstore
Question: How many orders were made by Alan Barnes in 2015 at the Central superstore?
Evidence: in 2015 refers to "Order Date" = '2015%'
SQL: SELECT COUNT(DISTINCT T2.`Order ID`) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Customer Name` = 'Alan Barnes' AND STRFTIME('%Y', T2.`Order Date`) = '2015'
Database: superstore
Question: What is the product name of order CA-2011-115791 in the East superstore?
Evidence: order CA-2011-115791 refers to "Order ID" = 'CA-2011-115791'
SQL: SELECT DISTINCT T2.`Product Name` FROM east_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T1.`Order ID` = 'CA-2011-141817'
Database: superstore
Question: What is the percentage of orders with 0.2 discount in the Central superstore were purchased by customers who live in Texas?
Evidence: live in Texas refers to State = 'Texas'; percentage = divide(sum(Order ID) when Discount = 0.2, sum(Order ID)) as percentage
SQL: SELECT CAST(SUM(CASE  WHEN T2.Discount = 0.2 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 T1.State = 'Texas'
Database: superstore
Question: What is the percentage of furniture orders that were shipped through first class in 2013 at the Central superstore?
Evidence: furniture refers to Category = 'Furniture'; shipped through first class in 2013 refers to ship mode = 'first class' and "Ship Date" = '2013%'; percentage = divide(sum(Order ID) when Category = 'Furniture' and "Ship Date" = '2013%', sum(Order ID)) as percentage
SQL: SELECT CAST(SUM(CASE  WHEN T1.`Ship Mode` = 'First Class' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.Category = 'Furniture' AND STRFTIME('%Y', T1.`Ship Date`) = '2013'
Database: superstore
Question: Who order from the west region on August 12, 2013, and received a discount of 0.2?
Evidence: Who refers to "Customer Name"; on August 12, 2013 refers to "Order Date" = '2013-08-12'; discount of 0.2 refers to discount = 0.2
SQL: SELECT DISTINCT T2.`Customer Name` FROM west_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Order Date` = '2013-08-12' AND T1.Discount = 0.2 AND T1.Region = 'West'
Database: superstore
Question: What is the order ID of the security-Tint Envelopes product ordered on June 3, 2013, in the Central region?
Evidence: Security-Tint Envelopes' refers to "Product Name"; ordered on June 3, 2013 refers to "Order Date" = '2013-06-03'
SQL: SELECT DISTINCT T1.`Order ID` FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Product Name` = 'Security-Tint Envelopes' AND T1.`Order Date` = '2013-06-03'
Database: superstore
Question: List the product's name bought by the customer named Bill Shonely from the Central region.
SQL: SELECT DISTINCT T3.`Product Name` FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T1.`Customer Name` = 'Bill Shonely' AND T2.Region = 'Central'
Database: superstore
Question: Please give the name of customers from the West region that bought exactly 8 items in their purchase.
Evidence: name of customers refers to "Customer Name"; bought exactly 8 items refers to Quantity = 8
SQL: SELECT DISTINCT T2.`Customer Name` FROM west_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.Quantity = 8 AND T1.Region = 'West'
Database: superstore
Question: Among the customers from Houston, Texas, what is the total profit of their orders in the Central region?
Evidence: customers from Houston, Texas refers to State = 'Texas' and City = 'Houston'; total profit = sum(Profit)
SQL: SELECT SUM(T2.Profit) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T1.City = 'Houston' AND T1.State = 'Texas' AND T2.Region = 'Central'
Database: superstore
Question: Who is the customer with an order shipped on March 5, 2013, in the eastern region?
Evidence: Who is the customer refers to Customer Name; shipped on March 5, 2013 refers to "Ship Date" = '2013-03-05'; eastern region refers to Region = 'East'
SQL: SELECT DISTINCT T2.`Customer Name` FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Ship Date` = '2013-03-05'
Database: superstore
Question: Among the orders from 2016 in the Central region, what is the product with the lowest profit?
Evidence: orders from 2016 refers to "Order Date" = '2016%'; product refers to "Product Name"; lowest profit refers to min(Profit)
SQL: SELECT T2.`Product Name` FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.Region = 'Central' AND STRFTIME('%Y', T1.`Order Date`) = '2016' ORDER BY T1.Profit ASC LIMIT 1
Database: superstore
Question: Who ordered the order ID CA-2011-118976 from the East region?
Evidence: Who refers to "Customer Name"
SQL: SELECT DISTINCT T2.`Customer Name` FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Order ID` = 'CA-2011-118976' AND T2.Region = 'East'
Database: superstore
Question: Provide the product's name of the product with the highest sales in the South region.
Evidence: highest sales refers to max(Sales)
SQL: SELECT T2.`Product Name` FROM south_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.Region = 'South' ORDER BY T1.Sales DESC LIMIT 1
Database: superstore
Question: List down the sales, profit, and subcategories of the product ordered in the order ID US-2011-126571 in the East region.
SQL: SELECT T1.Sales, T1.Profit, T2.`Sub-Category` FROM east_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T1.`Order ID` = 'US-2011-126571' AND T2.Region = 'East'
Database: superstore
Question: What is the product's name in the highest quantity in a single purchase?
Evidence: highest quantity refers to max(Quantity)
SQL: SELECT T2.`Product Name` FROM east_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.Region = 'East' ORDER BY T1.Quantity DESC LIMIT 1
Database: superstore
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
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
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
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
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
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
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
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
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
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'