target-benchmark/spider-queries huggingface dataset:
Database: train_station (tables: train, station, train_station)
Question: Show all train names and times in stations in London in descending order by train time.
SQL: 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
Database: train_station (tables: station, train_station)
Question: Show the station name with greatest number of trains.
SQL: 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
Database: train_station (tables: station, train_station)
Question: Show the station name with at least two trains.
SQL: 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
Database: train_station (tables: station)
Question: Show all locations with only 1 station.
SQL: SELECT LOCATION FROM station GROUP BY LOCATION HAVING count(*)  =  1
Database: train_station (tables: station, train_station)
Question: Show station names without any trains.
SQL: SELECT name FROM station WHERE station_id NOT IN (SELECT station_id FROM train_station)
Database: train_station (tables: train, station, train_station)
Question: What are the names of the stations which serve both "Ananthapuri Express" and "Guruvayur Express" trains?
SQL: 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"
Database: train_station (tables: train, station, train_station)
Question: Find the names of the trains that do not pass any station located in London.
SQL: 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")
Database: train_station (tables: station)
Question: List the names and locations of all stations ordered by their yearly entry exit and interchange amounts.
SQL: SELECT name ,  LOCATION FROM station ORDER BY Annual_entry_exit ,  Annual_interchanges
Database: driving_school (tables: vehicles)
Question: List all vehicle id
SQL: SELECT vehicle_id FROM Vehicles;
Database: driving_school (tables: vehicles)
Question: What are the ids of all vehicles?
SQL: SELECT vehicle_id FROM Vehicles;
Database: driving_school (tables: vehicles)
Question: How many vehicle in total?
SQL: SELECT count(*) FROM Vehicles;
Database: driving_school (tables: vehicles)
Question: How many vehicles exist?
SQL: SELECT count(*) FROM Vehicles;
Database: driving_school (tables: vehicles)
Question: Show the detail of vehicle with id 1.
SQL: SELECT vehicle_details FROM Vehicles WHERE vehicle_id = 1;
Database: driving_school (tables: vehicles)
Question: What are the details of the car with id 1?
SQL: SELECT vehicle_details FROM Vehicles WHERE vehicle_id = 1;
Database: driving_school (tables: staff)
Question: List the first name middle name and last name of all staff.
SQL: SELECT first_name ,  middle_name ,  last_name FROM Staff;
Database: driving_school (tables: staff)
Question: What are the first, middle, and last names of all staff?
SQL: SELECT first_name ,  middle_name ,  last_name FROM Staff;
Database: driving_school (tables: staff)
Question: What is the birthday of the staff member with first name as Janessa and last name as Sawayn?
SQL: SELECT date_of_birth FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn";
Database: driving_school (tables: staff)
Question: What is the date of birth for the staff member named Janessa Sawayn?
SQL: SELECT date_of_birth FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn";
Database: driving_school (tables: staff)
Question: When did the staff member with first name as Janessa and last name as Sawayn join the company?
SQL: SELECT date_joined_staff FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn";
Database: driving_school (tables: staff)
Question: When did the staff member named Janessa Sawayn join the company?
SQL: SELECT date_joined_staff FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn";
Database: driving_school (tables: staff)
Question: When did the staff member with first name as Janessa and last name as Sawayn leave the company?
SQL: SELECT date_left_staff FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn";
Database: driving_school (tables: staff)
Question: When did the staff member Janessa Sawayn leave the company?
SQL: SELECT date_left_staff FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn";
Database: driving_school (tables: staff)
Question: How many staff have the first name Ludie?
SQL: SELECT count(*) FROM Staff WHERE first_name = "Ludie";
Database: driving_school (tables: staff)
Question: How many employees have a first name of Ludie?
SQL: SELECT count(*) FROM Staff WHERE first_name = "Ludie";
Database: driving_school (tables: staff)
Question: What is the nickname of staff with first name as Janessa and last name as Sawayn?
SQL: SELECT nickname FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn";
Database: driving_school (tables: staff)
Question: What is the nickname of the employee named Janessa Sawayn?
SQL: SELECT nickname FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn";
Database: driving_school (tables: staff)
Question: How many staff in total?
SQL: SELECT count(*) FROM Staff;
Database: driving_school (tables: staff)
Question: How many employees are there?
SQL: SELECT count(*) FROM Staff;
Database: driving_school (tables: addresses, staff)
Question: Which city does staff with first name as Janessa and last name as Sawayn live?
SQL: 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";
Database: driving_school (tables: addresses, staff)
Question: In what city does Janessa Sawayn live?
SQL: 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";
Database: driving_school (tables: addresses, staff)
Question: Which country and state does staff with first name as Janessa and last name as Sawayn lived?
SQL: 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";
Database: driving_school (tables: addresses, staff)
Question: In which country and state does Janessa Sawayn live?
SQL: 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";
Database: driving_school (tables: lessons, customers)
Question: How long is the total lesson time took by customer with first name as Rylan and last name as Goodwin?
SQL: 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";
Database: driving_school (tables: lessons, customers)
Question: How long is the total lesson time took by the customer named Rylan Goodwin?
SQL: 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";
Database: driving_school (tables: addresses, staff)
Question: What is the zip code of staff with first name as Janessa and last name as Sawayn lived?
SQL: 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";
Database: driving_school (tables: addresses, staff)
Question: What is the zip code of the hosue of the employee named Janessa Sawayn?
SQL: 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";
Database: driving_school (tables: addresses)
Question: How many staff live in state Georgia?
SQL: SELECT count(*) FROM Addresses WHERE state_province_county = "Georgia";
Database: driving_school (tables: addresses)
Question: How many employees live in Georgia?
SQL: SELECT count(*) FROM Addresses WHERE state_province_county = "Georgia";
Database: driving_school (tables: addresses, staff)
Question: Find out the first name and last name of staff lived in city Damianfort.
SQL: 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";
Database: driving_school (tables: addresses, staff)
Question: What is the first and last name of all employees who live in the city Damianfort?
SQL: 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";
Database: driving_school (tables: addresses, staff)
Question: Which city lives most of staffs? List the city name and number of staffs.
SQL: 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;
Database: driving_school (tables: addresses, staff)
Question: In which city do the most employees live and how many of them live there?
SQL: 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;
Database: driving_school (tables: addresses, staff)
Question: List the states which have between 2 to 4 staffs living there.
SQL: 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;
Database: driving_school (tables: addresses, staff)
Question: What are the names of the states that have 2 to 4 employees living there?
SQL: 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;
Database: driving_school (tables: customers)
Question: List the first name and last name of all customers.
SQL: SELECT first_name ,  last_name FROM Customers;
Database: driving_school (tables: customers)
Question: What are the first and last names for all customers?
SQL: SELECT first_name ,  last_name FROM Customers;
Database: driving_school (tables: customers)
Question: List email address and birthday of customer whose first name as Carole.
SQL: SELECT email_address ,  date_of_birth FROM Customers WHERE first_name = "Carole"
Database: driving_school (tables: customers)
Question: What are the email addresses and date of births for all customers who have a first name of Carole?
SQL: SELECT email_address ,  date_of_birth FROM Customers WHERE first_name = "Carole"
Database: driving_school (tables: customers)
Question: List phone number and email address of customer with more than 2000 outstanding balance.
SQL: SELECT phone_number ,  email_address FROM Customers WHERE amount_outstanding  >  2000;
Database: driving_school (tables: customers)
Question: What are the phone numbers and email addresses of all customers who have an outstanding balance of more than 2000?
SQL: SELECT phone_number ,  email_address FROM Customers WHERE amount_outstanding  >  2000;
Database: driving_school (tables: customers)
Question: What is the status code, mobile phone number and email address of customer with last name as Kohler or first name as Marina?
SQL: SELECT customer_status_code ,  cell_mobile_phone_number ,  email_address FROM Customers WHERE first_name = "Marina" OR last_name  =  "Kohler"
Database: driving_school (tables: customers)
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?
SQL: SELECT customer_status_code ,  cell_mobile_phone_number ,  email_address FROM Customers WHERE first_name = "Marina" OR last_name  =  "Kohler"
Database: driving_school (tables: customers)
Question: When are the birthdays of customer who are classified as 'Good Customer' status?
SQL: SELECT date_of_birth FROM Customers WHERE customer_status_code  =  'Good Customer'
Database: driving_school (tables: customers)
Question: What is the date of birth of every customer whose status code is 'Good Customer'?
SQL: SELECT date_of_birth FROM Customers WHERE customer_status_code  =  'Good Customer'
Database: driving_school (tables: customers)
Question: When did customer with first name as Carole and last name as Bernhard became a customer?
SQL: SELECT date_became_customer FROM Customers WHERE first_name = "Carole" AND last_name = "Bernhard";
Database: driving_school (tables: customers)
Question: When did Carole Bernhard first become a customer?
SQL: SELECT date_became_customer FROM Customers WHERE first_name = "Carole" AND last_name = "Bernhard";
Database: driving_school (tables: customers)
Question: How many customers in total?
SQL: SELECT count(*) FROM Customers;
Database: driving_school (tables: customers)
Question: How many customers are there?
SQL: SELECT count(*) FROM Customers;
Database: driving_school (tables: customers)
Question: List all customer status codes and the number of customers having each status code.
SQL: SELECT customer_status_code , count(*) FROM Customers GROUP BY customer_status_code;
Database: driving_school (tables: customers)
Question: For each customer status code, how many customers are classified that way?
SQL: SELECT customer_status_code , count(*) FROM Customers GROUP BY customer_status_code;
Database: driving_school (tables: customers)
Question: Which customer status code has least number of customers?
SQL: SELECT customer_status_code FROM Customers GROUP BY customer_status_code ORDER BY count(*) ASC LIMIT 1;
Database: driving_school (tables: customers)
Question: What is the status code with the least number of customers?
SQL: SELECT customer_status_code FROM Customers GROUP BY customer_status_code ORDER BY count(*) ASC LIMIT 1;
Database: driving_school (tables: lessons, customers)
Question: How many lessons taken by customer with first name as Rylan and last name as Goodwin were completed?
SQL: 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";
Database: driving_school (tables: lessons, customers)
Question: How many lessons did the customer Ryan Goodwin complete?
SQL: 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";
Database: driving_school (tables: customers)
Question: What is maximum, minimum and average amount of outstanding of customer?
SQL: SELECT max(amount_outstanding) ,  min(amount_outstanding) ,  avg(amount_outstanding) FROM Customers;
Database: driving_school (tables: customers)
Question: What is the maximum, minimum, and average amount of money outsanding for all customers?
SQL: SELECT max(amount_outstanding) ,  min(amount_outstanding) ,  avg(amount_outstanding) FROM Customers;
Database: driving_school (tables: customers)
Question: List the first name and last name of customers have the amount of outstanding between 1000 and 3000.
SQL: SELECT first_name ,  last_name FROM Customers WHERE amount_outstanding BETWEEN 1000 AND 3000;
Database: driving_school (tables: customers)
Question: What are the first and last names of all customers with between 1000 and 3000 dollars outstanding?
SQL: SELECT first_name ,  last_name FROM Customers WHERE amount_outstanding BETWEEN 1000 AND 3000;
Database: driving_school (tables: addresses, customers)
Question: List first name and last name of customers lived in city Lockmanfurt.
SQL: 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";
Database: driving_school (tables: addresses, customers)
Question: What are the first and last names of all customers who lived in Lockmanfurt?
SQL: 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";
Database: driving_school (tables: addresses, customers)
Question: Which country does customer with first name as Carole and last name as Bernhard lived in?
SQL: 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"
Database: driving_school (tables: addresses, customers)
Question: What is the country in which the customer Carole Bernhard lived?
SQL: 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"
Database: driving_school (tables: addresses, customers)
Question: What is zip code of customer with first name as Carole and last name as Bernhard?
SQL: 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"
Database: driving_school (tables: addresses, customers)
Question: What is the zip code of the customer Carole Bernhard?
SQL: 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"
Database: driving_school (tables: addresses, customers)
Question: Which city does has most number of customers?
SQL: 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;
Database: driving_school (tables: addresses, customers)
Question: What is the city with the most customers?
SQL: 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;
Database: driving_school (tables: customer_payments, customers)
Question: How much in total does customer with first name as Carole and last name as Bernhard paid?
SQL: 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"
Database: driving_school (tables: customer_payments, customers)
Question: What is the total amount of moeny paid by the customer Carole Bernhard?
SQL: 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"
Database: driving_school (tables: customer_payments, customers)
Question: List the number of customers that did not have any payment history.
SQL: SELECT count(*) FROM Customers WHERE customer_id NOT IN ( SELECT customer_id FROM Customer_Payments );
Database: driving_school (tables: customer_payments, customers)
Question: How many customers have no payment histories?
SQL: SELECT count(*) FROM Customers WHERE customer_id NOT IN ( SELECT customer_id FROM Customer_Payments );
Database: driving_school (tables: customer_payments, customers)
Question: List first name and last name of customers that have more than 2 payments.
SQL: 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;
Database: driving_school (tables: customer_payments, customers)
Question: What are the first and last names of all customers with more than 2 payments?
SQL: 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;
Database: driving_school (tables: customer_payments)
Question: List all payment methods and number of payments using each payment methods.
SQL: SELECT payment_method_code ,  count(*) FROM Customer_Payments GROUP BY payment_method_code;
Database: driving_school (tables: customer_payments)
Question: For each payment method, how many payments were made?
SQL: SELECT payment_method_code ,  count(*) FROM Customer_Payments GROUP BY payment_method_code;
Database: driving_school (tables: lessons)
Question: How many lessons were in cancelled state?
SQL: SELECT count(*) FROM Lessons WHERE lesson_status_code = "Cancelled";
Database: driving_school (tables: lessons)
Question: How many lessons have been cancelled?
SQL: SELECT count(*) FROM Lessons WHERE lesson_status_code = "Cancelled";
Database: driving_school (tables: staff, lessons)
Question: List lesson id of all lessons taught by staff with first name as Janessa, last name as Sawayn and nickname containing letter 's'.
SQL: SELECT T1.lesson_id FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn" AND nickname LIKE "%s%";
Database: driving_school (tables: staff, lessons)
Question: What are the the lesson ids of all staff taught by Janessa Sawayn whose nickname has the letter s?
SQL: SELECT T1.lesson_id FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn" AND nickname LIKE "%s%";
Database: driving_school (tables: staff, lessons)
Question: How many lessons taught by staff whose first name has letter 'a' in it?
SQL: SELECT count(*) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name LIKE "%a%"
Database: driving_school (tables: staff, lessons)
Question: How many lessons were taught by a staff member whose first name has the letter 'a' in it?
SQL: SELECT count(*) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name LIKE "%a%"
Database: driving_school (tables: staff, lessons)
Question: How long is the total lesson time taught by staff with first name as Janessa and last name as Sawayn?
SQL: SELECT sum(lesson_time) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn";
Database: driving_school (tables: staff, lessons)
Question: What is the total time for all lessons taught by Janessa Sawayn?
SQL: SELECT sum(lesson_time) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn";
Database: driving_school (tables: staff, lessons)
Question: What is average lesson price taught by staff with first name as Janessa and last name as Sawayn?
SQL: SELECT avg(price) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn";
Database: driving_school (tables: staff, lessons)
Question: What is the average price for a lesson taught by Janessa Sawayn?
SQL: SELECT avg(price) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn";
Database: driving_school (tables: lessons, customers)
Question: How many lesson does customer with first name Ray took?
SQL: SELECT count(*) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id  = T2.customer_id WHERE T2.first_name = "Ray"
Database: driving_school (tables: lessons, customers)
Question: How many lessons did the customer with the first name Ray take?
SQL: SELECT count(*) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id  = T2.customer_id WHERE T2.first_name = "Ray"
Database: driving_school (tables: staff, customers)
Question: Which last names are both used by customers and by staff?
SQL: SELECT last_name FROM Customers INTERSECT SELECT last_name FROM Staff
Database: driving_school (tables: staff, customers)
Question: What are the last names that are used by customers and staff?
SQL: SELECT last_name FROM Customers INTERSECT SELECT last_name FROM Staff