input
stringlengths
193
2.69k
output
stringlengths
24
744
[INST] Here is a database schema: Employees : EmployeeID [ INTEGER ] primary_key FirstName [ TEXT ] MiddleInitial [ TEXT ] LastName [ TEXT ] Products : ProductID [ INTEGER ] primary_key Name [ TEXT ] Price [ REAL ] Sales : SalesID [ INTEGER ] primary_key SalesPersonID [ INTEGER ] Sales.SalesPersonID = Employees.EmployeeID CustomerID [ INTEGER ] Sales.CustomerID = Customers.CustomerID ProductID [ INTEGER ] Sales.ProductID = Products.ProductID Quantity [ INTEGER ] Please write me a SQL statement that answers the following question: What is the total cost of all the "Road-650, Red, 60" products that Abraham E. Bennet sold? [/INST]
SELECT SUM(T2.Quantity * T3.Price) FROM Employees AS T1 INNER JOIN Sales AS T2 ON T1.EmployeeID = T2.SalesPersonID INNER JOIN Products AS T3 ON T2.ProductID = T3.ProductID WHERE T1.FirstName = 'Abraham' AND T1.MiddleInitial = 'e' AND T1.LastName = 'Bennet' AND T3.Name = 'Road-650 Red, 60';
[INST] Here is a database schema: Products : ProductID [ INTEGER ] primary_key Name [ TEXT ] Price [ REAL ] Sales : SalesID [ INTEGER ] primary_key SalesPersonID [ INTEGER ] Sales.SalesPersonID = Employees.EmployeeID CustomerID [ INTEGER ] Sales.CustomerID = Customers.CustomerID ProductID [ INTEGER ] Sales.ProductID = Products.ProductID Quantity [ INTEGER ] Please write me a SQL statement that answers the following question: Which product has the highest total amount of quantity sold? Calculate its overall total price. [/INST]
SELECT T1.Name, SUM(T2.Quantity * T1.Price) FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID GROUP BY T1.ProductID, T1.Name ORDER BY SUM(T2.Quantity) DESC LIMIT 1;
[INST] Here is a database schema: Customers : CustomerID [ INTEGER ] primary_key FirstName [ TEXT ] MiddleInitial [ TEXT ] LastName [ TEXT ] Please write me a SQL statement that answers the following question: List the first name of all the customers whose last name is Chen. [/INST]
SELECT FirstName, LastName FROM Customers WHERE LastName = 'Chen';
[INST] Here is a database schema: Employees : EmployeeID [ INTEGER ] primary_key FirstName [ TEXT ] MiddleInitial [ TEXT ] LastName [ TEXT ] Please write me a SQL statement that answers the following question: Among the employee names, what is the most common middle initial? [/INST]
SELECT MiddleInitial FROM Employees GROUP BY MiddleInitial ORDER BY COUNT(MiddleInitial) DESC LIMIT 1;
[INST] Here is a database schema: Products : ProductID [ INTEGER ] primary_key Name [ TEXT ] Price [ REAL ] Please write me a SQL statement that answers the following question: What is the average price of products that cost between 100 and 200? [/INST]
SELECT AVG(Price) FROM Products WHERE Price BETWEEN 100 AND 200;
[INST] Here is a database schema: Customers : CustomerID [ INTEGER ] primary_key FirstName [ TEXT ] MiddleInitial [ TEXT ] LastName [ TEXT ] Sales : SalesID [ INTEGER ] primary_key SalesPersonID [ INTEGER ] Sales.SalesPersonID = Employees.EmployeeID CustomerID [ INTEGER ] Sales.CustomerID = Customers.CustomerID ProductID [ INTEGER ] Sales.ProductID = Products.ProductID Quantity [ INTEGER ] Please write me a SQL statement that answers the following question: Find and list the full name of customers who bought products above-average quantity. [/INST]
SELECT T2.FirstName, T2.MiddleInitial, T2.LastName FROM Sales AS T1 INNER JOIN Customers AS T2 ON T1.CustomerID = T2.CustomerID GROUP BY T1.Quantity HAVING T1.Quantity > ( SELECT AVG(Quantity) FROM Sales );
[INST] Here is a database schema: Customers : CustomerID [ INTEGER ] primary_key FirstName [ TEXT ] MiddleInitial [ TEXT ] LastName [ TEXT ] Products : ProductID [ INTEGER ] primary_key Name [ TEXT ] Price [ REAL ] Sales : SalesID [ INTEGER ] primary_key SalesPersonID [ INTEGER ] Sales.SalesPersonID = Employees.EmployeeID CustomerID [ INTEGER ] Sales.CustomerID = Customers.CustomerID ProductID [ INTEGER ] Sales.ProductID = Products.ProductID Quantity [ INTEGER ] Please write me a SQL statement that answers the following question: Give the full name of the customer who bought the most amount of products. [/INST]
SELECT T3.FirstName, T3.MiddleInitial, T3.LastName FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID INNER JOIN Customers AS T3 ON T2.CustomerID = T3.CustomerID ORDER BY T2.Quantity * T1.Price DESC LIMIT 1;
[INST] Here is a database schema: Employees : EmployeeID [ INTEGER ] primary_key FirstName [ TEXT ] MiddleInitial [ TEXT ] LastName [ TEXT ] Products : ProductID [ INTEGER ] primary_key Name [ TEXT ] Price [ REAL ] Sales : SalesID [ INTEGER ] primary_key SalesPersonID [ INTEGER ] Sales.SalesPersonID = Employees.EmployeeID CustomerID [ INTEGER ] Sales.CustomerID = Customers.CustomerID ProductID [ INTEGER ] Sales.ProductID = Products.ProductID Quantity [ INTEGER ] Please write me a SQL statement that answers the following question: Of the employees who sold Blade, who has the most amount of sales? [/INST]
SELECT T1.FirstName, T1.MiddleInitial, T1.LastName FROM Employees AS T1 INNER JOIN Sales AS T2 ON T1.EmployeeID = T2.SalesPersonID INNER JOIN Products AS T3 ON T2.ProductID = T3.ProductID ORDER BY T2.Quantity * T3.Price DESC LIMIT 1;
[INST] Here is a database schema: Customers : CustomerID [ INTEGER ] primary_key FirstName [ TEXT ] MiddleInitial [ TEXT ] LastName [ TEXT ] Products : ProductID [ INTEGER ] primary_key Name [ TEXT ] Price [ REAL ] Sales : SalesID [ INTEGER ] primary_key SalesPersonID [ INTEGER ] Sales.SalesPersonID = Employees.EmployeeID CustomerID [ INTEGER ] Sales.CustomerID = Customers.CustomerID ProductID [ INTEGER ] Sales.ProductID = Products.ProductID Quantity [ INTEGER ] Please write me a SQL statement that answers the following question: List the full name of customers who spend more than 50,000 in descending order the amount spend. [/INST]
SELECT DISTINCT T3.FirstName, T3.MiddleInitial, T3.LastName FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID INNER JOIN Customers AS T3 ON T2.CustomerID = T3.CustomerID WHERE T2.Quantity * T1.Price > 50000;
[INST] Here is a database schema: Products : ProductID [ INTEGER ] primary_key Name [ TEXT ] Price [ REAL ] Sales : SalesID [ INTEGER ] primary_key SalesPersonID [ INTEGER ] Sales.SalesPersonID = Employees.EmployeeID CustomerID [ INTEGER ] Sales.CustomerID = Customers.CustomerID ProductID [ INTEGER ] Sales.ProductID = Products.ProductID Quantity [ INTEGER ] Please write me a SQL statement that answers the following question: Name the product that sold the most quantity. [/INST]
SELECT T2.Name FROM Sales AS T1 INNER JOIN Products AS T2 ON T1.ProductID = T2.ProductID ORDER BY T1.Quantity DESC LIMIT 1;
[INST] Here is a database schema: Products : ProductID [ INTEGER ] primary_key Name [ TEXT ] Price [ REAL ] Sales : SalesID [ INTEGER ] primary_key SalesPersonID [ INTEGER ] Sales.SalesPersonID = Employees.EmployeeID CustomerID [ INTEGER ] Sales.CustomerID = Customers.CustomerID ProductID [ INTEGER ] Sales.ProductID = Products.ProductID Quantity [ INTEGER ] Please write me a SQL statement that answers the following question: Find and list the products that sold below the average quantity. [/INST]
SELECT DISTINCT T2.Name FROM Sales AS T1 INNER JOIN Products AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Quantity < ( SELECT AVG(Quantity) FROM Sales );
[INST] Here is a database schema: 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 ] Please write me a SQL statement that answers the following question: How many dishes do not have correct data for the year in which it appeared first? [/INST]
SELECT COUNT(*) FROM Dish WHERE first_appeared < 1851 OR first_appeared > 2012;
[INST] Here is a database schema: 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 ] Please write me a SQL statement that answers the following question: Which dish lasted longer, Anchovies or Fresh lobsters in every style? [/INST]
SELECT CASE WHEN SUM(CASE WHEN name = 'Anchovies' THEN last_appeared - first_appeared ELSE 0 END) - SUM(CASE WHEN name = 'Fresh lobsters in every style' THEN last_appeared - first_appeared ELSE 0 END) > 0 THEN 'Anchovies' ELSE 'Fresh lobsters in every style' END FROM Dish WHERE name IN ('Fresh lobsters in every style', 'Anchovies');
[INST] Here is a database schema: 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 ] Please write me a SQL statement that answers the following question: Among all the dishes that were once free, what is the name of the dish that had appeared on most menus? [/INST]
SELECT name FROM Dish WHERE lowest_price = 0 ORDER BY menus_appeared DESC LIMIT 1;
[INST] Here is a database schema: 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 ] Please write me a SQL statement that answers the following question: How many menus with the name "Waldorf Astoria" have 4 pages? [/INST]
SELECT COUNT(*) FROM Menu WHERE name = 'Waldorf Astoria' AND page_count = 4;
[INST] Here is a database schema: 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 ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: What is the name of the dish that appeared on the upper left corner on menu page no. 1389? [/INST]
SELECT T1.name FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T2.menu_page_id = 1389 AND T2.xpos < 0.25 AND T2.ypos < 0.25;
[INST] Here is a database schema: 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 ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: Please list the prices of the dish "Clear green turtle" on every menu page it appeared on. [/INST]
SELECT T2.price FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T1.name = 'Clear green turtle';
[INST] Here is a database schema: 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 ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: Among all the menu pages with the appearance of the dish "Clear green turtle", how many of them have the dish at a stable price? [/INST]
SELECT SUM(CASE WHEN T1.name = 'Clear green turtle' 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;
[INST] Here is a database schema: 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 ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: What is the highest price of the dish "Clear green turtle" on a menu page? [/INST]
SELECT T2.price FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T1.name = 'Clear green turtle' ORDER BY T2.price DESC LIMIT 1;
[INST] Here is a database schema: 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 ] MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: Please list the IDs of all the menus in which the dish "Clear green turtle" had appeared. [/INST]
SELECT T1.menu_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 = 'Clear green turtle';
[INST] Here is a database schema: 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 ] 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 ] MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: Among the menus in which the dish "Clear green turtle" had appeared, how many of them used the dollar as their currency? [/INST]
SELECT SUM(CASE WHEN T3.currency = 'Dollars' THEN 1 ELSE 0 END) 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 T4.name = 'Clear green turtle';
[INST] Here is a database schema: 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 ] 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 ] MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: Among the menus in which the dish "Clear green turtle" had appeared, how many of them did not support taking out or booking in advance? [/INST]
SELECT SUM(CASE WHEN T4.name = 'Clear green turtle' THEN 1 ELSE 0 END) 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.call_number IS NULL;
[INST] Here is a database schema: 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 ] 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 ] MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: Please list the names of all the dishes that appeared on the menu "Zentral Theater Terrace". [/INST]
SELECT T4.name 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 = 'Zentral Theater Terrace';
[INST] Here is a database schema: 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 ] 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 ] MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: Which dish has the highest price on the menu "Zentral Theater Terrace"? Please give its name. [/INST]
SELECT T4.name 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 = 'Zentral Theater Terrace' ORDER BY T1.price DESC LIMIT 1;
[INST] Here is a database schema: 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 ] MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: How many dishes are there on the menu "Zentral Theater Terrace"? [/INST]
SELECT SUM(CASE WHEN T3.name = 'Zentral Theater Terrace' THEN 1 ELSE 0 END) 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;
[INST] Here is a database schema: 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 ] MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: How many dishes are there in total in the menus with the name "Waldorf Astoria"? [/INST]
SELECT SUM(CASE WHEN T3.name = 'Waldorf Astoria' THEN 1 ELSE 0 END) 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;
[INST] Here is a database schema: 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 ] 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 ] MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: Please list the IDs of the menus that are DIYs of the restaurant and have the dish "Clear green turtle". [/INST]
SELECT T2.menu_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 T4.name = 'Clear green turtle' AND T3.sponsor IS NULL;
[INST] Here is a database schema: 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 ] MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: What is the average page number of the menus that have the dish "Clear green turtle"? [/INST]
SELECT AVG(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 = 'Clear green turtle';
[INST] Here is a database schema: 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 ] MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: What is the average price of the dishes on the menu "Zentral Theater Terrace"? [/INST]
SELECT SUM(T1.price) / COUNT(T1.price) 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 T3.name = 'Zentral Theater Terrace';
[INST] Here is a database schema: MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: How many menu items were created on 28th March 2011? [/INST]
SELECT COUNT(*) FROM MenuItem WHERE created_at LIKE '2011-03-28%';
[INST] Here is a database schema: MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: How many dishes are included in the menu page ID 144? [/INST]
SELECT COUNT(*) FROM MenuItem WHERE menu_page_id = 144;
[INST] Here is a database schema: 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 ] Please write me a SQL statement that answers the following question: How many menus were used in Dutcher House? [/INST]
SELECT COUNT(*) FROM Menu WHERE location = 'Dutcher House';
[INST] Here is a database schema: 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 ] Please write me a SQL statement that answers the following question: How many dishes appeared on a menu more than once? [/INST]
SELECT COUNT(*) FROM Dish WHERE times_appeared > menus_appeared;
[INST] Here is a database schema: 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 ] Please write me a SQL statement that answers the following question: How many menus were created for steamship? [/INST]
SELECT COUNT(*) FROM Menu WHERE venue = 'STEAMSHIP';
[INST] Here is a database schema: 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 ] MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] Please write me a SQL statement that answers the following question: How many pages were there on the menu created on 17th November 1898? [/INST]
SELECT SUM(CASE WHEN T1.date = '1898-11-17' THEN 1 ELSE 0 END) FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id;
[INST] Here is a database schema: 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 ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: Name the dishes that were on the menu page ID 174. [/INST]
SELECT T2.name FROM MenuItem AS T1 INNER JOIN Dish AS T2 ON T2.id = T1.dish_id WHERE T1.menu_page_id = 174;
[INST] Here is a database schema: 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 ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: List the names and menu page IDs of the dishes that first appeared in 1861. [/INST]
SELECT T2.name, T1.dish_id FROM MenuItem AS T1 INNER JOIN Dish AS T2 ON T2.id = T1.dish_id WHERE T2.first_appeared = 1861;
[INST] Here is a database schema: 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 ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: Among the dishes on menu page ID 7610, list the names and highest prices of the dishes in menu items that were created on 23rd May 2011. [/INST]
SELECT T1.name, T2.price FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T2.created_at LIKE '2011-05-23%' ORDER BY T2.price DESC LIMIT 1;
[INST] Here is a database schema: 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 ] MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: List the dishes included on page number 30 with the least in full height. [/INST]
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.page_number = 30 ORDER BY T1.full_height DESC, T1.full_height ASC LIMIT 1;
[INST] Here is a database schema: 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 ] MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] Please write me a SQL statement that answers the following question: Provide the page IDs and name of the menu which had the highest page count. [/INST]
SELECT T1.page_number, T2.name FROM MenuPage AS T1 INNER JOIN Menu AS T2 ON T2.id = T1.menu_id ORDER BY T2.page_count DESC LIMIT 1;
[INST] Here is a database schema: 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 ] MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: On the menu with the most dishes, how many dishes were there on its second page? [/INST]
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 WHERE T2.page_number = 2 GROUP BY T3.name ORDER BY T3.dish_count DESC LIMIT 1;
[INST] Here is a database schema: 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 ] 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 ] MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: Provide the numbers of the menu item which includes Fresh lobsters in every style and location where that dish was used on a menu. [/INST]
SELECT T2.menu_id, T1.xpos, T1.ypos 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 T4.name = 'Fresh lobsters in every style';
[INST] Here is a database schema: 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 ] 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 ] MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: List the dishes that appeared at the left upper corner of the CHAS.BRADLEY'S OYSTER & DINING ROOM"s sponsored menu. [/INST]
SELECT T4.name 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.sponsor = 'CHAS.BRADLEY''S OYSTER & DINING ROOM' AND T1.xpos < 0.25 AND T1.ypos < 0.25;
[INST] Here is a database schema: 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 ] 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 ] MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: Provide the sponsor and event of the menu which includes Cerealine with Milk. [/INST]
SELECT T3.name, T3.event 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 T4.name = 'Cerealine with Milk';
[INST] Here is a database schema: 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 ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: How many percent of Bluefish dishes are located at the center of the menu page? [/INST]
SELECT CAST(SUM(CASE WHEN T2.xpos BETWEEN 0.25 AND 0.75 AND T2.ypos BETWEEN 0.25 AND 0.75 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.id) FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T1.name LIKE '%BLuefish%';
[INST] Here is a database schema: 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 ] Please write me a SQL statement that answers the following question: Who is the sponsor of menu with ID 12463? [/INST]
SELECT sponsor FROM Menu WHERE id = 12463;
[INST] Here is a database schema: 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 ] Please write me a SQL statement that answers the following question: What is the event sponsored by the Republican House? [/INST]
SELECT event FROM Menu WHERE sponsor = 'REPUBLICAN HOUSE';
[INST] Here is a database schema: 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 ] Please write me a SQL statement that answers the following question: Where is the place that menu with ID 12472 was created for? [/INST]
SELECT location FROM Menu WHERE id = 12472;
[INST] Here is a database schema: 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 ] Please write me a SQL statement that answers the following question: Please describe the menu sponsored by Noviomagus physically. [/INST]
SELECT physical_description FROM Menu WHERE sponsor = 'Noviomagus';
[INST] Here is a database schema: 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 ] Please write me a SQL statement that answers the following question: What is the occasion for menu with ID 12463? [/INST]
SELECT occasion FROM Menu WHERE id = 12463;
[INST] Here is a database schema: 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 ] Please write me a SQL statement that answers the following question: List down the locations of menu sponsored by Norddeutscher Lloyd Bremen. [/INST]
SELECT location FROM Menu WHERE sponsor = 'Norddeutscher Lloyd Bremen';
[INST] Here is a database schema: 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 ] MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] Please write me a SQL statement that answers the following question: List down the menu page IDs for menu sponsored by Occidental & Oriental? [/INST]
SELECT T2.id FROM MenuPage AS T1 INNER JOIN Menu AS T2 ON T2.id = T1.menu_id WHERE T2.sponsor = 'Occidental & Oriental';
[INST] Here is a database schema: 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 ] MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] Please write me a SQL statement that answers the following question: List down the image IDs for menu located at Manhattan Hotel. [/INST]
SELECT T1.image_id FROM MenuPage AS T1 INNER JOIN Menu AS T2 ON T2.id = T1.menu_id WHERE T2.location = 'Manhattan Hotel';
[INST] Here is a database schema: 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 ] MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] Please write me a SQL statement that answers the following question: State the full height and width for menu called "El Fuerte Del Palmar". [/INST]
SELECT T1.full_height, T1.full_width FROM MenuPage AS T1 INNER JOIN Menu AS T2 ON T2.id = T1.menu_id WHERE T2.name = 'El Fuerte Del Palmar';
[INST] Here is a database schema: 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 ] MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] Please write me a SQL statement that answers the following question: Is "c02c9a3b-6881-7080-e040-e00a180631aa" the uuid for menu called "The Biltmore"? [/INST]
SELECT CASE WHEN T2.uuid = 'c02c9a3b-6881-7080-e040-e00a180631aa' THEN 'yes' ELSE 'no' END AS yn FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id WHERE T1.name = 'The Biltmore' AND T2.uuid = 'c02c9a3b-6881-7080-e040-e00a180631aa';
[INST] Here is a database schema: 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 ] MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] Please write me a SQL statement that answers the following question: State the name of menu with the longest full height. [/INST]
SELECT T2.name FROM MenuPage AS T1 INNER JOIN Menu AS T2 ON T2.id = T1.menu_id ORDER BY T1.full_height DESC LIMIT 1;
[INST] Here is a database schema: 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 ] MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] Please write me a SQL statement that answers the following question: What is the page count for menu with page ID of 130? [/INST]
SELECT T1.page_count FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id WHERE T2.id = 130;
[INST] Here is a database schema: 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 ] MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: How much is the price of menu with image ID 4000009194? [/INST]
SELECT T3.price FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id INNER JOIN MenuItem AS T3 ON T2.id = T3.menu_page_id WHERE T2.image_id = 4000009194;
[INST] Here is a database schema: 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 ] MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: List down the page numbers for menu with dishes on the right upper corner. [/INST]
SELECT T2.page_number FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id INNER JOIN MenuItem AS T3 ON T2.id = T3.menu_page_id WHERE T3.xpos > 0.75 AND T3.ypos < 0.25;
[INST] Here is a database schema: 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 ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: List down the name of dishes from menu created in April. [/INST]
SELECT T2.name FROM MenuItem AS T1 INNER JOIN Dish AS T2 ON T2.id = T1.dish_id WHERE SUBSTR(T1.created_at, 7, 1) = '4';
[INST] Here is a database schema: 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 ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: List down name of dishes from menu with menu page ID 1389. [/INST]
SELECT T2.name FROM MenuItem AS T1 INNER JOIN Dish AS T2 ON T2.id = T1.dish_id WHERE T1.menu_page_id = 1389;
[INST] Here is a database schema: 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 ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: What is the highest price of dishes with menu item ID 1 to 5? [/INST]
SELECT T2.price FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T2.id BETWEEN 1 AND 5 ORDER BY T2.price DESC LIMIT 1;
[INST] Here is a database schema: 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 ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: List down the name of dishes that were positioned on the left upper corner. [/INST]
SELECT T1.name FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T2.xpos < 0.25 AND T2.ypos < 0.25;
[INST] Here is a database schema: 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 ] MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] Please write me a SQL statement that answers the following question: Calculate the total dish count for menu with uuid of "510d47e4-2958-a3d9-e040-e00a18064a99" & "510d47e4-295a-a3d9-e040-e00a18064a99". [/INST]
SELECT SUM(CASE WHEN T2.uuid = '510d47e4-2958-a3d9-e040-e00a18064a99' THEN T1.dish_count ELSE 0 END) - SUM(CASE WHEN T2.uuid = '510d47e4-295a-a3d9-e040-e00a18064a99' THEN T1.dish_count ELSE 0 END) FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id;
[INST] Here is a database schema: MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: Calculate the total price of items for menu with ID 12882. [/INST]
SELECT SUM(T2.price) FROM MenuPage AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.menu_page_id WHERE T1.menu_id = 12882;
[INST] Here is a database schema: 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 ] Please write me a SQL statement that answers the following question: List the top five dishes, by descending order, in terms of highest price. [/INST]
SELECT name FROM Dish ORDER BY highest_price DESC LIMIT 5;
[INST] Here is a database schema: 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 ] Please write me a SQL statement that answers the following question: Among the dishes, how many of them are for free? [/INST]
SELECT COUNT(*) FROM Dish WHERE lowest_price = 0;
[INST] Here is a database schema: 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 ] Please write me a SQL statement that answers the following question: What dishes made their first and last appearances in 1855 and 1900, respectively? [/INST]
SELECT name FROM Dish WHERE first_appeared = 1855 AND last_appeared = 1900;
[INST] Here is a database schema: 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 ] Please write me a SQL statement that answers the following question: Write down the top ten menus with the highest dish count. [/INST]
SELECT name FROM Menu GROUP BY name ORDER BY dish_count DESC LIMIT 10;
[INST] Here is a database schema: 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 ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: How many dishes appear in the right upper corner of the menu page? [/INST]
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;
[INST] Here is a database schema: 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 ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: How long has the "Clear Green Turtle" dish appeared on the menu, and tell me when its latest update was? [/INST]
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';
[INST] Here is a database schema: 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 ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: Tally the dishes that have appeared on the menu for more than 100 years. [/INST]
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;
[INST] Here is a database schema: 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 ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: How many dishes have appeared on the menu in less than 5 years? [/INST]
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;
[INST] Here is a database schema: 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 ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: Give me the name and menu price of dishes that were free. [/INST]
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;
[INST] Here is a database schema: MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: How much does the dish on page 2 of menu ID 12474 cost? [/INST]
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;
[INST] Here is a database schema: 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 ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: 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. [/INST]
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;
[INST] Here is a database schema: 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 ] MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] Please write me a SQL statement that answers the following question: Who are the sponsors of the menu whose image full height is more than 10000 mm? [/INST]
SELECT T2.sponsor FROM MenuPage AS T1 INNER JOIN Menu AS T2 ON T2.id = T1.menu_id WHERE T1.full_height = 10000;
[INST] Here is a database schema: 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 ] MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] Please write me a SQL statement that answers the following question: 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. [/INST]
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';
[INST] Here is a database schema: 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 ] MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] Please write me a SQL statement that answers the following question: Under what events was the menu page's full width less than 2000 mm? [/INST]
SELECT T1.event FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id WHERE T2.full_width = 2000;
[INST] Here is a database schema: 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 ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: Name the dishes that cost 180,000. [/INST]
SELECT T1.name FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T2.price = 180000;
[INST] Here is a database schema: 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 ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: What is the position coordinate on the page menu of the "Small Hominy" dish and how long did it appear? [/INST]
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';
[INST] Here is a database schema: 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 ] MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: 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. [/INST]
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';
[INST] Here is a database schema: 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 ] Please write me a SQL statement that answers the following question: How many dishes appeared more than once on a menu? [/INST]
SELECT COUNT(*) FROM Dish WHERE times_appeared > Dish.menus_appeared;
[INST] Here is a database schema: 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 ] Please write me a SQL statement that answers the following question: How many menus sponsored by Krogs Fiske Restaurant were created in April 2015? [/INST]
SELECT COUNT(*) FROM Menu WHERE date LIKE '2015-04%' AND sponsor = 'Krogs Fiskerestaurant';
[INST] Here is a database schema: 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 ] Please write me a SQL statement that answers the following question: Which dish has the longest history? [/INST]
SELECT name FROM Dish ORDER BY last_appeared - Dish.first_appeared DESC LIMIT 1;
[INST] Here is a database schema: 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 ] Please write me a SQL statement that answers the following question: On 1887-07-21, what was the event that lead to the creation of menu id 21380? [/INST]
SELECT event FROM Menu WHERE date = '1887-07-21' AND id = 21380;
[INST] Here is a database schema: 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 ] MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] Please write me a SQL statement that answers the following question: How many pages are there in the "Emil Kuehn" menu? [/INST]
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;
[INST] Here is a database schema: 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 ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: How many menus include puree of split peas aux croutons? [/INST]
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;
[INST] Here is a database schema: 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 ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: What are the names of the dishes with a stable price that were created in April of 2011? [/INST]
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;
[INST] Here is a database schema: 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 ] MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] Please write me a SQL statement that answers the following question: What is the name of the menu with the highest number of pages? [/INST]
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;
[INST] Here is a database schema: 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 ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: Provide the menu page ids of all the menu that includes mashed potatoes. [/INST]
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';
[INST] Here is a database schema: 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 ] MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] Please write me a SQL statement that answers the following question: Among the menus sponsored by Pacific Mail Steamship Company, how many menus have no more than 2 pages? [/INST]
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;
[INST] Here is a database schema: 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 ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: Among the menus that include milk, what is the menu page id of the menu that has the highest price? [/INST]
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;
[INST] Here is a database schema: 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 ] MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] Please write me a SQL statement that answers the following question: What is the menu id of the menu sponsored by Occidental and Oriental Steamship Company with the highest number of pages? [/INST]
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;
[INST] Here is a database schema: 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 ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: List the positions of the dish "breaded veal cutlet with peas" on every menu where it appeared. [/INST]
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';
[INST] Here is a database schema: 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 ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: What are the names of the dishes shown in the lower right corner of menu page 48706? [/INST]
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;
[INST] Here is a database schema: 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 ] 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 ] MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: 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? [/INST]
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';
[INST] Here is a database schema: 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 ] 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 ] MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: Among the menus that include baked apples with cream, who is the sponsor of the menu with the highest price? [/INST]
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;
[INST] Here is a database schema: 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 ] 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 ] MenuPage : id [ INTEGER ] primary_key menu_id [ INTEGER ] MenuPage.menu_id = Menu.id page_number [ INTEGER ] image_id [ REAL ] full_height [ INTEGER ] full_width [ INTEGER ] uuid [ TEXT ] MenuItem : id [ INTEGER ] primary_key menu_page_id [ INTEGER ] MenuItem.menu_page_id = MenuPage.id price [ REAL ] high_price [ REAL ] dish_id [ INTEGER ] MenuItem.dish_id = Dish.id created_at [ TEXT ] updated_at [ TEXT ] xpos [ REAL ] ypos [ REAL ] Please write me a SQL statement that answers the following question: 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. [/INST]
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;
[INST] Here is a database schema: 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 ] Please write me a SQL statement that answers the following question: Please list the IDs of all the menus that are DIYs of the restaurant. [/INST]
SELECT id FROM Menu WHERE sponsor IS NULL;