db_id
stringclasses
140 values
input
stringlengths
191
7.13k
output
stringlengths
19
578
train_station
Tables: station, train, train_station Columns: station.Station_ID, station.Name, station.Annual_entry_exit, station.Annual_interchanges, station.Total_Passengers, station.Location, station.Main_Services, station.Number_of_Platforms, train.Train_ID, train.Name, train.Time, train.Service, train_station.Train_ID, train_station.Station_ID Question: Show the name, location, and number of platforms for all stations. [/INST]
SELECT name , LOCATION , number_of_platforms FROM station;
train_station
Tables: station, train, train_station Columns: station.Station_ID, station.Name, station.Annual_entry_exit, station.Annual_interchanges, station.Total_Passengers, station.Location, station.Main_Services, station.Number_of_Platforms, train.Train_ID, train.Name, train.Time, train.Service, train_station.Train_ID, train_station.Station_ID Question: What are all locations of train stations? [/INST]
SELECT DISTINCT LOCATION FROM station;
train_station
Tables: station, train, train_station Columns: station.Station_ID, station.Name, station.Annual_entry_exit, station.Annual_interchanges, station.Total_Passengers, station.Location, station.Main_Services, station.Number_of_Platforms, train.Train_ID, train.Name, train.Time, train.Service, train_station.Train_ID, train_station.Station_ID Question: Show the names and total passengers for all train stations not in London. [/INST]
SELECT name , total_passengers FROM station WHERE LOCATION != 'London';
train_station
Tables: station, train, train_station Columns: station.Station_ID, station.Name, station.Annual_entry_exit, station.Annual_interchanges, station.Total_Passengers, station.Location, station.Main_Services, station.Number_of_Platforms, train.Train_ID, train.Name, train.Time, train.Service, train_station.Train_ID, train_station.Station_ID Question: Show the names and main services for train stations that have the top three total number of passengers. [/INST]
SELECT name , main_services FROM station ORDER BY total_passengers DESC LIMIT 3;
train_station
Tables: station, train, train_station Columns: station.Station_ID, station.Name, station.Annual_entry_exit, station.Annual_interchanges, station.Total_Passengers, station.Location, station.Main_Services, station.Number_of_Platforms, train.Train_ID, train.Name, train.Time, train.Service, train_station.Train_ID, train_station.Station_ID Question: What is the average and maximum number of total passengers for train stations in London or Glasgow? [/INST]
SELECT avg(total_passengers) , max(total_passengers) FROM station WHERE LOCATION = 'London' OR LOCATION = 'Glasgow';
train_station
Tables: station, train, train_station Columns: station.Station_ID, station.Name, station.Annual_entry_exit, station.Annual_interchanges, station.Total_Passengers, station.Location, station.Main_Services, station.Number_of_Platforms, train.Train_ID, train.Name, train.Time, train.Service, train_station.Train_ID, train_station.Station_ID Question: Show all locations and the total number of platforms and passengers for all train stations in each location. [/INST]
SELECT LOCATION , sum(number_of_platforms) , sum(total_passengers) FROM station GROUP BY LOCATION;
train_station
Tables: station, train, train_station Columns: station.Station_ID, station.Name, station.Annual_entry_exit, station.Annual_interchanges, station.Total_Passengers, station.Location, station.Main_Services, station.Number_of_Platforms, train.Train_ID, train.Name, train.Time, train.Service, train_station.Train_ID, train_station.Station_ID Question: Show all locations that have train stations with at least 15 platforms and train stations with more than 25 total passengers. [/INST]
SELECT DISTINCT LOCATION FROM station WHERE number_of_platforms >= 15 AND total_passengers > 25;
train_station
Tables: station, train, train_station Columns: station.Station_ID, station.Name, station.Annual_entry_exit, station.Annual_interchanges, station.Total_Passengers, station.Location, station.Main_Services, station.Number_of_Platforms, train.Train_ID, train.Name, train.Time, train.Service, train_station.Train_ID, train_station.Station_ID Question: Show all locations which don't have a train station with at least 15 platforms. [/INST]
SELECT LOCATION FROM station EXCEPT SELECT LOCATION FROM station WHERE number_of_platforms >= 15;
train_station
Tables: station, train, train_station Columns: station.Station_ID, station.Name, station.Annual_entry_exit, station.Annual_interchanges, station.Total_Passengers, station.Location, station.Main_Services, station.Number_of_Platforms, train.Train_ID, train.Name, train.Time, train.Service, train_station.Train_ID, train_station.Station_ID Question: Show the location with most number of train stations. [/INST]
SELECT LOCATION FROM station GROUP BY LOCATION ORDER BY count(*) DESC LIMIT 1;
train_station
Tables: station, train, train_station Columns: station.Station_ID, station.Name, station.Annual_entry_exit, station.Annual_interchanges, station.Total_Passengers, station.Location, station.Main_Services, station.Number_of_Platforms, train.Train_ID, train.Name, train.Time, train.Service, train_station.Train_ID, train_station.Station_ID Question: Show the name, time, and service for all trains. [/INST]
SELECT name , TIME , service FROM train;
train_station
Tables: station, train, train_station Columns: station.Station_ID, station.Name, station.Annual_entry_exit, station.Annual_interchanges, station.Total_Passengers, station.Location, station.Main_Services, station.Number_of_Platforms, train.Train_ID, train.Name, train.Time, train.Service, train_station.Train_ID, train_station.Station_ID Question: Show the number of trains [/INST]
SELECT count(*) FROM train;
train_station
Tables: station, train, train_station Columns: station.Station_ID, station.Name, station.Annual_entry_exit, station.Annual_interchanges, station.Total_Passengers, station.Location, station.Main_Services, station.Number_of_Platforms, train.Train_ID, train.Name, train.Time, train.Service, train_station.Train_ID, train_station.Station_ID Question: Show the name and service for all trains in order by time. [/INST]
SELECT name , service FROM train ORDER BY TIME;
train_station
Tables: station, train, train_station Columns: station.Station_ID, station.Name, station.Annual_entry_exit, station.Annual_interchanges, station.Total_Passengers, station.Location, station.Main_Services, station.Number_of_Platforms, train.Train_ID, train.Name, train.Time, train.Service, train_station.Train_ID, train_station.Station_ID Question: Show the station name and number of trains in each station. [/INST]
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;
train_station
Tables: station, train, train_station Columns: station.Station_ID, station.Name, station.Annual_entry_exit, station.Annual_interchanges, station.Total_Passengers, station.Location, station.Main_Services, station.Number_of_Platforms, train.Train_ID, train.Name, train.Time, train.Service, train_station.Train_ID, train_station.Station_ID Question: show the train name and station name for each train. [/INST]
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;
train_station
Tables: station, train, train_station Columns: station.Station_ID, station.Name, station.Annual_entry_exit, station.Annual_interchanges, station.Total_Passengers, station.Location, station.Main_Services, station.Number_of_Platforms, train.Train_ID, train.Name, train.Time, train.Service, train_station.Train_ID, train_station.Station_ID Question: Show all train names and times in stations in London in descending order by train time. [/INST]
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;
train_station
Tables: station, train, train_station Columns: station.Station_ID, station.Name, station.Annual_entry_exit, station.Annual_interchanges, station.Total_Passengers, station.Location, station.Main_Services, station.Number_of_Platforms, train.Train_ID, train.Name, train.Time, train.Service, train_station.Train_ID, train_station.Station_ID Question: Show the station name with greatest number of trains. [/INST]
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;
train_station
Tables: station, train, train_station Columns: station.Station_ID, station.Name, station.Annual_entry_exit, station.Annual_interchanges, station.Total_Passengers, station.Location, station.Main_Services, station.Number_of_Platforms, train.Train_ID, train.Name, train.Time, train.Service, train_station.Train_ID, train_station.Station_ID Question: Show the station name with at least two trains. [/INST]
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;
train_station
Tables: station, train, train_station Columns: station.Station_ID, station.Name, station.Annual_entry_exit, station.Annual_interchanges, station.Total_Passengers, station.Location, station.Main_Services, station.Number_of_Platforms, train.Train_ID, train.Name, train.Time, train.Service, train_station.Train_ID, train_station.Station_ID Question: Show all locations with only 1 station. [/INST]
SELECT LOCATION FROM station GROUP BY LOCATION HAVING count(*) = 1;
train_station
Tables: station, train, train_station Columns: station.Station_ID, station.Name, station.Annual_entry_exit, station.Annual_interchanges, station.Total_Passengers, station.Location, station.Main_Services, station.Number_of_Platforms, train.Train_ID, train.Name, train.Time, train.Service, train_station.Train_ID, train_station.Station_ID Question: Show station names without any trains. [/INST]
SELECT name FROM station WHERE station_id NOT IN (SELECT station_id FROM train_station);
train_station
Tables: station, train, train_station Columns: station.Station_ID, station.Name, station.Annual_entry_exit, station.Annual_interchanges, station.Total_Passengers, station.Location, station.Main_Services, station.Number_of_Platforms, train.Train_ID, train.Name, train.Time, train.Service, train_station.Train_ID, train_station.Station_ID Question: What are the names of the stations which serve both "Ananthapuri Express" and "Guruvayur Express" trains? [/INST]
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";
train_station
Tables: station, train, train_station Columns: station.Station_ID, station.Name, station.Annual_entry_exit, station.Annual_interchanges, station.Total_Passengers, station.Location, station.Main_Services, station.Number_of_Platforms, train.Train_ID, train.Name, train.Time, train.Service, train_station.Train_ID, train_station.Station_ID Question: Find the names of the trains that do not pass any station located in London. [/INST]
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");
train_station
Tables: station, train, train_station Columns: station.Station_ID, station.Name, station.Annual_entry_exit, station.Annual_interchanges, station.Total_Passengers, station.Location, station.Main_Services, station.Number_of_Platforms, train.Train_ID, train.Name, train.Time, train.Service, train_station.Train_ID, train_station.Station_ID Question: List the names and locations of all stations ordered by their yearly entry exit and interchange amounts. [/INST]
SELECT name , LOCATION FROM station ORDER BY Annual_entry_exit , Annual_interchanges;
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: List all vehicle id [/INST]
SELECT vehicle_id FROM Vehicles;
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: What are the ids of all vehicles? [/INST]
SELECT vehicle_id FROM Vehicles;
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: How many vehicle in total? [/INST]
SELECT count(*) FROM Vehicles;
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: How many vehicles exist? [/INST]
SELECT count(*) FROM Vehicles;
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: Show the detail of vehicle with id 1. [/INST]
SELECT vehicle_details FROM Vehicles WHERE vehicle_id = 1;
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: What are the details of the car with id 1? [/INST]
SELECT vehicle_details FROM Vehicles WHERE vehicle_id = 1;
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: List the first name middle name and last name of all staff. [/INST]
SELECT first_name , middle_name , last_name FROM Staff;
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: What are the first, middle, and last names of all staff? [/INST]
SELECT first_name , middle_name , last_name FROM Staff;
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: What is the birthday of the staff member with first name as Janessa and last name as Sawayn? [/INST]
SELECT date_of_birth FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: What is the date of birth for the staff member named Janessa Sawayn? [/INST]
SELECT date_of_birth FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: When did the staff member with first name as Janessa and last name as Sawayn join the company? [/INST]
SELECT date_joined_staff FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: When did the staff member named Janessa Sawayn join the company? [/INST]
SELECT date_joined_staff FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: When did the staff member with first name as Janessa and last name as Sawayn leave the company? [/INST]
SELECT date_left_staff FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: When did the staff member Janessa Sawayn leave the company? [/INST]
SELECT date_left_staff FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: How many staff have the first name Ludie? [/INST]
SELECT count(*) FROM Staff WHERE first_name = "Ludie";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: How many employees have a first name of Ludie? [/INST]
SELECT count(*) FROM Staff WHERE first_name = "Ludie";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: What is the nickname of staff with first name as Janessa and last name as Sawayn? [/INST]
SELECT nickname FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: What is the nickname of the employee named Janessa Sawayn? [/INST]
SELECT nickname FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: How many staff in total? [/INST]
SELECT count(*) FROM Staff;
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: How many employees are there? [/INST]
SELECT count(*) FROM Staff;
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: Which city does staff with first name as Janessa and last name as Sawayn live? [/INST]
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";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: In what city does Janessa Sawayn live? [/INST]
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";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: Which country and state does staff with first name as Janessa and last name as Sawayn lived? [/INST]
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";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: In which country and state does Janessa Sawayn live? [/INST]
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";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: How long is the total lesson time took by customer with first name as Rylan and last name as Goodwin? [/INST]
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";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: How long is the total lesson time took by the customer named Rylan Goodwin? [/INST]
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";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: What is the zip code of staff with first name as Janessa and last name as Sawayn lived? [/INST]
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";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: What is the zip code of the hosue of the employee named Janessa Sawayn? [/INST]
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";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: How many staff live in state Georgia? [/INST]
SELECT count(*) FROM Addresses WHERE state_province_county = "Georgia";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: How many employees live in Georgia? [/INST]
SELECT count(*) FROM Addresses WHERE state_province_county = "Georgia";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: Find out the first name and last name of staff lived in city Damianfort. [/INST]
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";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: What is the first and last name of all employees who live in the city Damianfort? [/INST]
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";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: Which city lives most of staffs? List the city name and number of staffs. [/INST]
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;
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: In which city do the most employees live and how many of them live there? [/INST]
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;
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: List the states which have between 2 to 4 staffs living there. [/INST]
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;
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: What are the names of the states that have 2 to 4 employees living there? [/INST]
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;
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: List the first name and last name of all customers. [/INST]
SELECT first_name , last_name FROM Customers;
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: What are the first and last names for all customers? [/INST]
SELECT first_name , last_name FROM Customers;
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: List email address and birthday of customer whose first name as Carole. [/INST]
SELECT email_address , date_of_birth FROM Customers WHERE first_name = "Carole";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: What are the email addresses and date of births for all customers who have a first name of Carole? [/INST]
SELECT email_address , date_of_birth FROM Customers WHERE first_name = "Carole";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: List phone number and email address of customer with more than 2000 outstanding balance. [/INST]
SELECT phone_number , email_address FROM Customers WHERE amount_outstanding > 2000;
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: What are the phone numbers and email addresses of all customers who have an outstanding balance of more than 2000? [/INST]
SELECT phone_number , email_address FROM Customers WHERE amount_outstanding > 2000;
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: What is the status code, mobile phone number and email address of customer with last name as Kohler or first name as Marina? [/INST]
SELECT customer_status_code , cell_mobile_phone_number , email_address FROM Customers WHERE first_name = "Marina" OR last_name = "Kohler";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: What is the status code, phone number, and email address of the customer whose last name is Kohler or whose first name is Marina? [/INST]
SELECT customer_status_code , cell_mobile_phone_number , email_address FROM Customers WHERE first_name = "Marina" OR last_name = "Kohler";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: When are the birthdays of customer who are classified as 'Good Customer' status? [/INST]
SELECT date_of_birth FROM Customers WHERE customer_status_code = 'Good Customer';
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: What is the date of birth of every customer whose status code is 'Good Customer'? [/INST]
SELECT date_of_birth FROM Customers WHERE customer_status_code = 'Good Customer';
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: When did customer with first name as Carole and last name as Bernhard became a customer? [/INST]
SELECT date_became_customer FROM Customers WHERE first_name = "Carole" AND last_name = "Bernhard";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: When did Carole Bernhard first become a customer? [/INST]
SELECT date_became_customer FROM Customers WHERE first_name = "Carole" AND last_name = "Bernhard";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: How many customers in total? [/INST]
SELECT count(*) FROM Customers;
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: How many customers are there? [/INST]
SELECT count(*) FROM Customers;
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: List all customer status codes and the number of customers having each status code. [/INST]
SELECT customer_status_code , count(*) FROM Customers GROUP BY customer_status_code;
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: For each customer status code, how many customers are classified that way? [/INST]
SELECT customer_status_code , count(*) FROM Customers GROUP BY customer_status_code;
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: Which customer status code has least number of customers? [/INST]
SELECT customer_status_code FROM Customers GROUP BY customer_status_code ORDER BY count(*) ASC LIMIT 1;
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: What is the status code with the least number of customers? [/INST]
SELECT customer_status_code FROM Customers GROUP BY customer_status_code ORDER BY count(*) ASC LIMIT 1;
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: How many lessons taken by customer with first name as Rylan and last name as Goodwin were completed? [/INST]
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";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: How many lessons did the customer Ryan Goodwin complete? [/INST]
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";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: What is maximum, minimum and average amount of outstanding of customer? [/INST]
SELECT max(amount_outstanding) , min(amount_outstanding) , avg(amount_outstanding) FROM Customers;
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: What is the maximum, minimum, and average amount of money outsanding for all customers? [/INST]
SELECT max(amount_outstanding) , min(amount_outstanding) , avg(amount_outstanding) FROM Customers;
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: List the first name and last name of customers have the amount of outstanding between 1000 and 3000. [/INST]
SELECT first_name , last_name FROM Customers WHERE amount_outstanding BETWEEN 1000 AND 3000;
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: What are the first and last names of all customers with between 1000 and 3000 dollars outstanding? [/INST]
SELECT first_name , last_name FROM Customers WHERE amount_outstanding BETWEEN 1000 AND 3000;
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: List first name and last name of customers lived in city Lockmanfurt. [/INST]
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";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: What are the first and last names of all customers who lived in Lockmanfurt? [/INST]
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";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: Which country does customer with first name as Carole and last name as Bernhard lived in? [/INST]
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";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: What is the country in which the customer Carole Bernhard lived? [/INST]
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";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: What is zip code of customer with first name as Carole and last name as Bernhard? [/INST]
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";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: What is the zip code of the customer Carole Bernhard? [/INST]
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";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: Which city does has most number of customers? [/INST]
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;
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: What is the city with the most customers? [/INST]
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;
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: How much in total does customer with first name as Carole and last name as Bernhard paid? [/INST]
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";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: What is the total amount of moeny paid by the customer Carole Bernhard? [/INST]
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";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: List the number of customers that did not have any payment history. [/INST]
SELECT count(*) FROM Customers WHERE customer_id NOT IN ( SELECT customer_id FROM Customer_Payments );
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: How many customers have no payment histories? [/INST]
SELECT count(*) FROM Customers WHERE customer_id NOT IN ( SELECT customer_id FROM Customer_Payments );
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: List first name and last name of customers that have more than 2 payments. [/INST]
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;
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: What are the first and last names of all customers with more than 2 payments? [/INST]
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;
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: List all payment methods and number of payments using each payment methods. [/INST]
SELECT payment_method_code , count(*) FROM Customer_Payments GROUP BY payment_method_code;
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: For each payment method, how many payments were made? [/INST]
SELECT payment_method_code , count(*) FROM Customer_Payments GROUP BY payment_method_code;
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: How many lessons were in cancelled state? [/INST]
SELECT count(*) FROM Lessons WHERE lesson_status_code = "Cancelled";
driving_school
Tables: Addresses, Staff, Vehicles, Customers, Customer_Payments, Lessons Columns: Addresses.address_id, Addresses.line_1_number_building, Addresses.city, Addresses.zip_postcode, Addresses.state_province_county, Addresses.country, Staff.staff_id, Staff.staff_address_id, Staff.nickname, Staff.first_name, Staff.middle_name, Staff.last_name, Staff.date_of_birth, Staff.date_joined_staff, Staff.date_left_staff, Vehicles.vehicle_id, Vehicles.vehicle_details, Customers.customer_id, Customers.customer_address_id, Customers.customer_status_code, Customers.date_became_customer, Customers.date_of_birth, Customers.first_name, Customers.last_name, Customers.amount_outstanding, Customers.email_address, Customers.phone_number, Customers.cell_mobile_phone_number, Customer_Payments.customer_id, Customer_Payments.datetime_payment, Customer_Payments.payment_method_code, Customer_Payments.amount_payment, Lessons.lesson_id, Lessons.customer_id, Lessons.lesson_status_code, Lessons.staff_id, Lessons.vehicle_id, Lessons.lesson_date, Lessons.lesson_time, Lessons.price Question: How many lessons have been cancelled? [/INST]
SELECT count(*) FROM Lessons WHERE lesson_status_code = "Cancelled";