Dludora/DAIL-BIRD huggingface dataset:
/* Given the following database schema: */
CREATE TABLE Dish
(
    id             INTEGER
            primary key,
    name           TEXT,
    description    TEXT,
    menus_appeared INTEGER,
    times_appeared INTEGER,
    first_appeared INTEGER,
    last_appeared  INTEGER,
    lowest_price   REAL,
    highest_price  REAL
)

CREATE TABLE Menu
(
    id                   INTEGER
            primary key,
    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
)

CREATE TABLE MenuPage
(
    id          INTEGER
            primary key,
    menu_id     INTEGER,
    page_number INTEGER,
    image_id    REAL,
    full_height INTEGER,
    full_width  INTEGER,
    uuid        TEXT,
    foreign key (menu_id) references Menu(id)
)

CREATE TABLE MenuItem
(
    id           INTEGER
            primary key,
    menu_page_id INTEGER,
    price        REAL,
    high_price   REAL,
    dish_id      INTEGER,
    created_at   TEXT,
    updated_at   TEXT,
    xpos         REAL,
    ypos         REAL,
    foreign key (dish_id) references Dish(id),
    foreign key (menu_page_id) references MenuPage(id)
)

/* Answer the following: Which dish has the longest history? longest history refers to MAX(SUBTRACT(last_appeared, first_appeared)); */
SELECT 
SELECT name FROM Dish ORDER BY last_appeared - Dish.first_appeared DESC LIMIT 1
/* Given the following database schema: */
CREATE TABLE Dish
(
    id             INTEGER
            primary key,
    name           TEXT,
    description    TEXT,
    menus_appeared INTEGER,
    times_appeared INTEGER,
    first_appeared INTEGER,
    last_appeared  INTEGER,
    lowest_price   REAL,
    highest_price  REAL
)

CREATE TABLE Menu
(
    id                   INTEGER
            primary key,
    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
)

CREATE TABLE MenuPage
(
    id          INTEGER
            primary key,
    menu_id     INTEGER,
    page_number INTEGER,
    image_id    REAL,
    full_height INTEGER,
    full_width  INTEGER,
    uuid        TEXT,
    foreign key (menu_id) references Menu(id)
)

CREATE TABLE MenuItem
(
    id           INTEGER
            primary key,
    menu_page_id INTEGER,
    price        REAL,
    high_price   REAL,
    dish_id      INTEGER,
    created_at   TEXT,
    updated_at   TEXT,
    xpos         REAL,
    ypos         REAL,
    foreign key (dish_id) references Dish(id),
    foreign key (menu_page_id) references MenuPage(id)
)

/* Answer the following: On 1887-07-21, what was the event that lead to the creation of menu id 21380? On 1887-07-21 refers to date = '1887-07-21'; */
SELECT 
SELECT event FROM Menu WHERE date = '1887-07-21' AND id = 21380
/* Given the following database schema: */
CREATE TABLE Dish
(
    id             INTEGER
            primary key,
    name           TEXT,
    description    TEXT,
    menus_appeared INTEGER,
    times_appeared INTEGER,
    first_appeared INTEGER,
    last_appeared  INTEGER,
    lowest_price   REAL,
    highest_price  REAL
)

CREATE TABLE Menu
(
    id                   INTEGER
            primary key,
    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
)

CREATE TABLE MenuPage
(
    id          INTEGER
            primary key,
    menu_id     INTEGER,
    page_number INTEGER,
    image_id    REAL,
    full_height INTEGER,
    full_width  INTEGER,
    uuid        TEXT,
    foreign key (menu_id) references Menu(id)
)

CREATE TABLE MenuItem
(
    id           INTEGER
            primary key,
    menu_page_id INTEGER,
    price        REAL,
    high_price   REAL,
    dish_id      INTEGER,
    created_at   TEXT,
    updated_at   TEXT,
    xpos         REAL,
    ypos         REAL,
    foreign key (dish_id) references Dish(id),
    foreign key (menu_page_id) references MenuPage(id)
)

