target-benchmark/spider-queries huggingface dataset:
Database: customers_card_transactions (tables: financial_transactions)
Question: What are the different account ids that have made financial transactions, as well as how many transactions correspond to each?
SQL: SELECT account_id ,  count(*) FROM Financial_transactions GROUP BY account_id
Database: race_track (tables: track)
Question: How many tracks do we have?
SQL: SELECT count(*) FROM track
Database: race_track (tables: track)
Question: Count the number of tracks.
SQL: SELECT count(*) FROM track
Database: race_track (tables: track)
Question: Show the name and location for all tracks.
SQL: SELECT name ,  LOCATION FROM track
Database: race_track (tables: track)
Question: What are the names and locations of all tracks?
SQL: SELECT name ,  LOCATION FROM track
Database: race_track (tables: track)
Question: Show names and seatings, ordered by seating for all tracks opened after 2000.
SQL: SELECT name ,  seating FROM track WHERE year_opened  >  2000 ORDER BY seating
Database: race_track (tables: track)
Question: What are the names and seatings for all tracks opened after 2000, ordered by seating?
SQL: SELECT name ,  seating FROM track WHERE year_opened  >  2000 ORDER BY seating
Database: race_track (tables: track)
Question: What is the name, location and seating for the most recently opened track?
SQL: SELECT name ,  LOCATION ,  seating FROM track ORDER BY year_opened DESC LIMIT 1
Database: race_track (tables: track)
Question: Return the name, location, and seating of the track that was opened in the most recent year.
SQL: SELECT name ,  LOCATION ,  seating FROM track ORDER BY year_opened DESC LIMIT 1
Database: race_track (tables: track)
Question: What is the minimum, maximum, and average seating for all tracks.
SQL: SELECT min(seating) ,  max(seating) ,  avg(seating) FROM track
Database: race_track (tables: track)
Question: Return the minimum, maximum, and average seating across all tracks.
SQL: SELECT min(seating) ,  max(seating) ,  avg(seating) FROM track
Database: race_track (tables: track)
Question: Show the name, location, open year for all tracks with a seating higher than the average.
SQL: SELECT name ,  LOCATION ,  year_opened FROM track WHERE seating  >  (SELECT avg(seating) FROM track)
Database: race_track (tables: track)
Question: What are the names, locations, and years of opening for tracks with seating higher than average?
SQL: SELECT name ,  LOCATION ,  year_opened FROM track WHERE seating  >  (SELECT avg(seating) FROM track)
Database: race_track (tables: track)
Question: What are distinct locations where tracks are located?
SQL: SELECT DISTINCT LOCATION FROM track
Database: race_track (tables: track)
Question: Give the different locations of tracks.
SQL: SELECT DISTINCT LOCATION FROM track
Database: race_track (tables: race)
Question: How many races are there?
SQL: SELECT count(*) FROM race
Database: race_track (tables: race)
Question: Count the number of races.
SQL: SELECT count(*) FROM race
Database: race_track (tables: race)
Question: What are the distinct classes that races can have?
SQL: SELECT DISTINCT CLASS FROM race
Database: race_track (tables: race)
Question: Return the different classes of races.
SQL: SELECT DISTINCT CLASS FROM race
Database: race_track (tables: race)
Question: Show name, class, and date for all races.
SQL: SELECT name ,  CLASS ,  date FROM race
Database: race_track (tables: race)
Question: What are the names, classes, and dates for all races?
SQL: SELECT name ,  CLASS ,  date FROM race
Database: race_track (tables: race)
Question: Show the race class and number of races in each class.
SQL: SELECT CLASS ,  count(*) FROM race GROUP BY CLASS
Database: race_track (tables: race)
Question: What are the different classes of races, and how many races correspond to each?
SQL: SELECT CLASS ,  count(*) FROM race GROUP BY CLASS
Database: race_track (tables: race)
Question: What is the race class with most number of races.
SQL: SELECT CLASS FROM race GROUP BY CLASS ORDER BY count(*) DESC LIMIT 1
Database: race_track (tables: race)
Question: Give the class of races that is most common.
SQL: SELECT CLASS FROM race GROUP BY CLASS ORDER BY count(*) DESC LIMIT 1
Database: race_track (tables: race)
Question: List the race class with at least two races.
SQL: SELECT CLASS FROM race GROUP BY CLASS HAVING count(*)  >=  2
Database: race_track (tables: race)
Question: What are the classes of races that have two or more corresponding races?
SQL: SELECT CLASS FROM race GROUP BY CLASS HAVING count(*)  >=  2
Database: race_track (tables: race, track)
Question: What are the names for tracks without a race in class 'GT'.
SQL: SELECT name FROM track EXCEPT SELECT T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id WHERE T1.class  =  'GT'
Database: race_track (tables: race, track)
Question: Give the names of tracks that do not have a race in the class 'GT'.
SQL: SELECT name FROM track EXCEPT SELECT T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id WHERE T1.class  =  'GT'
Database: race_track (tables: race, track)
Question: Show all track names that have had no races.
SQL: SELECT name FROM track WHERE track_id NOT IN (SELECT track_id FROM race)
Database: race_track (tables: race, track)
Question: Return the names of tracks that have no had any races.
SQL: SELECT name FROM track WHERE track_id NOT IN (SELECT track_id FROM race)
Database: race_track (tables: track)
Question: Show year where a track with a seating at least 5000 opened and a track with seating no more than 4000 opened.
SQL: SELECT year_opened FROM track WHERE seating BETWEEN 4000 AND 5000
Database: race_track (tables: track)
Question: What are the years of opening for tracks with seating between 4000 and 5000?
SQL: SELECT year_opened FROM track WHERE seating BETWEEN 4000 AND 5000
Database: race_track (tables: race, track)
Question: Show the name of track and the number of races in each track.
SQL: SELECT T2.name ,  count(*) FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id GROUP BY T1.track_id
Database: race_track (tables: race, track)
Question: What are the names of different tracks, and how many races has each had?
SQL: SELECT T2.name ,  count(*) FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id GROUP BY T1.track_id
Database: race_track (tables: race, track)
Question: Show the name of track with most number of races.
SQL: SELECT T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id GROUP BY T1.track_id ORDER BY count(*) DESC LIMIT 1
Database: race_track (tables: race, track)
Question: What is the name of the track that has had the greatest number of races?
SQL: SELECT T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id GROUP BY T1.track_id ORDER BY count(*) DESC LIMIT 1
Database: race_track (tables: race, track)
Question: Show the name and date for each race and its track name.
SQL: SELECT T1.name ,  T1.date ,  T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id
Database: race_track (tables: race, track)
Question: What are the names and dates of races, and the names of the tracks where they are held?
SQL: SELECT T1.name ,  T1.date ,  T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id
Database: race_track (tables: race, track)
Question: Show the name and location of track with 1 race.
SQL: SELECT T2.name ,  T2.location FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id GROUP BY T1.track_id HAVING count(*)  =  1
Database: race_track (tables: race, track)
Question: What are the names and locations of tracks that have had exactly 1 race?
SQL: SELECT T2.name ,  T2.location FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id GROUP BY T1.track_id HAVING count(*)  =  1
Database: race_track (tables: track)
Question: Find the locations where have both tracks with more than 90000 seats and tracks with less than 70000 seats.
SQL: SELECT LOCATION FROM track WHERE seating  >  90000 INTERSECT SELECT LOCATION FROM track WHERE seating  <  70000
Database: race_track (tables: track)
Question: What are the locations that have both tracks with more than 90000 seats, and tracks with fewer than 70000 seats?
SQL: SELECT LOCATION FROM track WHERE seating  >  90000 INTERSECT SELECT LOCATION FROM track WHERE seating  <  70000
Database: coffee_shop (tables: member)
Question: How many members have the black membership card?
SQL: SELECT count(*) FROM member WHERE Membership_card  =  'Black'
Database: coffee_shop (tables: member)
Question: Find the number of members living in each address.
SQL: SELECT count(*) ,  address FROM member GROUP BY address
Database: coffee_shop (tables: member)
Question: Give me the names of members whose address is in Harford or Waterbury.
SQL: SELECT name FROM member WHERE address  =  'Harford' OR address  =  'Waterbury'
Database: coffee_shop (tables: member)
Question: Find the ids and names of members who are under age 30 or with black membership card.
SQL: SELECT name ,  member_id FROM member WHERE Membership_card  =  'Black' OR age  <  30
Database: coffee_shop (tables: member)
Question: Find the purchase time, age and address of each member, and show the results in the order of purchase time.
SQL: SELECT Time_of_purchase ,  age ,  address FROM member ORDER BY Time_of_purchase
Database: coffee_shop (tables: member)
Question: Which membership card has more than 5 members?
SQL: SELECT Membership_card FROM member GROUP BY Membership_card HAVING count(*)  >  5
Database: coffee_shop (tables: member)
Question: Which address has both members younger than 30 and members older than 40?
SQL: SELECT address FROM member WHERE age  <  30 INTERSECT SELECT address FROM member WHERE age  >  40
Database: coffee_shop (tables: member)
Question: What is the membership card held by both members living in Hartford and ones living in Waterbury address?
SQL: SELECT membership_card FROM member WHERE address  =  'Hartford' INTERSECT SELECT membership_card FROM member WHERE address  =  'Waterbury'
Database: coffee_shop (tables: member)
Question: How many members are not living in Hartford?
SQL: SELECT count(*) FROM member WHERE address != 'Hartford'
Database: coffee_shop (tables: member)
Question: Which address do not have any member with the black membership card?
SQL: SELECT address FROM member EXCEPT SELECT address FROM member WHERE Membership_card  =  'Black'
Database: coffee_shop (tables: shop)
Question: Show the shop addresses ordered by their opening year.
SQL: SELECT address FROM shop ORDER BY open_year
Database: coffee_shop (tables: shop)
Question: What are the average score and average staff number of all shops?
SQL: SELECT avg(num_of_staff) ,  avg(score) FROM shop
Database: coffee_shop (tables: shop)
Question: Find the id and address of the shops whose score is below the average score.
SQL: SELECT shop_id ,  address FROM shop WHERE score  <  (SELECT avg(score) FROM shop)
Database: coffee_shop (tables: happy_hour, shop)
Question: Find the address and staff number of the shops that do not have any happy hour.
SQL: SELECT address ,  num_of_staff FROM shop WHERE shop_id NOT IN (SELECT shop_id FROM happy_hour)
Database: coffee_shop (tables: happy_hour, shop)
Question: What are the id and address of the shops which have a happy hour in May?
SQL: SELECT t1.address ,  t1.shop_id FROM shop AS t1 JOIN happy_hour AS t2 ON t1.shop_id  =  t2.shop_id WHERE MONTH  =  'May'
Database: coffee_shop (tables: happy_hour)
Question: which shop has happy hour most frequently? List its id and number of happy hours.
SQL: SELECT shop_id ,  count(*) FROM happy_hour GROUP BY shop_id ORDER BY count(*) DESC LIMIT 1
Database: coffee_shop (tables: happy_hour)
Question: Which month has the most happy hours?
SQL: SELECT MONTH FROM happy_hour GROUP BY MONTH ORDER BY count(*) DESC LIMIT 1
Database: coffee_shop (tables: happy_hour)
Question: Which months have more than 2 happy hours?
SQL: SELECT MONTH FROM happy_hour GROUP BY MONTH HAVING count(*)  >  2
Database: chinook_1 (tables: album)
Question: How many albums are there?
SQL: SELECT count(*) FROM ALBUM
Database: chinook_1 (tables: album)
Question: Find the number of albums.
SQL: SELECT count(*) FROM ALBUM
Database: chinook_1 (tables: genre)
Question: List the names of all music genres.
SQL: SELECT Name FROM GENRE
Database: chinook_1 (tables: genre)
Question: What are the names of different music genres?
SQL: SELECT Name FROM GENRE
Database: chinook_1 (tables: customer)
Question: Find all the customer information in state NY.
SQL: SELECT * FROM CUSTOMER WHERE State  =  "NY"
Database: chinook_1 (tables: customer)
Question: What is all the customer information for customers in NY state?
SQL: SELECT * FROM CUSTOMER WHERE State  =  "NY"
Database: chinook_1 (tables: employee)
Question: What are the first names and last names of the employees who live in Calgary city.
SQL: SELECT FirstName ,  LastName FROM EMPLOYEE WHERE City  =  "Calgary"
Database: chinook_1 (tables: employee)
Question: Find the full names of employees living in the city of Calgary.
SQL: SELECT FirstName ,  LastName FROM EMPLOYEE WHERE City  =  "Calgary"
Database: chinook_1 (tables: invoice)
Question: What are the distinct billing countries of the invoices?
SQL: SELECT distinct(BillingCountry) FROM INVOICE
Database: chinook_1 (tables: invoice)
Question: Find the different billing countries for all invoices.
SQL: SELECT distinct(BillingCountry) FROM INVOICE
Database: chinook_1 (tables: artist)
Question: Find the names of all artists that have "a" in their names.
SQL: SELECT Name FROM ARTIST WHERE Name LIKE "%a%"
Database: chinook_1 (tables: artist)
Question: What are the names of artist who have the letter 'a' in their names?
SQL: SELECT Name FROM ARTIST WHERE Name LIKE "%a%"
Database: chinook_1 (tables: artist, album)
Question: Find the title of all the albums of the artist "AC/DC".
SQL: SELECT Title FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId  =  T2.ArtistId WHERE T2.Name  =  "AC/DC"
Database: chinook_1 (tables: artist, album)
Question: What are the titles of albums by the artist "AC/DC"?
SQL: SELECT Title FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId  =  T2.ArtistId WHERE T2.Name  =  "AC/DC"
Database: chinook_1 (tables: artist, album)
Question: Hom many albums does the artist "Metallica" have?
SQL: SELECT COUNT(*) FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId  =  T2.ArtistId WHERE T2.Name  =  "Metallica"
Database: chinook_1 (tables: artist, album)
Question: Find the number of albums by the artist "Metallica".
SQL: SELECT COUNT(*) FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId  =  T2.ArtistId WHERE T2.Name  =  "Metallica"
Database: chinook_1 (tables: artist, album)
Question: Which artist does the album "Balls to the Wall" belong to?
SQL: SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId  =  T2.ArtistId WHERE T1.Title  =  "Balls to the Wall"
Database: chinook_1 (tables: artist, album)
Question: Find the name of the artist who made the album "Balls to the Wall".
SQL: SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId  =  T2.ArtistId WHERE T1.Title  =  "Balls to the Wall"
Database: chinook_1 (tables: artist, album)
Question: Which artist has the most albums?
SQL: SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId  =  T2.ArtistId GROUP BY T2.Name ORDER BY COUNT(*) DESC LIMIT 1
Database: chinook_1 (tables: artist, album)
Question: What is the name of the artist with the greatest number of albums?
SQL: SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId  =  T2.ArtistId GROUP BY T2.Name ORDER BY COUNT(*) DESC LIMIT 1
Database: chinook_1 (tables: track)
Question: Find the names of all the tracks that contain the word "you".
SQL: SELECT Name FROM TRACK WHERE Name LIKE '%you%'
Database: chinook_1 (tables: track)
Question: What are the names of tracks that contain the the word you in them?
SQL: SELECT Name FROM TRACK WHERE Name LIKE '%you%'
Database: chinook_1 (tables: track)
Question: What is the average unit price of all the tracks?
SQL: SELECT AVG(UnitPrice) FROM TRACK
Database: chinook_1 (tables: track)
Question: Find the average unit price for a track.
SQL: SELECT AVG(UnitPrice) FROM TRACK
Database: chinook_1 (tables: track)
Question: What are the durations of the longest and the shortest tracks in milliseconds?
SQL: SELECT max(Milliseconds) ,  min(Milliseconds) FROM TRACK
Database: chinook_1 (tables: track)
Question: Find the maximum and minimum durations of tracks in milliseconds.
SQL: SELECT max(Milliseconds) ,  min(Milliseconds) FROM TRACK
Database: chinook_1 (tables: track, album)
Question: Show the album names, ids and the number of tracks for each album.
SQL: SELECT T1.Title ,  T2.AlbumID ,  COUNT(*) FROM ALBUM AS T1 JOIN TRACK AS T2 ON T1.AlbumId  =  T2.AlbumId GROUP BY T2.AlbumID
Database: chinook_1 (tables: track, album)
Question: What are the names and ids of the different albums, and how many tracks are on each?
SQL: SELECT T1.Title ,  T2.AlbumID ,  COUNT(*) FROM ALBUM AS T1 JOIN TRACK AS T2 ON T1.AlbumId  =  T2.AlbumId GROUP BY T2.AlbumID
Database: chinook_1 (tables: genre, track)
Question: What is the name of the most common genre in all tracks?
SQL: SELECT T1.Name FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId  =  T2.GenreId GROUP BY T2.GenreId ORDER BY COUNT(*) DESC LIMIT 1
Database: chinook_1 (tables: genre, track)
Question: Find the name of the genre that is most frequent across all tracks.
SQL: SELECT T1.Name FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId  =  T2.GenreId GROUP BY T2.GenreId ORDER BY COUNT(*) DESC LIMIT 1
Database: chinook_1 (tables: track, mediatype)
Question: What is the least common media type in all tracks?
SQL: SELECT T1.Name FROM MEDIATYPE AS T1 JOIN TRACK AS T2 ON T1.MediaTypeId  =  T2.MediaTypeId GROUP BY T2.MediaTypeId ORDER BY COUNT(*) ASC LIMIT 1
Database: chinook_1 (tables: track, mediatype)
Question: What is the name of the media type that is least common across all tracks?
SQL: SELECT T1.Name FROM MEDIATYPE AS T1 JOIN TRACK AS T2 ON T1.MediaTypeId  =  T2.MediaTypeId GROUP BY T2.MediaTypeId ORDER BY COUNT(*) ASC LIMIT 1
Database: chinook_1 (tables: track, album)
Question: Show the album names and ids for albums that contain tracks with unit price bigger than 1.
SQL: SELECT T1.Title ,  T2.AlbumID FROM ALBUM AS T1 JOIN TRACK AS T2 ON T1.AlbumId  =  T2.AlbumId WHERE T2.UnitPrice  >  1 GROUP BY T2.AlbumID
Database: chinook_1 (tables: track, album)
Question: What are the titles and ids for albums containing tracks with unit price greater than 1?
SQL: SELECT T1.Title ,  T2.AlbumID FROM ALBUM AS T1 JOIN TRACK AS T2 ON T1.AlbumId  =  T2.AlbumId WHERE T2.UnitPrice  >  1 GROUP BY T2.AlbumID
Database: chinook_1 (tables: genre, track)
Question: How many tracks belong to rock genre?
SQL: SELECT COUNT(*) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId  =  T2.GenreId WHERE T1.Name  =  "Rock"
Database: chinook_1 (tables: genre, track)
Question: Count the number of tracks that are part of the rock genre.
SQL: SELECT COUNT(*) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId  =  T2.GenreId WHERE T1.Name  =  "Rock"
Database: chinook_1 (tables: genre, track)
Question: What is the average unit price of tracks that belong to Jazz genre?
SQL: SELECT AVG(UnitPrice) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId  =  T2.GenreId WHERE T1.Name  =  "Jazz"
Database: chinook_1 (tables: genre, track)
Question: Find the average unit price of jazz tracks.
SQL: SELECT AVG(UnitPrice) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId  =  T2.GenreId WHERE T1.Name  =  "Jazz"
Database: chinook_1 (tables: customer)
Question: What is the first name and last name of the customer that has email "luisg@embraer.com.br"?
SQL: SELECT FirstName ,  LastName FROM CUSTOMER WHERE Email  =  "luisg@embraer.com.br"
Database: chinook_1 (tables: customer)
Question: Find the full name of the customer with the email "luisg@embraer.com.br".
SQL: SELECT FirstName ,  LastName FROM CUSTOMER WHERE Email  =  "luisg@embraer.com.br"
Database: chinook_1 (tables: customer)
Question: How many customers have email that contains "gmail.com"?
SQL: SELECT COUNT(*) FROM CUSTOMER WHERE Email LIKE "%gmail.com%"
Database: chinook_1 (tables: customer)
Question: Count the number of customers that have an email containing "gmail.com".
SQL: SELECT COUNT(*) FROM CUSTOMER WHERE Email LIKE "%gmail.com%"
Database: chinook_1 (tables: employee, customer)
Question: What is the first name and last name employee helps the customer with first name Leonie?
SQL: SELECT T2.FirstName ,  T2.LastName FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId  =  T2.EmployeeId WHERE T1.FirstName  =  "Leonie"
Database: chinook_1 (tables: employee, customer)
Question: Find the full names of employees who help customers with the first name Leonie.
SQL: SELECT T2.FirstName ,  T2.LastName FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId  =  T2.EmployeeId WHERE T1.FirstName  =  "Leonie"
Database: chinook_1 (tables: employee, customer)
Question: What city does the employee who helps the customer with postal code 70174 live in?
SQL: SELECT T2.City FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId  =  T2.EmployeeId WHERE T1.PostalCode  =  "70174"
Database: chinook_1 (tables: employee, customer)
Question: Find the cities corresponding to employees who help customers with the postal code 70174.
SQL: SELECT T2.City FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId  =  T2.EmployeeId WHERE T1.PostalCode  =  "70174"
Database: chinook_1 (tables: employee)
Question: How many distinct cities does the employees live in?
SQL: SELECT COUNT(DISTINCT city) FROM EMPLOYEE
Database: chinook_1 (tables: employee)
Question: Find the number of different cities that employees live in.
SQL: SELECT COUNT(DISTINCT city) FROM EMPLOYEE
Database: chinook_1 (tables: invoice, customer)
Question: Find all invoice dates corresponding to customers with first name Astrid and last name Gruber.
SQL: SELECT T2.InvoiceDate FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId  =  T2.CustomerId WHERE T1.FirstName  =  "Astrid" AND LastName  =  "Gruber"
Database: chinook_1 (tables: invoice, customer)
Question: What are the invoice dates for customers with the first name Astrid and the last name Gruber?
SQL: SELECT T2.InvoiceDate FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId  =  T2.CustomerId WHERE T1.FirstName  =  "Astrid" AND LastName  =  "Gruber"
Database: chinook_1 (tables: invoice, customer)
Question: Find all the customer last names that do not have invoice totals larger than 20.
SQL: SELECT LastName FROM CUSTOMER EXCEPT SELECT T1.LastName FROM CUSTOMER AS T1 JOIN Invoice AS T2 ON T1.CustomerId  =  T2.CustomerId WHERE T2.total  >  20
Database: chinook_1 (tables: invoice, customer)
Question: What are the last names of customers without invoice totals exceeding 20?
SQL: SELECT LastName FROM CUSTOMER EXCEPT SELECT T1.LastName FROM CUSTOMER AS T1 JOIN Invoice AS T2 ON T1.CustomerId  =  T2.CustomerId WHERE T2.total  >  20
Database: chinook_1 (tables: invoice, customer)
Question: Find the first names of all customers that live in Brazil and have an invoice.
SQL: SELECT DISTINCT T1.FirstName FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId  =  T2.CustomerId WHERE T1.country  =  "Brazil"
Database: chinook_1 (tables: invoice, customer)
Question: What are the different first names for customers from Brazil who have also had an invoice?
SQL: SELECT DISTINCT T1.FirstName FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId  =  T2.CustomerId WHERE T1.country  =  "Brazil"
Database: chinook_1 (tables: invoice, customer)
Question: Find the address of all customers that live in Germany and have invoice.
SQL: SELECT DISTINCT T1.Address FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId  =  T2.CustomerId WHERE T1.country  =  "Germany"
Database: chinook_1 (tables: invoice, customer)
Question: What are the addresses of customers living in Germany who have had an invoice?
SQL: SELECT DISTINCT T1.Address FROM CUSTOMER AS T1 JOIN INVOICE AS T2 ON T1.CustomerId  =  T2.CustomerId WHERE T1.country  =  "Germany"
Database: chinook_1 (tables: employee)
Question: List the phone numbers of all employees.
SQL: SELECT Phone FROM EMPLOYEE
Database: chinook_1 (tables: employee)
Question: What are the phone numbers for each employee?
SQL: SELECT Phone FROM EMPLOYEE