problem
stringlengths 121
422
| db_id
stringclasses 69
values | solution
stringlengths 23
804
|
---|---|---|
Write SQL query to solve given problem: Among the shipments for Downey, how many shipments were shipped to California in 2016?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | SELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN customer AS T3 ON T3.cust_id = T1.cust_id WHERE T2.city_name = 'Downey' AND STRFTIME('%Y', T1.ship_date) = '2016' AND T3.state = 'CA' |
Write SQL query to solve given problem: How many shipments did Holger Nohr transport to North Las Vegas overall?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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' |
Write SQL query to solve given problem: How many shipments were shipped to the most densely populated city?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | SELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id ORDER BY T2.area / T2.population DESC LIMIT 1 |
Write SQL query to solve given problem: Determine the percentage of manufacturers who are from Texas among all of Lorenzo's customers.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | SELECT CAST(SUM(CASE WHEN cust_type = 'manufacturer' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM customer WHERE state = 'TX' |
Write SQL query to solve given problem: Identify the total weight of shipments transported to San Mateo, California, in 2016.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | SELECT SUM(T1.weight) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T2.city_name = 'San Mateo' AND STRFTIME('%Y', T1.ship_date) = '2016' |
Write SQL query to solve given problem: Identify the total weight of shipments transported in 2016 by the newest Peterbilt.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | SELECT SUM(T2.weight) FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T1.make = 'Peterbilt' AND STRFTIME('%Y', T2.ship_date) = '2016' ORDER BY T1.model_year DESC LIMIT 1 |
Write SQL query to solve given problem: What was the maximum weight of the shipment carried to Boston? Name the customer of that shipment.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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 |
Write SQL query to solve given problem: Where was shipment no. 1002 headed?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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' |
Write SQL query to solve given problem: What is the average shipment weight carried by the oldest Mack?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | SELECT AVG(T2.weight) FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T1.make = 'Mack' |
Write SQL query to solve given problem: Identify the full name of the driver who delivered a shipment to the city of New York in February 2016.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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%' |
Write SQL query to solve given problem: Name the customer who sent the shipment to Oak Park.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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' |
Write SQL query to solve given problem: Determine the number of shipments delivered by Andrea Simons to Huntsville in 2016.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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' |
Write SQL query to solve given problem: How many shipments does each driver deliver per month on average?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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 |
Write SQL query to solve given problem: Among all shipments placed by Sunguard Window Tinting & Truck Accessories in 2017, identify the percentage of shipments whose weight exceeded 10,000 pounds.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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' |
Write SQL query to solve given problem: Among all shipments delivered by Sue Newel, identify the percentage of shipments that were placed by Autoware Inc.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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' |
Write SQL query to solve given problem: How many cities which belong to New Jersey have transported weight greater than 20000?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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 ) |
Write SQL query to solve given problem: How many cities whose polulation is larger than 50000 pounds have shipment in 2017?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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' |
Write SQL query to solve given problem: State the weight of shipments transported by Peterbilt.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | SELECT T2.weight FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE make = 'Peterbilt' |
Write SQL query to solve given problem: What is the model year of the truck used in shipment id 1003?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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' |
Write SQL query to solve given problem: What is the brand of truck used in shipment id 1011?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | SELECT T1.make FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T2.ship_id = '1011' |
Write SQL query to solve given problem: What is the first name of the driver who transported shipment id 1028?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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 |
Write SQL query to solve given problem: List out the state of driver who transported the shipment id 1055.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | SELECT T2.state FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.ship_id = '1055' |
Write SQL query to solve given problem: State the address of drivers who transported the shipment with weight greater than 50000 pounds.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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 |
Write SQL query to solve given problem: Give the full name of driver who transported the items on 3/2/2016.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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' |
Write SQL query to solve given problem: What is the average annual revenue of customers who have shipment weight of less than 65000 pounds?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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 |
Write SQL query to solve given problem: What is the percentage of wholesaler customers who have shipment weight of not greater than 70000 pounds?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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' |
Write SQL query to solve given problem: What is the last name of driver who transported shipment id 1088?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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' |
Write SQL query to solve given problem: Give the phone of drivers who transported shipment weight of greater than 20000 pounds.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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 |
Write SQL query to solve given problem: What is the brand and model of truck used in shipment id 1055?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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' |
Write SQL query to solve given problem: How many trucks were manufactured in year 2009?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | SELECT COUNT(truck_id) FROM truck WHERE model_year = 2009 |
Write SQL query to solve given problem: How many customers are manufacturer?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | SELECT COUNT(*) FROM customer WHERE cust_type = 'manufacturer' |
Write SQL query to solve given problem: How many customers who live in California that are retailers?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | SELECT COUNT(*) FROM customer WHERE cust_type = 'retailer' AND state = 'CA' |
Write SQL query to solve given problem: How many cities are in Connecticut?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | SELECT COUNT(*) FROM city WHERE state = 'Connecticut' |
Write SQL query to solve given problem: What is the most populated city in California?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | SELECT city_name FROM city WHERE state = 'California' AND population = ( SELECT MAX(population) FROM city WHERE state = 'California' ) |
Write SQL query to solve given problem: What is the annual revenue of Klett & Sons Repair?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | SELECT annual_revenue FROM customer WHERE cust_name = 'Klett & Sons Repair' |
Write SQL query to solve given problem: Who is the driver that transported the lightest weight of shipment? Provide the full name of the driver.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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 |
Write SQL query to solve given problem: How many shipments were shipped to customers living in California in year 2016?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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' |
Write SQL query to solve given problem: What is the brand of the truck that is used to ship by Zachery Hicks?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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' |
Write SQL query to solve given problem: List all the name of the customers that received a shipment in February 2017.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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%' |
Write SQL query to solve given problem: Provide the brand of the truck and the name of the driver that transported goods in Klett & Sons Repair.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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' |
Write SQL query to solve given problem: What is the shipment ID of the heaviest shipment that Zachery Hicks transported?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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 |
Write SQL query to solve given problem: How many shipments did Zachery Hicks transport goods to New York in the year 2016?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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' |
Write SQL query to solve given problem: Which headquarter's truck has the highest shipments in year 2016?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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 |
Write SQL query to solve given problem: How many shipments were shipped to the least populated city in California?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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 |
Write SQL query to solve given problem: In which city did the heaviest shipment transported?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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 |
Write SQL query to solve given problem: List all the cities where Zachery Hicks transported goods.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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' |
Write SQL query to solve given problem: Calculate the average number of shipments that Zachery Hicks shipped in year 2017.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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' |
Write SQL query to solve given problem: Calculate the percentage of the weight of goods being transported by Zachery Hicks to California in year 2016.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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' |
Write SQL query to solve given problem: How many shipments were shipped by the driver named Zachary Hicks?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | SELECT COUNT(*) FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.driver_id = 23 |
Write SQL query to solve given problem: What is the ship ID of shipments shipped to the city with the largest area?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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 |
Write SQL query to solve given problem: List the drivers who shipped the shipments to the least populated city.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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 |
Write SQL query to solve given problem: Among the shipments shipped to Cicero, Illinois, how many shipments weighed between 9,000 to 15,000?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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 |
Write SQL query to solve given problem: What model year of truck delivered the ship ID 1233?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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' |
Write SQL query to solve given problem: What is the address of the driver that delivers the shipment for the customer lives at 7052 Carroll Road, San Diego, California?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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' |
Write SQL query to solve given problem: Among the shipments delivered by Maria Craft, how many shipments were delivered in 2017?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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' |
Write SQL query to solve given problem: What is the truck's model year used to ship the ship ID 1245?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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' |
Write SQL query to solve given problem: Where does the driver of ship ID 1127 live?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | SELECT T2.address FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.ship_id = '1127' |
Write SQL query to solve given problem: Give the annual revenue of the customer of ship ID 1047.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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' |
Write SQL query to solve given problem: What is the weight of the shipment delivered by Andrea Simons on March 7, 2016?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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' |
Write SQL query to solve given problem: Provide the destination city of the shipment shipped by January 16, 2017.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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' |
Write SQL query to solve given problem: How many shipments were delivered to a customer from New York?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | SELECT COUNT(*) FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T2.state = 'NY' |
Write SQL query to solve given problem: What is the name of the customer of ship ID 1147?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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' |
Write SQL query to solve given problem: List the ship ID of shipments shipped to the most populated city.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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 |
Write SQL query to solve given problem: List the driver's name of the shipment shipped on February 22, 2016.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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' |
Write SQL query to solve given problem: List the weight of the customer's shipment with annual revenue of 39448581.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | SELECT T1.weight FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T2.annual_revenue = 39448581 |
Write SQL query to solve given problem: What is the customer's address for the shipment with ship ID 1117?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | SELECT T2.address FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T1.ship_id = '1117' |
Write SQL query to solve given problem: Among the shipments to a customer from Texas, what percentage of the shipments shipped in 2017?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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' |
Write SQL query to solve given problem: Calculate the difference between the number of shipments shipped by the truck with the model year 2005 and model year 2006.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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 |
Write SQL query to solve given problem: List the driver's name of the shipment with a weight greater than 95% of the average weight of all shipments.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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 ) |
Write SQL query to solve given problem: Name the longest Catalan language Wikipedia page title and state the number of different words in this page.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | language_corpus | SELECT title, words FROM pages WHERE title = ( SELECT MAX(LENGTH(title)) FROM pages ) |
Write SQL query to solve given problem: List all the Catalan language wikipedia page title with less than 10 number of different words in these pages.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | language_corpus | SELECT title FROM pages WHERE words < 10 |
Write SQL query to solve given problem: List the page number for Catalan language wikipedia pages containing the word 'Art' in the page title.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | language_corpus | SELECT page FROM pages WHERE title LIKE 'Art%' OR title LIKE '%Art%' OR title LIKE '%Art' |
Write SQL query to solve given problem: What is the title of Catalan language wikipedia page with revision page id '16203226'?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | language_corpus | SELECT title FROM pages WHERE revision = 16203226 |
Write SQL query to solve given problem: List the titles for all Catalan language wikipedia page from revision page id 106600 to 106700.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | language_corpus | SELECT title FROM pages WHERE revision BETWEEN 106600 AND 106700 |
Write SQL query to solve given problem: How many Catalan language wikipedia pages have between 1000 to 2000 number of different words?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | language_corpus | SELECT COUNT(pid) FROM pages WHERE words BETWEEN 1000 AND 2000 |
Write SQL query to solve given problem: List the page id of wikipedia about Catalan language which have the appearance of the word 'decimal'?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | language_corpus | SELECT T2.pid FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid WHERE T1.word = 'decimal' |
Write SQL query to solve given problem: Which word has the most occurrences within the same page of wikipedia about Catalan language?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | language_corpus | 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 ) |
Write SQL query to solve given problem: List all the first words of the biwords pair where the second word is 'antic'.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | language_corpus | 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' ) |
Write SQL query to solve given problem: Show all the title of pages and number of occurences for each page where the word 'quipu' appears.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | language_corpus | 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' |
Write SQL query to solve given problem: Calculate the average number of the word occurrences in which ‘system’ appeared as the first word in the pair.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | language_corpus | 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' ) |
Write SQL query to solve given problem: What is the total pages of Wikipedia in Catalan language?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | language_corpus | SELECT pages FROM langs WHERE lang = 'ca' |
Write SQL query to solve given problem: In the Catalan language, which biwords pair appeared the most in this language/page?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | language_corpus | SELECT w1st, w2nd FROM biwords WHERE occurrences = ( SELECT MAX(occurrences) FROM biwords ) |
Write SQL query to solve given problem: What is the word id of the catalan language that was repeated no more than 10 times in the said language?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | language_corpus | SELECT wid FROM langs_words WHERE occurrences <= 10 |
Write SQL query to solve given problem: What is the title of the Catalan language Wikipedia page that has the highest number of different words?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | language_corpus | SELECT title FROM pages WHERE words = ( SELECT MAX(words) FROM pages ) |
Write SQL query to solve given problem: What is the wikipedia page id of Arqueozoologia?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | language_corpus | SELECT page FROM pages WHERE title = 'Arqueozoologia' |
Write SQL query to solve given problem: 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.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | language_corpus | 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 |
Write SQL query to solve given problem: 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.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | language_corpus | SELECT T1.title FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid ORDER BY T1.words LIMIT 5 |
Write SQL query to solve given problem: How many times did the word pair "i" and "a" appeared in the Cataln language/page?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | language_corpus | SELECT SUM(occurrences) FROM biwords WHERE w1st = 86 AND w2nd = 109 |
Write SQL query to solve given problem: What are the word pairs that occured only twice?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | language_corpus | 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 |
Write SQL query to solve given problem: What is the word pair that occured the highest amount of times in Addicio? Indicate how many times such word pair occured.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | language_corpus | 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 |
Write SQL query to solve given problem: What is the total word of title "Adam" and "Acampada"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | language_corpus | SELECT SUM(words) FROM pages WHERE title IN ('Adam', 'Acampada') |
Write SQL query to solve given problem: What is the revision page ID of title "Aigua dolça"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | language_corpus | SELECT revision FROM pages WHERE title = 'Aigua dolça' |
Write SQL query to solve given problem: What is the title of corpus with most words?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | language_corpus | SELECT title FROM pages WHERE words = ( SELECT MAX(words) FROM pages ) |
Write SQL query to solve given problem: What is the average words of the 10 fewest words title?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | language_corpus | 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 |
Write SQL query to solve given problem: Among the title with single digit word count, list down 5 revision page ID of these titles.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | language_corpus | SELECT revision FROM pages WHERE words < 10 LIMIT 5 |
Write SQL query to solve given problem: List down the page id of titles start with alphabet "b".. Keep the solution inside sql tag ```sql [SQL-Query] ``` | language_corpus | SELECT pid FROM pages WHERE title LIKE 'b%' |
Write SQL query to solve given problem: What is the title of corpus where word "desena" appear?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | language_corpus | 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' |
Write SQL query to solve given problem: What is the word id for title "Sometent"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | language_corpus | SELECT T2.wid FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid WHERE T1.title = 'Sometent' |
Write SQL query to solve given problem: Is word id "88" the word id for title "Animals"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | language_corpus | 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' |
Write SQL query to solve given problem: What are the occurance of word "del" in title "Any anomalÃstic"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | language_corpus | 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' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.