/* Answer the following: How many pages are there in the "Emil Kuehn" menu? Emil Kuehn is a name of menu; */
SELECT 
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
/* Given the following database schema: */
CREATE TABLE Dish
(
    id             INTEGER
            primary key,
    name           TEXT,
    description    TEXT,
    menus_appeared INTEGER,
    times_appeared INTEGER,
    first_appeared INTEGER,
    last_appeared  INTEGER,
    lowest_price   REAL,
    highest_price  REAL
)

CREATE TABLE Menu
(
    id                   INTEGER
            primary key,
    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
)

CREATE TABLE MenuPage
(
    id          INTEGER
            primary key,
    menu_id     INTEGER,
    page_number INTEGER,
    image_id    REAL,
    full_height INTEGER,
    full_width  INTEGER,
    uuid        TEXT,
    foreign key (menu_id) references Menu(id)
)

CREATE TABLE MenuItem
(
    id           INTEGER
            primary key,
    menu_page_id INTEGER,
    price        REAL,
    high_price   REAL,
    dish_id      INTEGER,
    created_at   TEXT,
    updated_at   TEXT,
    xpos         REAL,
    ypos         REAL,
    foreign key (dish_id) references Dish(id),
    foreign key (menu_page_id) references MenuPage(id)
)

/* Answer the following: How many menus include puree of split peas aux croutons? puree of split peas aux croutons is a name of dish; */
SELECT 
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
/* Given the following database schema: */
CREATE TABLE Dish
(
    id             INTEGER
            primary key,
    name           TEXT,
    description    TEXT,
    menus_appeared INTEGER,
    times_appeared INTEGER,
    first_appeared INTEGER,
    last_appeared  INTEGER,
    lowest_price   REAL,
    highest_price  REAL
)

CREATE TABLE Menu
(
    id                   INTEGER
            primary key,
    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
)

CREATE TABLE MenuPage
(
    id          INTEGER
            primary key,
    menu_id     INTEGER,
    page_number INTEGER,
    image_id    REAL,
    full_height INTEGER,
    full_width  INTEGER,
    uuid        TEXT,
    foreign key (menu_id) references Menu(id)
)

CREATE TABLE MenuItem
(
    id           INTEGER
            primary key,
    menu_page_id INTEGER,
    price        REAL,
    high_price   REAL,
    dish_id      INTEGER,
    created_at   TEXT,
    updated_at   TEXT,
    xpos         REAL,
    ypos         REAL,
    foreign key (dish_id) references Dish(id),
    foreign key (menu_page_id) references MenuPage(id)
)

/* Answer the following: What are the names of the dishes with a stable price that were created in April of 2011? dishes with a stable price refers to highest_price is null; created in April of 2011 refers to SUBSTR(created_at,1,4) = '2011' and SUBSTR(created_at, 7, 1) = '4'; */
SELECT 
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
/* Given the following database schema: */
CREATE TABLE Dish
(
    id             INTEGER
            primary key,
    name           TEXT,
    description    TEXT,
    menus_appeared INTEGER,
    times_appeared INTEGER,
    first_appeared INTEGER,
    last_appeared  INTEGER,
    lowest_price   REAL,
    highest_price  REAL
)

CREATE TABLE Menu
(
    id                   INTEGER
            primary key,
    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
)

CREATE TABLE MenuPage
(
    id          INTEGER
            primary key,
    menu_id     INTEGER,
    page_number INTEGER,
    image_id    REAL,
    full_height INTEGER,
    full_width  INTEGER,
    uuid        TEXT,
    foreign key (menu_id) references Menu(id)
)

CREATE TABLE MenuItem
(
    id           INTEGER
            primary key,
    menu_page_id INTEGER,
    price        REAL,
    high_price   REAL,
    dish_id      INTEGER,
    created_at   TEXT,
    updated_at   TEXT,
    xpos         REAL,
    ypos         REAL,
    foreign key (dish_id) references Dish(id),
    foreign key (menu_page_id) references MenuPage(id)
)

/* Answer the following: What is the name of the menu with the highest number of pages? highest number of pages refers to MAX(COUNT(page_number)); */
SELECT 
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
/* Given the following database schema: */
CREATE TABLE Dish
(
    id             INTEGER
            primary key,
    name           TEXT,
    description    TEXT,
    menus_appeared INTEGER,
    times_appeared INTEGER,
    first_appeared INTEGER,
    last_appeared  INTEGER,
    lowest_price   REAL,
    highest_price  REAL
)

