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