context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
What dishes made their first and last appearances in 1855 and 1900, respectively?
SELECT name FROM Dish WHERE first_appeared = 1855 AND last_appeared = 1900
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
Write down the top ten menus with the highest dish count.
SELECT name FROM Menu GROUP BY name ORDER BY dish_count DESC LIMIT 10
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
How many dishes appear in the right upper corner of the menu page?
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
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
How long has the "Clear Green Turtle" dish appeared on the menu, and tell me when its latest update was?
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'
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
Tally the dishes that have appeared on the menu for more than 100 years.
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
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
How many dishes have appeared on the menu in less than 5 years?
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
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
Give me the name and menu price of dishes that were free.
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
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
How much does the dish on page 2 of menu ID 12474 cost?
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
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
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.
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
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
Who are the sponsors of the menu whose image full height is more than 10000 mm?
SELECT T2.sponsor FROM MenuPage AS T1 INNER JOIN Menu AS T2 ON T2.id = T1.menu_id WHERE T1.full_height = 10000
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
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.
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'
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
Under what events was the menu page's full width less than 2000 mm?
SELECT T1.event FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id WHERE T2.full_width = 2000
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
Name the dishes that cost 180,000.
SELECT T1.name FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T2.price = 180000
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
What is the position coordinate on the page menu of the "Small Hominy" dish and how long did it appear?
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'
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
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.
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'
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
How many dishes appeared more than once on a menu?
SELECT COUNT(*) FROM Dish WHERE times_appeared > Dish.menus_appeared
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
How many menus sponsored by Krogs Fiske Restaurant were created in April 2015?
SELECT COUNT(*) FROM Menu WHERE date LIKE '2015-04%' AND sponsor = 'Krogs Fiskerestaurant'
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
Which dish has the longest history?
SELECT name FROM Dish ORDER BY last_appeared - Dish.first_appeared DESC LIMIT 1
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
On 1887-07-21, what was the event that lead to the creation of menu id 21380?
SELECT event FROM Menu WHERE date = '1887-07-21' AND id = 21380
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
How many pages are there in the "Emil Kuehn" 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
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
How many menus include puree of split peas aux croutons?
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
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
What are the names of the dishes with a stable price that were created in April of 2011?
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
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
What is the name of the menu with the highest number of pages?
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
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
Provide the menu page ids of all the menu that includes mashed potatoes.
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'
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
Among the menus sponsored by Pacific Mail Steamship Company, how many menus have no more than 2 pages?
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
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
Among the menus that include milk, what is the menu page id of the menu that has the highest price?
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
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
What is the menu id of the menu sponsored by Occidental and Oriental Steamship Company with the highest number of pages?
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
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
List the positions of the dish "breaded veal cutlet with peas" on every menu where it appeared.
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'
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
What are the names of the dishes shown in the lower right corner of menu page 48706?
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
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
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?
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'
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
Among the menus that include baked apples with cream, who is the sponsor of the menu with the highest price?
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
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
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.
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
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
Please list the IDs of all the menus that are DIYs of the restaurant.
SELECT id FROM Menu WHERE sponsor IS NULL
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
How many menus were created for lunch?
SELECT COUNT(*) FROM Menu WHERE event = 'LUNCH'
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
Among the menus with over 10 pages, how many of them have over 20 dishes?
SELECT COUNT(*) FROM Menu WHERE page_count > 10 AND dish_count > 20
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
What is the ID of the menu with the most number of dishes?
SELECT id FROM Menu ORDER BY dish_count DESC LIMIT 1
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
How many dishes are there on the menu "Zentral Theater Terrace"?
SELECT COUNT(*) FROM Menu WHERE name = 'Zentral Theater Terrace'
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
Among the menus that did not support taking out or booking in advance, how many of them were created before 1950?
SELECT COUNT(*) FROM Menu WHERE call_number IS NULL AND strftime('%Y', date) < '1950'
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
What is the image ID of page 1 of the menu "Zentral Theater Terrace"?
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
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
To which menu does the menu page image ID5189412 belong? Please give its name.
SELECT T1.name FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id WHERE T2.image_id = 5189412
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
Which menu page has a bigger width, page 1 of "Zentral Theater Terrace" or page 1 of "Young's Hotel"?
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
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
Which menu page of "Ritz Carlton" has the biggest height?
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
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
Among the menu pages of "Ritz Carlton", how many of them have a width of over 1000?
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
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
How many dishes are there on page 1 of menu ID12882?
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
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
Please list the names of all the dishes on page 1 of menu ID12882.
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
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
Please list the page numbers of all the menu pages on which the dish "Chicken gumbo" had appeared.
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'
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
Among the menu pages on which the dish "Chicken gumbo" had appeared, what is the menu ID of the one with the biggest width?
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
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
For how many times had the dish "Chicken gumbo" appeared on a menu page?
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
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
Among the menu pages on which the dish "Paysanne Soup" had appeared, how many of them had a stable price for the dish?
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
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
What is the highest price of the dish "Chicken gumbo" on a menu page?
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
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
How much space does page 1 of the menu "Zentral Theater Terrace" cover?
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
bird
CREATE TABLE menu (id integer, name text, description text, menus_appeared integer, times_appeared integer, first_appeared integer, last_appeared integer, lowest_price real, highest_price real, id integer, name text, sponsor text, event text, venue text, place text, physical_description text, occasion text, notes text, call_number text, keywords text, language text, date date, location text, location_type text, currency text, currency_symbol text, status text, page_count integer, dish_count integer, id integer, menu_id integer, page_number integer, image_id real, full_height integer, full_width integer, uuid text, id integer, menu_page_id integer, price real, high_price real, dish_id integer, created_at text, updated_at text, xpos real, ypos real)
What is the average number of dishes per menu page of menu ID12882?
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
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
How many shipments were ordered by S K L Enterprises Inc in 2017?
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'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
What is the total number of pounds being transported for S K L Enterprises Inc?
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'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Among the shipments done by Sue Newell, how many of them are for S K L Enterprises Inc?
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'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
How many shipments were ordered by a customer in Florida?
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'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Please list the IDs of all the shipments made by a retailer customer.
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'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Among the customers having at least one shipment in 2017, how many of them have an annual revenue of over 30000000?
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
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
How many shipments in 2017 were done by Sue Newell?
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'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
What is the full name of the driver that has done the most shipments in 2017?
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
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Among the shipments in 2017, how many of them have the destination in New Jersey?
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'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
What is the maximum weight being transported to New York during a single shipment?
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'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
How much more pounds in total were transported to New York than to Chicago?
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
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Please list the destination cities of all the shipments ordered by S K L Enterprises Inc.
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'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
What is the average weight of the goods being transported on a single shipment ordered by S K L Enterprises Inc?
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'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Among all the shipments to Florida, what is the percentage of the shipment to Jacksonville?
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'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
State the headquarter of the truck which completed shipment no.1045.
SELECT T1.make FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T2.ship_id = 1045
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
How many shipments were delivered by the oldest truck model?
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
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Who was the customer of shipment no.1275? Give the customer's name.
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'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Where was the destination city of shipment no.1701?
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'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Give the name of the driver of shipment no.1021.
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'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Tell the name of the driver who received the shipment on 2017/11/5.
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'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Show the population of the city which was the destination of shipment no.1398.
SELECT T2.population FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T1.ship_id = '1398'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Provide the ship date of the first shipment to customers in South Carolina.
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'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
For the shipment received by Leszek Kieltyka on 2017/9/25, what was its weight?
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'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
What is the area of the destination city of shipment No.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'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Provide the weight of the shipment to U-haul Center Of N Syracuse on 2016/9/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'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Who was the driver of truck no.3 on 2016/9/19? Tell the full 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'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Calculate the population density of the city as the destination of shipment no.1369.
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'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
What is the average number of shipments done by the Kenworth trucks?
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'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
How many pounds did Sue Newell transport during her first shipment?
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
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
To whom did the company transport its heaviest shipment?
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
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
What is the full name of the driver who transported the first shipment of the company?
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
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
In total, how many shipments were transported to Olympic Camper Sales Inc?
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'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
How many of the shipments bound for New York City were shipped to Harry's Hot Rod Auto and Truck Accessories?
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'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Among the top 5 heaviest shipments, how many shipments were transported via Mack?
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
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
What is the full name of the driver who delivered the most shipments to the least populated city?
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
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
How many shipments with weight of no more than 1,000 pounds were shipped by the oldest truck?
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
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
How much is the annual revenue of the customer with the most number of shipments?
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
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Among the shipments for Downey, how many shipments were shipped to California in 2016?
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'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
How many shipments did Holger Nohr transport to North Las Vegas overall?
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'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
How many shipments were shipped to the most densely populated city?
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
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Determine the percentage of manufacturers who are from Texas among all of Lorenzo's customers.
SELECT CAST(SUM(CASE WHEN cust_type = 'manufacturer' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM customer WHERE state = 'TX'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Identify the total weight of shipments transported to San Mateo, California, in 2016.
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'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Identify the total weight of shipments transported in 2016 by the newest Peterbilt.
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
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
What was the maximum weight of the shipment carried to Boston? Name the customer of that shipment.
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
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Where was shipment no. 1002 headed?
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'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
What is the average shipment weight carried by the oldest Mack?
SELECT AVG(T2.weight) FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T1.make = 'Mack'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Identify the full name of the driver who delivered a shipment to the city of New York in February 2016.
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%'
bird
CREATE TABLE shipping (city_id integer, city_name text, state text, population integer, area real, cust_id integer, cust_name text, annual_revenue integer, cust_type text, address text, city text, state text, zip real, phone text, driver_id integer, first_name text, last_name text, address text, city text, state text, zip_code integer, phone text, truck_id integer, make text, model_year integer, ship_id integer, cust_id integer, weight real, truck_id integer, driver_id integer, city_id integer, ship_date text)
Name the customer who sent the shipment to Oak Park.
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'
bird