CREATE TABLE Menu
(
    id                   INTEGER
            primary key,
    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
)

CREATE TABLE MenuPage
(
    id          INTEGER
            primary key,
    menu_id     INTEGER,
    page_number INTEGER,
    image_id    REAL,
    full_height INTEGER,
    full_width  INTEGER,
    uuid        TEXT,
    foreign key (menu_id) references Menu(id)
)

CREATE TABLE MenuItem
(
    id           INTEGER
            primary key,
    menu_page_id INTEGER,
    price        REAL,
    high_price   REAL,
    dish_id      INTEGER,
    created_at   TEXT,
    updated_at   TEXT,
    xpos         REAL,
    ypos         REAL,
    foreign key (dish_id) references Dish(id),
    foreign key (menu_page_id) references MenuPage(id)
)

/* Answer the following: Provide the menu page ids of all the menu that includes mashed potatoes. mashed potatoes is a name of dish; */
SELECT 
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'
/* Given the following database schema: */
CREATE TABLE Dish
(
    id             INTEGER
            primary key,
    name           TEXT,
    description    TEXT,
    menus_appeared INTEGER,
    times_appeared INTEGER,
    first_appeared INTEGER,
    last_appeared  INTEGER,
    lowest_price   REAL,
    highest_price  REAL
)

CREATE TABLE Menu
(
    id                   INTEGER
            primary key,
    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
)

CREATE TABLE MenuPage
(
    id          INTEGER
            primary key,
    menu_id     INTEGER,
    page_number INTEGER,
    image_id    REAL,
    full_height INTEGER,
    full_width  INTEGER,
    uuid        TEXT,
    foreign key (menu_id) references Menu(id)
)

CREATE TABLE MenuItem
(
    id           INTEGER
            primary key,
    menu_page_id INTEGER,
    price        REAL,
    high_price   REAL,
    dish_id      INTEGER,
    created_at   TEXT,
    updated_at   TEXT,
    xpos         REAL,
    ypos         REAL,
    foreign key (dish_id) references Dish(id),
    foreign key (menu_page_id) references MenuPage(id)
)

/* Answer the following: Among the menus sponsored by Pacific Mail Steamship Company, how many menus have no more than 2 pages? sponsored by Pacific Mail Steamship Company refers to sponsor = 'PACIFIC MAIL STEAMSHIP COMPANY'; no more than 2 pages refers to COUNT(page_number) < = 2; */
SELECT 
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
/* Given the following database schema: */
CREATE TABLE Dish
(
    id             INTEGER
            primary key,
    name           TEXT,
    description    TEXT,
    menus_appeared INTEGER,
    times_appeared INTEGER,
    first_appeared INTEGER,
    last_appeared  INTEGER,
    lowest_price   REAL,
    highest_price  REAL
)

CREATE TABLE Menu
(
    id                   INTEGER
            primary key,
    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
)

CREATE TABLE MenuPage
(
    id          INTEGER
            primary key,
    menu_id     INTEGER,
    page_number INTEGER,
    image_id    REAL,
    full_height INTEGER,
    full_width  INTEGER,
    uuid        TEXT,
    foreign key (menu_id) references Menu(id)
)

CREATE TABLE MenuItem
(
    id           INTEGER
            primary key,
    menu_page_id INTEGER,
    price        REAL,
    high_price   REAL,
    dish_id      INTEGER,
    created_at   TEXT,
    updated_at   TEXT,
    xpos         REAL,
    ypos         REAL,
    foreign key (dish_id) references Dish(id),
    foreign key (menu_page_id) references MenuPage(id)
)

/* Answer the following: Among the menus that include milk, what is the menu page id of the menu that has the highest price? milk is a name of dish; highest price refers to MAX(price); */
SELECT 
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
/* Given the following database schema: */
CREATE TABLE Dish
(
    id             INTEGER
            primary key,
    name           TEXT,
    description    TEXT,
    menus_appeared INTEGER,
    times_appeared INTEGER,
    first_appeared INTEGER,
    last_appeared  INTEGER,
    lowest_price   REAL,
    highest_price  REAL
)

