training_input
stringlengths
118
1.06k
###context:CREATE TABLE WINE (Winery VARCHAR, SCORE VARCHAR) ###human: Which winery is the wine that has the highest score from? ###assistant: SELECT Winery FROM WINE ORDER BY SCORE LIMIT 1
###context:CREATE TABLE WINE (Name VARCHAR, YEAR VARCHAR) ###human: Find the names of all wines produced in 2008. ###assistant: SELECT Name FROM WINE WHERE YEAR = "2008"
###context:CREATE TABLE WINE (Grape VARCHAR, Appelation VARCHAR) ###human: List the grapes and appelations of all wines. ###assistant: SELECT Grape, Appelation FROM WINE
###context:CREATE TABLE WINE (Name VARCHAR, Score VARCHAR) ###human: List the names and scores of all wines. ###assistant: SELECT Name, Score FROM WINE
###context:CREATE TABLE APPELLATIONS (Area VARCHAR, County VARCHAR) ###human: List the area and county of all appelations. ###assistant: SELECT Area, County FROM APPELLATIONS
###context:CREATE TABLE WINE (Price VARCHAR, YEAR INTEGER) ###human: What are the prices of wines produced before the year of 2010? ###assistant: SELECT Price FROM WINE WHERE YEAR < 2010
###context:CREATE TABLE WINE (Name VARCHAR, score INTEGER) ###human: List the names of all distinct wines that have scores higher than 90. ###assistant: SELECT Name FROM WINE WHERE score > 90
###context:CREATE TABLE GRAPES (Grape VARCHAR, Color VARCHAR); CREATE TABLE WINE (Name VARCHAR, Grape VARCHAR) ###human: List the names of all distinct wines that are made of red color grape. ###assistant: SELECT DISTINCT T2.Name FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = "Red"
###context:CREATE TABLE APPELLATIONs (Appelation VARCHAR, Area VARCHAR); CREATE TABLE WINE (Name VARCHAR, Appelation VARCHAR) ###human: Find the names of all distinct wines that have appellations in North Coast area. ###assistant: SELECT DISTINCT T2.Name FROM APPELLATIONs AS T1 JOIN WINE AS T2 ON T1.Appelation ...
###context:CREATE TABLE WINE (Winery VARCHAR) ###human: How many wines are produced at Robert Biale winery? ###assistant: SELECT COUNT(*) FROM WINE WHERE Winery = "Robert Biale"
###context:CREATE TABLE APPELLATIONS (County VARCHAR) ###human: How many appelations are in Napa Country? ###assistant: SELECT COUNT(*) FROM APPELLATIONS WHERE County = "Napa"
###context:CREATE TABLE WINE (Price INTEGER, Appelation VARCHAR); CREATE TABLE APPELLATIONS (Appelation VARCHAR, County VARCHAR) ###human: Give me the average prices of wines that are produced by appelations in Sonoma County. ###assistant: SELECT AVG(T2.Price) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appel...
###context:CREATE TABLE GRAPES (Grape VARCHAR, Color VARCHAR); CREATE TABLE WINE (Name VARCHAR, Score VARCHAR, Grape VARCHAR) ###human: What are the names and scores of wines that are made of white color grapes? ###assistant: SELECT T2.Name, T2.Score FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHER...
###context:CREATE TABLE APPELLATIONS (Appelation VARCHAR, Area VARCHAR); CREATE TABLE WINE (Price INTEGER, Appelation VARCHAR, year VARCHAR) ###human: Find the maximum price of wins from the appelations in Central Coast area and produced before the year of 2005. ###assistant: SELECT MAX(T2.Price) FROM APPELLATI...
###context:CREATE TABLE GRAPES (Grape VARCHAR, Color VARCHAR); CREATE TABLE WINE (Grape VARCHAR, score VARCHAR) ###human: Find the the grape whose white color grapes are used to produce wines with scores higher than 90. ###assistant: SELECT DISTINCT T1.Grape FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Gr...
###context:CREATE TABLE WINE (Name VARCHAR, Grape VARCHAR, price VARCHAR); CREATE TABLE Grapes (Grape VARCHAR, Color VARCHAR) ###human: What are the wines that have prices higher than 50 and made of Red color grapes? ###assistant: SELECT T2.Name FROM Grapes AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1....
###context:CREATE TABLE APPELLATIONS (Appelation VARCHAR, County VARCHAR); CREATE TABLE WINE (Name VARCHAR, Appelation VARCHAR, price VARCHAR) ###human: What are the wines that have prices lower than 50 and have appelations in Monterey county? ###assistant: SELECT T2.Name FROM APPELLATIONS AS T1 JOIN WINE AS T2...
###context:CREATE TABLE WINE (Grape VARCHAR) ###human: What are the numbers of wines for different grapes? ###assistant: SELECT COUNT(*), Grape FROM WINE GROUP BY Grape
###context:CREATE TABLE WINE (YEAR VARCHAR, Price INTEGER) ###human: What are the average prices of wines for different years? ###assistant: SELECT AVG(Price), YEAR FROM WINE GROUP BY YEAR
###context:CREATE TABLE wine (Name VARCHAR, Price INTEGER, Winery VARCHAR); CREATE TABLE WINE (Name VARCHAR, Price INTEGER, Winery VARCHAR) ###human: Find the distinct names of all wines that have prices higher than some wines from John Anthony winery. ###assistant: SELECT DISTINCT Name FROM WINE WHERE Price > ...
###context:CREATE TABLE WINE (Name VARCHAR) ###human: List the names of all distinct wines in alphabetical order. ###assistant: SELECT DISTINCT Name FROM WINE ORDER BY Name
###context:CREATE TABLE WINE (Name VARCHAR, price VARCHAR) ###human: List the names of all distinct wines ordered by price. ###assistant: SELECT DISTINCT Name FROM WINE ORDER BY price
###context:CREATE TABLE WINE (Appelation VARCHAR, year VARCHAR); CREATE TABLE APPELLATIONS (Area VARCHAR, Appelation VARCHAR) ###human: What is the area of the appelation that produces the highest number of wines before the year of 2010? ###assistant: SELECT T1.Area FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1...
###context:CREATE TABLE GRAPES (Color VARCHAR, Grape VARCHAR); CREATE TABLE WINE (Grape VARCHAR) ###human: What is the color of the grape whose wine products has the highest average price? ###assistant: SELECT T1.Color FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape GROUP BY T2.Grape ORDER BY AVG(Price...
###context:CREATE TABLE WINE (Name VARCHAR, YEAR VARCHAR) ###human: Find the distinct names of wines produced before the year of 2000 or after the year of 2010. ###assistant: SELECT DISTINCT Name FROM WINE WHERE YEAR < 2000 OR YEAR > 2010
###context:CREATE TABLE WINE (Winery VARCHAR, Price INTEGER) ###human: Find the distinct winery of wines having price between 50 and 100. ###assistant: SELECT DISTINCT Winery FROM WINE WHERE Price BETWEEN 50 AND 100
###context:CREATE TABLE WINE (Price INTEGER, Cases INTEGER, YEAR VARCHAR, Grape VARCHAR) ###human: What are the average prices and cases of wines produced in the year of 2009 and made of Zinfandel grape? ###assistant: SELECT AVG(Price), AVG(Cases) FROM WINE WHERE YEAR = 2009 AND Grape = "Zinfandel"
###context:CREATE TABLE WINE (Price INTEGER, Score INTEGER, Appelation VARCHAR) ###human: What are the maximum price and score of wines produced by St. Helena appelation? ###assistant: SELECT MAX(Price), MAX(Score) FROM WINE WHERE Appelation = "St. Helena"
###context:CREATE TABLE WINE (YEAR VARCHAR, Price INTEGER, Score INTEGER) ###human: What are the maximum price and score of wines in each year? ###assistant: SELECT MAX(Price), MAX(Score), YEAR FROM WINE GROUP BY YEAR
###context:CREATE TABLE WINE (Appelation VARCHAR, Price INTEGER, Score INTEGER) ###human: What are the average price and score of wines grouped by appelation? ###assistant: SELECT AVG(Price), AVG(Score), Appelation FROM WINE GROUP BY Appelation
###context:CREATE TABLE WINE (Winery VARCHAR) ###human: Find the wineries that have at least four wines. ###assistant: SELECT Winery FROM WINE GROUP BY Winery HAVING COUNT(*) >= 4
###context:CREATE TABLE APPELLATIONS (County VARCHAR, Appelation VARCHAR); CREATE TABLE WINE (Appelation VARCHAR) ###human: Find the country of all appelations who have at most three wines. ###assistant: SELECT T1.County FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation GROUP BY T2.Appela...
###context:CREATE TABLE WINE (Name VARCHAR, YEAR INTEGER, Winery VARCHAR) ###human: What are the names of wines whose production year are before the year of all wines by Brander winery? ###assistant: SELECT Name FROM WINE WHERE YEAR < (SELECT MIN(YEAR) FROM WINE WHERE Winery = "Brander")
###context:CREATE TABLE WINE (Name VARCHAR, Price INTEGER, YEAR VARCHAR) ###human: What are the names of wines that are more expensive then all wines made in the year 2006? ###assistant: SELECT Name FROM WINE WHERE Price > (SELECT MAX(Price) FROM WINE WHERE YEAR = 2006)
###context:CREATE TABLE GRAPES (GRAPE VARCHAR, Color VARCHAR); CREATE TABLE WINE (Winery VARCHAR, GRAPE VARCHAR) ###human: Find the top 3 wineries with the greatest number of wines made of white color grapes. ###assistant: SELECT T2.Winery FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.GRAPE = T2.GRAPE WHERE T1.Color ...
###context:CREATE TABLE WINE (Grape VARCHAR, Winery VARCHAR, YEAR VARCHAR, Price INTEGER) ###human: List the grape, winery and year of the wines whose price is bigger than 100 ordered by year. ###assistant: SELECT Grape, Winery, YEAR FROM WINE WHERE Price > 100 ORDER BY YEAR
###context:CREATE TABLE WINE (Grape VARCHAR, Appelation VARCHAR, Name VARCHAR, Score INTEGER) ###human: List the grape, appelation and name of wines whose score is higher than 93 ordered by Name. ###assistant: SELECT Grape, Appelation, Name FROM WINE WHERE Score > 93 ORDER BY Name
###context:CREATE TABLE WINE (Appelation VARCHAR, YEAR INTEGER, Area VARCHAR); CREATE TABLE APPELLATIONS (Appelation VARCHAR, YEAR INTEGER, Area VARCHAR) ###human: Find the appelations that produce wines after the year of 2008 but not in Central Coast area. ###assistant: SELECT Appelation FROM WINE WHERE YEAR >...
###context:CREATE TABLE wine (price INTEGER, Appelation VARCHAR); CREATE TABLE APPELLATIONS (Appelation VARCHAR, County VARCHAR); CREATE TABLE WINE (Appelation VARCHAR) ###human: Find the average price of wines that are not produced from Sonoma county. ###assistant: SELECT AVG(price) FROM wine WHERE NOT Appelat...
###context:CREATE TABLE WINE (Appelation VARCHAR, Score INTEGER); CREATE TABLE APPELLATIONS (County VARCHAR, Appelation VARCHAR) ###human: Find the county where produces the most number of wines with score higher than 90. ###assistant: SELECT T1.County FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = ...
###context:CREATE TABLE station (Id VARCHAR) ###human: How many train stations are there? ###assistant: SELECT COUNT(*) FROM station
###context:CREATE TABLE station (name VARCHAR, LOCATION VARCHAR, number_of_platforms VARCHAR) ###human: Show the name, location, and number of platforms for all stations. ###assistant: SELECT name, LOCATION, number_of_platforms FROM station
###context:CREATE TABLE station (LOCATION VARCHAR) ###human: What are all locations of train stations? ###assistant: SELECT DISTINCT LOCATION FROM station
###context:CREATE TABLE station (name VARCHAR, total_passengers VARCHAR, LOCATION VARCHAR) ###human: Show the names and total passengers for all train stations not in London. ###assistant: SELECT name, total_passengers FROM station WHERE LOCATION <> 'London'
###context:CREATE TABLE station (name VARCHAR, main_services VARCHAR, total_passengers VARCHAR) ###human: Show the names and main services for train stations that have the top three total number of passengers. ###assistant: SELECT name, main_services FROM station ORDER BY total_passengers DESC LIMIT 3
###context:CREATE TABLE station (total_passengers INTEGER, LOCATION VARCHAR) ###human: What is the average and maximum number of total passengers for train stations in London or Glasgow? ###assistant: SELECT AVG(total_passengers), MAX(total_passengers) FROM station WHERE LOCATION = 'London' OR LOCATION = 'Glasg...
###context:CREATE TABLE station (LOCATION VARCHAR, number_of_platforms INTEGER, total_passengers INTEGER) ###human: Show all locations and the total number of platforms and passengers for all train stations in each location. ###assistant: SELECT LOCATION, SUM(number_of_platforms), SUM(total_passengers) FROM sta...
###context:CREATE TABLE station (LOCATION VARCHAR, number_of_platforms VARCHAR, total_passengers VARCHAR) ###human: Show all locations that have train stations with at least 15 platforms and train stations with more than 25 total passengers. ###assistant: SELECT DISTINCT LOCATION FROM station WHERE number_of_pl...
###context:CREATE TABLE station (LOCATION VARCHAR, number_of_platforms VARCHAR) ###human: Show all locations which don't have a train station with at least 15 platforms. ###assistant: SELECT LOCATION FROM station EXCEPT SELECT LOCATION FROM station WHERE number_of_platforms >= 15
###context:CREATE TABLE station (LOCATION VARCHAR) ###human: Show the location with most number of train stations. ###assistant: SELECT LOCATION FROM station GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1
###context:CREATE TABLE train (name VARCHAR, TIME VARCHAR, service VARCHAR) ###human: Show the name, time, and service for all trains. ###assistant: SELECT name, TIME, service FROM train
###context:CREATE TABLE train (Id VARCHAR) ###human: Show the number of trains ###assistant: SELECT COUNT(*) FROM train
###context:CREATE TABLE train (name VARCHAR, service VARCHAR, TIME VARCHAR) ###human: Show the name and service for all trains in order by time. ###assistant: SELECT name, service FROM train ORDER BY TIME
###context:CREATE TABLE station (name VARCHAR, station_id VARCHAR); CREATE TABLE train_station (station_id VARCHAR) ###human: Show the station name and number of trains in each station. ###assistant: SELECT T2.name, COUNT(*) FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T...
###context:CREATE TABLE station (name VARCHAR, station_id VARCHAR); CREATE TABLE train (name VARCHAR, train_id VARCHAR); CREATE TABLE train_station (station_id VARCHAR, train_id VARCHAR) ###human: show the train name and station name for each train. ###assistant: SELECT T2.name, T3.name FROM train_station AS T1...
###context:CREATE TABLE train_station (station_id VARCHAR, train_id VARCHAR); CREATE TABLE station (station_id VARCHAR, location VARCHAR); CREATE TABLE train (name VARCHAR, time VARCHAR, train_id VARCHAR) ###human: Show all train names and times in stations in London in descending order by train time. ###assist...
###context:CREATE TABLE station (name VARCHAR, station_id VARCHAR); CREATE TABLE train_station (station_id VARCHAR) ###human: Show the station name with greatest number of trains. ###assistant: SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id ORD...
###context:CREATE TABLE station (name VARCHAR, station_id VARCHAR); CREATE TABLE train_station (station_id VARCHAR) ###human: Show the station name with at least two trains. ###assistant: SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id HAVING CO...
###context:CREATE TABLE station (LOCATION VARCHAR) ###human: Show all locations with only 1 station. ###assistant: SELECT LOCATION FROM station GROUP BY LOCATION HAVING COUNT(*) = 1
###context:CREATE TABLE station (name VARCHAR, station_id VARCHAR); CREATE TABLE train_station (name VARCHAR, station_id VARCHAR) ###human: Show station names without any trains. ###assistant: SELECT name FROM station WHERE NOT station_id IN (SELECT station_id FROM train_station)
###context:CREATE TABLE station (name VARCHAR, station_id VARCHAR); CREATE TABLE train (train_id VARCHAR, Name VARCHAR); CREATE TABLE train_station (station_id VARCHAR, train_id VARCHAR) ###human: What are the names of the stations which serve both "Ananthapuri Express" and "Guruvayur Express" trains? ###assist...
###context:CREATE TABLE station (station_id VARCHAR); CREATE TABLE train_station (station_id VARCHAR); CREATE TABLE train_station (train_id VARCHAR, station_id VARCHAR); CREATE TABLE train (name VARCHAR, train_id VARCHAR) ###human: Find the names of the trains that do not pass any station located in London. ###...
###context:CREATE TABLE station (name VARCHAR, LOCATION VARCHAR, Annual_entry_exit VARCHAR, Annual_interchanges VARCHAR) ###human: List the names and locations of all stations ordered by their yearly entry exit and interchange amounts. ###assistant: SELECT name, LOCATION FROM station ORDER BY Annual_entry_exit,...
###context:CREATE TABLE Vehicles (vehicle_id VARCHAR) ###human: List all vehicle id ###assistant: SELECT vehicle_id FROM Vehicles
###context:CREATE TABLE Vehicles (Id VARCHAR) ###human: How many vehicle in total? ###assistant: SELECT COUNT(*) FROM Vehicles
###context:CREATE TABLE Vehicles (vehicle_details VARCHAR, vehicle_id VARCHAR) ###human: Show the detail of vehicle with id 1. ###assistant: SELECT vehicle_details FROM Vehicles WHERE vehicle_id = 1
###context:CREATE TABLE Staff (first_name VARCHAR, middle_name VARCHAR, last_name VARCHAR) ###human: List the first name middle name and last name of all staff. ###assistant: SELECT first_name, middle_name, last_name FROM Staff
###context:CREATE TABLE Staff (date_of_birth VARCHAR, first_name VARCHAR, last_name VARCHAR) ###human: What is the birthday of the staff member with first name as Janessa and last name as Sawayn? ###assistant: SELECT date_of_birth FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn"
###context:CREATE TABLE Staff (date_joined_staff VARCHAR, first_name VARCHAR, last_name VARCHAR) ###human: When did the staff member with first name as Janessa and last name as Sawayn join the company? ###assistant: SELECT date_joined_staff FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn"
###context:CREATE TABLE Staff (date_left_staff VARCHAR, first_name VARCHAR, last_name VARCHAR) ###human: When did the staff member with first name as Janessa and last name as Sawayn leave the company? ###assistant: SELECT date_left_staff FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn"
###context:CREATE TABLE Staff (first_name VARCHAR) ###human: How many staff have the first name Ludie? ###assistant: SELECT COUNT(*) FROM Staff WHERE first_name = "Ludie"
###context:CREATE TABLE Staff (nickname VARCHAR, first_name VARCHAR, last_name VARCHAR) ###human: What is the nickname of staff with first name as Janessa and last name as Sawayn? ###assistant: SELECT nickname FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn"
###context:CREATE TABLE Staff (Id VARCHAR) ###human: How many staff in total? ###assistant: SELECT COUNT(*) FROM Staff
###context:CREATE TABLE Staff (staff_address_id VARCHAR, first_name VARCHAR, last_name VARCHAR); CREATE TABLE Addresses (city VARCHAR, address_id VARCHAR) ###human: Which city does staff with first name as Janessa and last name as Sawayn live? ###assistant: SELECT T1.city FROM Addresses AS T1 JOIN Staff AS T2 O...
###context:CREATE TABLE Addresses (country VARCHAR, state_province_county VARCHAR, address_id VARCHAR); CREATE TABLE Staff (staff_address_id VARCHAR, first_name VARCHAR, last_name VARCHAR) ###human: Which country and state does staff with first name as Janessa and last name as Sawayn lived? ###assistant: SELECT...
###context:CREATE TABLE Lessons (lesson_time INTEGER, customer_id VARCHAR); CREATE TABLE Customers (customer_id VARCHAR, first_name VARCHAR, last_name VARCHAR) ###human: How long is the total lesson time took by customer with first name as Rylan and last name as Goodwin? ###assistant: SELECT SUM(T1.lesson_time)...
###context:CREATE TABLE Addresses (zip_postcode VARCHAR, address_id VARCHAR); CREATE TABLE Staff (staff_address_id VARCHAR, first_name VARCHAR, last_name VARCHAR) ###human: What is the zip code of staff with first name as Janessa and last name as Sawayn lived? ###assistant: SELECT T1.zip_postcode FROM Addresses...
###context:CREATE TABLE Addresses (state_province_county VARCHAR) ###human: How many staff live in state Georgia? ###assistant: SELECT COUNT(*) FROM Addresses WHERE state_province_county = "Georgia"
###context:CREATE TABLE Staff (first_name VARCHAR, last_name VARCHAR, staff_address_id VARCHAR); CREATE TABLE Addresses (address_id VARCHAR, city VARCHAR) ###human: Find out the first name and last name of staff lived in city Damianfort. ###assistant: SELECT T2.first_name, T2.last_name FROM Addresses AS T1 JOIN...
###context:CREATE TABLE Staff (staff_address_id VARCHAR); CREATE TABLE Addresses (city VARCHAR, address_id VARCHAR) ###human: Which city lives most of staffs? List the city name and number of staffs. ###assistant: SELECT T1.city, COUNT(*) FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address...
###context:CREATE TABLE Addresses (state_province_county VARCHAR, address_id VARCHAR); CREATE TABLE Staff (staff_address_id VARCHAR) ###human: List the states which have between 2 to 4 staffs living there. ###assistant: SELECT T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2....
###context:CREATE TABLE Customers (first_name VARCHAR, last_name VARCHAR) ###human: List the first name and last name of all customers. ###assistant: SELECT first_name, last_name FROM Customers
###context:CREATE TABLE Customers (email_address VARCHAR, date_of_birth VARCHAR, first_name VARCHAR) ###human: List email address and birthday of customer whose first name as Carole. ###assistant: SELECT email_address, date_of_birth FROM Customers WHERE first_name = "Carole"
###context:CREATE TABLE Customers (phone_number VARCHAR, email_address VARCHAR, amount_outstanding INTEGER) ###human: List phone number and email address of customer with more than 2000 outstanding balance. ###assistant: SELECT phone_number, email_address FROM Customers WHERE amount_outstanding > 2000
###context:CREATE TABLE Customers (customer_status_code VARCHAR, cell_mobile_phone_number VARCHAR, email_address VARCHAR, first_name VARCHAR, last_name VARCHAR) ###human: What is the status code, mobile phone number and email address of customer with last name as Kohler or first name as Marina? ###assistant: SE...
###context:CREATE TABLE Customers (date_of_birth VARCHAR, customer_status_code VARCHAR) ###human: When are the birthdays of customer who are classified as 'Good Customer' status? ###assistant: SELECT date_of_birth FROM Customers WHERE customer_status_code = 'Good Customer'
###context:CREATE TABLE Customers (date_became_customer VARCHAR, first_name VARCHAR, last_name VARCHAR) ###human: When did customer with first name as Carole and last name as Bernhard became a customer? ###assistant: SELECT date_became_customer FROM Customers WHERE first_name = "Carole" AND last_name = "Bernhar...
###context:CREATE TABLE Customers (customer_status_code VARCHAR) ###human: List all customer status codes and the number of customers having each status code. ###assistant: SELECT customer_status_code, COUNT(*) FROM Customers GROUP BY customer_status_code
###context:CREATE TABLE Customers (customer_status_code VARCHAR) ###human: Which customer status code has least number of customers? ###assistant: SELECT customer_status_code FROM Customers GROUP BY customer_status_code ORDER BY COUNT(*) LIMIT 1
###context:CREATE TABLE Lessons (customer_id VARCHAR, lesson_status_code VARCHAR); CREATE TABLE Customers (customer_id VARCHAR, first_name VARCHAR, last_name VARCHAR) ###human: How many lessons taken by customer with first name as Rylan and last name as Goodwin were completed? ###assistant: SELECT COUNT(*) FROM...
###context:CREATE TABLE Customers (amount_outstanding INTEGER) ###human: What is maximum, minimum and average amount of outstanding of customer? ###assistant: SELECT MAX(amount_outstanding), MIN(amount_outstanding), AVG(amount_outstanding) FROM Customers
###context:CREATE TABLE Customers (first_name VARCHAR, last_name VARCHAR, amount_outstanding INTEGER) ###human: List the first name and last name of customers have the amount of outstanding between 1000 and 3000. ###assistant: SELECT first_name, last_name FROM Customers WHERE amount_outstanding BETWEEN 1000 AND...
###context:CREATE TABLE Customers (first_name VARCHAR, last_name VARCHAR, customer_address_id VARCHAR); CREATE TABLE Addresses (address_id VARCHAR, city VARCHAR) ###human: List first name and last name of customers lived in city Lockmanfurt. ###assistant: SELECT T1.first_name, T1.last_name FROM Customers AS T1 ...
###context:CREATE TABLE Addresses (country VARCHAR, address_id VARCHAR); CREATE TABLE Customers (customer_address_id VARCHAR, first_name VARCHAR, last_name VARCHAR) ###human: Which country does customer with first name as Carole and last name as Bernhard lived in? ###assistant: SELECT T2.country FROM Customers ...
###context:CREATE TABLE Addresses (zip_postcode VARCHAR, address_id VARCHAR); CREATE TABLE Customers (customer_address_id VARCHAR, first_name VARCHAR, last_name VARCHAR) ###human: What is zip code of customer with first name as Carole and last name as Bernhard? ###assistant: SELECT T2.zip_postcode FROM Customer...
###context:CREATE TABLE Customers (customer_address_id VARCHAR); CREATE TABLE Addresses (city VARCHAR, address_id VARCHAR) ###human: Which city does has most number of customers? ###assistant: SELECT T2.city FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id GROUP BY T2.city ORD...
###context:CREATE TABLE Customers (customer_id VARCHAR, first_name VARCHAR, last_name VARCHAR); CREATE TABLE Customer_Payments (amount_payment INTEGER, customer_id VARCHAR) ###human: How much in total does customer with first name as Carole and last name as Bernhard paid? ###assistant: SELECT SUM(T1.amount_paym...
###context:CREATE TABLE Customers (customer_id VARCHAR); CREATE TABLE Customer_Payments (customer_id VARCHAR) ###human: List the number of customers that did not have any payment history. ###assistant: SELECT COUNT(*) FROM Customers WHERE NOT customer_id IN (SELECT customer_id FROM Customer_Payments)
###context:CREATE TABLE Customers (first_name VARCHAR, last_name VARCHAR, customer_id VARCHAR); CREATE TABLE Customer_Payments (customer_id VARCHAR) ###human: List first name and last name of customers that have more than 2 payments. ###assistant: SELECT T2.first_name, T2.last_name FROM Customer_Payments AS T1 ...
###context:CREATE TABLE Customer_Payments (payment_method_code VARCHAR) ###human: List all payment methods and number of payments using each payment methods. ###assistant: SELECT payment_method_code, COUNT(*) FROM Customer_Payments GROUP BY payment_method_code