minktn/spider-data huggingface dataset:
Database: video_game
Question: What are the names of players who do not play any games?
SQL: SELECT Player_name FROM player WHERE Player_ID NOT IN (SELECT Player_ID FROM game_player)
Database: video_game
Question: Show the title of games that are played by both players from college "Oklahoma" and players from college "Auburn".
SQL: SELECT T1.Title FROM game AS T1 JOIN game_player AS T2 ON T1.Game_ID  =  T2.Game_ID JOIN player AS T3 ON T2.Player_ID  =  T3.Player_ID WHERE T3.College  =  "Oklahoma" INTERSECT SELECT T1.Title FROM game AS T1 JOIN game_player AS T2 ON T1.Game_ID  =  T2.Game_ID JOIN player AS T3 ON T2.Player_ID  =  T3.Player_ID WHERE T3.College  =  "Auburn"
Database: video_game
Question: What are the titles of games that are played by players from Oklahoma college or Auburn college?
SQL: SELECT T1.Title FROM game AS T1 JOIN game_player AS T2 ON T1.Game_ID  =  T2.Game_ID JOIN player AS T3 ON T2.Player_ID  =  T3.Player_ID WHERE T3.College  =  "Oklahoma" INTERSECT SELECT T1.Title FROM game AS T1 JOIN game_player AS T2 ON T1.Game_ID  =  T2.Game_ID JOIN player AS T3 ON T2.Player_ID  =  T3.Player_ID WHERE T3.College  =  "Auburn"
Database: video_game
Question: Show all distinct franchises of games.
SQL: SELECT DISTINCT Franchise FROM game
Database: video_game
Question: What are all the distinct franchises?
SQL: SELECT DISTINCT Franchise FROM game
Database: video_game
Question: Show the title of games that are not played by any player who is in the Guard position.
SQL: SELECT Title FROM game EXCEPT SELECT T1.Title FROM game AS T1 JOIN game_player AS T2 ON T1.Game_ID  =  T2.Game_ID JOIN player AS T3 ON T2.Player_ID  =  T3.Player_ID WHERE T3.Position  =  "Guard"
Database: video_game
Question: What are the titles of games not played by any players who play the Guard position?
SQL: SELECT Title FROM game EXCEPT SELECT T1.Title FROM game AS T1 JOIN game_player AS T2 ON T1.Game_ID  =  T2.Game_ID JOIN player AS T3 ON T2.Player_ID  =  T3.Player_ID WHERE T3.Position  =  "Guard"
Database: book_press
Question: list all the names of press in descending order of the profit of the year.
SQL: SELECT name FROM press ORDER BY Year_Profits_billion DESC
Database: book_press
Question: Sorted all the press by year profits in descending order, and return press names.
SQL: SELECT name FROM press ORDER BY Year_Profits_billion DESC
Database: book_press
Question: What are the names of the publishers that made more than 15 billion profits each year or 1 billion each month?
SQL: SELECT name FROM press WHERE Year_Profits_billion  >  15 OR Month_Profits_billion  >  1
Database: book_press
Question: Find the press whose yearly profit is more than 15 billion or whose monthly profit is more than 1 billion. Return the press names.
SQL: SELECT name FROM press WHERE Year_Profits_billion  >  15 OR Month_Profits_billion  >  1
Database: book_press
Question: what are the average and maximum profit of a year for all presses?
SQL: SELECT avg(Year_Profits_billion) ,  max(Year_Profits_billion) FROM press
Database: book_press
Question: Find the average and maximum yearly profit for each press.
SQL: SELECT avg(Year_Profits_billion) ,  max(Year_Profits_billion) FROM press
Database: book_press
Question: Find the name of the publisher whose monthly profit is the highest.
SQL: SELECT name FROM press ORDER BY Month_Profits_billion DESC LIMIT 1
Database: book_press
Question: Which press has the largest monthly profit? Give me the press name.
SQL: SELECT name FROM press ORDER BY Month_Profits_billion DESC LIMIT 1
Database: book_press
Question: Find the name of the publisher whose monthly profit is the highest or the lowest.
SQL: SELECT name FROM press WHERE Month_Profits_billion  =  (SELECT min(Month_Profits_billion) FROM press) OR Month_Profits_billion  =  (SELECT max(Month_Profits_billion) FROM press)
Database: book_press
Question: What are the names of the press that makes the highest monthly profit or the lowest monthly profit?
SQL: SELECT name FROM press WHERE Month_Profits_billion  =  (SELECT min(Month_Profits_billion) FROM press) OR Month_Profits_billion  =  (SELECT max(Month_Profits_billion) FROM press)
Database: book_press
Question: how many authors are under age 30?
SQL: SELECT count(*) FROM author WHERE age  <  30
Database: book_press
Question: Count the number of authors of age below 30.
SQL: SELECT count(*) FROM author WHERE age  <  30
Database: book_press
Question: find the average age of authors for each gender.
SQL: SELECT avg(age) ,  gender FROM author GROUP BY gender
Database: book_press
Question: For each gender, return gender and the average age of authors.
SQL: SELECT avg(age) ,  gender FROM author GROUP BY gender
Database: book_press
Question: find the number of authors who are older than 30 for each gender.
SQL: SELECT count(*) ,  gender FROM author WHERE age  >  30 GROUP BY gender
Database: book_press
Question: How many authors are of age above 30 for each gender?
SQL: SELECT count(*) ,  gender FROM author WHERE age  >  30 GROUP BY gender
Database: book_press
Question: List all book titles in the order of their release date from the most recent to the past.
SQL: SELECT title FROM book ORDER BY release_date DESC
Database: book_press
Question: Sort all the books in descending order of release date, and return the book titles.
SQL: SELECT title FROM book ORDER BY release_date DESC
Database: book_press
Question: Find the number of books for each series.
SQL: SELECT count(*) ,  book_series FROM book GROUP BY book_series
Database: book_press
Question: How many books does each book series have? Return the counts and book series.
SQL: SELECT count(*) ,  book_series FROM book GROUP BY book_series
Database: book_press
Question: Find the titles and publish dates of the top 5 best sale books.
SQL: SELECT title ,  release_date FROM book ORDER BY sale_amount DESC LIMIT 5
Database: book_press
Question: What are the 5 best books in terms of sale amount? Give me their titles and release dates.
SQL: SELECT title ,  release_date FROM book ORDER BY sale_amount DESC LIMIT 5
Database: book_press
Question: Find the book series that have some book selling more than 1000 and some book less 500.
SQL: SELECT book_series FROM book WHERE sale_amount  >  1000 INTERSECT SELECT book_series FROM book WHERE sale_amount  <  500
Database: book_press
Question: Which book series contain both books with sale amount above 1000 and books with sale amount below 500?
SQL: SELECT book_series FROM book WHERE sale_amount  >  1000 INTERSECT SELECT book_series FROM book WHERE sale_amount  <  500
Database: book_press
Question: Find the name of authors who publish their books in both "MM" and "LT" series.
SQL: SELECT t1.name FROM author AS t1 JOIN book AS t2 ON t1.author_id  =  t2.author_id WHERE t2.book_series  =  'MM' INTERSECT SELECT t1.name FROM author AS t1 JOIN book AS t2 ON t1.author_id  =  t2.author_id WHERE t2.book_series  =  'LT'
Database: book_press
Question: Which authors publish books in both "MM" and "LT" series? Give me the author names.
SQL: SELECT t1.name FROM author AS t1 JOIN book AS t2 ON t1.author_id  =  t2.author_id WHERE t2.book_series  =  'MM' INTERSECT SELECT t1.name FROM author AS t1 JOIN book AS t2 ON t1.author_id  =  t2.author_id WHERE t2.book_series  =  'LT'
Database: book_press
Question: Find the name and age of the authors who do not have any book in the record.
SQL: SELECT name ,  age FROM author WHERE author_id NOT IN (SELECT author_id FROM book)
Database: book_press
Question: Which authors in the record have not published any books ? Give me their names .
SQL: select name from author where author_id not in (select author_id from book)
Database: book_press
Question: Find the names of authors who have more than one book in the database.
SQL: SELECT t1.name FROM author AS t1 JOIN book AS t2 ON t1.author_id  =  t2.author_id GROUP BY t2.author_id HAVING count(*)  >  1
Database: book_press
Question: Which authors have published more than 1 book according to the database? Give me their names.
SQL: SELECT t1.name FROM author AS t1 JOIN book AS t2 ON t1.author_id  =  t2.author_id GROUP BY t2.author_id HAVING count(*)  >  1
Database: book_press
Question: Find the title, author name, and publisher name for the top 3 best sales books.
SQL: SELECT t1.name ,  t2.title ,  t3.name FROM author AS t1 JOIN book AS t2 ON t1.author_id  =  t2.author_id JOIN press AS t3 ON t2.press_id  =  t3.press_id ORDER BY t2.sale_amount DESC LIMIT 3
Database: book_press
Question: What are the 3 best selling books? Show their titles, author names, and press names.
SQL: SELECT t1.name ,  t2.title ,  t3.name FROM author AS t1 JOIN book AS t2 ON t1.author_id  =  t2.author_id JOIN press AS t3 ON t2.press_id  =  t3.press_id ORDER BY t2.sale_amount DESC LIMIT 3
Database: book_press
Question: Find the name and total book sale amount of each press.
SQL: SELECT sum(t1.sale_amount) ,  t2.name FROM book AS t1 JOIN press AS t2 ON t1.press_id  =  t2.press_id GROUP BY t1.press_id
Database: book_press
Question: What are the name and total book sale amount of each press?
SQL: SELECT sum(t1.sale_amount) ,  t2.name FROM book AS t1 JOIN press AS t2 ON t1.press_id  =  t2.press_id GROUP BY t1.press_id
Database: book_press
Question: Find the number of books that are sold more than 1000 for each publisher. List the press name as well.
SQL: SELECT count(*) ,  t2.name FROM book AS t1 JOIN press AS t2 ON t1.press_id  =  t2.press_id WHERE sale_amount  >  1000 GROUP BY t2.name
Database: book_press
Question: For each press, return its name and the number of books that have sale amount above 1000.
SQL: SELECT count(*) ,  t2.name FROM book AS t1 JOIN press AS t2 ON t1.press_id  =  t2.press_id WHERE sale_amount  >  1000 GROUP BY t2.name
Database: book_press
Question: What is the name of the author of best selling book?
SQL: SELECT t1.name FROM author AS t1 JOIN book AS t2 ON t1.author_id  =  t2.author_id ORDER BY t2.sale_amount DESC LIMIT 1
Database: book_press
Question: Who wrote the best selling book? Give me the author name.
SQL: SELECT t1.name FROM author AS t1 JOIN book AS t2 ON t1.author_id  =  t2.author_id ORDER BY t2.sale_amount DESC LIMIT 1
Database: book_press
Question: find the name and gender of the author who published the most books.
SQL: SELECT t1.name ,  t1.gender FROM author AS t1 JOIN book AS t2 ON t1.author_id  =  t2.author_id GROUP BY t2.author_id ORDER BY count(*) DESC LIMIT 1
Database: book_press
Question: Who wrote the largest number of books? Give me the author name and gender.
SQL: SELECT t1.name ,  t1.gender FROM author AS t1 JOIN book AS t2 ON t1.author_id  =  t2.author_id GROUP BY t2.author_id ORDER BY count(*) DESC LIMIT 1
Database: book_press
Question: Find the names of the authors who did not have any book with the "Accor" press.
SQL: SELECT name FROM author EXCEPT SELECT t1.name FROM author AS t1 JOIN book AS t2 ON t1.author_id  =  t2.author_id JOIN press AS t3 ON t2.press_id  =  t3.press_id WHERE t3.name  =  'Accor'
Database: book_press
Question: Which authors have never published under the "Accor" press? Give me their names.
SQL: SELECT name FROM author EXCEPT SELECT t1.name FROM author AS t1 JOIN book AS t2 ON t1.author_id  =  t2.author_id JOIN press AS t3 ON t2.press_id  =  t3.press_id WHERE t3.name  =  'Accor'
Database: book_press
Question: Find the name and the yearly profit in billion for press that published more than two books.
SQL: SELECT t2.name ,  t2.Year_Profits_billion FROM book AS t1 JOIN press AS t2 ON t1.press_id  =  t2.press_id GROUP BY t2.press_id HAVING count(*)  >  2
Database: book_press
Question: Find the press that published more than two books, and return its name and yearly profit in billion.
SQL: SELECT t2.name ,  t2.Year_Profits_billion FROM book AS t1 JOIN press AS t2 ON t1.press_id  =  t2.press_id GROUP BY t2.press_id HAVING count(*)  >  2
Database: cre_Doc_Workflow
Question: How many authors do we have?
SQL: SELECT count(*) FROM Authors
Database: cre_Doc_Workflow
Question: Show all author names.
SQL: SELECT author_name FROM Authors
Database: cre_Doc_Workflow
Question: Show the names and other details for all authors.
SQL: SELECT author_name ,  other_details FROM Authors
Database: cre_Doc_Workflow
Question: Show the other details for the author Addison Denesik.
SQL: SELECT other_details FROM Authors WHERE author_name  =  "Addison Denesik"
Database: cre_Doc_Workflow
Question: Show the number of documents.
SQL: SELECT count(*) FROM Documents
Database: cre_Doc_Workflow
Question: Who is the author of the document with id 4?
SQL: SELECT author_name FROM Documents WHERE document_id  =  4
Database: cre_Doc_Workflow
Question: Who is the author of the document "Travel to Brazil"?
SQL: SELECT author_name FROM Documents WHERE document_name  =  "Travel to Brazil"
Database: cre_Doc_Workflow
Question: How many documents does has the author Era Kerluke written?
SQL: SELECT count(*) FROM Documents WHERE author_name  =  "Era Kerluke"
Database: cre_Doc_Workflow
Question: Show the names and descriptions for all documents.
SQL: SELECT document_name ,  document_description FROM Documents
Database: cre_Doc_Workflow
Question: Show the ids and names for all documents by author Bianka Cummings.
SQL: SELECT document_id ,  document_name FROM Documents WHERE author_name  =  "Bianka Cummings"
Database: cre_Doc_Workflow
Question: Show the author name and details for the document "Travel to China".
SQL: SELECT T2.author_name ,  T2.other_details FROM Documents AS T1 JOIN Authors AS T2 ON T1.author_name  =  T2.author_name WHERE document_name  =  "Travel to China"
Database: cre_Doc_Workflow
Question: Show all author names and number of documents corresponding to each.
SQL: SELECT author_name ,  count(*) FROM Documents GROUP BY author_name
Database: cre_Doc_Workflow
Question: What is the name of the author with most number of documents?
SQL: SELECT author_name FROM Documents GROUP BY author_name ORDER BY count(*) DESC LIMIT 1
Database: cre_Doc_Workflow
Question: Show the names for authors with at least two documents.
SQL: SELECT author_name FROM Documents GROUP BY author_name HAVING count(*)  >=  2
Database: cre_Doc_Workflow
Question: How many business processes do we have?
SQL: SELECT count(*) FROM Business_processes
Database: cre_Doc_Workflow
Question: Show the next process id, process name, process description for process with id 9.
SQL: SELECT next_process_id ,  process_name ,  process_description FROM Business_processes WHERE process_id  =  9
Database: cre_Doc_Workflow
Question: What is the process name for the next process of the process with id 9?
SQL: SELECT process_name FROM Business_processes WHERE process_id  =  (SELECT next_process_id FROM Business_processes WHERE process_id  =  9)
Database: cre_Doc_Workflow
Question: Show the number of process outcomes.
SQL: SELECT count(*) FROM Process_outcomes
Database: cre_Doc_Workflow
Question: List the codes and descriptions for all process outcomes.
SQL: SELECT process_outcome_code ,  process_outcome_description FROM Process_outcomes
Database: cre_Doc_Workflow
Question: What is the description for the process outcome code working?
SQL: SELECT process_outcome_description FROM Process_outcomes WHERE process_outcome_code  =  "working"
Database: cre_Doc_Workflow
Question: Show the number of process status.
SQL: SELECT count(*) FROM Process_status
Database: cre_Doc_Workflow
Question: List the codes and descriptions for all process status.
SQL: SELECT process_status_code ,  process_status_description FROM Process_status
Database: cre_Doc_Workflow
Question: What is the description for process status code ct?
SQL: SELECT process_status_description FROM Process_status WHERE process_status_code  =  "ct"
Database: cre_Doc_Workflow
Question: How many staff do we have?
SQL: SELECT count(*) FROM Staff
Database: cre_Doc_Workflow
Question: Show the ids and details for all staff.
SQL: SELECT staff_id ,  staff_details FROM Staff
Database: cre_Doc_Workflow
Question: What are the details for the staff member with id 100.
SQL: SELECT staff_details FROM Staff WHERE staff_id  =  100
Database: cre_Doc_Workflow
Question: Show the number of staff roles.
SQL: SELECT count(*) FROM Ref_staff_roles
Database: cre_Doc_Workflow
Question: List the codes and descriptions for all staff roles.
SQL: SELECT staff_role_code ,  staff_role_description FROM Ref_staff_roles
Database: cre_Doc_Workflow
Question: What is the description for staff role code HR?
SQL: SELECT staff_role_description FROM Ref_staff_roles WHERE staff_role_code  =  "HR"
Database: cre_Doc_Workflow
Question: How many documents have a process?
SQL: SELECT count(DISTINCT document_id) FROM Documents_processes
Database: cre_Doc_Workflow
Question: List all process ids with a document.
SQL: SELECT DISTINCT process_id FROM Documents_processes
Database: cre_Doc_Workflow
Question: Show all document ids without a process.
SQL: SELECT document_id FROM Documents EXCEPT SELECT document_id FROM Documents_processes
Database: cre_Doc_Workflow
Question: List all process ids with no document.
SQL: SELECT process_id FROM Business_processes EXCEPT SELECT process_id FROM Documents_processes
Database: cre_Doc_Workflow
Question: What is the process outcome description and process status description for the document with id 0?
SQL: SELECT T2.process_outcome_description ,  T3.process_status_description FROM Documents_processes AS T1 JOIN Process_outcomes AS T2 ON T1.process_outcome_code  =  T2.process_outcome_code JOIN Process_Status AS T3 ON T1.process_status_code  =  T3.process_status_code WHERE T1.document_id  =  0
Database: cre_Doc_Workflow
Question: What is the process name for the document "Travel to Brazil"?
SQL: SELECT T3.process_name FROM Documents_processes AS T1 JOIN Documents AS T2 ON T1.document_id  =  T2.document_id JOIN Business_processes AS T3 ON T1.process_id  =  T3.process_id WHERE T2.document_name  =  "Travel to Brazil"
Database: cre_Doc_Workflow
Question: Show all process ids and the number of documents in each process.
SQL: SELECT process_id ,  count(*) FROM Documents_processes GROUP BY process_id
Database: cre_Doc_Workflow
Question: How many staff are the document with id 0 and process with id 9.
SQL: SELECT count(*) FROM Staff_in_processes WHERE document_id  =  0 AND process_id  =  9
Database: cre_Doc_Workflow
Question: Show all staff ids and the number of document processes for each staff.
SQL: SELECT staff_id ,  count(*) FROM Staff_in_processes GROUP BY staff_id
Database: cre_Doc_Workflow
Question: Show all staff role codes and the number of document processes for each role.
SQL: SELECT staff_role_code ,  count(*) FROM Staff_in_processes GROUP BY staff_role_code
Database: cre_Doc_Workflow
Question: How many different roles does the staff with id 3 have?
SQL: SELECT count(DISTINCT staff_role_code) FROM Staff_in_processes WHERE staff_id  =  3
Database: advertising_agencies
Question: How many agencies do we have?
SQL: SELECT count(*) FROM Agencies
Database: advertising_agencies
Question: Count the number of agencies.
SQL: SELECT count(*) FROM Agencies
Database: advertising_agencies
Question: Show all agency ids and details.
SQL: SELECT agency_id ,  agency_details FROM Agencies
Database: advertising_agencies
Question: What are all the agency ids and details?
SQL: SELECT agency_id ,  agency_details FROM Agencies
Database: advertising_agencies
Question: Show the number of clients.
SQL: SELECT count(*) FROM Clients
Database: advertising_agencies
Question: How many clients are there?
SQL: SELECT count(*) FROM Clients
Database: advertising_agencies
Question: List all client ids and client details.
SQL: SELECT client_id ,  client_details FROM Clients
Database: advertising_agencies
Question: What are all the client ids and details?
SQL: SELECT client_id ,  client_details FROM Clients
Database: advertising_agencies
Question: Show agency ids and the number of clients for each agency.
SQL: SELECT agency_id ,  count(*) FROM Clients GROUP BY agency_id
Database: advertising_agencies
Question: How many clients does each agency have?
SQL: SELECT agency_id ,  count(*) FROM Clients GROUP BY agency_id
Database: advertising_agencies
Question: What is the agency id and details with most number of clients?
SQL: SELECT T1.agency_id ,  T1.agency_details FROM Agencies AS T1 JOIN Clients AS T2 ON T1.agency_id  =  T2.agency_id GROUP BY T1.agency_id ORDER BY count(*) DESC LIMIT 1
Database: advertising_agencies
Question: Return the agency id and details for the agency with the greatest number of clients.
SQL: SELECT T1.agency_id ,  T1.agency_details FROM Agencies AS T1 JOIN Clients AS T2 ON T1.agency_id  =  T2.agency_id GROUP BY T1.agency_id ORDER BY count(*) DESC LIMIT 1
Database: advertising_agencies
Question: Show agency ids and details with at least 2 clients.
SQL: SELECT T1.agency_id ,  T1.agency_details FROM Agencies AS T1 JOIN Clients AS T2 ON T1.agency_id  =  T2.agency_id GROUP BY T1.agency_id HAVING count(*)  >=  2
Database: advertising_agencies
Question: What are the agency ids and details agencies with at least 2 clients?
SQL: SELECT T1.agency_id ,  T1.agency_details FROM Agencies AS T1 JOIN Clients AS T2 ON T1.agency_id  =  T2.agency_id GROUP BY T1.agency_id HAVING count(*)  >=  2
Database: advertising_agencies
Question: Show agency details for client with detail 'Mac'.
SQL: SELECT T2.agency_details FROM Clients AS T1 JOIN Agencies AS T2 ON T1.agency_id  =  T2.agency_id WHERE T1.client_details  =  'Mac'
Database: advertising_agencies
Question: What are the agency details for clients with the detail Mac?
SQL: SELECT T2.agency_details FROM Clients AS T1 JOIN Agencies AS T2 ON T1.agency_id  =  T2.agency_id WHERE T1.client_details  =  'Mac'
Database: advertising_agencies
Question: Show details for all clients and the details of their corresponding agents.
SQL: SELECT T1.client_details ,  T2.agency_details FROM Clients AS T1 JOIN Agencies AS T2 ON T1.agency_id  =  T2.agency_id
Database: advertising_agencies
Question: What are the client details for each client and the corresponding details of their agencies?
SQL: SELECT T1.client_details ,  T2.agency_details FROM Clients AS T1 JOIN Agencies AS T2 ON T1.agency_id  =  T2.agency_id
Database: advertising_agencies
Question: Show all sic codes and the number of clients with each code.
SQL: SELECT sic_code ,  count(*) FROM Clients GROUP BY sic_code
Database: advertising_agencies
Question: How many clients are there for each sic code?
SQL: SELECT sic_code ,  count(*) FROM Clients GROUP BY sic_code
Database: advertising_agencies
Question: Show all client ids and details with sic code "Bad".
SQL: SELECT client_id ,  client_details FROM Clients WHERE sic_code  =  "Bad";
Database: advertising_agencies
Question: What are the client ideas and details for clients with the sic code Bad?
SQL: SELECT client_id ,  client_details FROM Clients WHERE sic_code  =  "Bad";
Database: advertising_agencies
Question: Show all agency ids and details for agencies with a client.
SQL: SELECT T1.agency_id ,  T1.agency_details FROM Agencies AS T1 JOIN Clients AS T2 ON T1.agency_id  =  T2.agency_id
Database: advertising_agencies
Question: What are the agency ids and agency details for all agencies who have a client?
SQL: SELECT T1.agency_id ,  T1.agency_details FROM Agencies AS T1 JOIN Clients AS T2 ON T1.agency_id  =  T2.agency_id
Database: advertising_agencies
Question: Show all agency ids without any client.
SQL: SELECT agency_id FROM Agencies EXCEPT SELECT agency_id FROM Clients
Database: advertising_agencies
Question: What are ids of agencies that do not have any clients?
SQL: SELECT agency_id FROM Agencies EXCEPT SELECT agency_id FROM Clients
Database: advertising_agencies
Question: How many invoices do we have?
SQL: SELECT count(*) FROM Invoices
Database: advertising_agencies
Question: Count the number of invoices.
SQL: SELECT count(*) FROM Invoices
Database: advertising_agencies
Question: Show ids, status codes, and details for all invoices for clients.
SQL: SELECT invoice_id ,  invoice_status ,  invoice_details FROM Invoices
Database: advertising_agencies
Question: What are the ids, statuses, and details for all invoices?
SQL: SELECT invoice_id ,  invoice_status ,  invoice_details FROM Invoices
Database: advertising_agencies
Question: Show all client ids and the number of invoices for each client.
SQL: SELECT client_id ,  count(*) FROM Invoices GROUP BY client_id
Database: advertising_agencies
Question: How many invoices are there for each client id?
SQL: SELECT client_id ,  count(*) FROM Invoices GROUP BY client_id
Database: advertising_agencies
Question: List the client id and detail with most number of invoices.
SQL: SELECT T1.client_id ,  T2.client_details FROM Invoices AS T1 JOIN Clients AS T2 ON T1.client_id  =  T2.client_id GROUP BY T1.client_id ORDER BY count(*) DESC LIMIT 1
Database: advertising_agencies
Question: What are the client id and details for the client with the most invoices?
SQL: SELECT T1.client_id ,  T2.client_details FROM Invoices AS T1 JOIN Clients AS T2 ON T1.client_id  =  T2.client_id GROUP BY T1.client_id ORDER BY count(*) DESC LIMIT 1
Database: advertising_agencies
Question: What are client ids for clients with at least 2 invoices.
SQL: SELECT client_id FROM Invoices GROUP BY client_id HAVING count(*)  >=  2
Database: advertising_agencies
Question: Return the client ids for clients with two or more invoices?
SQL: SELECT client_id FROM Invoices GROUP BY client_id HAVING count(*)  >=  2
Database: advertising_agencies
Question: Show all invoice status codes and the number of invoices with each status.
SQL: SELECT invoice_status ,  count(*) FROM Invoices GROUP BY invoice_status
Database: advertising_agencies
Question: How many invoices are there for each status code?
SQL: SELECT invoice_status ,  count(*) FROM Invoices GROUP BY invoice_status
Database: advertising_agencies
Question: What is the invoice status code with most number of invoices.
SQL: SELECT invoice_status FROM Invoices GROUP BY invoice_status ORDER BY count(*) DESC LIMIT 1
Database: advertising_agencies
Question: Return the invoice status that has the most invoices.
SQL: SELECT invoice_status FROM Invoices GROUP BY invoice_status ORDER BY count(*) DESC LIMIT 1
Database: advertising_agencies
Question: Show all invoice status codes and details and the corresponding client id and details and agency id and details.
SQL: SELECT T1.invoice_status ,  T1.invoice_details ,  T2.client_id ,  T2.client_details ,  T3.agency_id ,  T3.agency_details FROM Invoices AS T1 JOIN Clients AS T2 ON T1.client_id  =  T2.client_id JOIN Agencies AS T3 ON T2.agency_id  =  T3.agency_id
Database: advertising_agencies
Question: What are the invoice status, invoice details, and corresponding client ids and details and agency id and details?
SQL: SELECT T1.invoice_status ,  T1.invoice_details ,  T2.client_id ,  T2.client_details ,  T3.agency_id ,  T3.agency_details FROM Invoices AS T1 JOIN Clients AS T2 ON T1.client_id  =  T2.client_id JOIN Agencies AS T3 ON T2.agency_id  =  T3.agency_id
Database: advertising_agencies
Question: List all meeting type codes and details.
SQL: SELECT meeting_type ,  other_details FROM meetings
Database: advertising_agencies
Question: What are all meeting types and other details?
SQL: SELECT meeting_type ,  other_details FROM meetings
Database: advertising_agencies
Question: Show all meeting outcomes and purposes.
SQL: SELECT meeting_outcome ,  purpose_of_meeting FROM meetings
Database: advertising_agencies
Question: What are all meeting outcomes and purposes?
SQL: SELECT meeting_outcome ,  purpose_of_meeting FROM meetings
Database: advertising_agencies
Question: Show all payment ids and details for invoices whose status is 'Working'.
SQL: SELECT T1.payment_id ,  T1.payment_details FROM Payments AS T1 JOIN Invoices AS T2 ON T1.invoice_id  =  T2.invoice_id WHERE T2.invoice_status  =  'Working'
Database: advertising_agencies
Question: What are all payment ids and payment details for invoices with status Working?
SQL: SELECT T1.payment_id ,  T1.payment_details FROM Payments AS T1 JOIN Invoices AS T2 ON T1.invoice_id  =  T2.invoice_id WHERE T2.invoice_status  =  'Working'
Database: advertising_agencies
Question: Show all invoice ids and statuses without a payment.
SQL: SELECT invoice_id ,  invoice_status FROM Invoices EXCEPT SELECT T1.invoice_id ,  T1.invoice_status FROM Invoices AS T1 JOIN Payments AS T2 ON T1.invoice_id  =  T2.invoice_id
Database: advertising_agencies
Question: What are the invoice ids and statuses for invoices without a payment?
SQL: SELECT invoice_id ,  invoice_status FROM Invoices EXCEPT SELECT T1.invoice_id ,  T1.invoice_status FROM Invoices AS T1 JOIN Payments AS T2 ON T1.invoice_id  =  T2.invoice_id
Database: advertising_agencies
Question: How many payments do we have?
SQL: SELECT count(*) FROM Payments
Database: advertising_agencies
Question: Count the number of payments.
SQL: SELECT count(*) FROM Payments
Database: advertising_agencies
Question: List all payment ids and its corresponding invoice ids and details.
SQL: SELECT payment_id ,  invoice_id ,  payment_details FROM Payments
Database: advertising_agencies
Question: What are the payment ids, invoice ids, and payment details for all payments?
SQL: SELECT payment_id ,  invoice_id ,  payment_details FROM Payments
Database: advertising_agencies
Question: Show all the different invoice ids and statuses of the payments
SQL: SELECT DISTINCT T1.invoice_id ,  T1.invoice_status FROM Invoices AS T1 JOIN Payments AS T2 ON T1.invoice_id  =  T2.invoice_id
Database: advertising_agencies
Question: What are the distinct invoice ids and statuses for all payments?
SQL: SELECT DISTINCT T1.invoice_id ,  T1.invoice_status FROM Invoices AS T1 JOIN Payments AS T2 ON T1.invoice_id  =  T2.invoice_id
Database: advertising_agencies
Question: Show all invoice ids and the number of payments for each invoice.
SQL: SELECT invoice_id ,  count(*) FROM Payments GROUP BY invoice_id
Database: advertising_agencies
Question: How many payments are there for each invoice?
SQL: SELECT invoice_id ,  count(*) FROM Payments GROUP BY invoice_id
Database: advertising_agencies
Question: What is the invoice id, status code, and details for the invoice with most number of payments.
SQL: SELECT T1.invoice_id ,  T2.invoice_status ,  T2.invoice_details FROM Payments AS T1 JOIN Invoices AS T2 ON T1.invoice_id  =  T2.invoice_id GROUP BY T1.invoice_id ORDER BY count(*) DESC LIMIT 1
Database: advertising_agencies
Question: Return the invoice ids, statuses, and details for invoices with the most payments?
SQL: SELECT T1.invoice_id ,  T2.invoice_status ,  T2.invoice_details FROM Payments AS T1 JOIN Invoices AS T2 ON T1.invoice_id  =  T2.invoice_id GROUP BY T1.invoice_id ORDER BY count(*) DESC LIMIT 1
Database: advertising_agencies
Question: How many staff do we have?
SQL: SELECT count(*) FROM Staff
Database: advertising_agencies
Question: Count the number of staff.
SQL: SELECT count(*) FROM Staff
Database: advertising_agencies
Question: Show the agency ids and the number of staff in each agent?
SQL: SELECT agency_id ,  count(*) FROM Staff GROUP BY agency_id
Database: advertising_agencies
Question: Return the agency ids and number of staff in each.
SQL: SELECT agency_id ,  count(*) FROM Staff GROUP BY agency_id
Database: advertising_agencies
Question: What is the agent id and details for the agency with most staff?
SQL: SELECT T1.agency_id ,  T2.agency_details FROM Staff AS T1 JOIN Agencies AS T2 ON T1.agency_id  =  T2.agency_id GROUP BY T1.agency_id ORDER BY count(*) DESC LIMIT 1
Database: advertising_agencies
Question: Return the id and detail for the agency with the most staff.
SQL: SELECT T1.agency_id ,  T2.agency_details FROM Staff AS T1 JOIN Agencies AS T2 ON T1.agency_id  =  T2.agency_id GROUP BY T1.agency_id ORDER BY count(*) DESC LIMIT 1
Database: advertising_agencies
Question: Show meeting outcome codes and the number of meeting in each outcome.
SQL: SELECT meeting_outcome ,  count(*) FROM Meetings GROUP BY meeting_outcome
Database: advertising_agencies
Question: How many meetings had each meeting outcome?
SQL: SELECT meeting_outcome ,  count(*) FROM Meetings GROUP BY meeting_outcome
Database: advertising_agencies
Question: List the client ids and the number of meeting for each client.
SQL: SELECT client_id ,  count(*) FROM Meetings GROUP BY client_id
Database: advertising_agencies
Question: How many meetings are there for each client id?
SQL: SELECT client_id ,  count(*) FROM Meetings GROUP BY client_id
Database: advertising_agencies
Question: Show the meeting type codes and the number of meeting for each client.
SQL: SELECT meeting_type ,  count(*) FROM Meetings GROUP BY meeting_type
Database: advertising_agencies
Question: How many meetings are there for each meeting type?
SQL: SELECT meeting_type ,  count(*) FROM Meetings GROUP BY meeting_type
Database: advertising_agencies
Question: Show all meeting ids, meeting outcomes, meeting types and the details of the client atttending it.
SQL: SELECT T1.meeting_id ,  T1.meeting_outcome ,  T1.meeting_type ,  T2.client_details FROM meetings AS T1 JOIN clients AS T2 ON T1.client_id  =  T2.client_id
Database: advertising_agencies
Question: What are the meeting ids, meeting outcomes, meeting types, and client details for all meetings?
SQL: SELECT T1.meeting_id ,  T1.meeting_outcome ,  T1.meeting_type ,  T2.client_details FROM meetings AS T1 JOIN clients AS T2 ON T1.client_id  =  T2.client_id
Database: advertising_agencies
Question: Show the meeting ids and the number of staff in each meeting.
SQL: SELECT meeting_id ,  count(*) FROM Staff_in_meetings GROUP BY meeting_id
Database: advertising_agencies
Question: Count the number of staff in each meeting by meeting id.
SQL: SELECT meeting_id ,  count(*) FROM Staff_in_meetings GROUP BY meeting_id
Database: advertising_agencies
Question: Show the staff id and the number of meetings attended by the staff who attended some meeting but had the lowest attendance.
SQL: SELECT staff_id ,  count(*) FROM Staff_in_meetings GROUP BY staff_id ORDER BY count(*) ASC LIMIT 1;
Database: advertising_agencies
Question: What is the staff id of the staff who attended the least meetings but attended some meeting?
SQL: SELECT staff_id ,  count(*) FROM Staff_in_meetings GROUP BY staff_id ORDER BY count(*) ASC LIMIT 1;
Database: advertising_agencies
Question: How many staff have attended a meeting?
SQL: SELECT count(DISTINCT staff_id) FROM Staff_in_meetings
Database: advertising_agencies
Question: Return the number of distinct staff who have attended a meeting?
SQL: SELECT count(DISTINCT staff_id) FROM Staff_in_meetings
Database: advertising_agencies
Question: How many staff did not attend any meeting?
SQL: SELECT count(*) FROM Staff WHERE staff_id NOT IN ( SELECT staff_id FROM Staff_in_meetings )
Database: advertising_agencies
Question: Count the number of staff who did not attend any meeting.
SQL: SELECT count(*) FROM Staff WHERE staff_id NOT IN ( SELECT staff_id FROM Staff_in_meetings )
Database: advertising_agencies
Question: What are the ids and details of the clients who have attended any meeting or have any invoice?
SQL: SELECT T1.client_id ,  T1.client_details FROM Clients AS T1 JOIN meetings AS T2 ON T1.client_id  =  T2.client_id UNION SELECT T1.client_id ,  T1.client_details FROM Clients AS T1 JOIN invoices AS T2 ON T1.client_id  =  T2.client_id
Database: advertising_agencies
Question: Return the ids and details of clients who have attended a meeting or had an invoice.
SQL: SELECT T1.client_id ,  T1.client_details FROM Clients AS T1 JOIN meetings AS T2 ON T1.client_id  =  T2.client_id UNION SELECT T1.client_id ,  T1.client_details FROM Clients AS T1 JOIN invoices AS T2 ON T1.client_id  =  T2.client_id
Database: advertising_agencies
Question: What are the ids and details of the staff who have attended at least 1 meetings and have the detail with letter 's'?
SQL: SELECT staff_id ,  staff_details FROM staff WHERE staff_details LIKE "%s%" GROUP BY staff_id HAVING count(*)  >=  1
Database: advertising_agencies
Question: Return the ids and details of staff who have attended at least 1 meeting and have an s in their staff details?
SQL: SELECT staff_id ,  staff_details FROM staff WHERE staff_details LIKE "%s%" GROUP BY staff_id HAVING count(*)  >=  1
Database: advertising_agencies
Question: What are the id, sic code and agency id of the client who has attended 1 meeting and has any invoice.
SQL: SELECT T1.client_id ,  T1.sic_code ,  T1.agency_id FROM clients AS T1 JOIN meetings AS T2 ON T1.client_id  =  T2.client_id GROUP BY T1.client_id HAVING count(*)  =  1 INTERSECT SELECT T1.client_id ,  T1.sic_code ,  T1.agency_id FROM clients AS T1 JOIN invoices AS T2 ON T1.client_id  =  T2.client_id
Database: advertising_agencies
Question: Return the ids, sic codes, and agency ids of clients who have attended 1 meeting and had an invoice.
SQL: SELECT T1.client_id ,  T1.sic_code ,  T1.agency_id FROM clients AS T1 JOIN meetings AS T2 ON T1.client_id  =  T2.client_id GROUP BY T1.client_id HAVING count(*)  =  1 INTERSECT SELECT T1.client_id ,  T1.sic_code ,  T1.agency_id FROM clients AS T1 JOIN invoices AS T2 ON T1.client_id  =  T2.client_id
Database: advertising_agencies
Question: List the start time, end time of each meeting, and the corresponding client detail and staff detail.
SQL: SELECT T1.start_date_time ,  T1.end_date_time ,  T2.client_details ,  T4.staff_details FROM meetings AS T1 JOIN clients AS T2 ON T1.client_id  =  T2.client_id JOIN staff_in_meetings AS T3 ON T1.meeting_id  =  T3.meeting_id JOIN staff AS T4 ON T3.staff_id  =  T4.staff_id
Database: advertising_agencies
Question: What are the start and end times of each meeting, as well as the corresponding client and staff details the attendees?
SQL: SELECT T1.start_date_time ,  T1.end_date_time ,  T2.client_details ,  T4.staff_details FROM meetings AS T1 JOIN clients AS T2 ON T1.client_id  =  T2.client_id JOIN staff_in_meetings AS T3 ON T1.meeting_id  =  T3.meeting_id JOIN staff AS T4 ON T3.staff_id  =  T4.staff_id