CREATE TABLE Menu
(
    id                   INTEGER
            primary key,
    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
)

CREATE TABLE MenuPage
(
    id          INTEGER
            primary key,
    menu_id     INTEGER,
    page_number INTEGER,
    image_id    REAL,
    full_height INTEGER,
    full_width  INTEGER,
    uuid        TEXT,
    foreign key (menu_id) references Menu(id)
)

CREATE TABLE MenuItem
(
    id           INTEGER
            primary key,
    menu_page_id INTEGER,
    price        REAL,
    high_price   REAL,
    dish_id      INTEGER,
    created_at   TEXT,
    updated_at   TEXT,
    xpos         REAL,
    ypos         REAL,
    foreign key (dish_id) references Dish(id),
    foreign key (menu_page_id) references MenuPage(id)
)

/* Answer the following: What is the menu id of the menu sponsored by Occidental and Oriental Steamship Company with the highest number of pages? sponsored by Occidental and Oriental Steamship Company refers to sponsor = 'OCCIDENTAL & ORIENTAL STEAMSHIP COMPANY'; highest number of pages refers to MAX(COUNT(page_number)); */
SELECT 
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
/* Given the following database schema: */
CREATE TABLE Dish
(
    id             INTEGER
            primary key,
    name           TEXT,
    description    TEXT,
    menus_appeared INTEGER,
    times_appeared INTEGER,
    first_appeared INTEGER,
    last_appeared  INTEGER,
    lowest_price   REAL,
    highest_price  REAL
)

CREATE TABLE Menu
(
    id                   INTEGER
            primary key,
    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
)

CREATE TABLE MenuPage
(
    id          INTEGER
            primary key,
    menu_id     INTEGER,
    page_number INTEGER,
    image_id    REAL,
    full_height INTEGER,
    full_width  INTEGER,
    uuid        TEXT,
    foreign key (menu_id) references Menu(id)
)

CREATE TABLE MenuItem
(
    id           INTEGER
            primary key,
    menu_page_id INTEGER,
    price        REAL,
    high_price   REAL,
    dish_id      INTEGER,
    created_at   TEXT,
    updated_at   TEXT,
    xpos         REAL,
    ypos         REAL,
    foreign key (dish_id) references Dish(id),
    foreign key (menu_page_id) references MenuPage(id)
)

/* Answer the following: List the positions of the dish "breaded veal cutlet with peas" on every menu where it appeared. positions = xpos, ypos; breaded veal cutlet with peas is a name of dish; */
SELECT 
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'
/* Given the following database schema: */
CREATE TABLE Dish
(
    id             INTEGER
            primary key,
    name           TEXT,
    description    TEXT,
    menus_appeared INTEGER,
    times_appeared INTEGER,
    first_appeared INTEGER,
    last_appeared  INTEGER,
    lowest_price   REAL,
    highest_price  REAL
)

CREATE TABLE Menu
(
    id                   INTEGER
            primary key,
    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
)

CREATE TABLE MenuPage
(
    id          INTEGER
            primary key,
    menu_id     INTEGER,
    page_number INTEGER,
    image_id    REAL,
    full_height INTEGER,
    full_width  INTEGER,
    uuid        TEXT,
    foreign key (menu_id) references Menu(id)
)

CREATE TABLE MenuItem
(
    id           INTEGER
            primary key,
    menu_page_id INTEGER,
    price        REAL,
    high_price   REAL,
    dish_id      INTEGER,
    created_at   TEXT,
    updated_at   TEXT,
    xpos         REAL,
    ypos         REAL,
    foreign key (dish_id) references Dish(id),
    foreign key (menu_page_id) references MenuPage(id)
)

/* Answer the following: What are the names of the dishes shown in the lower right corner of menu page 48706? shown in the lower right corner refers to xpos > 0.75 AND ypos > 0.75; */
SELECT 
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
/* Given the following database schema: */
CREATE TABLE Dish
(
    id             INTEGER
            primary key,
    name           TEXT,
    description    TEXT,
    menus_appeared INTEGER,
    times_appeared INTEGER,
    first_appeared INTEGER,
    last_appeared  INTEGER,
    lowest_price   REAL,
    highest_price  REAL
)

