db_id stringlengths 4 31 | SQL stringlengths 18 1.45k | input_sequence stringlengths 148 11k | question stringlengths 16 325 |
|---|---|---|---|
train_station | select name , location , number_of_platforms from station | Question: show the name, location, and number of platforms for all stations. | Tables: station -> Station_ID, Name, Annual_entry_exit, Annual_interchanges, Total_Passengers, Location, Main_Services, Number_of_Platforms. train -> Train_ID, Name, Time, Service. train_station -> Train_ID, Station_ID. | Joins: train_statio... | show the name, location, and number of platforms for all stations. |
train_station | select distinct location from station | Question: what are all locations of train stations? | Tables: station -> Station_ID, Name, Annual_entry_exit, Annual_interchanges, Total_Passengers, Location, Main_Services, Number_of_Platforms. train -> Train_ID, Name, Time, Service. train_station -> Train_ID, Station_ID. | Joins: train_station.Station_ID = station.St... | what are all locations of train stations? |
train_station | select name , total_passengers from station where location != 'london' | Question: show the names and total passengers for all train stations not in london. | Tables: station -> Station_ID, Name, Annual_entry_exit, Annual_interchanges, Total_Passengers, Location, Main_Services, Number_of_Platforms. train -> Train_ID, Name, Time, Service. train_station -> Train_ID, Station_ID. | Joins: train... | show the names and total passengers for all train stations not in london. |
train_station | select name , main_services from station order by total_passengers desc limit 3 | Question: show the names and main services for train stations that have the top three total number of passengers. | Tables: station -> Station_ID, Name, Annual_entry_exit, Annual_interchanges, Total_Passengers, Location, Main_Services, Number_of_Platforms. train -> Train_ID, Name, Time, Service. train_station -> Train_... | show the names and main services for train stations that have the top three total number of passengers. |
train_station | select avg(total_passengers) , max(total_passengers) from station where location = 'london' or location = 'glasgow' | Question: what is the average and maximum number of total passengers for train stations in london or glasgow? | Tables: station -> Station_ID, Name, Annual_entry_exit, Annual_interchanges, Total_Passengers, Location, Main_Services, Number_of_Platforms. train -> Train_ID, Name, Time, Service. train_station -> Train_ID, ... | what is the average and maximum number of total passengers for train stations in london or glasgow? |
train_station | select location , sum(number_of_platforms) , sum(total_passengers) from station group by location | Question: show all locations and the total number of platforms and passengers for all train stations in each location. | Tables: station -> Station_ID, Name, Annual_entry_exit, Annual_interchanges, Total_Passengers, Location, Main_Services, Number_of_Platforms. train -> Train_ID, Name, Time, Service. train_station -> T... | show all locations and the total number of platforms and passengers for all train stations in each location. |
train_station | select distinct location from station where number_of_platforms >= 15 and total_passengers > 25 | Question: show all locations that have train stations with at least 15 platforms and train stations with more than 25 total passengers. | Tables: station -> Station_ID, Name, Annual_entry_exit, Annual_interchanges, Total_Passengers, Location, Main_Services, Number_of_Platforms. train -> Train_ID, Name, Time, Service. t... | show all locations that have train stations with at least 15 platforms and train stations with more than 25 total passengers. |
train_station | select location from station except select location from station where number_of_platforms >= 15 | Question: show all locations which don't have a train station with at least 15 platforms. | Tables: station -> Station_ID, Name, Annual_entry_exit, Annual_interchanges, Total_Passengers, Location, Main_Services, Number_of_Platforms. train -> Train_ID, Name, Time, Service. train_station -> Train_ID, Station_ID. | Joins:... | show all locations which don't have a train station with at least 15 platforms. |
train_station | select location from station group by location order by count(*) desc limit 1 | Question: show the location with most number of train stations. | Tables: station -> Station_ID, Name, Annual_entry_exit, Annual_interchanges, Total_Passengers, Location, Main_Services, Number_of_Platforms. train -> Train_ID, Name, Time, Service. train_station -> Train_ID, Station_ID. | Joins: train_station.Station_ID ... | show the location with most number of train stations. |
train_station | select name , time , service from train | Question: show the name, time, and service for all trains. | Tables: station -> Station_ID, Name, Annual_entry_exit, Annual_interchanges, Total_Passengers, Location, Main_Services, Number_of_Platforms. train -> Train_ID, Name, Time, Service. train_station -> Train_ID, Station_ID. | Joins: train_station.Station_ID = sta... | show the name, time, and service for all trains. |
train_station | select count(*) from train | Question: show the number of trains | Tables: station -> Station_ID, Name, Annual_entry_exit, Annual_interchanges, Total_Passengers, Location, Main_Services, Number_of_Platforms. train -> Train_ID, Name, Time, Service. train_station -> Train_ID, Station_ID. | Joins: train_station.Station_ID = station.Station_ID, train_... | show the number of trains |
train_station | select name , service from train order by time | Question: show the name and service for all trains in order by time. | Tables: station -> Station_ID, Name, Annual_entry_exit, Annual_interchanges, Total_Passengers, Location, Main_Services, Number_of_Platforms. train -> Train_ID, Name, Time, Service. train_station -> Train_ID, Station_ID. | Joins: train_station.Statio... | show the name and service for all trains in order by time. |
train_station | 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 | Question: show the station name and number of trains in each station. | Tables: station -> Station_ID, Name, Annual_entry_exit, Annual_interchanges, Total_Passengers, Location, Main_Services, Number_of_Platforms. train -> Train_ID, Name, Time, Service. train_station -> Train_ID, Station_ID. | Joins: train_station.Stati... | show the station name and number of trains in each station. |
train_station | 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 | Question: show the train name and station name for each train. | Tables: station -> Station_ID, Name, Annual_entry_exit, Annual_interchanges, Total_Passengers, Location, Main_Services, Number_of_Platforms. train -> Train_ID, Name, Time, Service. train_station -> Train_ID, Station_ID. | Joins: train_station.Station_ID =... | show the train name and station name for each train. |
train_station | 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 | Question: show all train names and times in stations in london in descending order by train time. | Tables: station -> Station_ID, Name, Annual_entry_exit, Annual_interchanges, Total_Passengers, Location, Main_Services, Number_of_Platforms. train -> Train_ID, Name, Time, Service. train_station -> Train_ID, Station_ID. ... | show all train names and times in stations in london in descending order by train time. |
train_station | 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 | Question: show the station name with greatest number of trains. | Tables: station -> Station_ID, Name, Annual_entry_exit, Annual_interchanges, Total_Passengers, Location, Main_Services, Number_of_Platforms. train -> Train_ID, Name, Time, Service. train_station -> Train_ID, Station_ID. | Joins: train_station.Station_ID ... | show the station name with greatest number of trains. |
train_station | 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 | Question: show the station name with at least two trains. | Tables: station -> Station_ID, Name, Annual_entry_exit, Annual_interchanges, Total_Passengers, Location, Main_Services, Number_of_Platforms. train -> Train_ID, Name, Time, Service. train_station -> Train_ID, Station_ID. | Joins: train_station.Station_ID = stat... | show the station name with at least two trains. |
train_station | select location from station group by location having count(*) = 1 | Question: show all locations with only 1 station. | Tables: station -> Station_ID, Name, Annual_entry_exit, Annual_interchanges, Total_Passengers, Location, Main_Services, Number_of_Platforms. train -> Train_ID, Name, Time, Service. train_station -> Train_ID, Station_ID. | Joins: train_station.Station_ID = station.Stat... | show all locations with only 1 station. |
train_station | select name from station where station_id not in (select station_id from train_station) | Question: show station names without any trains. | Tables: station -> Station_ID, Name, Annual_entry_exit, Annual_interchanges, Total_Passengers, Location, Main_Services, Number_of_Platforms. train -> Train_ID, Name, Time, Service. train_station -> Train_ID, Station_ID. | Joins: train_station.Station_ID = station.Stati... | show station names without any trains. |
train_station | 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 =... | Question: what are the names of the stations which serve both 'ananthapuri express' and 'guruvayur express' trains? | Tables: station -> Station_ID, Name, Annual_entry_exit, Annual_interchanges, Total_Passengers, Location, Main_Services, Number_of_Platforms. train -> Train_ID, Name, Time, Service. train_station -> Trai... | what are the names of the stations which serve both 'ananthapuri express' and 'guruvayur express' trains? |
train_station | 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') | Question: find the names of the trains that do not pass any station located in london. | Tables: station -> Station_ID, Name, Annual_entry_exit, Annual_interchanges, Total_Passengers, Location, Main_Services, Number_of_Platforms. train -> Train_ID, Name, Time, Service. train_station -> Train_ID, Station_ID. | Joins: tr... | find the names of the trains that do not pass any station located in london. |
train_station | select name , location from station order by annual_entry_exit , annual_interchanges | Question: list the names and locations of all stations ordered by their yearly entry exit and interchange amounts. | Tables: station -> Station_ID, Name, Annual_entry_exit, Annual_interchanges, Total_Passengers, Location, Main_Services, Number_of_Platforms. train -> Train_ID, Name, Time, Service. train_station -> Train... | list the names and locations of all stations ordered by their yearly entry exit and interchange amounts. |
driving_school | select vehicle_id from vehicles; | Question: list all vehicle id | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staff. Vehicles -> vehicle_id, vehicle_details. Cust... | list all vehicle id |
driving_school | select vehicle_id from vehicles; | Question: what are the ids of all vehicles? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staff. Vehicles -> vehicle_id, vehicle... | what are the ids of all vehicles? |
driving_school | select count(*) from vehicles; | Question: how many vehicle in total? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staff. Vehicles -> vehicle_id, vehicle_detail... | how many vehicle in total? |
driving_school | select count(*) from vehicles; | Question: how many vehicles exist? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staff. Vehicles -> vehicle_id, vehicle_details.... | how many vehicles exist? |
driving_school | select vehicle_details from vehicles where vehicle_id = 1; | Question: show the detail of vehicle with id 1. | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staff. Vehicles -> vehicle_id, veh... | show the detail of vehicle with id 1. |
driving_school | select vehicle_details from vehicles where vehicle_id = 1; | Question: what are the details of the car with id 1? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staff. Vehicles -> vehicle_id... | what are the details of the car with id 1? |
driving_school | select first_name , middle_name , last_name from staff; | Question: list the first name middle name and last name of all staff. | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staff. Vehic... | list the first name middle name and last name of all staff. |
driving_school | select first_name , middle_name , last_name from staff; | Question: what are the first, middle, and last names of all staff? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staff. Vehicles... | what are the first, middle, and last names of all staff? |
driving_school | select date_of_birth from staff where first_name = 'janessa' and last_name = 'sawayn'; | Question: what is the birthday of the staff member with first name as janessa and last name as sawayn? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joi... | what is the birthday of the staff member with first name as janessa and last name as sawayn? |
driving_school | select date_of_birth from staff where first_name = 'janessa' and last_name = 'sawayn'; | Question: what is the date of birth for the staff member named janessa sawayn? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_sta... | what is the date of birth for the staff member named janessa sawayn? |
driving_school | select date_joined_staff from staff where first_name = 'janessa' and last_name = 'sawayn'; | Question: when did the staff member with first name as janessa and last name as sawayn join the company? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_j... | when did the staff member with first name as janessa and last name as sawayn join the company? |
driving_school | select date_joined_staff from staff where first_name = 'janessa' and last_name = 'sawayn'; | Question: when did the staff member named janessa sawayn join the company? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staff. ... | when did the staff member named janessa sawayn join the company? |
driving_school | select date_left_staff from staff where first_name = 'janessa' and last_name = 'sawayn'; | Question: when did the staff member with first name as janessa and last name as sawayn leave the company? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_... | when did the staff member with first name as janessa and last name as sawayn leave the company? |
driving_school | select date_left_staff from staff where first_name = 'janessa' and last_name = 'sawayn'; | Question: when did the staff member janessa sawayn leave the company? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staff. Vehic... | when did the staff member janessa sawayn leave the company? |
driving_school | select count(*) from staff where first_name = 'ludie'; | Question: how many staff have the first name ludie? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staff. Vehicles -> vehicle_id,... | how many staff have the first name ludie? |
driving_school | select count(*) from staff where first_name = 'ludie'; | Question: how many employees have a first name of ludie? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staff. Vehicles -> vehicl... | how many employees have a first name of ludie? |
driving_school | select nickname from staff where first_name = 'janessa' and last_name = 'sawayn'; | Question: what is the nickname of staff with first name as janessa and last name as sawayn? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, ... | what is the nickname of staff with first name as janessa and last name as sawayn? |
driving_school | select nickname from staff where first_name = 'janessa' and last_name = 'sawayn'; | Question: what is the nickname of the employee named janessa sawayn? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staff. Vehicl... | what is the nickname of the employee named janessa sawayn? |
driving_school | select count(*) from staff; | Question: how many staff in total? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staff. Vehicles -> vehicle_id, vehicle_details.... | how many staff in total? |
driving_school | select count(*) from staff; | Question: how many employees are there? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staff. Vehicles -> vehicle_id, vehicle_det... | how many employees are there? |
driving_school | 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'; | Question: which city does staff with first name as janessa and last name as sawayn live? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, dat... | which city does staff with first name as janessa and last name as sawayn live? |
driving_school | 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'; | Question: in what city does janessa sawayn live? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staff. Vehicles -> vehicle_id, ve... | in what city does janessa sawayn live? |
driving_school | 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'; | Question: which country and state does staff with first name as janessa and last name as sawayn lived? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joi... | which country and state does staff with first name as janessa and last name as sawayn lived? |
driving_school | 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'; | Question: in which country and state does janessa sawayn live? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staff. Vehicles -> ... | in which country and state does janessa sawayn live? |
driving_school | 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'; | Question: how long is the total lesson time took by customer with first name as rylan and last name as goodwin? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth,... | how long is the total lesson time took by customer with first name as rylan and last name as goodwin? |
driving_school | 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'; | Question: how long is the total lesson time took by the customer named rylan goodwin? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_l... | how long is the total lesson time took by the customer named rylan goodwin? |
driving_school | 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'; | Question: what is the zip code of staff with first name as janessa and last name as sawayn lived? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_s... | what is the zip code of staff with first name as janessa and last name as sawayn lived? |
driving_school | 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'; | Question: what is the zip code of the hosue of the employee named janessa sawayn? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_... | what is the zip code of the hosue of the employee named janessa sawayn? |
driving_school | select count(*) from addresses where state_province_county = 'georgia'; | Question: how many staff live in state georgia? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staff. Vehicles -> vehicle_id, veh... | how many staff live in state georgia? |
driving_school | select count(*) from addresses where state_province_county = 'georgia'; | Question: how many employees live in georgia? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staff. Vehicles -> vehicle_id, vehic... | how many employees live in georgia? |
driving_school | 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'; | Question: find out the first name and last name of staff lived in city damianfort. | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left... | find out the first name and last name of staff lived in city damianfort. |
driving_school | 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'; | Question: what is the first and last name of all employees who live in the city damianfort? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, ... | what is the first and last name of all employees who live in the city damianfort? |
driving_school | 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; | Question: which city lives most of staffs? list the city name and number of staffs. | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_lef... | which city lives most of staffs? list the city name and number of staffs. |
driving_school | 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; | Question: in which city do the most employees live and how many of them live there? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_lef... | in which city do the most employees live and how many of them live there? |
driving_school | 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; | Question: list the states which have between 2 to 4 staffs living there. | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staff. Ve... | list the states which have between 2 to 4 staffs living there. |
driving_school | 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; | Question: what are the names of the states that have 2 to 4 employees living there? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_lef... | what are the names of the states that have 2 to 4 employees living there? |
driving_school | select first_name , last_name from customers; | Question: list the first name and last name of all customers. | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staff. Vehicles -> v... | list the first name and last name of all customers. |
driving_school | select first_name , last_name from customers; | Question: what are the first and last names for all customers? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staff. Vehicles -> ... | what are the first and last names for all customers? |
driving_school | select email_address , date_of_birth from customers where first_name = 'carole' | Question: list email address and birthday of customer whose first name as carole. | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_... | list email address and birthday of customer whose first name as carole. |
driving_school | select email_address , date_of_birth from customers where first_name = 'carole' | Question: what are the email addresses and date of births for all customers who have a first name of carole? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, da... | what are the email addresses and date of births for all customers who have a first name of carole? |
driving_school | select phone_number , email_address from customers where amount_outstanding > 2000; | Question: list phone number and email address of customer with more than 2000 outstanding balance. | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_... | list phone number and email address of customer with more than 2000 outstanding balance. |
driving_school | select phone_number , email_address from customers where amount_outstanding > 2000; | Question: what are the phone numbers and email addresses of all customers who have an outstanding balance of more than 2000? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, d... | what are the phone numbers and email addresses of all customers who have an outstanding balance of more than 2000? |
driving_school | select customer_status_code , cell_mobile_phone_number , email_address from customers where first_name = 'marina' or last_name = 'kohler' | Question: what is the status code, mobile phone number and email address of customer with last name as kohler or first name as marina? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, la... | what is the status code, mobile phone number and email address of customer with last name as kohler or first name as marina? |
driving_school | select customer_status_code , cell_mobile_phone_number , email_address from customers where first_name = 'marina' or last_name = 'kohler' | 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? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_nam... | what is the status code, phone number, and email address of the customer whose last name is kohler or whose first name is marina? |
driving_school | select date_of_birth from customers where customer_status_code = 'good customer' | Question: when are the birthdays of customer who are classified as 'good customer' status? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, d... | when are the birthdays of customer who are classified as 'good customer' status? |
driving_school | select date_of_birth from customers where customer_status_code = 'good customer' | Question: what is the date of birth of every customer whose status code is 'good customer'? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, ... | what is the date of birth of every customer whose status code is 'good customer'? |
driving_school | select date_became_customer from customers where first_name = 'carole' and last_name = 'bernhard'; | Question: when did customer with first name as carole and last name as bernhard became a customer? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_... | when did customer with first name as carole and last name as bernhard became a customer? |
driving_school | select date_became_customer from customers where first_name = 'carole' and last_name = 'bernhard'; | Question: when did carole bernhard first become a customer? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staff. Vehicles -> veh... | when did carole bernhard first become a customer? |
driving_school | select count(*) from customers; | Question: how many customers in total? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staff. Vehicles -> vehicle_id, vehicle_deta... | how many customers in total? |
driving_school | select count(*) from customers; | Question: how many customers are there? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staff. Vehicles -> vehicle_id, vehicle_det... | how many customers are there? |
driving_school | select customer_status_code , count(*) from customers group by customer_status_code; | Question: list all customer status codes and the number of customers having each status code. | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff... | list all customer status codes and the number of customers having each status code. |
driving_school | select customer_status_code , count(*) from customers group by customer_status_code; | Question: for each customer status code, how many customers are classified that way? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_le... | for each customer status code, how many customers are classified that way? |
driving_school | select customer_status_code from customers group by customer_status_code order by count(*) asc limit 1; | Question: which customer status code has least number of customers? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staff. Vehicle... | which customer status code has least number of customers? |
driving_school | select customer_status_code from customers group by customer_status_code order by count(*) asc limit 1; | Question: what is the status code with the least number of customers? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staff. Vehic... | what is the status code with the least number of customers? |
driving_school | 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'; | Question: how many lessons taken by customer with first name as rylan and last name as goodwin were completed? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, ... | how many lessons taken by customer with first name as rylan and last name as goodwin were completed? |
driving_school | 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'; | Question: how many lessons did the customer ryan goodwin complete? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staff. Vehicles... | how many lessons did the customer ryan goodwin complete? |
driving_school | select max(amount_outstanding) , min(amount_outstanding) , avg(amount_outstanding) from customers; | Question: what is maximum, minimum and average amount of outstanding of customer? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_... | what is maximum, minimum and average amount of outstanding of customer? |
driving_school | select max(amount_outstanding) , min(amount_outstanding) , avg(amount_outstanding) from customers; | Question: what is the maximum, minimum, and average amount of money outsanding for all customers? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_s... | what is the maximum, minimum, and average amount of money outsanding for all customers? |
driving_school | select first_name , last_name from customers where amount_outstanding between 1000 and 3000; | Question: list the first name and last name of customers have the amount of outstanding between 1000 and 3000. | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, ... | list the first name and last name of customers have the amount of outstanding between 1000 and 3000. |
driving_school | select first_name , last_name from customers where amount_outstanding between 1000 and 3000; | Question: what are the first and last names of all customers with between 1000 and 3000 dollars outstanding? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, da... | what are the first and last names of all customers with between 1000 and 3000 dollars outstanding? |
driving_school | 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'; | Question: list first name and last name of customers lived in city lockmanfurt. | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_st... | list first name and last name of customers lived in city lockmanfurt. |
driving_school | 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'; | Question: what are the first and last names of all customers who lived in lockmanfurt? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_... | what are the first and last names of all customers who lived in lockmanfurt? |
driving_school | 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' | Question: which country does customer with first name as carole and last name as bernhard lived in? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined... | which country does customer with first name as carole and last name as bernhard lived in? |
driving_school | 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' | Question: what is the country in which the customer carole bernhard lived? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staff. ... | what is the country in which the customer carole bernhard lived? |
driving_school | 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' | Question: what is zip code of customer with first name as carole and last name as bernhard? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, ... | what is zip code of customer with first name as carole and last name as bernhard? |
driving_school | 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' | Question: what is the zip code of the customer carole bernhard? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staff. Vehicles ->... | what is the zip code of the customer carole bernhard? |
driving_school | 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; | Question: which city does has most number of customers? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staff. Vehicles -> vehicle... | which city does has most number of customers? |
driving_school | 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; | Question: what is the city with the most customers? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staff. Vehicles -> vehicle_id,... | what is the city with the most customers? |
driving_school | 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' | Question: how much in total does customer with first name as carole and last name as bernhard paid? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined... | how much in total does customer with first name as carole and last name as bernhard paid? |
driving_school | 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' | Question: what is the total amount of moeny paid by the customer carole bernhard? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_... | what is the total amount of moeny paid by the customer carole bernhard? |
driving_school | select count(*) from customers where customer_id not in ( select customer_id from customer_payments ); | Question: list the number of customers that did not have any payment history. | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staf... | list the number of customers that did not have any payment history. |
driving_school | select count(*) from customers where customer_id not in ( select customer_id from customer_payments ); | Question: how many customers have no payment histories? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staff. Vehicles -> vehicle... | how many customers have no payment histories? |
driving_school | 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; | Question: list first name and last name of customers that have more than 2 payments. | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_le... | list first name and last name of customers that have more than 2 payments. |
driving_school | 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; | Question: what are the first and last names of all customers with more than 2 payments? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date... | what are the first and last names of all customers with more than 2 payments? |
driving_school | select payment_method_code , count(*) from customer_payments group by payment_method_code; | Question: list all payment methods and number of payments using each payment methods. | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_l... | list all payment methods and number of payments using each payment methods. |
driving_school | select payment_method_code , count(*) from customer_payments group by payment_method_code; | Question: for each payment method, how many payments were made? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staff. Vehicles ->... | for each payment method, how many payments were made? |
driving_school | select count(*) from lessons where lesson_status_code = 'cancelled'; | Question: how many lessons were in cancelled state? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staff. Vehicles -> vehicle_id,... | how many lessons were in cancelled state? |
driving_school | select count(*) from lessons where lesson_status_code = 'cancelled'; | Question: how many lessons have been cancelled? | Tables: Addresses -> address_id, line_1_number_building, city, zip_postcode, state_province_county, country. Staff -> staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staff. Vehicles -> vehicle_id, veh... | how many lessons have been cancelled? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.