db_id
stringclasses
68 values
question
stringlengths
24
325
evidence
stringlengths
0
580
SQL
stringlengths
23
728
shipping
Provide the ship date of the first shipment to customers in South Carolina.
"South Carolina" refers to state = 'SC'; first shipment refers to Min(ship_date)
SELECT MIN(T1.ship_date) FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T2.state = 'SC'
shipping
For the shipment received by Leszek Kieltyka on 2017/9/25, what was its weight?
on 2017/9/25 refers to ship_date = '2017-09-25'
SELECT T1.weight FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T2.first_name = 'Leszek' AND T2.last_name = 'Kieltyka' AND T1.ship_date = '2017-09-25'
shipping
What is the area of the destination city of shipment No.1346?
shipment no. 1346 refers to ship_id = 1346
SELECT T2.area FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T1.ship_id = '1346'
shipping
Provide the weight of the shipment to U-haul Center Of N Syracuse on 2016/9/21.
"U-haul Center Of N Syracuse" is the cust_name; on 2016/9/21 refers to ship_date = '2016/09/21'
SELECT T1.weight FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T2.cust_name = 'U-haul Center Of N Syracuse' AND T1.ship_date = '2016-09-21'
shipping
Who was the driver of truck no.3 on 2016/9/19? Tell the full name.
truck no. 3 refers to truck_id = 3; on 2016/9/19 refers to ship_date = '2016-09-19'; full name refers to first_name, last_name
SELECT T3.first_name, T3.last_name 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 T1.truck_id = '3' AND T2.ship_date = '2016-09-19'
shipping
Calculate the population density of the city as the destination of shipment no.1369.
shipment no. 1369 refers to ship_id = 1369; population density refers to Divide (area, population)
SELECT T2.area / T2.population FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T1.ship_id = '1369'
shipping
What is the average number of shipments done by the Kenworth trucks?
"Kenworth" is the make of truck; average = Divide (Count(ship_id where make = 'Kenworth'), Count(truck_id where make = 'Kenworth))
SELECT CAST(COUNT(T2.ship_id) AS REAL) / COUNT(DISTINCT T1.truck_id) FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T1.make = 'Kenworth'
shipping
How many pounds did Sue Newell transport during her first shipment?
first shipment refers to Min(ship_date); pounds refers to weight
SELECT T1.weight FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T2.first_name = 'Sue' AND T2.last_name = 'Newell' ORDER BY T1.ship_date ASC LIMIT 1
shipping
To whom did the company transport its heaviest shipment?
heaviest shipment refers to Max(weight)
SELECT T2.cust_name FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id ORDER BY T1.weight DESC LIMIT 1
shipping
What is the full name of the driver who transported the first shipment of the company?
first shipment of the company refers to Min(ship_date); full name refers to first_name, last_name
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.ship_date ASC LIMIT 1
shipping
In total, how many shipments were transported to Olympic Camper Sales Inc?
"Olympic Camper Sales Inc" is the cust_name
SELECT COUNT(T2.ship_id) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE T1.cust_name = 'Olympic Camper Sales Inc'
shipping
How many of the shipments bound for New York City were shipped to Harry's Hot Rod Auto and Truck Accessories?
"New York" is the city_name; 'Harry's Hot Rod Auto & Truck Accessories' is the cust_name
SELECT COUNT(*) 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.city_name = 'New York' AND T1.cust_name = 'Harry''s Hot Rod Auto & Truck Accessories'
shipping
What is the full name of the driver who delivered the most shipments to the least populated city?
least populated city refers to Min(population); fullname refers to first_name, last_name; most shipment refers to driver_id where Max(Count (ship_id))
SELECT T1.first_name, T1.last_name FROM driver AS T1 INNER JOIN shipment AS T2 ON T1.driver_id = T2.driver_id INNER JOIN city AS T3 ON T3.city_id = T2.city_id GROUP BY T1.first_name, T1.last_name, T3.population HAVING T3.population = MAX(T3.population) ORDER BY COUNT(*) DESC LIMIT 1
shipping
How many shipments did Holger Nohr transport to North Las Vegas overall?
"North Las Vegas" is the city_name
SELECT COUNT(*) FROM driver AS T1 INNER JOIN shipment AS T2 ON T1.driver_id = T2.driver_id INNER JOIN city AS T3 ON T3.city_id = T2.city_id WHERE T1.first_name = 'Holger' AND T1.last_name = 'Nohr' AND T3.city_name = 'North Las Vegas'
shipping
Determine the percentage of manufacturers who are from Texas among all of Lorenzo's customers.
"Texas" refers to state = 'TX'; 'manufacturer' is the cust_type; percentage = Divide (Count(cust_id where state = 'TX'), Count(cust_id)) * 100
SELECT CAST(SUM(CASE WHEN cust_type = 'manufacturer' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM customer WHERE state = 'TX'
shipping
What was the maximum weight of the shipment carried to Boston? Name the customer of that shipment.
"Boston" is the city_name; maximum weight refers to Max(weight); customer refers to cust_name
SELECT T1.weight, T2.cust_name FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id INNER JOIN city AS T3 ON T3.city_id = T1.city_id WHERE T3.city_name = 'Boston' ORDER BY T1.weight DESC LIMIT 1
shipping
Where was shipment no. 1002 headed?
shipment no. 1002 refers to ship_id = 1002; where shipment was headed refers to city_name
SELECT T2.city_name FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T1.ship_id = '1002'
shipping
What is the average shipment weight carried by the oldest Mack?
"Mack" is the make; oldest refers to Min(model_year); average shipment weight refers to AVG(weight)
SELECT AVG(T2.weight) FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T1.make = 'Mack'
shipping
Identify the full name of the driver who delivered a shipment to the city of New York in February 2016.
"New York" is the city_name; in February 2016 refers to ship_date LIKE '2016-02%'; full name refers to first_name, last_name
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 WHERE T2.city_name = 'New York' AND T1.ship_date LIKE '2016-02%'
shipping
Name the customer who sent the shipment to Oak Park.
"Oak Park" is the city_name; customer name refers to cust_name
SELECT T2.cust_name FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id INNER JOIN city AS T3 ON T3.city_id = T1.city_id WHERE T3.city_name = 'Oak Park'
shipping
How many shipments does each driver deliver per month on average?
shipment data was for 24 months in 2016 and 2017 respectively; deliver per month on average refers to Divide(Count(ship_id), Multiply (24, Count(driver_id)))
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
shipping
Among all shipments delivered by Sue Newel, identify the percentage of shipments that were placed by Autoware Inc.
"Autoware Inc" is the cust_name; percentage = Divide (Count(ship_id where cust_name = 'Autoware Inc'), Count(ship_id)) * 100
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'
shipping
How many cities which belong to New Jersey have transported weight greater than 20000?
"New Jersey" is the state; transported weight greater than 20000 refers to Sum(weight) > 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 )
shipping
State the weight of shipments transported by Peterbilt.
"Peterbilt" is the make
SELECT T2.weight FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE make = 'Peterbilt'
shipping
What is the model year of the truck used in shipment id 1003?
shipment id 1003 refers to ship_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'
shipping
What is the brand of truck used in shipment id 1011?
shipment id 1011 refers to ship_id = 1011; brand of truck refers to make
SELECT T1.make FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T2.ship_id = '1011'
shipping
What is the first name of the driver who transported shipment id 1028?
shipment id 1028 refers to ship_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
shipping
List out the state of driver who transported the shipment id 1055.
shipment id 1055 refers to ship_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'
shipping
State the address of drivers who transported the shipment with weight greater than 50000 pounds.
shipment with weight greater than 50000 pounds refers to Sum(weight) > 50000
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
shipping
Give the full name of driver who transported the items on 3/2/2016.
on 3/2/2016 refers to ship_date = '2016-02-03'; full name refers to first_name, last_name
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'
shipping
What is the average annual revenue of customers who have shipment weight of less than 65000 pounds?
weight of less than 65000 pounds refers to weight < 65000; average annual revenue refers to AVG(annual_revenue)
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
shipping
What is the percentage of wholesaler customers who have shipment weight of not greater than 70000 pounds?
"wholesaler" is the cust_type; weight of not greater than 70000 pounds refers to weight < 70000; percentage = Divide (Count(cust_id where weight < 70000), Count(cust_id)) * 100
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'
shipping
What is the last name of driver who transported shipment id 1088?
shipment id 1088 refers to ship_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'
shipping
Give the phone of drivers who transported shipment weight of greater than 20000 pounds.
shipment weight of greater than 20000 pounds refers to Sum(weight) > 20000
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
shipping
What is the brand and model of truck used in shipment id 1055?
shipment id 1055 refers to ship_id = 1055; brand refers to make; model refers to model_year
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'
shipping
How many trucks were manufactured in year 2009?
manufactured in year 2009 refers to model_year = 2009
SELECT COUNT(truck_id) FROM truck WHERE model_year = 2009
shipping
How many customers are manufacturer?
"manufacturer" is the cust_type
SELECT COUNT(*) FROM customer WHERE cust_type = 'manufacturer'
shipping
How many customers who live in California that are retailers?
"retailer" is the cust_type; live in California refers to state = 'CA'
SELECT COUNT(*) FROM customer WHERE cust_type = 'retailer' AND state = 'CA'
shipping
How many cities are in Connecticut?
"Connecticut" is the state
SELECT COUNT(*) FROM city WHERE state = 'Connecticut'
shipping
What is the most populated city in California?
in California refers to state = 'CA'; most populated city refers to Max(population)
SELECT city_name FROM city WHERE state = 'California' AND population = ( SELECT MAX(population) FROM city WHERE state = 'California' )
shipping
What is the annual revenue of Klett & Sons Repair?
"Klett & Sons Repair" is the cust_name
SELECT annual_revenue FROM customer WHERE cust_name = 'Klett & Sons Repair'
shipping
Who is the driver that transported the lightest weight of shipment? Provide the full name of the driver.
lightest weight refers to Min(weight); full name refers to first_name, last_name
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
shipping
What is the brand of the truck that is used to ship by Zachery Hicks?
brand of truck refers to make
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'
shipping
List all the name of the customers that received a shipment in February 2017.
shipment in February 2017 refers to ship_date LIKE '2017-02-%'; name of customer refers to cust_name
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%'
shipping
Provide the brand of the truck and the name of the driver that transported goods in Klett & Sons Repair.
"Klett & Sons Repair" is the cust_name; brand of truck refers to make; name of driver refers to first_name, last_name
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'
shipping
What is the shipment ID of the heaviest shipment that Zachery Hicks transported?
shipment ID refers to ship_id; heaviest shipment refers to Max(weight)
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
shipping
In which city did the heaviest shipment transported?
heaviest shipment refers to Max(weight); city refers to city_name
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
shipping
List all the cities where Zachery Hicks transported goods.
city refers to city_name
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'
shipping
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
shipping
What is the ship ID of shipments shipped to the city with the largest area?
city with largest area refers to Max(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
shipping
List the drivers who shipped the shipments to the least populated city.
least populated city refers to Min(population); name refers to first_name, last_name
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
shipping
Among the shipments shipped to Cicero, Illinois, how many shipments weighed between 9,000 to 15,000?
"Cicero" is the city; 'Illinois' is the state
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
shipping
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'
shipping
What is the address of the driver that delivers the shipment for the customer lives at 7052 Carroll Road, San Diego, California?
"7052 Carroll Road" is the address of customer; 'San Diego' is the city; 'California' is the state
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'
shipping
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'
shipping
Where does the driver of ship ID 1127 live?
live refers to address
SELECT T2.address FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.ship_id = '1127'
shipping
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'
shipping
What is the weight of the shipment delivered by Andrea Simons on March 7, 2016?
on March 7, 2016 refers to ship_date = '2016-03-07'
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'
shipping
Provide the destination city of the shipment shipped by January 16, 2017.
January 16, 2017 refers to ship_date = '2017-01-16'; city refers to city_name
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'
shipping
How many shipments were delivered to a customer from New York?
"New York" refers to state = 'NY'
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T2.state = 'NY'
shipping
What is the name of the customer of ship ID 1147?
name of customer refers to cust_name
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'
shipping
List the ship ID of shipments shipped to the most populated city.
most populated city refers to Max(population)
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
shipping
List the driver's name of the shipment shipped on February 22, 2016.
on February 22, 2016 refers to ship_date = '2016-02-22'; driver's name refers to first_name, last_name
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'
shipping
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
shipping
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'
shipping
Calculate the difference between the number of shipments shipped by the truck with the model year 2005 and model year 2006.
"2005" and "2006" are both model_year of truck; difference = Subtract (Count (ship_id where model_year = 2005), Count(ship_id where 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
shipping
List the driver's name of the shipment with a weight greater than 95% of the average weight of all shipments.
weight greater than 95% of average weight refers to weight > Multiply (AVG(weight), 0.95); driver name refers to first_name, last_name
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 )
language_corpus
List all the Catalan language wikipedia page title with less than 10 number of different words in these pages.
less than 10 number of different words refers to words < 10
SELECT title FROM pages WHERE words < 10
language_corpus
List the page number for Catalan language wikipedia pages containing the word 'Art' in the page title.
containing the word 'Art' refers to title LIKE '% Art %'
SELECT page FROM pages WHERE title LIKE 'Art%' OR title LIKE '%Art%' OR title LIKE '%Art'
language_corpus
What is the title of Catalan language wikipedia page with revision page id '16203226'?
revision page id '16203226' refers to revision = 16203226
SELECT title FROM pages WHERE revision = 16203226
language_corpus
List the titles for all Catalan language wikipedia page from revision page id 106600 to 106700.
from revision page id 106600 to 106700 refers to revision BETWEEN 106600 AND 106700
SELECT title FROM pages WHERE revision BETWEEN 106600 AND 106700
language_corpus
How many Catalan language wikipedia pages have between 1000 to 2000 number of different words?
between 1000 to 2000 number of different words refers to words BETWEEN 1000 AND 2000
SELECT COUNT(pid) FROM pages WHERE words BETWEEN 1000 AND 2000
language_corpus
List the page id of wikipedia about Catalan language which have the appearance of the word 'decimal'?
have the appearance of 'decimal' refers to word = 'decimal'
SELECT T2.pid FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid WHERE T1.word = 'decimal'
language_corpus
Which word has the most occurrences within the same page of wikipedia about Catalan language?
most occurrences refers to max(occurrences)
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 )
language_corpus
List all the first words of the biwords pair where the second word is 'antic'.
first words refer to w1st.word; second word is 'antic' refers to w2nd.word = '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' )
language_corpus
Show all the title of pages and number of occurences for each page where the word 'quipu' appears.
word 'quipu' appears refers to word = 'quipu'
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'
language_corpus
Calculate the average number of the word occurrences in which ‘system’ appeared as the first word in the pair.
average word occurrences = divide(sum(occurrences), count(occurrences)); ‘system’ appeared as the first word refers to w1st = 'system'
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' )
language_corpus
What is the total pages of Wikipedia in Catalan language?
total pages refers to sum(pages); Catalan language refers to lang = 'ca'
SELECT pages FROM langs WHERE lang = 'ca'
language_corpus
In the Catalan language, which biwords pair appeared the most in this language/page?
biwords pair refers to w1st.word w2nd.word; appeared the most refers to max(occurrences)
SELECT w1st, w2nd FROM biwords WHERE occurrences = ( SELECT MAX(occurrences) FROM biwords )
language_corpus
What is the word id of the catalan language that was repeated no more than 10 times in the said language?
word id refers to wid; repeated no more than 10 times refers to occurrences < = 10
SELECT wid FROM langs_words WHERE occurrences <= 10
language_corpus
What is the title of the Catalan language Wikipedia page that has the highest number of different words?
highest number of different words refers to max(words)
SELECT title FROM pages WHERE words = ( SELECT MAX(words) FROM pages )
language_corpus
What is the wikipedia page id of Arqueozoologia?
page id refers to pid; Arqueozoologia refers to title = 'Arqueozoologia'
SELECT page FROM pages WHERE title = 'Arqueozoologia'
language_corpus
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.
Abadia refers to title = 'Abadia'; word id refers to wid; the highest amount of times refers to max(occurrences)
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
language_corpus
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.
least number of different words refers to min(words); word id refers to wid; appeared the most refers to max(occurrences)
SELECT T1.title FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid ORDER BY T1.words LIMIT 5
language_corpus
How many times did the word pair "i" and "a" appeared in the Cataln language/page?
times appeared refers to occurrences; word pair "i" and "a" refers to w1st.word = 'i' w2st.word = 'a'
SELECT SUM(occurrences) FROM biwords WHERE w1st = 86 AND w2nd = 109
language_corpus
What are the word pairs that occured only twice?
word pair refers to w1st.word w2nd.word; occured only twice refers to occurrences = 2
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
language_corpus
What is the total word of title "Adam" and "Acampada"?
total word refers to sum(words); title "Adam" and "Acampada" refers to title IN('Adam','Acampada')
SELECT SUM(words) FROM pages WHERE title IN ('Adam', 'Acampada')
language_corpus
What is the title of corpus with most words?
most words refers to max(words)
SELECT title FROM pages WHERE words = ( SELECT MAX(words) FROM pages )
language_corpus
What is the average words of the 10 fewest words title?
average words = avg(words); 10 fewest words refers to words > = 10
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
language_corpus
Among the title with single digit word count, list down 5 revision page ID of these titles.
single digit word count refers to words < 10
SELECT revision FROM pages WHERE words < 10 LIMIT 5
language_corpus
What is the title of corpus where word "desena" appear?
This is not
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'
language_corpus
What is the word id for title "Sometent"?
word id refers to wid
SELECT T2.wid FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid WHERE T1.title = 'Sometent'
language_corpus
Is word id "88" the word id for title "Animals"?
word id "88" refers to wid = 88
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'
language_corpus
State one biword pair with occurence of 4.
biword pair refers to w1st.word w2nd.word; occurrence of 4 refers to occurrences = 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
language_corpus
What are the words that were paired with "John", list down 10 of them.
pair with "John" refers to w1st.word = "John" or w2nd.word = "John"
SELECT w2nd FROM biwords WHERE w1st = ( SELECT wid FROM words WHERE word = 'john' ) LIMIT 10
language_corpus
List down the revision page id of titles where "fresc" appears.
page id refers to pid; "fresc" refers to word = 'fresc'
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'
language_corpus
For corpus title "Atomium", pick 3 words appear in the title and calculate the total occurence of these words.
total occurrences refers to sum(occurrences)
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
language_corpus
Indicate which is the word that is repeated the most times.
repeated the most times refer to MAX(occurrences);
SELECT word FROM words WHERE occurrences = ( SELECT MAX(occurrences) FROM words )
language_corpus
What is the pair of words that is repeated the most times? Identify them by their ID.
repeated the most times refer to MAX(occurrences); pair is a relationship of two words: w1st and w2nd, where w1st is word id of the first word and w2nd is a word id of the second word;
SELECT w1st, w2nd FROM biwords WHERE occurrences = ( SELECT MAX(occurrences) FROM biwords )
language_corpus
How many total occurrences are there in the three-letter words?
three-letter words are words composed of exactly three letters;
SELECT SUM(occurrences) FROM words WHERE LENGTH(word) = 3