CREATE TABLE Menu
(
    id                   INTEGER
            primary key,
    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
)

CREATE TABLE MenuPage
(
    id          INTEGER
            primary key,
    menu_id     INTEGER,
    page_number INTEGER,
    image_id    REAL,
    full_height INTEGER,
    full_width  INTEGER,
    uuid        TEXT,
    foreign key (menu_id) references Menu(id)
)

CREATE TABLE MenuItem
(
    id           INTEGER
            primary key,
    menu_page_id INTEGER,
    price        REAL,
    high_price   REAL,
    dish_id      INTEGER,
    created_at   TEXT,
    updated_at   TEXT,
    xpos         REAL,
    ypos         REAL,
    foreign key (dish_id) references Dish(id),
    foreign key (menu_page_id) references MenuPage(id)
)

/* Answer the following: 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? sponsored by The Society of Cumberland refers to sponsor = 'THE SOCIETY OF THE CUMBERLAND'; created for the 19th reunion refers to event = '19NTH REUNION'; Grand Pacific Hotel in Chicago, Illinois refers to place = 'GRAND PACIFIC HOTEL, CHICAGO, ILL'; */
SELECT 
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'
/* Given the following database schema: */
CREATE TABLE Dish
(
    id             INTEGER
            primary key,
    name           TEXT,
    description    TEXT,
    menus_appeared INTEGER,
    times_appeared INTEGER,
    first_appeared INTEGER,
    last_appeared  INTEGER,
    lowest_price   REAL,
    highest_price  REAL
)

CREATE TABLE Menu
(
    id                   INTEGER
            primary key,
    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
)

CREATE TABLE MenuPage
(
    id          INTEGER
            primary key,
    menu_id     INTEGER,
    page_number INTEGER,
    image_id    REAL,
    full_height INTEGER,
    full_width  INTEGER,
    uuid        TEXT,
    foreign key (menu_id) references Menu(id)
)

CREATE TABLE MenuItem
(
    id           INTEGER
            primary key,
    menu_page_id INTEGER,
    price        REAL,
    high_price   REAL,
    dish_id      INTEGER,
    created_at   TEXT,
    updated_at   TEXT,
    xpos         REAL,
    ypos         REAL,
    foreign key (dish_id) references Dish(id),
    foreign key (menu_page_id) references MenuPage(id)
)

/* Answer the following: Among the menus that include baked apples with cream, who is the sponsor of the menu with the highest price? baked apples with cream is a name of dish; highest price refers to MAX(price); */
SELECT 
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
/* Given the following database schema: */
CREATE TABLE Dish
(
    id             INTEGER
            primary key,
    name           TEXT,
    description    TEXT,
    menus_appeared INTEGER,
    times_appeared INTEGER,
    first_appeared INTEGER,
    last_appeared  INTEGER,
    lowest_price   REAL,
    highest_price  REAL
)

CREATE TABLE Menu
(
    id                   INTEGER
            primary key,
    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
)

CREATE TABLE MenuPage
(
    id          INTEGER
            primary key,
    menu_id     INTEGER,
    page_number INTEGER,
    image_id    REAL,
    full_height INTEGER,
    full_width  INTEGER,
    uuid        TEXT,
    foreign key (menu_id) references Menu(id)
)

CREATE TABLE MenuItem
(
    id           INTEGER
            primary key,
    menu_page_id INTEGER,
    price        REAL,
    high_price   REAL,
    dish_id      INTEGER,
    created_at   TEXT,
    updated_at   TEXT,
    xpos         REAL,
    ypos         REAL,
    foreign key (dish_id) references Dish(id),
    foreign key (menu_page_id) references MenuPage(id)
)

/* Answer the following: 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. average number of dishes per menu = DIVIDE(COUNT(dish_id), COUNT(menu_page_id)); Souper de Luxe is a name of menu; dish that appeared the most in all of its menus refers to MAX(COUNT(dish_id)); */
SELECT 
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
/* Given the following database schema: */
CREATE TABLE Dish
(
    id             INTEGER
            primary key,
    name           TEXT,
    description    TEXT,
    menus_appeared INTEGER,
    times_appeared INTEGER,
    first_appeared INTEGER,
    last_appeared  INTEGER,
    lowest_price   REAL,
    highest_price  REAL
)

