context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Determine the number of shipments delivered by Andrea Simons to Huntsville in 2016.
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN driver AS T3 ON T3.driver_id = T1.driver_id WHERE T3.first_name = 'Andrea' AND T3.last_name = 'Simons' AND T2.city_name = 'Huntsville' AND STRFTIME('%Y', T1.ship_date) = '2016'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
How many shipments does each driver deliver per month on average?
SELECT CAST(COUNT(*) AS REAL) / (12 * COUNT(T2.driver_id)) FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Among all shipments placed by Sunguard Window Tinting & Truck Accessories in 2017, identify the percentage of shipments whose weight exceeded 10,000 pounds.
SELECT CAST(SUM(CASE WHEN T1.weight >= 10000 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T2.cust_name = 'Sunguard Window Tinting & Truck Accessories' AND STRFTIME('%Y', T1.ship_date) = '2017'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Among all shipments delivered by Sue Newel, identify the percentage of shipments that were placed by Autoware Inc.
SELECT CAST(SUM(CASE WHEN T3.cust_name = 'Autoware Inc' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) AS per FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id INNER JOIN customer AS T3 ON T3.cust_id = T1.cust_id WHERE T2.first_name = 'Sue' AND T2.last_name = 'Newell'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
How many cities which belong to New Jersey have transported weight greater than 20000?
SELECT COUNT(*) FROM ( SELECT T2.city_id AS CITYID FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T2.state = 'New Jersey' GROUP BY T2.city_id HAVING SUM(T1.weight) > 20000 )
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
How many cities whose polulation is larger than 50000 pounds have shipment in 2017?
SELECT COUNT(*) FROM city AS T1 INNER JOIN shipment AS T2 ON T1.city_id = T2.city_id WHERE T1.population > 50000 AND STRFTIME('%Y', T2.ship_date) = '2017'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
State the weight of shipments transported by Peterbilt.
SELECT T2.weight FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE make = 'Peterbilt'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
What is the model year of the truck used in shipment id 1003?
SELECT T1.model_year FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T2.ship_id = '1003'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
What is the brand of truck used in shipment id 1011?
SELECT T1.make FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T2.ship_id = '1011'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
What is the first name of the driver who transported shipment id 1028?
SELECT T2.first_name, T2.last_name FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.ship_id = 1028
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
List out the state of driver who transported the shipment id 1055.
SELECT T2.state FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.ship_id = '1055'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
State the address of drivers who transported the shipment with weight greater than 50000 pounds.
SELECT T2.address FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id GROUP BY T2.driver_id HAVING SUM(T1.weight) > 50000
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Give the full name of driver who transported the items on 3/2/2016.
SELECT T2.first_name, T2.last_name FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.ship_date = '2016-03-02'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
What is the average annual revenue of customers who have shipment weight of less than 65000 pounds?
SELECT AVG(T1.annual_revenue) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE T2.weight < 65000
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
What is the percentage of wholesaler customers who have shipment weight of not greater than 70000 pounds?
SELECT CAST(SUM(CASE WHEN T2.weight < 70000 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE T1.cust_type = 'wholesaler'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
What is the last name of driver who transported shipment id 1088?
SELECT T2.last_name FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.ship_id = '1088'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Give the phone of drivers who transported shipment weight of greater than 20000 pounds.
SELECT T2.phone FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id GROUP BY T2.driver_id HAVING SUM(T1.weight) > 20000
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
What is the brand and model of truck used in shipment id 1055?
SELECT T1.make, T1.model_year FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T2.ship_id = '1055'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
How many trucks were manufactured in year 2009?
SELECT COUNT(truck_id) FROM truck WHERE model_year = 2009
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
How many customers are manufacturer?
SELECT COUNT(*) FROM customer WHERE cust_type = 'manufacturer'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
How many customers who live in California that are retailers?
SELECT COUNT(*) FROM customer WHERE cust_type = 'retailer' AND state = 'CA'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
How many cities are in Connecticut?
SELECT COUNT(*) FROM city WHERE state = 'Connecticut'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
What is the most populated city in California?
SELECT city_name FROM city WHERE state = 'California' AND population = ( SELECT MAX(population) FROM city WHERE state = 'California' )
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
What is the annual revenue of Klett & Sons Repair?
SELECT annual_revenue FROM customer WHERE cust_name = 'Klett & Sons Repair'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Who is the driver that transported the lightest weight of shipment? Provide the full name of the driver.
SELECT T2.first_name, T2.last_name FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id ORDER BY T1.weight ASC LIMIT 1
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
How many shipments were shipped to customers living in California in year 2016?
SELECT COUNT(*) AS per FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE STRFTIME('%Y', T2.ship_date) = '2016' AND T1.state = 'CA'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
What is the brand of the truck that is used to ship by Zachery Hicks?
SELECT DISTINCT T1.make FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id INNER JOIN driver AS T3 ON T3.driver_id = T2.driver_id WHERE T3.first_name = 'Zachery' AND T3.last_name = 'Hicks'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
List all the name of the customers that received a shipment in February 2017.
SELECT T1.cust_name FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE T2.ship_date LIKE '2017-02%'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Provide the brand of the truck and the name of the driver that transported goods in Klett & Sons Repair.
SELECT T3.make, T4.first_name, T4.last_name FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id INNER JOIN truck AS T3 ON T3.truck_id = T2.truck_id INNER JOIN driver AS T4 ON T4.driver_id = T2.driver_id WHERE T1.cust_name = 'Klett & Sons Repair'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
What is the shipment ID of the heaviest shipment that Zachery Hicks transported?
SELECT T1.ship_id FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T2.first_name = 'Zachery' AND T2.last_name = 'Hicks' ORDER BY T1.weight DESC LIMIT 1
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
How many shipments did Zachery Hicks transport goods to New York in the year 2016?
SELECT COUNT(*) FROM city AS T1 INNER JOIN shipment AS T2 ON T1.city_id = T2.city_id INNER JOIN driver AS T3 ON T3.driver_id = T2.driver_id WHERE T3.first_name = 'Zachery' AND T3.last_name = 'Hicks' AND T1.city_name = 'New York' AND STRFTIME('%Y', T2.ship_date) = '2016'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Which headquarter's truck has the highest shipments in year 2016?
SELECT CASE WHEN T2.make = 'Peterbilt' THEN 'Texas (TX)' WHEN T2.make = 'Mack' THEN 'North Carolina (NC)' WHEN T2.make = 'Kenworth' THEN 'Washington (WA)' END AS "result" FROM shipment AS T1 INNER JOIN truck AS T2 ON T1.truck_id = T2.truck_id WHERE CAST(T1.ship_date AS DATE) = 2016 GROUP BY T2.make ORDER BY COUNT(T1.ship_id) DESC LIMIT 1
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
How many shipments were shipped to the least populated city in California?
SELECT COUNT(T3.city_name) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id INNER JOIN city AS T3 ON T3.city_id = T2.city_id WHERE T3.state = 'California' ORDER BY T3.population ASC LIMIT 1
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
In which city did the heaviest shipment transported?
SELECT T2.city_name FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id ORDER BY T1.weight DESC LIMIT 1
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
List all the cities where Zachery Hicks transported goods.
SELECT DISTINCT T3.city_name FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id INNER JOIN city AS T3 ON T1.city_id = T3.city_id WHERE T2.first_name = 'Zachery' AND T2.last_name = 'Hicks'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Calculate the average number of shipments that Zachery Hicks shipped in year 2017.
SELECT CAST(SUM(CASE WHEN T2.first_name = 'Zachery' AND T2.last_name = 'Hicks' THEN T1.ship_id ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE STRFTIME('%Y', T1.ship_date) = '2017'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Calculate the percentage of the weight of goods being transported by Zachery Hicks to California in year 2016.
SELECT CAST(SUM(CASE WHEN T2.first_name = 'Zachery' AND T2.last_name = 'Hicks' THEN T1.weight ELSE 0 END) AS REAL) * 100 / SUM(T1.weight) FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE STRFTIME('%Y', T1.ship_date) = '2016'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
How many shipments were shipped by the driver named Zachary Hicks?
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.driver_id = 23
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
What is the ship ID of shipments shipped to the city with the largest area?
SELECT T1.ship_id FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id ORDER BY T2.area DESC LIMIT 1
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
List the drivers who shipped the shipments to the least populated city.
SELECT T3.first_name, T3.last_name FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN driver AS T3 ON T3.driver_id = T1.driver_id ORDER BY T2.population ASC LIMIT 1
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Among the shipments shipped to Cicero, Illinois, how many shipments weighed between 9,000 to 15,000?
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T2.city_name = 'Cicero' AND T2.state = 'Illinois' AND T1.weight BETWEEN 9000 AND 15000
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
What model year of truck delivered the ship ID 1233?
SELECT T1.model_year FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T2.ship_id = '1233'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
What is the address of the driver that delivers the shipment for the customer lives at 7052 Carroll Road, San Diego, California?
SELECT T3.address FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id INNER JOIN driver AS T3 ON T3.driver_id = T1.driver_id WHERE T2.address = '7052 Carroll Road' AND T2.city = 'San Diego' AND T2.state = 'CA'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Among the shipments delivered by Maria Craft, how many shipments were delivered in 2017?
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T2.first_name = 'Maria' AND T2.last_name = 'Craft' AND STRFTIME('%Y', T1.ship_date) = '2017'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
What is the truck's model year used to ship the ship ID 1245?
SELECT T1.model_year FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T2.ship_id = '1245'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Where does the driver of ship ID 1127 live?
SELECT T2.address FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.ship_id = '1127'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Give the annual revenue of the customer of ship ID 1047.
SELECT T2.annual_revenue FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T1.ship_id = '1047'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
What is the weight of the shipment delivered by Andrea Simons on March 7, 2016?
SELECT T1.weight FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T2.first_name = 'Andrea' AND T2.last_name = 'Simons' AND T1.ship_date = '2016-03-07'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Provide the destination city of the shipment shipped by January 16, 2017.
SELECT T2.city_name FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T1.ship_date = '2017-01-16'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
How many shipments were delivered to a customer from New York?
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T2.state = 'NY'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
What is the name of the customer of ship ID 1147?
SELECT T2.cust_name FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T1.ship_id = '1147'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
List the ship ID of shipments shipped to the most populated city.
SELECT T1.ship_id FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id ORDER BY T2.population DESC LIMIT 1
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
List the driver's name of the shipment shipped on February 22, 2016.
SELECT T2.first_name, T2.last_name FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.ship_date = '2016-02-22'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
List the weight of the customer's shipment with annual revenue of 39448581.
SELECT T1.weight FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T2.annual_revenue = 39448581
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
What is the customer's address for the shipment with ship ID 1117?
SELECT T2.address FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T1.ship_id = '1117'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Among the shipments to a customer from Texas, what percentage of the shipments shipped in 2017?
SELECT CAST(SUM(CASE WHEN STRFTIME('%Y', T1.ship_date) = '2017' THEN 1 ELSE 0 END) AS REAL ) * 100 / COUNT(*) FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T2.state = 'TX'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Calculate the difference between the number of shipments shipped by the truck with the model year 2005 and model year 2006.
SELECT SUM(CASE WHEN T1.model_year = '2005' THEN 1 ELSE 0 END) - SUM(CASE WHEN T1.model_year = '2006' THEN 1 ELSE 0 END) FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
List the driver's name of the shipment with a weight greater than 95% of the average weight of all shipments.
SELECT T2.first_name, T2.last_name FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.weight * 100 > ( SELECT 95 * AVG(weight) FROM shipment )
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
Name the longest Catalan language Wikipedia page title and state the number of different words in this page.
SELECT title, words FROM pages WHERE title = ( SELECT MAX(LENGTH(title)) FROM pages )
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
List all the Catalan language wikipedia page title with less than 10 number of different words in these pages.
SELECT title FROM pages WHERE words < 10
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
List the page number for Catalan language wikipedia pages containing the word 'Art' in the page title.
SELECT page FROM pages WHERE title LIKE 'Art%' OR title LIKE '%Art%' OR title LIKE '%Art'
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
What is the title of Catalan language wikipedia page with revision page id '16203226'?
SELECT title FROM pages WHERE revision = 16203226
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
List the titles for all Catalan language wikipedia page from revision page id 106600 to 106700.
SELECT title FROM pages WHERE revision BETWEEN 106600 AND 106700
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
How many Catalan language wikipedia pages have between 1000 to 2000 number of different words?
SELECT COUNT(pid) FROM pages WHERE words BETWEEN 1000 AND 2000
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
List the page id of wikipedia about Catalan language which have the appearance of the word 'decimal'?
SELECT T2.pid FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid WHERE T1.word = 'decimal'
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
Which word has the most occurrences within the same page of wikipedia about Catalan language?
SELECT T1.word FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid WHERE T2.occurrences = ( SELECT MAX(occurrences) FROM pages_words )
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
List all the first words of the biwords pair where the second word is 'antic'.
SELECT T1.word FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w1st WHERE T2.w2nd = ( SELECT wid FROM words WHERE word = 'antic' )
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
Show all the title of pages and number of occurences for each page where the word 'quipu' appears.
SELECT T1.title, T2.occurrences FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid INNER JOIN words AS T3 ON T2.wid = T3.wid WHERE T3.word = 'quipu'
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
Calculate the average number of the word occurrences in which ‘system’ appeared as the first word in the pair.
SELECT AVG(T2.occurrences) FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w1st WHERE T2.w1st = ( SELECT wid FROM words WHERE word = 'sistema' )
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
What is the total pages of Wikipedia in Catalan language?
SELECT pages FROM langs WHERE lang = 'ca'
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
In the Catalan language, which biwords pair appeared the most in this language/page?
SELECT w1st, w2nd FROM biwords WHERE occurrences = ( SELECT MAX(occurrences) FROM biwords )
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
What is the word id of the catalan language that was repeated no more than 10 times in the said language?
SELECT wid FROM langs_words WHERE occurrences <= 10
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
What is the title of the Catalan language Wikipedia page that has the highest number of different words?
SELECT title FROM pages WHERE words = ( SELECT MAX(words) FROM pages )
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
What is the wikipedia page id of Arqueozoologia?
SELECT page FROM pages WHERE title = 'Arqueozoologia'
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
In Abadia, what is the word id of the of the Catalan language that appeared the highest amount of times? Indicate the how many times did they said word id appeared.
SELECT T2.wid, T2.occurrences FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid WHERE T1.title = 'Abadia' ORDER BY T2.occurrences DESC LIMIT 1
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
What are the titles of the top 5 Catalan language Wikipedia page with the least number of different words? Indicate each title's word id that has appeared the most in the said pages.
SELECT T1.title FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid ORDER BY T1.words LIMIT 5
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
How many times did the word pair "i" and "a" appeared in the Cataln language/page?
SELECT SUM(occurrences) FROM biwords WHERE w1st = 86 AND w2nd = 109
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
What are the word pairs that occured only twice?
SELECT T1.word, T3.word FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w1st INNER JOIN words AS T3 ON T3.wid = T2.w2nd WHERE T2.occurrences = 2
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
What is the word pair that occured the highest amount of times in Addicio? Indicate how many times such word pair occured.
SELECT T3.w1st, T3.w2nd, T3.occurrences FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid INNER JOIN biwords AS T3 ON T2.wid = T3.w1st OR T2.wid = T3.w2nd WHERE T1.title = 'Addicio' ORDER BY T3.occurrences DESC LIMIT 1
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
What is the total word of title "Adam" and "Acampada"?
SELECT SUM(words) FROM pages WHERE title IN ('Adam', 'Acampada')
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
What is the revision page ID of title "Aigua dolça"?
SELECT revision FROM pages WHERE title = 'Aigua dolça'
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
What is the title of corpus with most words?
SELECT title FROM pages WHERE words = ( SELECT MAX(words) FROM pages )
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
What is the average words of the 10 fewest words title?
SELECT CAST(SUM(CASE WHEN words >= 10 THEN words ELSE 0 END) AS REAL) / SUM(CASE WHEN words >= 10 THEN 1 ELSE 0 END) FROM pages
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
Among the title with single digit word count, list down 5 revision page ID of these titles.
SELECT revision FROM pages WHERE words < 10 LIMIT 5
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
List down the page id of titles start with alphabet "b".
SELECT pid FROM pages WHERE title LIKE 'b%'
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
What is the title of corpus where word "desena" appear?
SELECT T1.title FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid INNER JOIN words AS T3 ON T2.wid = T3.wid WHERE T3.word = 'desena'
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
What is the word id for title "Sometent"?
SELECT T2.wid FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid WHERE T1.title = 'Sometent'
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
Is word id "88" the word id for title "Animals"?
SELECT CASE WHEN COUNT(T1.pid) > 0 THEN 'YES' ELSE 'NO' END AS YORN FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid WHERE T2.wid = 88 AND T1.title = 'Animals'
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
What are the occurance of word "del" in title "Any anomalístic"?
SELECT T2.occurrences FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid INNER JOIN pages AS T3 ON T2.pid = T3.pid WHERE T1.word = 'del' AND T3.title = 'Any anomalístic'
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
State one biword pair with occurence of 4.
SELECT T1.word, T3.word FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w1st INNER JOIN words AS T3 ON T3.wid = T2.w2nd WHERE T2.occurrences = 4 LIMIT 1
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
What are the total occurence of words that paired with "nombre"?
SELECT SUM(T2.occurrences) FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w1st OR T1.wid = T2.w2nd WHERE T2.w1st IN (( SELECT wid FROM words WHERE word = 'nombre' ) OR T2.w2nd IN ( SELECT wid FROM words WHERE word = 'nombre' ))
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
What are the words that were paired with "John", list down 10 of them.
SELECT w2nd FROM biwords WHERE w1st = ( SELECT wid FROM words WHERE word = 'john' ) LIMIT 10
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
List down the revision page id of titles where "fresc" appears.
SELECT T3.revision FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid INNER JOIN pages AS T3 ON T2.pid = T3.pid WHERE T1.word = 'fresc'
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
List down the words with word id from 1 to 10 and write down a paired word for each of them.
SELECT T1.word AS W1, T3.word AS W2 FROM words AS T1 LEFT JOIN biwords AS T2 ON T1.wid = T2.w1st LEFT JOIN words AS T3 ON T3.wid = T2.w2nd WHERE T1.wid <= 10 GROUP BY T1.wid
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
For corpus title "Atomium", pick 3 words appear in the title and calculate the total occurence of these words.
SELECT T1.word, T1.occurrences FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid WHERE T2.pid = ( SELECT pid FROM pages WHERE title = 'Atomium' ) LIMIT 3
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
Indicate which is the word that is repeated the most times.
SELECT word FROM words WHERE occurrences = ( SELECT MAX(occurrences) FROM words )
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
Indicate the page id of Wikipedia about Catalan language of all the pages that have a numeric value in their title.
SELECT pid, title FROM pages WHERE title LIKE '%0%' OR '%1%' OR '%2%' OR '%3%' OR '%4%' OR '%5%' OR '%6%' OR '%7%' OR '%8%' OR '%9%'
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
What is the title of the page that has the fewest words?
SELECT title FROM pages WHERE title = ( SELECT MIN(words) FROM pages )
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
What is the pair of words that is repeated the most times? Identify them by their ID.
SELECT w1st, w2nd FROM biwords WHERE occurrences = ( SELECT MAX(occurrences) FROM biwords )
bird
CREATE TABLE language_corpus (lid integer, lang text, locale text, pages integer, words integer, pid integer, lid integer, page integer, revision integer, title text, words integer, wid integer, word text, occurrences integer, lid integer, wid integer, occurrences integer, pid integer, wid integer, occurrences integer, lid integer, w1st integer, w2nd integer, occurrences integer)
How many total occurrences are there in the three-letter words?
SELECT SUM(occurrences) FROM words WHERE LENGTH(word) = 3
bird