brief_instruction
stringlengths
16
224
instruction
stringlengths
687
8.77k
output
stringlengths
18
577
Show the name, location, and number of platforms for all stations.
-- Language PostgreSQL -- Tables: -- Table: station columns : [['station id', 'number'], ['name', 'text'], ['annual entry exit', 'number'], ['annual interchanges', 'number'], ['total passengers', 'number'], ['location', 'text'], ['main services', 'text'], ['number of platforms', 'number']] -- Table: train columns : [['train id', 'number'], ['name', 'text'], ['time', 'text'], ['service', 'text']] -- Table: train station columns : [['train id', 'number'], ['station id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Show the name, location, and number of platforms for all stations.` to a syntactically-correct PostgreSQL query.
SELECT name , LOCATION , number_of_platforms FROM station
What are all locations of train stations?
-- Language PostgreSQL -- Tables: -- Table: station columns : [['station id', 'number'], ['name', 'text'], ['annual entry exit', 'number'], ['annual interchanges', 'number'], ['total passengers', 'number'], ['location', 'text'], ['main services', 'text'], ['number of platforms', 'number']] -- Table: train columns : [['train id', 'number'], ['name', 'text'], ['time', 'text'], ['service', 'text']] -- Table: train station columns : [['train id', 'number'], ['station id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What are all locations of train stations?` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT LOCATION FROM station
Show the names and total passengers for all train stations not in London.
-- Language PostgreSQL -- Tables: -- Table: station columns : [['station id', 'number'], ['name', 'text'], ['annual entry exit', 'number'], ['annual interchanges', 'number'], ['total passengers', 'number'], ['location', 'text'], ['main services', 'text'], ['number of platforms', 'number']] -- Table: train columns : [['train id', 'number'], ['name', 'text'], ['time', 'text'], ['service', 'text']] -- Table: train station columns : [['train id', 'number'], ['station id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Show the names and total passengers for all train stations not in London.` to a syntactically-correct PostgreSQL query.
SELECT name , total_passengers FROM station WHERE LOCATION != 'London'
Show the names and main services for train stations that have the top three total number of passengers.
-- Language PostgreSQL -- Tables: -- Table: station columns : [['station id', 'number'], ['name', 'text'], ['annual entry exit', 'number'], ['annual interchanges', 'number'], ['total passengers', 'number'], ['location', 'text'], ['main services', 'text'], ['number of platforms', 'number']] -- Table: train columns : [['train id', 'number'], ['name', 'text'], ['time', 'text'], ['service', 'text']] -- Table: train station columns : [['train id', 'number'], ['station id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Show the names and main services for train stations that have the top three total number of passengers.` to a syntactically-correct PostgreSQL query.
SELECT name , main_services FROM station ORDER BY total_passengers DESC LIMIT 3
What is the average and maximum number of total passengers for train stations in London or Glasgow?
-- Language PostgreSQL -- Tables: -- Table: station columns : [['station id', 'number'], ['name', 'text'], ['annual entry exit', 'number'], ['annual interchanges', 'number'], ['total passengers', 'number'], ['location', 'text'], ['main services', 'text'], ['number of platforms', 'number']] -- Table: train columns : [['train id', 'number'], ['name', 'text'], ['time', 'text'], ['service', 'text']] -- Table: train station columns : [['train id', 'number'], ['station id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What is the average and maximum number of total passengers for train stations in London or Glasgow?` to a syntactically-correct PostgreSQL query.
SELECT avg(total_passengers) , max(total_passengers) FROM station WHERE LOCATION = 'London' OR LOCATION = 'Glasgow'
Show all locations and the total number of platforms and passengers for all train stations in each location.
-- Language PostgreSQL -- Tables: -- Table: station columns : [['station id', 'number'], ['name', 'text'], ['annual entry exit', 'number'], ['annual interchanges', 'number'], ['total passengers', 'number'], ['location', 'text'], ['main services', 'text'], ['number of platforms', 'number']] -- Table: train columns : [['train id', 'number'], ['name', 'text'], ['time', 'text'], ['service', 'text']] -- Table: train station columns : [['train id', 'number'], ['station id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Show all locations and the total number of platforms and passengers for all train stations in each location.` to a syntactically-correct PostgreSQL query.
SELECT LOCATION , sum(number_of_platforms) , sum(total_passengers) FROM station GROUP BY LOCATION
Show all locations that have train stations with at least 15 platforms and train stations with more than 25 total passengers.
-- Language PostgreSQL -- Tables: -- Table: station columns : [['station id', 'number'], ['name', 'text'], ['annual entry exit', 'number'], ['annual interchanges', 'number'], ['total passengers', 'number'], ['location', 'text'], ['main services', 'text'], ['number of platforms', 'number']] -- Table: train columns : [['train id', 'number'], ['name', 'text'], ['time', 'text'], ['service', 'text']] -- Table: train station columns : [['train id', 'number'], ['station id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Show all locations that have train stations with at least 15 platforms and train stations with more than 25 total passengers.` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT LOCATION FROM station WHERE number_of_platforms >= 15 AND total_passengers > 25
Show all locations which don't have a train station with at least 15 platforms.
-- Language PostgreSQL -- Tables: -- Table: station columns : [['station id', 'number'], ['name', 'text'], ['annual entry exit', 'number'], ['annual interchanges', 'number'], ['total passengers', 'number'], ['location', 'text'], ['main services', 'text'], ['number of platforms', 'number']] -- Table: train columns : [['train id', 'number'], ['name', 'text'], ['time', 'text'], ['service', 'text']] -- Table: train station columns : [['train id', 'number'], ['station id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Show all locations which don't have a train station with at least 15 platforms.` to a syntactically-correct PostgreSQL query.
SELECT LOCATION FROM station EXCEPT SELECT LOCATION FROM station WHERE number_of_platforms >= 15
Show the location with most number of train stations.
-- Language PostgreSQL -- Tables: -- Table: station columns : [['station id', 'number'], ['name', 'text'], ['annual entry exit', 'number'], ['annual interchanges', 'number'], ['total passengers', 'number'], ['location', 'text'], ['main services', 'text'], ['number of platforms', 'number']] -- Table: train columns : [['train id', 'number'], ['name', 'text'], ['time', 'text'], ['service', 'text']] -- Table: train station columns : [['train id', 'number'], ['station id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Show the location with most number of train stations.` to a syntactically-correct PostgreSQL query.
SELECT LOCATION FROM station GROUP BY LOCATION ORDER BY count(*) DESC LIMIT 1
Show the name, time, and service for all trains.
-- Language PostgreSQL -- Tables: -- Table: station columns : [['station id', 'number'], ['name', 'text'], ['annual entry exit', 'number'], ['annual interchanges', 'number'], ['total passengers', 'number'], ['location', 'text'], ['main services', 'text'], ['number of platforms', 'number']] -- Table: train columns : [['train id', 'number'], ['name', 'text'], ['time', 'text'], ['service', 'text']] -- Table: train station columns : [['train id', 'number'], ['station id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Show the name, time, and service for all trains.` to a syntactically-correct PostgreSQL query.
SELECT name , TIME , service FROM train
Show the number of trains
-- Language PostgreSQL -- Tables: -- Table: station columns : [['station id', 'number'], ['name', 'text'], ['annual entry exit', 'number'], ['annual interchanges', 'number'], ['total passengers', 'number'], ['location', 'text'], ['main services', 'text'], ['number of platforms', 'number']] -- Table: train columns : [['train id', 'number'], ['name', 'text'], ['time', 'text'], ['service', 'text']] -- Table: train station columns : [['train id', 'number'], ['station id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Show the number of trains` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM train
Show the name and service for all trains in order by time.
-- Language PostgreSQL -- Tables: -- Table: station columns : [['station id', 'number'], ['name', 'text'], ['annual entry exit', 'number'], ['annual interchanges', 'number'], ['total passengers', 'number'], ['location', 'text'], ['main services', 'text'], ['number of platforms', 'number']] -- Table: train columns : [['train id', 'number'], ['name', 'text'], ['time', 'text'], ['service', 'text']] -- Table: train station columns : [['train id', 'number'], ['station id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Show the name and service for all trains in order by time.` to a syntactically-correct PostgreSQL query.
SELECT name , service FROM train ORDER BY TIME
Show the station name and number of trains in each station.
-- Language PostgreSQL -- Tables: -- Table: station columns : [['station id', 'number'], ['name', 'text'], ['annual entry exit', 'number'], ['annual interchanges', 'number'], ['total passengers', 'number'], ['location', 'text'], ['main services', 'text'], ['number of platforms', 'number']] -- Table: train columns : [['train id', 'number'], ['name', 'text'], ['time', 'text'], ['service', 'text']] -- Table: train station columns : [['train id', 'number'], ['station id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Show the station name and number of trains in each station.` to a syntactically-correct PostgreSQL query.
SELECT T2.name , count(*) FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id
show the train name and station name for each train.
-- Language PostgreSQL -- Tables: -- Table: station columns : [['station id', 'number'], ['name', 'text'], ['annual entry exit', 'number'], ['annual interchanges', 'number'], ['total passengers', 'number'], ['location', 'text'], ['main services', 'text'], ['number of platforms', 'number']] -- Table: train columns : [['train id', 'number'], ['name', 'text'], ['time', 'text'], ['service', 'text']] -- Table: train station columns : [['train id', 'number'], ['station id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `show the train name and station name for each train.` to a syntactically-correct PostgreSQL query.
SELECT T2.name , T3.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id
Show all train names and times in stations in London in descending order by train time.
-- Language PostgreSQL -- Tables: -- Table: station columns : [['station id', 'number'], ['name', 'text'], ['annual entry exit', 'number'], ['annual interchanges', 'number'], ['total passengers', 'number'], ['location', 'text'], ['main services', 'text'], ['number of platforms', 'number']] -- Table: train columns : [['train id', 'number'], ['name', 'text'], ['time', 'text'], ['service', 'text']] -- Table: train station columns : [['train id', 'number'], ['station id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Show all train names and times in stations in London in descending order by train time.` to a syntactically-correct PostgreSQL query.
SELECT T3.name , T3.time FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id WHERE T2.location = 'London' ORDER BY T3.time DESC
Show the station name with greatest number of trains.
-- Language PostgreSQL -- Tables: -- Table: station columns : [['station id', 'number'], ['name', 'text'], ['annual entry exit', 'number'], ['annual interchanges', 'number'], ['total passengers', 'number'], ['location', 'text'], ['main services', 'text'], ['number of platforms', 'number']] -- Table: train columns : [['train id', 'number'], ['name', 'text'], ['time', 'text'], ['service', 'text']] -- Table: train station columns : [['train id', 'number'], ['station id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Show the station name with greatest number of trains.` to a syntactically-correct PostgreSQL query.
SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id ORDER BY count(*) DESC LIMIT 1
Show the station name with at least two trains.
-- Language PostgreSQL -- Tables: -- Table: station columns : [['station id', 'number'], ['name', 'text'], ['annual entry exit', 'number'], ['annual interchanges', 'number'], ['total passengers', 'number'], ['location', 'text'], ['main services', 'text'], ['number of platforms', 'number']] -- Table: train columns : [['train id', 'number'], ['name', 'text'], ['time', 'text'], ['service', 'text']] -- Table: train station columns : [['train id', 'number'], ['station id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Show the station name with at least two trains.` to a syntactically-correct PostgreSQL query.
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 count(*) >= 2
Show all locations with only 1 station.
-- Language PostgreSQL -- Tables: -- Table: station columns : [['station id', 'number'], ['name', 'text'], ['annual entry exit', 'number'], ['annual interchanges', 'number'], ['total passengers', 'number'], ['location', 'text'], ['main services', 'text'], ['number of platforms', 'number']] -- Table: train columns : [['train id', 'number'], ['name', 'text'], ['time', 'text'], ['service', 'text']] -- Table: train station columns : [['train id', 'number'], ['station id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Show all locations with only 1 station.` to a syntactically-correct PostgreSQL query.
SELECT LOCATION FROM station GROUP BY LOCATION HAVING count(*) = 1
Show station names without any trains.
-- Language PostgreSQL -- Tables: -- Table: station columns : [['station id', 'number'], ['name', 'text'], ['annual entry exit', 'number'], ['annual interchanges', 'number'], ['total passengers', 'number'], ['location', 'text'], ['main services', 'text'], ['number of platforms', 'number']] -- Table: train columns : [['train id', 'number'], ['name', 'text'], ['time', 'text'], ['service', 'text']] -- Table: train station columns : [['train id', 'number'], ['station id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Show station names without any trains.` to a syntactically-correct PostgreSQL query.
SELECT name FROM station WHERE station_id NOT IN (SELECT station_id FROM train_station)
What are the names of the stations which serve both "Ananthapuri Express" and "Guruvayur Express" trains?
-- Language PostgreSQL -- Tables: -- Table: station columns : [['station id', 'number'], ['name', 'text'], ['annual entry exit', 'number'], ['annual interchanges', 'number'], ['total passengers', 'number'], ['location', 'text'], ['main services', 'text'], ['number of platforms', 'number']] -- Table: train columns : [['train id', 'number'], ['name', 'text'], ['time', 'text'], ['service', 'text']] -- Table: train station columns : [['train id', 'number'], ['station id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What are the names of the stations which serve both "Ananthapuri Express" and "Guruvayur Express" trains?` to a syntactically-correct PostgreSQL query.
SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id WHERE T3.Name = "Ananthapuri Express" INTERSECT SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id WHERE T3.Name = "Guruvayur Express"
Find the names of the trains that do not pass any station located in London.
-- Language PostgreSQL -- Tables: -- Table: station columns : [['station id', 'number'], ['name', 'text'], ['annual entry exit', 'number'], ['annual interchanges', 'number'], ['total passengers', 'number'], ['location', 'text'], ['main services', 'text'], ['number of platforms', 'number']] -- Table: train columns : [['train id', 'number'], ['name', 'text'], ['time', 'text'], ['service', 'text']] -- Table: train station columns : [['train id', 'number'], ['station id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Find the names of the trains that do not pass any station located in London.` to a syntactically-correct PostgreSQL query.
SELECT T2.name FROM train_station AS T1 JOIN train AS T2 ON T1.train_id = T2.train_id WHERE T1.station_id NOT IN (SELECT T4.station_id FROM train_station AS T3 JOIN station AS T4 ON T3.station_id = T4.station_id WHERE t4.location = "London")
List the names and locations of all stations ordered by their yearly entry exit and interchange amounts.
-- Language PostgreSQL -- Tables: -- Table: station columns : [['station id', 'number'], ['name', 'text'], ['annual entry exit', 'number'], ['annual interchanges', 'number'], ['total passengers', 'number'], ['location', 'text'], ['main services', 'text'], ['number of platforms', 'number']] -- Table: train columns : [['train id', 'number'], ['name', 'text'], ['time', 'text'], ['service', 'text']] -- Table: train station columns : [['train id', 'number'], ['station id', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `List the names and locations of all stations ordered by their yearly entry exit and interchange amounts.` to a syntactically-correct PostgreSQL query.
SELECT name , LOCATION FROM station ORDER BY Annual_entry_exit , Annual_interchanges
List all vehicle id
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `List all vehicle id` to a syntactically-correct PostgreSQL query.
SELECT vehicle_id FROM Vehicles;
What are the ids of all vehicles?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What are the ids of all vehicles?` to a syntactically-correct PostgreSQL query.
SELECT vehicle_id FROM Vehicles;
How many vehicle in total?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How many vehicle in total?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM Vehicles;
How many vehicles exist?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How many vehicles exist?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM Vehicles;
Show the detail of vehicle with id 1.
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Show the detail of vehicle with id 1.` to a syntactically-correct PostgreSQL query.
SELECT vehicle_details FROM Vehicles WHERE vehicle_id = 1;
What are the details of the car with id 1?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What are the details of the car with id 1?` to a syntactically-correct PostgreSQL query.
SELECT vehicle_details FROM Vehicles WHERE vehicle_id = 1;
List the first name middle name and last name of all staff.
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `List the first name middle name and last name of all staff.` to a syntactically-correct PostgreSQL query.
SELECT first_name , middle_name , last_name FROM Staff;
What are the first, middle, and last names of all staff?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What are the first, middle, and last names of all staff?` to a syntactically-correct PostgreSQL query.
SELECT first_name , middle_name , last_name FROM Staff;
What is the birthday of the staff member with first name as Janessa and last name as Sawayn?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What is the birthday of the staff member with first name as Janessa and last name as Sawayn?` to a syntactically-correct PostgreSQL query.
SELECT date_of_birth FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn";
What is the date of birth for the staff member named Janessa Sawayn?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What is the date of birth for the staff member named Janessa Sawayn?` to a syntactically-correct PostgreSQL query.
SELECT date_of_birth FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn";
When did the staff member with first name as Janessa and last name as Sawayn join the company?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `When did the staff member with first name as Janessa and last name as Sawayn join the company?` to a syntactically-correct PostgreSQL query.
SELECT date_joined_staff FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn";
When did the staff member named Janessa Sawayn join the company?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `When did the staff member named Janessa Sawayn join the company?` to a syntactically-correct PostgreSQL query.
SELECT date_joined_staff FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn";
When did the staff member with first name as Janessa and last name as Sawayn leave the company?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `When did the staff member with first name as Janessa and last name as Sawayn leave the company?` to a syntactically-correct PostgreSQL query.
SELECT date_left_staff FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn";
When did the staff member Janessa Sawayn leave the company?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `When did the staff member Janessa Sawayn leave the company?` to a syntactically-correct PostgreSQL query.
SELECT date_left_staff FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn";
How many staff have the first name Ludie?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How many staff have the first name Ludie?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM Staff WHERE first_name = "Ludie";
How many employees have a first name of Ludie?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How many employees have a first name of Ludie?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM Staff WHERE first_name = "Ludie";
What is the nickname of staff with first name as Janessa and last name as Sawayn?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What is the nickname of staff with first name as Janessa and last name as Sawayn?` to a syntactically-correct PostgreSQL query.
SELECT nickname FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn";
What is the nickname of the employee named Janessa Sawayn?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What is the nickname of the employee named Janessa Sawayn?` to a syntactically-correct PostgreSQL query.
SELECT nickname FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn";
How many staff in total?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How many staff in total?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM Staff;
How many employees are there?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How many employees are there?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM Staff;
Which city does staff with first name as Janessa and last name as Sawayn live?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Which city does staff with first name as Janessa and last name as Sawayn live?` to a syntactically-correct PostgreSQL query.
SELECT T1.city FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn";
In what city does Janessa Sawayn live?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `In what city does Janessa Sawayn live?` to a syntactically-correct PostgreSQL query.
SELECT T1.city FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn";
Which country and state does staff with first name as Janessa and last name as Sawayn lived?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Which country and state does staff with first name as Janessa and last name as Sawayn lived?` to a syntactically-correct PostgreSQL query.
SELECT T1.country , T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn";
In which country and state does Janessa Sawayn live?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `In which country and state does Janessa Sawayn live?` to a syntactically-correct PostgreSQL query.
SELECT T1.country , T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn";
How long is the total lesson time took by customer with first name as Rylan and last name as Goodwin?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How long is the total lesson time took by customer with first name as Rylan and last name as Goodwin?` to a syntactically-correct PostgreSQL query.
SELECT sum(T1.lesson_time) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Rylan" AND T2.last_name = "Goodwin";
How long is the total lesson time took by the customer named Rylan Goodwin?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How long is the total lesson time took by the customer named Rylan Goodwin?` to a syntactically-correct PostgreSQL query.
SELECT sum(T1.lesson_time) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Rylan" AND T2.last_name = "Goodwin";
What is the zip code of staff with first name as Janessa and last name as Sawayn lived?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What is the zip code of staff with first name as Janessa and last name as Sawayn lived?` to a syntactically-correct PostgreSQL query.
SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn";
What is the zip code of the hosue of the employee named Janessa Sawayn?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What is the zip code of the hosue of the employee named Janessa Sawayn?` to a syntactically-correct PostgreSQL query.
SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn";
How many staff live in state Georgia?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How many staff live in state Georgia?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM Addresses WHERE state_province_county = "Georgia";
How many employees live in Georgia?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How many employees live in Georgia?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM Addresses WHERE state_province_county = "Georgia";
Find out the first name and last name of staff lived in city Damianfort.
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Find out the first name and last name of staff lived in city Damianfort.` to a syntactically-correct PostgreSQL query.
SELECT T2.first_name , T2.last_name FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T1.city = "Damianfort";
What is the first and last name of all employees who live in the city Damianfort?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What is the first and last name of all employees who live in the city Damianfort?` to a syntactically-correct PostgreSQL query.
SELECT T2.first_name , T2.last_name FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T1.city = "Damianfort";
Which city lives most of staffs? List the city name and number of staffs.
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Which city lives most of staffs? List the city name and number of staffs.` to a syntactically-correct PostgreSQL query.
SELECT T1.city , count(*) FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.city ORDER BY count(*) DESC LIMIT 1;
In which city do the most employees live and how many of them live there?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `In which city do the most employees live and how many of them live there?` to a syntactically-correct PostgreSQL query.
SELECT T1.city , count(*) FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.city ORDER BY count(*) DESC LIMIT 1;
List the states which have between 2 to 4 staffs living there.
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `List the states which have between 2 to 4 staffs living there.` to a syntactically-correct PostgreSQL query.
SELECT T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.state_province_county HAVING count(*) BETWEEN 2 AND 4;
What are the names of the states that have 2 to 4 employees living there?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What are the names of the states that have 2 to 4 employees living there?` to a syntactically-correct PostgreSQL query.
SELECT T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.state_province_county HAVING count(*) BETWEEN 2 AND 4;
List the first name and last name of all customers.
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `List the first name and last name of all customers.` to a syntactically-correct PostgreSQL query.
SELECT first_name , last_name FROM Customers;
What are the first and last names for all customers?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What are the first and last names for all customers?` to a syntactically-correct PostgreSQL query.
SELECT first_name , last_name FROM Customers;
List email address and birthday of customer whose first name as Carole.
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `List email address and birthday of customer whose first name as Carole.` to a syntactically-correct PostgreSQL query.
SELECT email_address , date_of_birth FROM Customers WHERE first_name = "Carole"
What are the email addresses and date of births for all customers who have a first name of Carole?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What are the email addresses and date of births for all customers who have a first name of Carole?` to a syntactically-correct PostgreSQL query.
SELECT email_address , date_of_birth FROM Customers WHERE first_name = "Carole"
List phone number and email address of customer with more than 2000 outstanding balance.
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `List phone number and email address of customer with more than 2000 outstanding balance.` to a syntactically-correct PostgreSQL query.
SELECT phone_number , email_address FROM Customers WHERE amount_outstanding > 2000;
What are the phone numbers and email addresses of all customers who have an outstanding balance of more than 2000?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What are the phone numbers and email addresses of all customers who have an outstanding balance of more than 2000?` to a syntactically-correct PostgreSQL query.
SELECT phone_number , email_address FROM Customers WHERE amount_outstanding > 2000;
What is the status code, mobile phone number and email address of customer with last name as Kohler or first name as Marina?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What is the status code, mobile phone number and email address of customer with last name as Kohler or first name as Marina?` to a syntactically-correct PostgreSQL query.
SELECT customer_status_code , cell_mobile_phone_number , email_address FROM Customers WHERE first_name = "Marina" OR last_name = "Kohler"
What is the status code, phone number, and email address of the customer whose last name is Kohler or whose first name is Marina?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What is the status code, phone number, and email address of the customer whose last name is Kohler or whose first name is Marina?` to a syntactically-correct PostgreSQL query.
SELECT customer_status_code , cell_mobile_phone_number , email_address FROM Customers WHERE first_name = "Marina" OR last_name = "Kohler"
When are the birthdays of customer who are classified as 'Good Customer' status?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `When are the birthdays of customer who are classified as 'Good Customer' status?` to a syntactically-correct PostgreSQL query.
SELECT date_of_birth FROM Customers WHERE customer_status_code = 'Good Customer'
What is the date of birth of every customer whose status code is 'Good Customer'?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What is the date of birth of every customer whose status code is 'Good Customer'?` to a syntactically-correct PostgreSQL query.
SELECT date_of_birth FROM Customers WHERE customer_status_code = 'Good Customer'
When did customer with first name as Carole and last name as Bernhard became a customer?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `When did customer with first name as Carole and last name as Bernhard became a customer?` to a syntactically-correct PostgreSQL query.
SELECT date_became_customer FROM Customers WHERE first_name = "Carole" AND last_name = "Bernhard";
When did Carole Bernhard first become a customer?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `When did Carole Bernhard first become a customer?` to a syntactically-correct PostgreSQL query.
SELECT date_became_customer FROM Customers WHERE first_name = "Carole" AND last_name = "Bernhard";
How many customers in total?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How many customers in total?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM Customers;
How many customers are there?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How many customers are there?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM Customers;
List all customer status codes and the number of customers having each status code.
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `List all customer status codes and the number of customers having each status code.` to a syntactically-correct PostgreSQL query.
SELECT customer_status_code , count(*) FROM Customers GROUP BY customer_status_code;
For each customer status code, how many customers are classified that way?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `For each customer status code, how many customers are classified that way?` to a syntactically-correct PostgreSQL query.
SELECT customer_status_code , count(*) FROM Customers GROUP BY customer_status_code;
Which customer status code has least number of customers?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Which customer status code has least number of customers?` to a syntactically-correct PostgreSQL query.
SELECT customer_status_code FROM Customers GROUP BY customer_status_code ORDER BY count(*) ASC LIMIT 1;
What is the status code with the least number of customers?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What is the status code with the least number of customers?` to a syntactically-correct PostgreSQL query.
SELECT customer_status_code FROM Customers GROUP BY customer_status_code ORDER BY count(*) ASC LIMIT 1;
How many lessons taken by customer with first name as Rylan and last name as Goodwin were completed?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How many lessons taken by customer with first name as Rylan and last name as Goodwin were completed?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Rylan" AND T2.last_name = "Goodwin" AND T1.lesson_status_code = "Completed";
How many lessons did the customer Ryan Goodwin complete?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How many lessons did the customer Ryan Goodwin complete?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Rylan" AND T2.last_name = "Goodwin" AND T1.lesson_status_code = "Completed";
What is maximum, minimum and average amount of outstanding of customer?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What is maximum, minimum and average amount of outstanding of customer?` to a syntactically-correct PostgreSQL query.
SELECT max(amount_outstanding) , min(amount_outstanding) , avg(amount_outstanding) FROM Customers;
What is the maximum, minimum, and average amount of money outsanding for all customers?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What is the maximum, minimum, and average amount of money outsanding for all customers?` to a syntactically-correct PostgreSQL query.
SELECT max(amount_outstanding) , min(amount_outstanding) , avg(amount_outstanding) FROM Customers;
List the first name and last name of customers have the amount of outstanding between 1000 and 3000.
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `List the first name and last name of customers have the amount of outstanding between 1000 and 3000.` to a syntactically-correct PostgreSQL query.
SELECT first_name , last_name FROM Customers WHERE amount_outstanding BETWEEN 1000 AND 3000;
What are the first and last names of all customers with between 1000 and 3000 dollars outstanding?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What are the first and last names of all customers with between 1000 and 3000 dollars outstanding?` to a syntactically-correct PostgreSQL query.
SELECT first_name , last_name FROM Customers WHERE amount_outstanding BETWEEN 1000 AND 3000;
List first name and last name of customers lived in city Lockmanfurt.
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `List first name and last name of customers lived in city Lockmanfurt.` to a syntactically-correct PostgreSQL query.
SELECT T1.first_name , T1.last_name FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T2.city = "Lockmanfurt";
What are the first and last names of all customers who lived in Lockmanfurt?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What are the first and last names of all customers who lived in Lockmanfurt?` to a syntactically-correct PostgreSQL query.
SELECT T1.first_name , T1.last_name FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T2.city = "Lockmanfurt";
Which country does customer with first name as Carole and last name as Bernhard lived in?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Which country does customer with first name as Carole and last name as Bernhard lived in?` to a syntactically-correct PostgreSQL query.
SELECT T2.country FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T1.first_name = "Carole" AND T1.last_name = "Bernhard"
What is the country in which the customer Carole Bernhard lived?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What is the country in which the customer Carole Bernhard lived?` to a syntactically-correct PostgreSQL query.
SELECT T2.country FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T1.first_name = "Carole" AND T1.last_name = "Bernhard"
What is zip code of customer with first name as Carole and last name as Bernhard?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What is zip code of customer with first name as Carole and last name as Bernhard?` to a syntactically-correct PostgreSQL query.
SELECT T2.zip_postcode FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T1.first_name = "Carole" AND T1.last_name = "Bernhard"
What is the zip code of the customer Carole Bernhard?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What is the zip code of the customer Carole Bernhard?` to a syntactically-correct PostgreSQL query.
SELECT T2.zip_postcode FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T1.first_name = "Carole" AND T1.last_name = "Bernhard"
Which city does has most number of customers?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `Which city does has most number of customers?` to a syntactically-correct PostgreSQL query.
SELECT T2.city FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id GROUP BY T2.city ORDER BY count(*) DESC LIMIT 1;
What is the city with the most customers?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What is the city with the most customers?` to a syntactically-correct PostgreSQL query.
SELECT T2.city FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id GROUP BY T2.city ORDER BY count(*) DESC LIMIT 1;
How much in total does customer with first name as Carole and last name as Bernhard paid?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How much in total does customer with first name as Carole and last name as Bernhard paid?` to a syntactically-correct PostgreSQL query.
SELECT sum(T1.amount_payment) FROM Customer_Payments AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Carole" AND T2.last_name = "Bernhard"
What is the total amount of moeny paid by the customer Carole Bernhard?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What is the total amount of moeny paid by the customer Carole Bernhard?` to a syntactically-correct PostgreSQL query.
SELECT sum(T1.amount_payment) FROM Customer_Payments AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Carole" AND T2.last_name = "Bernhard"
List the number of customers that did not have any payment history.
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `List the number of customers that did not have any payment history.` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM Customers WHERE customer_id NOT IN ( SELECT customer_id FROM Customer_Payments );
How many customers have no payment histories?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How many customers have no payment histories?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM Customers WHERE customer_id NOT IN ( SELECT customer_id FROM Customer_Payments );
List first name and last name of customers that have more than 2 payments.
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `List first name and last name of customers that have more than 2 payments.` to a syntactically-correct PostgreSQL query.
SELECT T2.first_name , T2.last_name FROM Customer_Payments AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING count(*) > 2;
What are the first and last names of all customers with more than 2 payments?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `What are the first and last names of all customers with more than 2 payments?` to a syntactically-correct PostgreSQL query.
SELECT T2.first_name , T2.last_name FROM Customer_Payments AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING count(*) > 2;
List all payment methods and number of payments using each payment methods.
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `List all payment methods and number of payments using each payment methods.` to a syntactically-correct PostgreSQL query.
SELECT payment_method_code , count(*) FROM Customer_Payments GROUP BY payment_method_code;
For each payment method, how many payments were made?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `For each payment method, how many payments were made?` to a syntactically-correct PostgreSQL query.
SELECT payment_method_code , count(*) FROM Customer_Payments GROUP BY payment_method_code;
How many lessons were in cancelled state?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How many lessons were in cancelled state?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM Lessons WHERE lesson_status_code = "Cancelled";
How many lessons have been cancelled?
-- Language PostgreSQL -- Tables: -- Table: addresses columns : [['address id', 'number'], ['line 1 number building', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']] -- Table: staff columns : [['staff id', 'number'], ['staff address id', 'number'], ['nickname', 'text'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['date of birth', 'time'], ['date joined staff', 'time'], ['date left staff', 'time']] -- Table: vehicles columns : [['vehicle id', 'number'], ['vehicle details', 'text']] -- Table: customers columns : [['customer id', 'number'], ['customer address id', 'number'], ['customer status code', 'text'], ['date became customer', 'time'], ['date of birth', 'time'], ['first name', 'text'], ['last name', 'text'], ['amount outstanding', 'number'], ['email address', 'text'], ['phone number', 'text'], ['cell mobile phone number', 'text']] -- Table: customer payments columns : [['customer id', 'number'], ['datetime payment', 'time'], ['payment method code', 'text'], ['amount payment', 'number']] -- Table: lessons columns : [['lesson id', 'number'], ['customer id', 'number'], ['lesson status code', 'text'], ['staff id', 'number'], ['vehicle id', 'number'], ['lesson date', 'time'], ['lesson time', 'text'], ['price', 'number']] You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. You should not select columns that are not part of the tables provided to you. Think step by step. Your only output should be SQL code. Do not include any other text. Only SQL code. Translate `How many lessons have been cancelled?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM Lessons WHERE lesson_status_code = "Cancelled";