CREATE TABLE Menu
(
    id                   INTEGER
            primary key,
    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
)

CREATE TABLE MenuPage
(
    id          INTEGER
            primary key,
    menu_id     INTEGER,
    page_number INTEGER,
    image_id    REAL,
    full_height INTEGER,
    full_width  INTEGER,
    uuid        TEXT,
    foreign key (menu_id) references Menu(id)
)

CREATE TABLE MenuItem
(
    id           INTEGER
            primary key,
    menu_page_id INTEGER,
    price        REAL,
    high_price   REAL,
    dish_id      INTEGER,
    created_at   TEXT,
    updated_at   TEXT,
    xpos         REAL,
    ypos         REAL,
    foreign key (dish_id) references Dish(id),
    foreign key (menu_page_id) references MenuPage(id)
)

/* Answer the following: Please list the IDs of all the menus that are DIYs of the restaurant. menus that are DIYs of the restaurant refers to sponsor is null; */
SELECT 
SELECT id FROM Menu WHERE sponsor IS NULL
/* Given the following database schema: */
CREATE TABLE Dish
(
    id             INTEGER
            primary key,
    name           TEXT,
    description    TEXT,
    menus_appeared INTEGER,
    times_appeared INTEGER,
    first_appeared INTEGER,
    last_appeared  INTEGER,
    lowest_price   REAL,
    highest_price  REAL
)

CREATE TABLE Menu
(
    id                   INTEGER
            primary key,
    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
)

CREATE TABLE MenuPage
(
    id          INTEGER
            primary key,
    menu_id     INTEGER,
    page_number INTEGER,
    image_id    REAL,
    full_height INTEGER,
    full_width  INTEGER,
    uuid        TEXT,
    foreign key (menu_id) references Menu(id)
)

CREATE TABLE MenuItem
(
    id           INTEGER
            primary key,
    menu_page_id INTEGER,
    price        REAL,
    high_price   REAL,
    dish_id      INTEGER,
    created_at   TEXT,
    updated_at   TEXT,
    xpos         REAL,
    ypos         REAL,
    foreign key (dish_id) references Dish(id),
    foreign key (menu_page_id) references MenuPage(id)
)

/* Answer the following: How many menus were created for lunch? created for lunch refers to event = 'LUNCH'; */
SELECT 
SELECT COUNT(*) FROM Menu WHERE event = 'LUNCH'
/* Given the following database schema: */
CREATE TABLE Dish
(
    id             INTEGER
            primary key,
    name           TEXT,
    description    TEXT,
    menus_appeared INTEGER,
    times_appeared INTEGER,
    first_appeared INTEGER,
    last_appeared  INTEGER,
    lowest_price   REAL,
    highest_price  REAL
)

CREATE TABLE Menu
(
    id                   INTEGER
            primary key,
    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
)

CREATE TABLE MenuPage
(
    id          INTEGER
            primary key,
    menu_id     INTEGER,
    page_number INTEGER,
    image_id    REAL,
    full_height INTEGER,
    full_width  INTEGER,
    uuid        TEXT,
    foreign key (menu_id) references Menu(id)
)

CREATE TABLE MenuItem
(
    id           INTEGER
            primary key,
    menu_page_id INTEGER,
    price        REAL,
    high_price   REAL,
    dish_id      INTEGER,
    created_at   TEXT,
    updated_at   TEXT,
    xpos         REAL,
    ypos         REAL,
    foreign key (dish_id) references Dish(id),
    foreign key (menu_page_id) references MenuPage(id)
)

/* Answer the following: Among the menus with over 10 pages, how many of them have over 20 dishes? menus with over 10 pages refers to page_count > 10; over 20 dishes refers to dish_count > 20; */
SELECT 
SELECT COUNT(*) FROM Menu WHERE page_count > 10 AND dish_count > 20
/* Given the following database schema: */
CREATE TABLE Dish
(
    id             INTEGER
            primary key,
    name           TEXT,
    description    TEXT,
    menus_appeared INTEGER,
    times_appeared INTEGER,
    first_appeared INTEGER,
    last_appeared  INTEGER,
    lowest_price   REAL,
    highest_price  REAL
)

