problem
stringlengths 121
422
| db_id
stringclasses 69
values | solution
stringlengths 23
804
|
---|---|---|
Write SQL query to solve given problem: What is the page count for menu with page ID of 130?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT T1.page_count FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id WHERE T2.id = 130 |
Write SQL query to solve given problem: How much is the price of menu with image ID 4000009194?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT T3.price FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id INNER JOIN MenuItem AS T3 ON T2.id = T3.menu_page_id WHERE T2.image_id = 4000009194 |
Write SQL query to solve given problem: List down the page numbers for menu with dishes on the right upper corner.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT T2.page_number FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id INNER JOIN MenuItem AS T3 ON T2.id = T3.menu_page_id WHERE T3.xpos > 0.75 AND T3.ypos < 0.25 |
Write SQL query to solve given problem: List down the name of dishes from menu created in April.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT T2.name FROM MenuItem AS T1 INNER JOIN Dish AS T2 ON T2.id = T1.dish_id WHERE SUBSTR(T1.created_at, 7, 1) = '4' |
Write SQL query to solve given problem: List down name of dishes from menu with menu page ID 1389.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT T2.name FROM MenuItem AS T1 INNER JOIN Dish AS T2 ON T2.id = T1.dish_id WHERE T1.menu_page_id = 1389 |
Write SQL query to solve given problem: What is the highest price of dishes with menu item ID 1 to 5?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT T2.price FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T2.id BETWEEN 1 AND 5 ORDER BY T2.price DESC LIMIT 1 |
Write SQL query to solve given problem: List down the name of dishes that were positioned on the left upper corner.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT T1.name FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T2.xpos < 0.25 AND T2.ypos < 0.25 |
Write SQL query to solve given problem: Calculate the total dish count for menu with uuid of "510d47e4-2958-a3d9-e040-e00a18064a99" & "510d47e4-295a-a3d9-e040-e00a18064a99".. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT SUM(CASE WHEN T2.uuid = '510d47e4-2958-a3d9-e040-e00a18064a99' THEN T1.dish_count ELSE 0 END) - SUM(CASE WHEN T2.uuid = '510d47e4-295a-a3d9-e040-e00a18064a99' THEN T1.dish_count ELSE 0 END) FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id |
Write SQL query to solve given problem: Calculate the total price of items for menu with ID 12882.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT SUM(T2.price) FROM MenuPage AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.menu_page_id WHERE T1.menu_id = 12882 |
Write SQL query to solve given problem: List the top five dishes, by descending order, in terms of highest price.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT name FROM Dish ORDER BY highest_price DESC LIMIT 5 |
Write SQL query to solve given problem: Among the dishes, how many of them are for free?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT COUNT(*) FROM Dish WHERE lowest_price = 0 |
Write SQL query to solve given problem: What dishes made their first and last appearances in 1855 and 1900, respectively?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT name FROM Dish WHERE first_appeared = 1855 AND last_appeared = 1900 |
Write SQL query to solve given problem: Write down the top ten menus with the highest dish count.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT name FROM Menu GROUP BY name ORDER BY dish_count DESC LIMIT 10 |
Write SQL query to solve given problem: How many dishes appear in the right upper corner of the menu page?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT COUNT(*) FROM MenuItem AS T1 INNER JOIN Dish AS T2 ON T1.dish_id = T2.id WHERE T1.xpos > 0.75 AND T1.ypos < 0.25 |
Write SQL query to solve given problem: How long has the "Clear Green Turtle" dish appeared on the menu, and tell me when its latest update was?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT T1.last_appeared - T1.first_appeared, T2.updated_at FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T1.name = 'Clear green turtle' |
Write SQL query to solve given problem: Tally the dishes that have appeared on the menu for more than 100 years.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT T1.name FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T1.last_appeared - T1.first_appeared > 100 |
Write SQL query to solve given problem: How many dishes have appeared on the menu in less than 5 years?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT COUNT(*) FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T1.last_appeared - T1.first_appeared < 5 |
Write SQL query to solve given problem: Give me the name and menu price of dishes that were free.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT T2.name, T1.price FROM MenuItem AS T1 INNER JOIN Dish AS T2 ON T2.id = T1.dish_id WHERE T2.lowest_price = 0 |
Write SQL query to solve given problem: How much does the dish on page 2 of menu ID 12474 cost?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT T1.price FROM MenuItem AS T1 INNER JOIN MenuPage AS T2 ON T2.id = T1.menu_page_id WHERE T2.menu_id = 12474 AND T2.page_number = 2 |
Write SQL query to solve given problem: Among the dishes, how many of them were created between 2011-03-31 at 20:24:46 UTC and 2011-04-15 at 23:09:51 UTC.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT SUM(CASE WHEN T2.created_at BETWEEN '2011-03-31 20:24:46 UTC' AND '2011-04-15 23:09:51 UTC' THEN 1 ELSE 0 END) FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id |
Write SQL query to solve given problem: Who are the sponsors of the menu whose image full height is more than 10000 mm?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT T2.sponsor FROM MenuPage AS T1 INNER JOIN Menu AS T2 ON T2.id = T1.menu_id WHERE T1.full_height = 10000 |
Write SQL query to solve given problem: Write down the image ID, full height, and full width of the menu that were used in the "100TH ANNIVERSARY OF BIRTH OF DANIEL WEBSTER" event.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT T1.image_id, T1.full_height, T1.full_width FROM MenuPage AS T1 INNER JOIN Menu AS T2 ON T2.id = T1.menu_id WHERE T2.event = '100TH ANNIVERSARY OF BIRTH OF DANIEL WEBSTER' |
Write SQL query to solve given problem: Under what events was the menu page's full width less than 2000 mm?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT T1.event FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id WHERE T2.full_width = 2000 |
Write SQL query to solve given problem: Name the dishes that cost 180,000.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT T1.name FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T2.price = 180000 |
Write SQL query to solve given problem: What is the position coordinate on the page menu of the "Small Hominy" dish and how long did it appear?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT T2.xpos, T2.ypos, T1.last_appeared - T1.first_appeared FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T1.name = 'Small Hominy' |
Write SQL query to solve given problem: Calculate the image area of the page menu for the dish named "Baked Stuffed Mullet & Sauce Pomard". Please include the page number and image ID.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT T1.full_height * T1.full_width, T1.page_number, T1.image_id FROM MenuPage AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.menu_page_id INNER JOIN Dish AS T3 ON T2.dish_id = T3.id WHERE T3.name = 'Baked Stuffed Mullet & Sauce Pomard' |
Write SQL query to solve given problem: How many dishes appeared more than once on a menu?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT COUNT(*) FROM Dish WHERE times_appeared > Dish.menus_appeared |
Write SQL query to solve given problem: How many menus sponsored by Krogs Fiske Restaurant were created in April 2015?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT COUNT(*) FROM Menu WHERE date LIKE '2015-04%' AND sponsor = 'Krogs Fiskerestaurant' |
Write SQL query to solve given problem: Which dish has the longest history?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT name FROM Dish ORDER BY last_appeared - Dish.first_appeared DESC LIMIT 1 |
Write SQL query to solve given problem: On 1887-07-21, what was the event that lead to the creation of menu id 21380?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT event FROM Menu WHERE date = '1887-07-21' AND id = 21380 |
Write SQL query to solve given problem: How many pages are there in the "Emil Kuehn" menu?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT SUM(CASE WHEN T1.name = 'Emil Kuehn' THEN 1 ELSE 0 END) FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id |
Write SQL query to solve given problem: How many menus include puree of split peas aux croutons?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT SUM(CASE WHEN T1.name = 'Puree of split peas aux croutons' THEN 1 ELSE 0 END) FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id |
Write SQL query to solve given problem: What are the names of the dishes with a stable price that were created in April of 2011?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT T1.name FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE SUBSTR(T2.created_at, 1, 4) = '2011' AND SUBSTR(T2.created_at, 7, 1) = '4' AND T1.highest_price IS NULL |
Write SQL query to solve given problem: What is the name of the menu with the highest number of pages?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT T1.name FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id GROUP BY T2.menu_id ORDER BY COUNT(T2.page_number) DESC LIMIT 1 |
Write SQL query to solve given problem: Provide the menu page ids of all the menu that includes mashed potatoes.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT T2.menu_page_id FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T1.name = 'Mashed potatoes' |
Write SQL query to solve given problem: Among the menus sponsored by Pacific Mail Steamship Company, how many menus have no more than 2 pages?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT COUNT(*) FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id WHERE T1.sponsor = 'PACIFIC MAIL STEAMSHIP COMPANY' GROUP BY T2.menu_id HAVING COUNT(T2.page_number) <= 2 |
Write SQL query to solve given problem: Among the menus that include milk, what is the menu page id of the menu that has the highest price?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT T1.menu_page_id FROM MenuItem AS T1 INNER JOIN Dish AS T2 ON T2.id = T1.dish_id WHERE T2.name = 'Milk' ORDER BY T1.price DESC LIMIT 1 |
Write SQL query to solve given problem: What is the menu id of the menu sponsored by Occidental and Oriental Steamship Company with the highest number of pages?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT T2.menu_id FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id WHERE T1.sponsor = 'OCCIDENTAL & ORIENTAL STEAMSHIP COMPANY' GROUP BY T2.menu_id ORDER BY COUNT(T2.page_number) DESC LIMIT 1 |
Write SQL query to solve given problem: List the positions of the dish "breaded veal cutlet with peas" on every menu where it appeared.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT T2.xpos, T2.ypos FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T1.name = 'breaded veal cutlet with peas' |
Write SQL query to solve given problem: What are the names of the dishes shown in the lower right corner of menu page 48706?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT T2.name FROM MenuItem AS T1 INNER JOIN Dish AS T2 ON T2.id = T1.dish_id WHERE T1.xpos > 0.75 AND T1.ypos > 0.75 AND T1.menu_page_id = 48706 |
Write SQL query to solve given problem: What are the names of the dishes in the menu sponsored by The Society of Cumberland that was created for the 19th reunion at Grand Pacific Hotel in Chicago, Illinois?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT T4.name FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id INNER JOIN MenuItem AS T3 ON T2.id = T3.menu_page_id INNER JOIN Dish AS T4 ON T3.dish_id = T4.id WHERE T1.sponsor = 'THE SOCIETY OF THE CUMBERLAND' AND T1.event = '19NTH REUNION' AND T1.place = 'GRAND PACIFIC HOTEL,CHICAGO,ILL' |
Write SQL query to solve given problem: Among the menus that include baked apples with cream, who is the sponsor of the menu with the highest price?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT T4.sponsor FROM MenuPage AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.menu_page_id INNER JOIN Dish AS T3 ON T2.dish_id = T3.id INNER JOIN Menu AS T4 ON T4.id = T1.menu_id WHERE T3.name = 'Baked apples with cream' AND T3.id = 107 ORDER BY T2.price DESC LIMIT 1 |
Write SQL query to solve given problem: What is the average number of dishes per menu in the Souper de Luxe menus? Identify what is the name of the dish that appeared the most in all of its menus.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT COUNT(*), T1.dish_id FROM MenuItem AS T1 INNER JOIN MenuPage AS T2 ON T1.menu_page_id = T2.id INNER JOIN Menu AS T3 ON T2.menu_id = T3.id INNER JOIN Dish AS T4 ON T1.dish_id = T4.id WHERE T3.name = 'Souper de Luxe' GROUP BY T3.id ORDER BY COUNT(T1.dish_id) DESC LIMIT 1 |
Write SQL query to solve given problem: Please list the IDs of all the menus that are DIYs of the restaurant.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT id FROM Menu WHERE sponsor IS NULL |
Write SQL query to solve given problem: How many menus were created for lunch?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT COUNT(*) FROM Menu WHERE event = 'LUNCH' |
Write SQL query to solve given problem: Among the menus with over 10 pages, how many of them have over 20 dishes?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT COUNT(*) FROM Menu WHERE page_count > 10 AND dish_count > 20 |
Write SQL query to solve given problem: What is the ID of the menu with the most number of dishes?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT id FROM Menu ORDER BY dish_count DESC LIMIT 1 |
Write SQL query to solve given problem: How many dishes are there on the menu "Zentral Theater Terrace"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT COUNT(*) FROM Menu WHERE name = 'Zentral Theater Terrace' |
Write SQL query to solve given problem: Among the menus that did not support taking out or booking in advance, how many of them were created before 1950?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT COUNT(*) FROM Menu WHERE call_number IS NULL AND strftime('%Y', date) < '1950' |
Write SQL query to solve given problem: What is the image ID of page 1 of the menu "Zentral Theater Terrace"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT T2.image_id FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id WHERE T1.name = 'Zentral Theater Terrace' AND T2.page_number = 1 |
Write SQL query to solve given problem: To which menu does the menu page image ID5189412 belong? Please give its name.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT T1.name FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id WHERE T2.image_id = 5189412 |
Write SQL query to solve given problem: Which menu page has a bigger width, page 1 of "Zentral Theater Terrace" or page 1 of "Young's Hotel"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT CASE WHEN SUM(CASE WHEN T1.name = 'Zentral Theater Terrace' THEN T2.full_width ELSE 0 END) - SUM(CASE WHEN T1.name = 'Young''s Hotel' THEN T2.full_width ELSE 0 END) > 0 THEN 'Zentral Theater Terrace' ELSE 'Young''s Hotel' END FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id |
Write SQL query to solve given problem: Which menu page of "Ritz Carlton" has the biggest height?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT T1.page_number FROM MenuPage AS T1 INNER JOIN Menu AS T2 ON T2.id = T1.menu_id WHERE T2.name = 'Ritz Carlton' ORDER BY T1.full_height DESC LIMIT 1 |
Write SQL query to solve given problem: Among the menu pages of "Ritz Carlton", how many of them have a width of over 1000?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT SUM(CASE WHEN T1.name = 'Ritz Carlton' THEN 1 ELSE 0 END) FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id WHERE T2.full_width > 1000 |
Write SQL query to solve given problem: How many dishes are there on page 1 of menu ID12882?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT SUM(CASE WHEN T1.page_number = 1 THEN 1 ELSE 0 END) FROM MenuPage AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.menu_page_id WHERE T1.menu_id = 12882 |
Write SQL query to solve given problem: Please list the names of all the dishes on page 1 of menu ID12882.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT T3.name FROM MenuPage AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.menu_page_id INNER JOIN Dish AS T3 ON T2.dish_id = T3.id WHERE T1.menu_id = 12882 AND T1.page_number = 1 |
Write SQL query to solve given problem: Please list the page numbers of all the menu pages on which the dish "Chicken gumbo" had appeared.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT T1.page_number FROM MenuPage AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.menu_page_id INNER JOIN Dish AS T3 ON T2.dish_id = T3.id WHERE T3.name = 'Chicken gumbo' |
Write SQL query to solve given problem: Among the menu pages on which the dish "Chicken gumbo" had appeared, what is the menu ID of the one with the biggest width?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT T1.id FROM MenuPage AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.menu_page_id INNER JOIN Dish AS T3 ON T2.dish_id = T3.id WHERE T3.name = 'Chicken gumbo' ORDER BY T1.full_width DESC LIMIT 1 |
Write SQL query to solve given problem: For how many times had the dish "Chicken gumbo" appeared on a menu page?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT SUM(CASE WHEN T1.name = 'Chicken gumbo' THEN 1 ELSE 0 END) FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id |
Write SQL query to solve given problem: Among the menu pages on which the dish "Paysanne Soup" had appeared, how many of them had a stable price for the dish?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT SUM(CASE WHEN T1.name = 'Paysanne Soup' THEN 1 ELSE 0 END) FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T1.highest_price IS NULL |
Write SQL query to solve given problem: What is the highest price of the dish "Chicken gumbo" on a menu page?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT T2.price FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T1.name = 'Chicken gumbo' ORDER BY T2.price DESC LIMIT 1 |
Write SQL query to solve given problem: How much space does page 1 of the menu "Zentral Theater Terrace" cover?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT T2.full_height * T2.full_width FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id WHERE T1.name = 'Zentral Theater Terrace' AND T2.page_number = 1 |
Write SQL query to solve given problem: What is the average number of dishes per menu page of menu ID12882?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | menu | SELECT CAST(COUNT(dish_id) AS REAL) / COUNT(T3.page_count) FROM MenuItem AS T1 INNER JOIN MenuPage AS T2 ON T1.menu_page_id = T2.id INNER JOIN Menu AS T3 ON T2.menu_id = T3.id WHERE T2.menu_id = 12882 |
Write SQL query to solve given problem: How many shipments were ordered by S K L Enterprises Inc in 2017?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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 = 'S K L Enterprises Inc' AND STRFTIME('%Y', T2.ship_date) = '2017' |
Write SQL query to solve given problem: What is the total number of pounds being transported for S K L Enterprises Inc?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | SELECT SUM(T2.weight) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE T1.cust_name = 'S K L Enterprises Inc' |
Write SQL query to solve given problem: Among the shipments done by Sue Newell, how many of them are for S K L Enterprises Inc?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | SELECT COUNT(*) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id INNER JOIN driver AS T3 ON T3.driver_id = T2.driver_id WHERE T1.cust_name = 'S K L Enterprises Inc' AND T3.first_name = 'Sue' AND T3.last_name = 'Newell' |
Write SQL query to solve given problem: How many shipments were ordered by a customer in Florida?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | SELECT COUNT(T1.cust_id) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE T1.state = 'FL' |
Write SQL query to solve given problem: Please list the IDs of all the shipments made by a retailer customer.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | SELECT T2.ship_id FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE T1.cust_type = 'retailer' |
Write SQL query to solve given problem: Among the customers having at least one shipment in 2017, how many of them have an annual revenue of over 30000000?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | SELECT COUNT(COUNTCUSID) FROM ( SELECT COUNT(T1.cust_id) AS COUNTCUSID FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE STRFTIME('%Y', T2.ship_date) = '2017' AND T1.annual_revenue > 30000000 GROUP BY T1.cust_id HAVING COUNT(T2.ship_id) >= 1 ) T3 |
Write SQL query to solve given problem: How many shipments in 2017 were done by Sue Newell?. 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 STRFTIME('%Y', T1.ship_date) = '2017' AND T2.first_name = 'Sue' AND T2.last_name = 'Newell' |
Write SQL query to solve given problem: What is the full name of the driver that has done the most shipments in 2017?. 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 STRFTIME('%Y', T1.ship_date) = '2017' GROUP BY T2.first_name, T2.last_name ORDER BY COUNT(*) DESC LIMIT 1 |
Write SQL query to solve given problem: Among the shipments in 2017, how many of them have the destination in New Jersey?. 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 STRFTIME('%Y', T1.ship_date) = '2017' AND T2.state = 'New Jersey' |
Write SQL query to solve given problem: What is the maximum weight being transported to New York during a single shipment?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | SELECT MAX(T1.weight) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T2.city_name = 'New York' |
Write SQL query to solve given problem: How much more pounds in total were transported to New York than to Chicago?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | SELECT SUM(CASE WHEN T2.city_name = 'New York' THEN T1.weight ELSE 0 END) - SUM(CASE WHEN T2.city_name = 'Chicago' THEN T1.weight ELSE 0 END) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id |
Write SQL query to solve given problem: Please list the destination cities of all the shipments ordered by S K L Enterprises Inc.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | SELECT DISTINCT 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 T1.cust_name = 'S K L Enterprises Inc' |
Write SQL query to solve given problem: What is the average weight of the goods being transported on a single shipment ordered by S K L Enterprises Inc?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | SELECT AVG(T2.weight) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE T1.cust_name = 'S K L Enterprises Inc' |
Write SQL query to solve given problem: Among all the shipments to Florida, what is the percentage of the shipment to Jacksonville?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | SELECT CAST(SUM(CASE WHEN T2.city_name = 'Jacksonville' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T2.state = 'Florida' |
Write SQL query to solve given problem: State the headquarter of the truck which completed shipment no.1045.. 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 = 1045 |
Write SQL query to solve given problem: How many shipments were delivered by the oldest truck model?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | SELECT COUNT(*) FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id GROUP BY T1.model_year ORDER BY T1.model_year ASC LIMIT 1 |
Write SQL query to solve given problem: Who was the customer of shipment no.1275? Give the customer's name.. 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_id = '1275' |
Write SQL query to solve given problem: Where was the destination city of shipment no.1701?. 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 = '1701' |
Write SQL query to solve given problem: Give the name of the driver of shipment no.1021.. 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 = '1021' |
Write SQL query to solve given problem: Tell the name of the driver who received the shipment on 2017/11/5.. 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 = '2017-11-05' |
Write SQL query to solve given problem: Show the population of the city which was the destination of shipment no.1398.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | SELECT T2.population FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T1.ship_id = '1398' |
Write SQL query to solve given problem: Provide the ship date of the first shipment to customers in South Carolina.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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' |
Write SQL query to solve given problem: For the shipment received by Leszek Kieltyka on 2017/9/25, what was its weight?. 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 = 'Leszek' AND T2.last_name = 'Kieltyka' AND T1.ship_date = '2017-09-25' |
Write SQL query to solve given problem: What is the area of the destination city of shipment No.1346?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | SELECT T2.area FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T1.ship_id = '1346' |
Write SQL query to solve given problem: Provide the weight of the shipment to U-haul Center Of N Syracuse on 2016/9/21.. 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.cust_name = 'U-haul Center Of N Syracuse' AND T1.ship_date = '2016-09-21' |
Write SQL query to solve given problem: Who was the driver of truck no.3 on 2016/9/19? Tell the full name.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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' |
Write SQL query to solve given problem: Calculate the population density of the city as the destination of shipment no.1369.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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' |
Write SQL query to solve given problem: What is the average number of shipments done by the Kenworth trucks?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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' |
Write SQL query to solve given problem: How many pounds did Sue Newell transport during her first shipment?. 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 = 'Sue' AND T2.last_name = 'Newell' ORDER BY T1.ship_date ASC LIMIT 1 |
Write SQL query to solve given problem: To whom did the company transport its heaviest shipment?. 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 ORDER BY T1.weight DESC LIMIT 1 |
Write SQL query to solve given problem: What is the full name of the driver who transported the first shipment of the company?. 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.ship_date ASC LIMIT 1 |
Write SQL query to solve given problem: In total, how many shipments were transported to Olympic Camper Sales Inc?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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' |
Write SQL query to solve given problem: How many of the shipments bound for New York City were shipped to Harry's Hot Rod Auto and Truck Accessories?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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' |
Write SQL query to solve given problem: Among the top 5 heaviest shipments, how many shipments were transported via Mack?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | SELECT COUNT(T2.ship_id) FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T1.make = 'Mack' ORDER BY T2.weight DESC LIMIT 1 |
Write SQL query to solve given problem: What is the full name of the driver who delivered the most shipments to the least populated city?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | 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 |
Write SQL query to solve given problem: How many shipments with weight of no more than 1,000 pounds were shipped by the oldest truck?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shipping | SELECT COUNT(*) FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T2.weight < 1000 ORDER BY T1.model_year ASC LIMIT 1 |
Write SQL query to solve given problem: How much is the annual revenue of the customer with the most number of shipments?. 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 GROUP BY T1.cust_id ORDER BY COUNT(T1.cust_id) DESC LIMIT 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.