CREATE TABLE Menu
(
    id                   INTEGER
            primary key,
    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
)

CREATE TABLE MenuPage
(
    id          INTEGER
            primary key,
    menu_id     INTEGER,
    page_number INTEGER,
    image_id    REAL,
    full_height INTEGER,
    full_width  INTEGER,
    uuid        TEXT,
    foreign key (menu_id) references Menu(id)
)

CREATE TABLE MenuItem
(
    id           INTEGER
            primary key,
    menu_page_id INTEGER,
    price        REAL,
    high_price   REAL,
    dish_id      INTEGER,
    created_at   TEXT,
    updated_at   TEXT,
    xpos         REAL,
    ypos         REAL,
    foreign key (dish_id) references Dish(id),
    foreign key (menu_page_id) references MenuPage(id)
)

/* Answer the following: What is the ID of the menu with the most number of dishes? most number of dishes refers to MAX(COUNT(dish_count)); */
SELECT 
SELECT id FROM Menu ORDER BY dish_count DESC LIMIT 1
/* Given the following database schema: */
CREATE TABLE Dish
(
    id             INTEGER
            primary key,
    name           TEXT,
    description    TEXT,
    menus_appeared INTEGER,
    times_appeared INTEGER,
    first_appeared INTEGER,
    last_appeared  INTEGER,
    lowest_price   REAL,
    highest_price  REAL
)

CREATE TABLE Menu
(
    id                   INTEGER
            primary key,
    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
)

CREATE TABLE MenuPage
(
    id          INTEGER
            primary key,
    menu_id     INTEGER,
    page_number INTEGER,
    image_id    REAL,
    full_height INTEGER,
    full_width  INTEGER,
    uuid        TEXT,
    foreign key (menu_id) references Menu(id)
)

CREATE TABLE MenuItem
(
    id           INTEGER
            primary key,
    menu_page_id INTEGER,
    price        REAL,
    high_price   REAL,
    dish_id      INTEGER,
    created_at   TEXT,
    updated_at   TEXT,
    xpos         REAL,
    ypos         REAL,
    foreign key (dish_id) references Dish(id),
    foreign key (menu_page_id) references MenuPage(id)
)

/* Answer the following: How many dishes are there on the menu "Zentral Theater Terrace"? Zentral Theater Terrace is a name of menu; */
SELECT 
SELECT COUNT(*) FROM Menu WHERE name = 'Zentral Theater Terrace'
/* Given the following database schema: */
CREATE TABLE Dish
(
    id             INTEGER
            primary key,
    name           TEXT,
    description    TEXT,
    menus_appeared INTEGER,
    times_appeared INTEGER,
    first_appeared INTEGER,
    last_appeared  INTEGER,
    lowest_price   REAL,
    highest_price  REAL
)

CREATE TABLE Menu
(
    id                   INTEGER
            primary key,
    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
)

CREATE TABLE MenuPage
(
    id          INTEGER
            primary key,
    menu_id     INTEGER,
    page_number INTEGER,
    image_id    REAL,
    full_height INTEGER,
    full_width  INTEGER,
    uuid        TEXT,
    foreign key (menu_id) references Menu(id)
)

CREATE TABLE MenuItem
(
    id           INTEGER
            primary key,
    menu_page_id INTEGER,
    price        REAL,
    high_price   REAL,
    dish_id      INTEGER,
    created_at   TEXT,
    updated_at   TEXT,
    xpos         REAL,
    ypos         REAL,
    foreign key (dish_id) references Dish(id),
    foreign key (menu_page_id) references MenuPage(id)
)

/* Answer the following: Among the menus that did not support taking out or booking in advance, how many of them were created before 1950? did not support taking out or booking in advance refers to call_number is null; created before 1950 refers to strftime('%Y', date) < '1950'; */
SELECT 
SELECT COUNT(*) FROM Menu WHERE call_number IS NULL AND strftime('%Y', date) < '1950'
/* Given the following database schema: */
CREATE TABLE Dish
(
    id             INTEGER
            primary key,
    name           TEXT,
    description    TEXT,
    menus_appeared INTEGER,
    times_appeared INTEGER,
    first_appeared INTEGER,
    last_appeared  INTEGER,
    lowest_price   REAL,
    highest_price  REAL
)

CREATE TABLE Menu
(
    id                   INTEGER
            primary key,
    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
)

CREATE TABLE MenuPage
(
    id          INTEGER
            primary key,
    menu_id     INTEGER,
    page_number INTEGER,
    image_id    REAL,
    full_height INTEGER,
    full_width  INTEGER,
    uuid        TEXT,
    foreign key (menu_id) references Menu(id)
)

CREATE TABLE MenuItem
(
    id           INTEGER
            primary key,
    menu_page_id INTEGER,
    price        REAL,
    high_price   REAL,
    dish_id      INTEGER,
    created_at   TEXT,
    updated_at   TEXT,
    xpos         REAL,
    ypos         REAL,
    foreign key (dish_id) references Dish(id),
    foreign key (menu_page_id) references MenuPage(id)
)

/* Answer the following: What is the image ID of page 1 of the menu "Zentral Theater Terrace"? page 1 refers to page_number = 1; Zentral Theater Terrace is a name of menu; */
SELECT 
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
/* Given the following database schema: */
CREATE TABLE Dish
(
    id             INTEGER
            primary key,
    name           TEXT,
    description    TEXT,
    menus_appeared INTEGER,
    times_appeared INTEGER,
    first_appeared INTEGER,
    last_appeared  INTEGER,
    lowest_price   REAL,
    highest_price  REAL
)

CREATE TABLE Menu
(
    id                   INTEGER
            primary key,
    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
)

CREATE TABLE MenuPage
(
    id          INTEGER
            primary key,
    menu_id     INTEGER,
    page_number INTEGER,
    image_id    REAL,
    full_height INTEGER,
    full_width  INTEGER,
    uuid        TEXT,
    foreign key (menu_id) references Menu(id)
)

CREATE TABLE MenuItem
(
    id           INTEGER
            primary key,
    menu_page_id INTEGER,
    price        REAL,
    high_price   REAL,
    dish_id      INTEGER,
    created_at   TEXT,
    updated_at   TEXT,
    xpos         REAL,
    ypos         REAL,
    foreign key (dish_id) references Dish(id),
    foreign key (menu_page_id) references MenuPage(id)
)

/* Answer the following: To which menu does the menu page image ID5189412 belong? Please give its name. FALSE; */
SELECT 
SELECT T1.name FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id WHERE T2.image_id = 5189412
/* Given the following database schema: */
CREATE TABLE Dish
(
    id             INTEGER
            primary key,
    name           TEXT,
    description    TEXT,
    menus_appeared INTEGER,
    times_appeared INTEGER,
    first_appeared INTEGER,
    last_appeared  INTEGER,
    lowest_price   REAL,
    highest_price  REAL
)

CREATE TABLE Menu
(
    id                   INTEGER
            primary key,
    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
)

CREATE TABLE MenuPage
(
    id          INTEGER
            primary key,
    menu_id     INTEGER,
    page_number INTEGER,
    image_id    REAL,
    full_height INTEGER,
    full_width  INTEGER,
    uuid        TEXT,
    foreign key (menu_id) references Menu(id)
)

CREATE TABLE MenuItem
(
    id           INTEGER
            primary key,
    menu_page_id INTEGER,
    price        REAL,
    high_price   REAL,
    dish_id      INTEGER,
    created_at   TEXT,
    updated_at   TEXT,
    xpos         REAL,
    ypos         REAL,
    foreign key (dish_id) references Dish(id),
    foreign key (menu_page_id) references MenuPage(id)
)

/* Answer the following: Which menu page has a bigger width, page 1 of "Zentral Theater Terrace" or page 1 of "Young's Hotel"? if SUM(full_width where page_number = 1 AND menu.name = 'Zentral Theater Terrace') > SUM(full_width where page_number = 1 AND menu.name = 'Young''s Hotel'), it means Zentral Theater Terrace menu page is bigger than Young's Hotel; if SUM(full_width WHERE page_number = 1 AND menu.name = 'Young''s Hotel') < SUM(full_width WHERE page_number = 1 AND menu.name = 'Zentral Theater Terrace'), it means Young's Hotel menu page is bigger than Zentral Theater Terrace; */
SELECT 
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