interaction_utterance
sequencelengths 0
6
| interaction_query
sequencelengths 0
6
| final_utterance
stringlengths 19
224
| final_query
stringlengths 22
577
| db_id
stringclasses 140
values |
---|---|---|---|---|
[
"how many airports are in Italy?",
"show the info of routes listing those airports as destinations.",
"count the total number."
] | [
"SELECT count(*) FROM airports WHERE country = 'Italy'",
"SELECT * FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid WHERE T2.country = 'Italy'",
"SELECT count(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid WHERE T2.country = 'Italy'"
] | Find the number of routes with destination airports in Italy. | SELECT count(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid WHERE T2.country = 'Italy' | flight_4 |
[
"how many routes are operated by the airline with name 'American Airlines'.",
"how many of them list the US as the destination?",
"how about for Italy?"
] | [
"SELECT count(*) FROM routes AS T1 JOIN airlines AS T2 ON T1.alid = T2.alid WHERE T2.name = 'American Airlines'",
"SELECT count(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid JOIN airlines AS T3 ON T1.alid = T3.alid WHERE T2.country = 'United States' AND T3.name = 'American Airlines'",
"SELECT count(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid JOIN airlines AS T3 ON T1.alid = T3.alid WHERE T2.country = 'Italy' AND T3.name = 'American Airlines'"
] | Return the number of routes with destination airport in Italy operated by the airline with name 'American Airlines'. | SELECT count(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid JOIN airlines AS T3 ON T1.alid = T3.alid WHERE T2.country = 'Italy' AND T3.name = 'American Airlines' | flight_4 |
[
"which city is John F Kennedy International Airport located in?",
"which routes list it as a destination airport?",
"how many of those routes are there?"
] | [
"SELECT city FROM airports WHERE name = 'John F Kennedy International Airport'",
"SELECT * FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.name = 'John F Kennedy International Airport'",
"SELECT count(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.name = 'John F Kennedy International Airport'"
] | Find the number of routes that list John F Kennedy International Airport as a destination. | SELECT count(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.name = 'John F Kennedy International Airport' | flight_4 |
[
"Find the number of routes from the United States.",
"how many of them end up in Canada?"
] | [
"SELECT count(*) FROM routes WHERE src_apid IN (SELECT apid FROM airports WHERE country = 'United States')",
"SELECT count(*) FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country = 'Canada') AND src_apid IN (SELECT apid FROM airports WHERE country = 'United States')"
] | Find the number of routes from the United States to Canada. | SELECT count(*) FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country = 'Canada') AND src_apid IN (SELECT apid FROM airports WHERE country = 'United States') | flight_4 |
[
"how many routes end in the United States?",
"among them, how many fly from the United States?",
"what are their ids?"
] | [
"SELECT count(*) FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country = 'United States')",
"SELECT count(*) FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country = 'United States') AND src_apid IN (SELECT apid FROM airports WHERE country = 'United States')",
"SELECT rid FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country = 'United States') AND src_apid IN (SELECT apid FROM airports WHERE country = 'United States')"
] | Find the id of routes whose source and destination airports are in the United States. | SELECT rid FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country = 'United States') AND src_apid IN (SELECT apid FROM airports WHERE country = 'United States') | flight_4 |
[
"show info of all airlines.",
"find the number of routes for each airline. Show their names.",
"which airline has the most routes?"
] | [
"SELECT * FROM airlines",
"SELECT count(*), T1.name FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.name",
"SELECT T1.name FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.name ORDER BY count(*) DESC LIMIT 1"
] | Find the name of airline which runs the most number of routes. | SELECT T1.name FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.name ORDER BY count(*) DESC LIMIT 1 | flight_4 |
[
"show all airports in China.",
"which one is listed as the source airport of the most routes?"
] | [
"SELECT * FROM airports WHERE country = 'China'",
"SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid WHERE T1.country = 'China' GROUP BY T1.name ORDER BY count(*) DESC LIMIT 1"
] | Find the busiest source airport that runs most number of routes in China. | SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid WHERE T1.country = 'China' GROUP BY T1.name ORDER BY count(*) DESC LIMIT 1 | flight_4 |
[
"Show me all the information from invoices!",
"What is the country with the least number of invoices?",
"How about the one with the most!",
"How about the top 5?"
] | [
"Select * from invoices",
"SELECT billing_country , COUNT(*) FROM invoices GROUP BY billing_country ORDER BY count(*) ASC LIMIT 1;",
"SELECT billing_country , COUNT(*) FROM invoices GROUP BY billing_country ORDER BY count(*) DESC LIMIT 1;",
"SELECT billing_country , COUNT(*) FROM invoices GROUP BY billing_country ORDER BY count(*) DESC LIMIT 5;"
] | A list of the top 5 countries by number of invoices. List country name and number of invoices. | SELECT billing_country , COUNT(*) FROM invoices GROUP BY billing_country ORDER BY count(*) DESC LIMIT 5; | store_1 |
[
"Show me the number of invoices by country!",
"What is the total invoice for each!",
"Can you show me this sorted from greatest to least by total invoice size!",
"Now, show me just the billing country and total for the top 8!"
] | [
"SELECT billing_country, Count(*) FROM invoices GROUP BY billing_country;",
"SELECT billing_country, Count(*), SUM(total) FROM invoices GROUP BY billing_country;",
"SELECT billing_country, Count(*), SUM(total) FROM invoices GROUP BY billing_country ORDER BY SUM(total) DESC;",
"SELECT billing_country , SUM(total) FROM invoices GROUP BY billing_country ORDER BY SUM(total) DESC LIMIT 8;"
] | A list of the top 8 countries by gross/total invoice size. List country name and gross invoice size. | SELECT billing_country , SUM(total) FROM invoices GROUP BY billing_country ORDER BY SUM(total) DESC LIMIT 8; | store_1 |
[
"Can you show me the total invoice size per country!",
"Instead, display the average per country!",
"Just, show the top 15 by average invoice size.",
"Actually, just list the top 10!"
] | [
"SELECT billing_country , sum(total) FROM invoices GROUP BY billing_country;",
"SELECT billing_country , AVG(total) FROM invoices GROUP BY billing_country;",
"SELECT billing_country , AVG(total) FROM invoices GROUP BY billing_country ORDER BY AVG(total) DESC LIMIT 15;",
"SELECT billing_country , AVG(total) FROM invoices GROUP BY billing_country ORDER BY AVG(total) DESC LIMIT 10;"
] | A list of the top 10 countries by average invoice size. List country name and average invoice size. | SELECT billing_country , AVG(total) FROM invoices GROUP BY billing_country ORDER BY AVG(total) DESC LIMIT 10; | store_1 |
[
"Show all the ids, customer ids, and invoice dates from invoices.",
"Could you show me them in order of most recently purchased?",
"Also include the customer names of each purchase!!",
"Show just the first name and last names of the 5 most recent purchases."
] | [
"Select id, customer_id, invoice_date from invoices",
"SELECT id, Customer_id, invoice_date FROM invoices ORDER BY invoice_date DESC;",
"SELECT T1.first_name , T1.last_name, T2.id, T2.Customer_id, T2.invoice_date FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY T2.invoice_date DESC;",
"SELECT T1.first_name , T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY T2.invoice_date DESC LIMIT 5;"
] | Find out 5 customers who most recently purchased something. List customers' first and last name. | SELECT T1.first_name , T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY T2.invoice_date DESC LIMIT 5; | store_1 |
[
"How many orders have each customer created by customer name?",
"Show the entry with the lowest?",
"How about the highest!",
"How about the top 10!"
] | [
"SELECT T1.first_name , T1.last_name , COUNT(*) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id;",
"SELECT T1.first_name , T1.last_name , COUNT(*) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) ASC LIMIT 1;",
"SELECT T1.first_name , T1.last_name , COUNT(*) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1;",
"SELECT T1.first_name , T1.last_name , COUNT(*) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 10;"
] | Find out the top 10 customers by total number of orders. List customers' first and last name and the number of total orders. | SELECT T1.first_name , T1.last_name , COUNT(*) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 10; | store_1 |
[
"Show all the customer ids, and names!",
"How any invoices do each of them have?",
"What are their total gross sales?",
"Show just the names of the customers, and their total gross sales for the top 10 in gross sales!"
] | [
"SELECT id, first_name, last_name FROM customers",
"SELECT T1.id, T1.first_name , T1.last_name , count(*) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id;",
"SELECT T1.id, T1.first_name , T1.last_name , count(*), SUM(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id;",
"SELECT T1.first_name , T1.last_name , SUM(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY SUM(T2.total) DESC LIMIT 10;"
] | List the top 10 customers by total gross sales. List customers' first and last name and total gross sales. | SELECT T1.first_name , T1.last_name , SUM(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY SUM(T2.total) DESC LIMIT 10; | store_1 |
[
"How many tracks are there?",
"What are the names, composers, and genre names of each?",
"Show how many tracks there are per genre!",
"Show the genre names, and number of tracks of the top 5 by number of tracks!"
] | [
"Select count(*) from tracks",
"SELECT T2.name, T2.composer, T1.name FROM genres AS T1 JOIN tracks AS T2 ON T2.genre_id = T1.id;",
"SELECT T1.name , count(*) FROM genres AS T1 JOIN tracks AS T2 ON T2.genre_id = T1.id GROUP BY T1.id;",
"SELECT T1.name , COUNT(*) FROM genres AS T1 JOIN tracks AS T2 ON T2.genre_id = T1.id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 5;"
] | List the top 5 genres by number of tracks. List genres name and total tracks. | SELECT T1.name , COUNT(*) FROM genres AS T1 JOIN tracks AS T2 ON T2.genre_id = T1.id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 5; | store_1 |
[
"What are all the albums titles?",
"Which ones start with A?",
"Can you order them in alphabetical order?"
] | [
"Select title from albums",
"SELECT title FROM albums WHERE title LIKE 'A%'",
"SELECT title FROM albums WHERE title LIKE 'A%' ORDER BY title;"
] | List every album whose title starts with A in alphabetical order. | SELECT title FROM albums WHERE title LIKE 'A%' ORDER BY title; | store_1 |
[
"What are the invoices of each customer?",
"Show me the names of the customers with the top 15 totals!",
"How about the bottom 15!",
"How about the bottom 10!"
] | [
"SELECT *, T2.total FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id;",
"SELECT T1.first_name , T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY total DESC LIMIT 15;",
"SELECT T1.first_name , T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY total LIMIT 15;",
"SELECT T1.first_name , T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY total LIMIT 10;"
] | List the customers first and last name of 10 least expensive invoices. | SELECT T1.first_name , T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY total LIMIT 10; | store_1 |
[
"What are the different cities, and states that have invoices?",
"What are the number of invoices for each city and state?",
"Also provide the total invoice!",
"Can you how just the total invoice for the city Chicago in state IL?"
] | [
"SELECT distinct billing_city, billing_state FROM invoices;",
"SELECT billing_city, billing_state, count(*) FROM invoices group by billing_city, billing_state;",
"SELECT billing_city, billing_state, count(*), sum(total) FROM invoices group by billing_city, billing_state;",
"SELECT sum(total) FROM invoices WHERE billing_city = \"Chicago\" AND billing_state = \"IL\";"
] | List total amount of invoice from Chicago, IL. | SELECT sum(total) FROM invoices WHERE billing_city = "Chicago" AND billing_state = "IL"; | store_1 |
[
"Show all the invoices for the city Chicago in the state Illinois!",
"What is the total invoice?",
"How about the number of different customers?",
"How about the number of invoices?"
] | [
"SELECT * FROM invoices WHERE billing_city = \"Chicago\" AND billing_state = \"IL\";",
"SELECT sum(total) FROM invoices WHERE billing_city = \"Chicago\" AND billing_state = \"IL\";",
"SELECT count(distinct customer_id) FROM invoices WHERE billing_city = \"Chicago\" AND billing_state = \"IL\";",
"SELECT COUNT(*) FROM invoices WHERE billing_city = \"Chicago\" AND billing_state = \"IL\";"
] | List the number of invoices from Chicago, IL. | SELECT COUNT(*) FROM invoices WHERE billing_city = "Chicago" AND billing_state = "IL"; | store_1 |
[
"Show me all the ids, country and states for all the invoices!",
"Show me only those from the US?",
"What are the different states these comes from?",
"How many USA invoices are from each of them!"
] | [
"SELECT id, billing_country, billing_state FROM invoices;",
"SELECT id, billing_country, billing_state FROM invoices WHERE billing_country = \"USA\";",
"SELECT distinct billing_state FROM invoices WHERE billing_country = \"USA\";",
"SELECT billing_state, COUNT(*) FROM invoices WHERE billing_country = \"USA\" GROUP BY billing_state;"
] | List the number of invoices from the US, grouped by state. | SELECT billing_state , COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state; | store_1 |
[
"What are the different states in the US that have invoices?",
"Which one has the least number of invoices?",
"How about the most?"
] | [
"SELECT distinct billing_state FROM invoices WHERE billing_country = \"USA\";",
"SELECT billing_state , COUNT(*) FROM invoices WHERE billing_country = \"USA\" GROUP BY billing_state ORDER BY COUNT(*) ASC LIMIT 1;",
"SELECT billing_state , COUNT(*) FROM invoices WHERE billing_country = \"USA\" GROUP BY billing_state ORDER BY COUNT(*) DESC LIMIT 1;"
] | List the state in the US with the most invoices. | SELECT billing_state , COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state ORDER BY COUNT(*) DESC LIMIT 1; | store_1 |
[
"Show me all the information about the invoices in California!",
"Actually just show the billing_state, billing_city, and billing_country.",
"Can you show the billing_state and the total invoice of these?",
"Also provide the number of invoices."
] | [
"SELECT * FROM invoices WHERE billing_state = \"CA\";",
"SELECT billing_state, billing_city, billing_country FROM invoices WHERE billing_state = \"CA\";",
"SELECT billing_state, SUM(total) FROM invoices WHERE billing_state = \"CA\";",
"SELECT billing_state, COUNT(*) , SUM(total) FROM invoices WHERE billing_state = \"CA\";"
] | List the number of invoices and the invoice total from California. | SELECT billing_state , COUNT(*) , SUM(total) FROM invoices WHERE billing_state = "CA"; | store_1 |
[
"How many different albums are there?",
"What are the titles of the albums?",
"What are the names of the artists for each!",
"Show me only the album titles by the artist named Aerosmith!"
] | [
"SELECT count(*) FROM albums;",
"SELECT title FROM albums;",
"SELECT T1.title, T2.name FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id;",
"SELECT T1.title FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = \"Aerosmith\";"
] | List Aerosmith's albums. | SELECT T1.title FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = "Aerosmith"; | store_1 |
[
"How many albums are there?",
"What are they?",
"Which ones are made by Billy Cobham?",
"How many are there?"
] | [
"Select count(*) from albums",
"Select * from albums",
"SELECT * FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = \"Billy Cobham\";",
"SELECT count(*) FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = \"Billy Cobham\";"
] | How many albums does Billy Cobham has? | SELECT count(*) FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = "Billy Cobham"; | store_1 |
[
"How many customers have the first name Eduardo and last name Martins?",
"Show me all his customer information!",
"Just show the company!"
] | [
"SELECT count(*) FROM customers WHERE first_name = \"Eduardo\" AND last_name = \"Martins\";",
"SELECT * FROM customers WHERE first_name = \"Eduardo\" AND last_name = \"Martins\";",
"SELECT company FROM customers WHERE first_name = \"Eduardo\" AND last_name = \"Martins\";"
] | Eduardo Martins is a customer at which company? | SELECT company FROM customers WHERE first_name = "Eduardo" AND last_name = "Martins"; | store_1 |
[
"Show me the id of customer with first name Astrid, and last name Gruber!",
"What is her address?",
"How about her company?",
"Just show me her email and phone number?"
] | [
"SELECT id FROM customers WHERE first_name = \"Astrid\" AND last_name = \"Gruber\";",
"SELECT address FROM customers WHERE first_name = \"Astrid\" AND last_name = \"Gruber\";",
"SELECT company FROM customers WHERE first_name = \"Astrid\" AND last_name = \"Gruber\";",
"SELECT email , phone FROM customers WHERE first_name = \"Astrid\" AND last_name = \"Gruber\";"
] | What is Astrid Gruber's email and phone number? | SELECT email , phone FROM customers WHERE first_name = "Astrid" AND last_name = "Gruber"; | store_1 |
[
"How many different countries are the customers from?",
"What are they?",
"Show the customer names for each!",
"Which country has name Roberto Almeida?"
] | [
"Select count(distinct country) from customers;",
"SELECT distinct country FROM customers;",
"SELECT country, first_name, last_name FROM customers;",
"SELECT country FROM customers WHERE first_name = \"Roberto\" AND last_name = \"Almeida\";"
] | What country does Roberto Almeida live? | SELECT country FROM customers WHERE first_name = "Roberto" AND last_name = "Almeida"; | store_1 |
[
"How many different artists are there?",
"What are their names?",
"Show all the album titles for the one named Led!"
] | [
"Select count(*) from artists",
"SELECT name FROM artists",
"SELECT T2.title FROM artists AS T1 JOIN albums AS T2 ON T1.id = T2.artist_id WHERE T1.name LIKE '%Led%'"
] | List the name of albums that are released by artist whose name has 'Led' | SELECT T2.title FROM artists AS T1 JOIN albums AS T2 ON T1.id = T2.artist_id WHERE T1.name LIKE '%Led%' | store_1 |
[
"What is the title of the employee with first name Steve and last name Johnson?",
"Who does he report to?",
"What customers does he support?",
"How many are there?"
] | [
"Select title from employees WHERE first_name = \"Steve\" AND last_name = \"Johnson\";",
"Select T2.first_name, T2.last_name from employees as T1 JOIN employees as T2 on T1.reports_to = T2.id WHERE T1.first_name = \"Steve\" AND T1.last_name = \"Johnson\";",
"SELECT T2.first_name, T2.last_name FROM employees AS T1 JOIN customers AS T2 ON T2.support_rep_id = T1.id WHERE T1.first_name = \"Steve\" AND T1.last_name = \"Johnson\";",
"SELECT count(*) FROM employees AS T1 JOIN customers AS T2 ON T2.support_rep_id = T1.id WHERE T1.first_name = \"Steve\" AND T1.last_name = \"Johnson\";"
] | How many customers does Steve Johnson support? | SELECT count(*) FROM employees AS T1 JOIN customers AS T2 ON T2.support_rep_id = T1.id WHERE T1.first_name = "Steve" AND T1.last_name = "Johnson"; | store_1 |
[
"Tell me the phone number and email of employee named Nancy Edwards?",
"What is her birth date?",
"How about her address?",
"Show her title, phone number, and hire date!"
] | [
"SELECT phone , email FROM employees WHERE first_name = \"Nancy\" AND last_name = \"Edwards\";",
"SELECT birth_date FROM employees WHERE first_name = \"Nancy\" AND last_name = \"Edwards\";",
"SELECT address FROM employees WHERE first_name = \"Nancy\" AND last_name = \"Edwards\";",
"SELECT title , phone , hire_date FROM employees WHERE first_name = \"Nancy\" AND last_name = \"Edwards\";"
] | What is the title, phone and hire date of Nancy Edwards? | SELECT title , phone , hire_date FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards"; | store_1 |
[
"What is the title of Nancy Edwards?",
"Who does she report to?",
"How many report to her?",
"What are their names?"
] | [
"Select title from employees WHERE first_name = \"Nancy\" AND last_name = \"Edwards\";",
"SELECT T2.first_name, T2.last_name FROM employees AS T1 JOIN employees AS T2 ON T1.reports_to = T2.id WHERE T1.first_name = \"Nancy\" AND T1.last_name = \"Edwards\";",
"SELECT count(*) FROM employees AS T1 JOIN employees AS T2 ON T1.id = T2.reports_to WHERE T1.first_name = \"Nancy\" AND T1.last_name = \"Edwards\";",
"SELECT T2.first_name , T2.last_name FROM employees AS T1 JOIN employees AS T2 ON T1.id = T2.reports_to WHERE T1.first_name = \"Nancy\" AND T1.last_name = \"Edwards\";"
] | find the full name of employees who report to Nancy Edwards? | SELECT T2.first_name , T2.last_name FROM employees AS T1 JOIN employees AS T2 ON T1.id = T2.reports_to WHERE T1.first_name = "Nancy" AND T1.last_name = "Edwards"; | store_1 |
[
"Show all the employee ids and addresses!",
"Order by country, state, and city!",
"Also provide employee name!",
"Just show the address of customer named Nancy Edwards!"
] | [
"SELECT id, address FROM employees;",
"SELECT id, address FROM employees order by country, state, city;",
"SELECT first_name, last_name, id, address FROM employees order by country, state, city;",
"SELECT address FROM employees WHERE first_name = \"Nancy\" AND last_name = \"Edwards\";"
] | What is the address of employee Nancy Edwards? | SELECT address FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards"; | store_1 |
[
"Who are the employees that actually support customers?",
"How about the most?",
"What is the name of the employee that supports this many!"
] | [
"SELECT T1.first_name, T2.last_name FROM employees AS T1 JOIN customers AS T2 ON T1.id = T2.support_rep_id",
"SELECT count(*) FROM employees AS T1 JOIN customers AS T2 ON T1.id = T2.support_rep_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1",
"SELECT T1.first_name , T1.last_name FROM employees AS T1 JOIN customers AS T2 ON T1.id = T2.support_rep_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1"
] | Find the full name of employee who supported the most number of customers. | SELECT T1.first_name , T1.last_name FROM employees AS T1 JOIN customers AS T2 ON T1.id = T2.support_rep_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1 | store_1 |
[
"Show the employee information on employee with name Nancy Edwards!",
"Show just her email!",
"Actually show just her phone!"
] | [
"SELECT * FROM employees WHERE first_name = \"Nancy\" AND last_name = \"Edwards\";",
"SELECT email FROM employees WHERE first_name = \"Nancy\" AND last_name = \"Edwards\";",
"SELECT phone FROM employees WHERE first_name = \"Nancy\" AND last_name = \"Edwards\";"
] | What is employee Nancy Edwards's phone number? | SELECT phone FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards"; | store_1 |
[
"Show all the employe information ordered by oldest to youngest!",
"Just show the birthdate of the oldest!",
"How about that of the youngest!",
"What is the youngest's name?"
] | [
"SELECT * FROM employees ORDER BY birth_date ASC;",
"SELECT birth_date FROM employees ORDER BY birth_date ASC LIMIT 1;",
"SELECT birth_date FROM employees ORDER BY birth_date DESC LIMIT 1;",
"SELECT first_name , last_name FROM employees ORDER BY birth_date DESC LIMIT 1;"
] | Who is the youngest employee in the company? List employee's first and last name. | SELECT first_name , last_name FROM employees ORDER BY birth_date DESC LIMIT 1; | store_1 |
[
"What is the name of the most recent employee?",
"How about the first employee?",
"How about the most recent 10 most recent employees?",
"List first 10 employees!"
] | [
"SELECT first_name , last_name FROM employees ORDER BY hire_date ASC LIMIT 1;",
"SELECT first_name , last_name FROM employees ORDER BY hire_date DESC LIMIT 1;",
"SELECT first_name , last_name FROM employees ORDER BY hire_date DESC LIMIT 10;",
"SELECT first_name , last_name FROM employees ORDER BY hire_date ASC LIMIT 10;"
] | List top 10 employee work longest in the company. List employee's first and last name. | SELECT first_name , last_name FROM employees ORDER BY hire_date ASC LIMIT 10; | store_1 |
[
"Show all the different cities that employees are from.",
"How many are from each one!",
"How many are of the title Sales Support Agent?",
"How about IT Staff?"
] | [
"SELECT distinct city FROM employees",
"SELECT count(*) , city FROM employees GROUP BY city",
"SELECT count(*) , city FROM employees WHERE title = 'Sales Support Agent' GROUP BY city",
"SELECT count(*) , city FROM employees WHERE title = 'IT Staff' GROUP BY city"
] | Find the number of employees whose title is IT Staff from each city? | SELECT count(*) , city FROM employees WHERE title = 'IT Staff' GROUP BY city | store_1 |
[
"What are the name of the employees that do not manage any other employees?",
"Show me all the names of all the others!",
"Who manages the max number of people?",
"Also provide the number of people managed!"
] | [
"SELECT first_name, last_name from employees where id in (select id from employees except select reports_to from employees)",
"SELECT T2.first_name , T2.last_name , count(T1.reports_to) FROM employees AS T1 JOIN employees AS T2 ON T1.reports_to = T2.id;",
"SELECT T2.first_name , T2.last_name FROM employees AS T1 JOIN employees AS T2 ON T1.reports_to = T2.id GROUP BY T1.reports_to ORDER BY count(T1.reports_to) DESC LIMIT 1;",
"SELECT T2.first_name , T2.last_name , count(T1.reports_to) FROM employees AS T1 JOIN employees AS T2 ON T1.reports_to = T2.id GROUP BY T1.reports_to ORDER BY count(T1.reports_to) DESC LIMIT 1;"
] | Which employee manage most number of peoples? List employee's first and last name, and number of people report to that employee. | SELECT T2.first_name , T2.last_name , count(T1.reports_to) FROM employees AS T1 JOIN employees AS T2 ON T1.reports_to = T2.id GROUP BY T1.reports_to ORDER BY count(T1.reports_to) DESC LIMIT 1; | store_1 |
[
"For all the invoices, show the invoice ids and customer ids!",
"How many have each customer ordered!",
"Show their names for each!",
"Show the number for customer named Lucas Mancini!"
] | [
"SELECT id, customer_id FROM invoices;",
"SELECT T1.id, count(*) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id group by T1.id;",
"SELECT T1.first_name, T1.last_name, T1.id, count(*) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id group by T1.id;",
"SELECT count(*) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = \"Lucas\" AND T1.last_name = \"Mancini\";"
] | How many orders does Lucas Mancini has? | SELECT count(*) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = "Lucas" AND T1.last_name = "Mancini"; | store_1 |
[
"Show the number of orders for each customer name!",
"Also include the total amount each has spent!",
"Show the entry for customer named Lucas Mancini.",
"Actually, just show the total amount of money!"
] | [
"SELECT count(*), T1.first_name, T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id group by T1.id;",
"SELECT sum(T2.total), count(*), T1.first_name, T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id group by T1.id;",
"SELECT sum(T2.total), count(*), T1.first_name, T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = \"Lucas\" AND T1.last_name = \"Mancini\";",
"SELECT sum(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = \"Lucas\" AND T1.last_name = \"Mancini\";"
] | What is the total amount of money spent by Lucas Mancini? | SELECT sum(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = "Lucas" AND T1.last_name = "Mancini"; | store_1 |
[
"For each track, show the track name and album name!",
"Also include the genre name !",
"Show just the ones of the genre named Rock!",
"Show just the track names!"
] | [
"SELECT T1.name, T2.title FROM tracks AS T1 JOIN albums AS T2 ON T1.album_id = T2.id;",
"SELECT T3.name, T1.name, T2.title FROM tracks AS T1 JOIN albums AS T2 ON T1.album_id = T2.id join genres as T3 on T1.genre_id = T3.id;",
"SELECT T3.name, T1.name, T2.title FROM tracks AS T1 JOIN albums AS T2 ON T1.album_id = T2.id join genres as T3 on T1.genre_id = T3.id WHERE T3.name = \"Rock\";",
"SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = \"Rock\";"
] | What is the name of tracks whose genre is Rock? | SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = "Rock"; | store_1 |
[
"Who is the composer for track named \"Balls to the Wall\";",
"How long is it?",
"How about its price?",
"the title of the album it belongs to?"
] | [
"SELECT composer FROM tracks where name = \"Balls to the Wall\";",
"SELECT milliseconds FROM tracks where name = \"Balls to the Wall\";",
"SELECT unit_price FROM tracks where name = \"Balls to the Wall\";",
"SELECT T1.title FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.album_id WHERE T2.name = \"Balls to the Wall\";"
] | What is title of album which track Balls to the Wall belongs to? | SELECT T1.title FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.album_id WHERE T2.name = "Balls to the Wall"; | store_1 |
[
"What are all the album names and respective track names?",
"Show them ordered by album name!",
"Show just the track names for album called \"Balls to the Wall\""
] | [
"SELECT T1.title, T2.name FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id;",
"SELECT T1.title, T2.name FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id order by T1.title;",
"SELECT T2.name FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.title = \"Balls to the Wall\";"
] | List name of all tracks in Balls to the Wall. | SELECT T2.name FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.title = "Balls to the Wall"; | store_1 |
[
"How many have greater than 5?",
"greater than 10?",
"What are their titles?"
] | [
"Select count(*) from (SELECT * FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.album_id GROUP BY T1.id HAVING count(T1.id) > 15);",
"Select count(*) from (SELECT * FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.album_id GROUP BY T1.id HAVING count(T1.id) > 10);",
"SELECT T1.title FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.album_id GROUP BY T1.id HAVING count(T1.id) > 10;"
] | List title of albums have the number of tracks greater than 10. | SELECT T1.title FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.album_id GROUP BY T1.id HAVING count(T1.id) > 10; | store_1 |
[
"Show me all the tracks names and their media types!",
"Which ones are MPEG files?",
"Also provide the genres for each of these!!",
"Which names of the ones are in the genre Rock?"
] | [
"SELECT T1.name, T2.name FROM tracks AS T1 JOIN media_types AS T2 ON T2.id = T1.media_type_id;",
"SELECT T1.name, T2.name FROM tracks AS T1 JOIN media_types AS T2 ON T2.id = T1.media_type_id WHERE T2.name = \"MPEG audio file\";",
"SELECT T1.name, T2.name, T3.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id JOIN media_types AS T3 ON T3.id = T2.media_type_id WHERE T3.name = \"MPEG audio file\";",
"SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id JOIN media_types AS T3 ON T3.id = T2.media_type_id WHERE T1.name = \"Rock\" AND T3.name = \"MPEG audio file\";"
] | List the name of tracks belongs to genre Rock and whose media type is MPEG audio file. | SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id JOIN media_types AS T3 ON T3.id = T2.media_type_id WHERE T1.name = "Rock" AND T3.name = "MPEG audio file"; | store_1 |
[
"Show the names of each track and their genre names!",
"Show me the names of the tracks that are in the genre Rock!",
"Show me any names of tracks whose media type is an MPEG audio file!",
"Can you show a list of both of these names?"
] | [
"SELECT T1.name, T2.name FROM tracks AS T1 JOIN genres AS T2 ON T1.genre_id = T2.id;",
"SELECT T1.name FROM tracks AS T1 JOIN genres AS T2 ON T1.genre_id = T2.id where T2.name = \"Rock\";",
"SELECT T1.name FROM tracks AS T1 JOIN media_types AS T2 ON T2.id = T1.media_type_id WHERE T2.name = \"MPEG audio file\";",
"SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id JOIN media_types AS T3 ON T3.id = T2.media_type_id WHERE T1.name = \"Rock\" OR T3.name = \"MPEG audio file\";"
] | List the name of tracks belongs to genre Rock or media type is MPEG audio file. | SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id JOIN media_types AS T3 ON T3.id = T2.media_type_id WHERE T1.name = "Rock" OR T3.name = "MPEG audio file"; | store_1 |
[
"What genre names for each track by track name!",
"Show us all the tracks that belong to genre Rock.",
"How about those that belong to genre Jazz.",
"Which ones belong to either one?"
] | [
"SELECT T1.name, T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = \"Rock\"",
"SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = \"Rock\"",
"SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = \"Jazz\"",
"SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = \"Rock\" OR T1.name = \"Jazz\""
] | List the name of tracks belongs to genre Rock or genre Jazz. | SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = "Rock" OR T1.name = "Jazz" | store_1 |
[
"How many tracks are there?",
"How many are in a playlist of a Movie?",
"Which ones ?"
] | [
"Select count(*) from tracks;",
"SELECT count(*) FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T3.id = T2.playlist_id WHERE T3.name = \"Movies\";",
"SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T3.id = T2.playlist_id WHERE T3.name = \"Movies\";"
] | List the name of all tracks in the playlists of Movies. | SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T3.id = T2.playlist_id WHERE T3.name = "Movies"; | store_1 |
[
"What are the names of all the playlist?",
"For each, what are the names of their tracks?",
"For each playlist name, count the number of tracks!",
"Show the only the names of the playlists with more than 100!"
] | [
"Select name from playlists;",
"SELECT T3.name, T2.name FROM playlist_tracks AS T1 JOIN playlists AS T2 ON T2.id = T1.playlist_id JOIN tracks as T3 on T1.track_id = T3.id;",
"SELECT T2.name, count(T1.track_id) FROM playlist_tracks AS T1 JOIN playlists AS T2 ON T2.id = T1.playlist_id GROUP BY T1.playlist_id;",
"SELECT T2.name FROM playlist_tracks AS T1 JOIN playlists AS T2 ON T2.id = T1.playlist_id GROUP BY T1.playlist_id HAVING count(T1.track_id) > 100;"
] | List the name of playlist which has number of tracks greater than 100. | SELECT T2.name FROM playlist_tracks AS T1 JOIN playlists AS T2 ON T2.id = T1.playlist_id GROUP BY T1.playlist_id HAVING count(T1.track_id) > 100; | store_1 |
[
"Show me the customer information about a customer named Daan Peeters.",
"How many invoices has he had?",
"In each invoice, how many tracks did he buy?",
"Can you show just all the names of these tracks!"
] | [
"Select * from customers where first_name = \"Daan\" and last_name = \"Peeters\";",
"SELECT count(*) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = \"Daan\" AND T1.last_name = \"Peeters\";",
"SELECT T2.id, count(*) FROM invoice_lines AS T1 JOIN invoices AS T2 ON T2.id = T1.invoice_id JOIN customers AS T3 ON T3.id = T2.customer_id WHERE T3.first_name = \"Daan\" AND T3.last_name = \"Peeters\" group by T2.id;",
"SELECT T1.name FROM tracks AS T1 JOIN invoice_lines AS T2 ON T1.id = T2.track_id JOIN invoices AS T3 ON T3.id = T2.invoice_id JOIN customers AS T4 ON T4.id = T3.customer_id WHERE T4.first_name = \"Daan\" AND T4.last_name = \"Peeters\";"
] | List all tracks bought by customer Daan Peeters. | SELECT T1.name FROM tracks AS T1 JOIN invoice_lines AS T2 ON T1.id = T2.track_id JOIN invoices AS T3 ON T3.id = T2.invoice_id JOIN customers AS T4 ON T4.id = T3.customer_id WHERE T4.first_name = "Daan" AND T4.last_name = "Peeters"; | store_1 |
[
"What different types of playlists are there?",
"What are the names of the tracks are in the movie playlist?",
"Which of these are also in the music playl",
"How about those that are not!"
] | [
"Select name from playlists",
"SELECT T1.name, T3.name from tracks as T1 join playlist_tracks as T2 on T1.id = T2.track_id join playlists as T3 on T2.playlist_id = T3.id WHERE T3.name = 'Movies'",
"SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Movies' INTERSECT SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Music';",
"SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Movies' EXCEPT SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Music';"
] | Find the name of tracks which are in Movies playlist but not in music playlist. | SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Movies' EXCEPT SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Music' | store_1 |
[
"How many different playlist are there?",
"What are they?",
"What are the tracks in each one?",
"What are the names of the ones are in both Movies and music!"
] | [
"Select count(*) from playlists;",
"Select name from playlists;",
"Select T1.name, T3.name from tracks as T1 join playlist_tracks as T2 on T1.id = T2.track_id join playlists as T3 on T2.playlist_id = T3.id;",
"SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Movies' INTERSECT SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Music'"
] | Find the name of tracks which are in both Movies and music playlists. | SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Movies' INTERSECT SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Music' | store_1 |
[
"What are the heights of buildings?",
"give the max.",
"What is its name?"
] | [
"SELECT height_feet from building",
"SELECT max(height_feet) from building",
"SELECT name FROM building ORDER BY height_feet DESC LIMIT 1"
] | What is the name of the tallest building? | SELECT name FROM building ORDER BY height_feet DESC LIMIT 1 | protein_institute |
[
"How many floors does each building name have?",
"What is the average?",
"Give statistics about the avg, max, and min."
] | [
"SELECT name, floors from building",
"SELECT avg(floors) FROM building",
"SELECT avg(floors) , max(floors) , min(floors) FROM building"
] | What are the average, maximum, and minimum number of floors for all buildings? | SELECT avg(floors) , max(floors) , min(floors) FROM building | protein_institute |
[
"How many buildings have height abouve average?",
"What about floors above average?",
"Give the union of the above."
] | [
"SELECT count(*) FROM building WHERE height_feet > (SELECT avg(height_feet) FROM building)",
"SELECT count(*) FROM building WHERE height_feet > (SELECT avg(floors) FROM building)",
"SELECT count(*) FROM building WHERE height_feet > (SELECT avg(height_feet) FROM building) OR floors > (SELECT avg(floors) FROM building)"
] | Show the number of buildings with a height above the average or a number of floors above the average. | SELECT count(*) FROM building WHERE height_feet > (SELECT avg(height_feet) FROM building) OR floors > (SELECT avg(floors) FROM building) | protein_institute |
[
"Which buildings are taller than 200?",
"Which have floors greater or equal to 20?",
"Intersect those."
] | [
"SELECT name FROM building WHERE height_feet >= 200",
"SELECT name FROM building WHERE floors >= 20",
"SELECT name FROM building WHERE height_feet >= 200 AND floors >= 20"
] | List the names of buildings with at least 200 feet of height and with at least 20 floors. | SELECT name FROM building WHERE height_feet >= 200 AND floors >= 20 | protein_institute |
[
"What are the names and founded dates for the institutions?",
"Also show the private/public status.",
"Show the names and locations of institutions that are founded after 1990 and have the type \"Private\"."
] | [
"SELECT institution, founded from institution",
"SELECT institution, founded, type from institution",
"SELECT institution , LOCATION FROM institution WHERE founded > 1990 AND TYPE = 'Private'"
] | Show the names and locations of institutions that are founded after 1990 and have the type "Private". | SELECT institution , LOCATION FROM institution WHERE founded > 1990 AND TYPE = 'Private' | protein_institute |
[
"What are the unique types of institution?",
"Count those.",
"Also sum over enrollment."
] | [
"SELECT distinct type from institution",
"SELECT TYPE, count(*) FROM institution GROUP BY TYPE",
"SELECT TYPE , count(*) , sum(enrollment) FROM institution GROUP BY TYPE"
] | Show institution types, along with the number of institutions and total enrollment for each type. | SELECT TYPE , count(*) , sum(enrollment) FROM institution GROUP BY TYPE | protein_institute |
[
"How many institutions have type Tribal?",
"Show the institution type with the largest number of institutions."
] | [
"SELECT count(*) FROM institution WHERE type = 'Tribal'",
"SELECT TYPE FROM institution GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1"
] | Show the institution type with the largest number of institutions. | SELECT TYPE FROM institution GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1 | protein_institute |
[
"Which institutions were founded after 1990?",
"What are their types?",
"Show the institution type with an institution founded after 1990 and an institution with at least 1000 enrollment."
] | [
"SELECT institution FROM institution WHERE founded > 1990",
"SELECT institution, type FROM institution WHERE founded > 1990",
"SELECT TYPE FROM institution WHERE founded > 1990 AND enrollment >= 1000"
] | Show the institution type with an institution founded after 1990 and an institution with at least 1000 enrollment. | SELECT TYPE FROM institution WHERE founded > 1990 AND enrollment >= 1000 | protein_institute |
[
"which building ids have an institution?",
"Which do not?",
"Give just their names."
] | [
"SELECT DISTINCT building_id FROM institution",
"SELECT building_id FROM building WHERE building_id NOT IN (SELECT building_id FROM institution)",
"SELECT name FROM building WHERE building_id NOT IN (SELECT building_id FROM institution)"
] | Show the name of buildings that do not have any institution. | SELECT name FROM building WHERE building_id NOT IN (SELECT building_id FROM institution) | protein_institute |
[
"Which institutions were founded in 2003?",
"What are the corresponding building ids?",
"What are the names of these buildings?",
"Which building names are not in there?"
] | [
"SELECT institution from institution WHERE founded = 2003",
"SELECT building_id from institution WHERE founded = 2003",
"SELECT T1.name FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id WHERE T2.founded = 2003",
"SELECT name FROM building EXCEPT SELECT T1.name FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id WHERE T2.founded = 2003"
] | Show the names of buildings except for those having an institution founded in 2003. | SELECT name FROM building EXCEPT SELECT T1.name FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id WHERE T2.founded = 2003 | protein_institute |
[
"How many institutions are in Citizens Bank Building?",
"Generalize this process for all buildings."
] | [
"SELECT count(*) FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id GROUP BY T1.building_id HAVING T1.name = 'Citizens Bank Building'",
"SELECT T1.name , count(*) FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id GROUP BY T1.building_id"
] | For each building, show the name of the building and the number of institutions in it. | SELECT T1.name , count(*) FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id GROUP BY T1.building_id | protein_institute |
[
"Which institutions were founded after 1880?",
"Give the building ids of these buildings.",
"Only show the building ids that appear twice or more on that list.",
"Give the names and heights of those buildings."
] | [
"SELECT institution from institution WHERE founded > 1880",
"SELECT building_id, institution from institution WHERE founded > 1880",
"SELECT building_id from institution WHERE founded > 1880 GROUP BY building_id HAVING count(*) >= 2",
"SELECT T1.name , T1.height_feet FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id WHERE T2.founded > 1880 GROUP BY T1.building_id HAVING count(*) >= 2"
] | Show the names and heights of buildings with at least two institutions founded after 1880. | SELECT T1.name , T1.height_feet FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id WHERE T2.founded > 1880 GROUP BY T1.building_id HAVING count(*) >= 2 | protein_institute |
[
"Show the institution names joined with the protein names.",
"Aggregate, count, over the institution names."
] | [
"SELECT T1.institution , T2.protein_name FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id",
"SELECT T1.institution , count(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id GROUP BY T1.institution_id"
] | Show institution names along with the number of proteins for each institution. | SELECT T1.institution , count(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id GROUP BY T1.institution_id | protein_institute |
[
"Which proteins are associated with institutions founded after 1880?",
"And which are associated with an institution with type \"Private\"?",
"Union those.",
"Count the union."
] | [
"SELECT T2.protein_name FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id WHERE T1.founded > 1880",
"SELECT T2.protein_name FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id WHERE T1.type = 'Private'",
"SELECT T2.protein_name FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id WHERE T1.founded > 1880 OR T1.type = 'Private'",
"SELECT count(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id WHERE T1.founded > 1880 OR T1.type = 'Private'"
] | How many proteins are associated with an institution founded after 1880 or an institution with type "Private"? | SELECT count(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id WHERE T1.founded > 1880 OR T1.type = 'Private' | protein_institute |
[
"Which protein names are associated with an institution in a building with at least 20 floors?",
"Which of those have common name equal to 'Tropical Clawed Frog'?",
"Give a count of the proteins in the first query."
] | [
"SELECT T2.protein_name FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id JOIN building AS T3 ON T3.building_id = T1.building_id WHERE T3.floors >= 20",
"SELECT T2.protein_name FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id JOIN building AS T3 ON T3.building_id = T1.building_id WHERE T3.floors >= 20 and T2.common_name = 'Tropical Clawed Frog'",
"SELECT count(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id JOIN building AS T3 ON T3.building_id = T1.building_id WHERE T3.floors >= 20"
] | How many proteins are associated with an institution in a building with at least 20 floors? | SELECT count(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id JOIN building AS T3 ON T3.building_id = T1.building_id WHERE T3.floors >= 20 | protein_institute |
[
"show all the different member addresses.",
"who is living in Harford?",
"also include the members living in Waterbury."
] | [
"SELECT distinct address FROM member",
"SELECT name FROM member WHERE address = 'Harford'",
"SELECT name FROM member WHERE address = 'Harford' OR address = 'Waterbury'"
] | Give me the names of members whose address is in Harford or Waterbury. | SELECT name FROM member WHERE address = 'Harford' OR address = 'Waterbury' | coffee_shop |
[
"how many members are under age 30?",
"how about the number of members with a black membership card?",
"what is the total number between these two groups of members?",
"what are their ids and names?"
] | [
"SELECT count(*) FROM member WHERE age < 30",
"SELECT count(*) FROM member WHERE Membership_card = 'Black'",
"SELECT count(*) FROM member WHERE Membership_card = 'Black' OR age < 30",
"SELECT name , member_id FROM member WHERE Membership_card = 'Black' OR age < 30"
] | Find the ids and names of members who are under age 30 or with black membership card. | SELECT name , member_id FROM member WHERE Membership_card = 'Black' OR age < 30 | coffee_shop |
[
"what are all the different membership cards?",
"how many members does each of them have?",
"which ones have more than 3 members?",
"how about 5?"
] | [
"SELECT distinct Membership_card FROM member",
"SELECT count(*), Membership_card FROM member GROUP BY Membership_card",
"SELECT Membership_card FROM member GROUP BY Membership_card HAVING count(*) > 3",
"SELECT Membership_card FROM member GROUP BY Membership_card HAVING count(*) > 5"
] | Which membership card has more than 5 members? | SELECT Membership_card FROM member GROUP BY Membership_card HAVING count(*) > 5 | coffee_shop |
[
"show all info about members.",
"which of them are older than 40?",
"for those who are younger than 30?",
"Which addresses have members in both groups?"
] | [
"SELECT * FROM member",
"SELECT * FROM member WHERE age > 40",
"SELECT * FROM member WHERE age < 30",
"SELECT address FROM member WHERE age < 30 INTERSECT SELECT address FROM member WHERE age > 40"
] | Which address has both members younger than 30 and members older than 40? | SELECT address FROM member WHERE age < 30 INTERSECT SELECT address FROM member WHERE age > 40 | coffee_shop |
[
"show the names of members living in Hartford.",
"also those living in Waterbury.",
"which membership cards are held by members living in these two places?"
] | [
"SELECT name FROM member WHERE address = 'Hartford'",
"SELECT name FROM member WHERE address = 'Waterbury'",
"SELECT membership_card FROM member WHERE address = 'Hartford' INTERSECT SELECT membership_card FROM member WHERE address = 'Waterbury'"
] | What is the membership card held by both members living in Hartford and ones living in Waterbury address? | SELECT membership_card FROM member WHERE address = 'Hartford' INTERSECT SELECT membership_card FROM member WHERE address = 'Waterbury' | coffee_shop |
[
"what are different membership cards?",
"how many black ones are there?",
"show addresses for those who have one.",
"how about those who do not have one?"
] | [
"SELECT distinct Membership_card FROM member",
"SELECT count(*) FROM member WHERE Membership_card = 'Black'",
"SELECT address FROM member WHERE Membership_card = 'Black'",
"SELECT address FROM member EXCEPT SELECT address FROM member WHERE Membership_card = 'Black'"
] | Which address do not have any member with the black membership card? | SELECT address FROM member EXCEPT SELECT address FROM member WHERE Membership_card = 'Black' | coffee_shop |
[
"show the scores and staff numbers for all shops.",
"what are the averages for these two columns?"
] | [
"SELECT num_of_staff, score FROM shop",
"SELECT avg(num_of_staff) , avg(score) FROM shop"
] | What are the average score and average staff number of all shops? | SELECT avg(num_of_staff) , avg(score) FROM shop | coffee_shop |
[
"what is the highest score for all shops?",
"how about the average?",
"what are the id and addresses of the shops whose scores are below this?"
] | [
"SELECT max(score) FROM shop",
"SELECT avg(score) FROM shop",
"SELECT shop_id, address FROM shop WHERE score < (SELECT avg(score) FROM shop)"
] | Find the id and address of the shops whose score is below the average score. | SELECT shop_id , address FROM shop WHERE score < (SELECT avg(score) FROM shop) | coffee_shop |
[
"Find the addresses of the shops where they have happy hour.",
"also return the staff numbers.",
"how about those where there is no happy hour?"
] | [
"SELECT t1.address FROM shop AS t1 JOIN happy_hour AS t2 ON t1.shop_id = t2.shop_id",
"SELECT t1.address, t1.num_of_staff FROM shop AS t1 JOIN happy_hour AS t2 ON t1.shop_id = t2.shop_id",
"SELECT address , num_of_staff FROM shop WHERE shop_id NOT IN (SELECT shop_id FROM happy_hour)"
] | Find the address and staff number of the shops that do not have any happy hour. | SELECT address , num_of_staff FROM shop WHERE shop_id NOT IN (SELECT shop_id FROM happy_hour) | coffee_shop |
[
"show the id of the shops that have a happy hour.",
"just show those that have happy hours in May.",
"return their addresses too."
] | [
"SELECT shop_id FROM happy_hour",
"SELECT shop_id FROM happy_hour WHERE MONTH = 'May'",
"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'"
] | What are the id and address of the shops which have a happy hour in May? | 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' | coffee_shop |
[
"find the number of happy hours in each shop. Also show shop id.",
"which of them has happy hour most often?"
] | [
"SELECT shop_id, count(*) FROM happy_hour GROUP BY shop_id",
"SELECT shop_id FROM happy_hour GROUP BY shop_id ORDER BY count(*) DESC LIMIT 1"
] | which shop has happy hour most frequently? List its id and number of happy hours. | SELECT shop_id , count(*) FROM happy_hour GROUP BY shop_id ORDER BY count(*) DESC LIMIT 1 | coffee_shop |
[
"how many happy hour shops are there?",
"for each month?",
"Which month has the most?"
] | [
"SELECT count(*) FROM happy_hour",
"SELECT count(*) FROM happy_hour GROUP BY MONTH",
"SELECT MONTH FROM happy_hour GROUP BY MONTH ORDER BY count(*) DESC LIMIT 1"
] | Which month has the most happy hours? | SELECT MONTH FROM happy_hour GROUP BY MONTH ORDER BY count(*) DESC LIMIT 1 | coffee_shop |
[
"Show information for all premises.",
"How many of them are there?"
] | [
"SELECT * FROM premises",
"SELECT count(*) FROM premises"
] | How many premises are there? | SELECT count(*) FROM premises | customers_campaigns_ecommerce |
[
"Show information for premises.",
"Only show the premise type for all of them.",
"What are the distinct types among them?"
] | [
"select * FROM premises",
"SELECT premises_type FROM premises",
"SELECT DISTINCT premises_type FROM premises"
] | What are all the distinct premise types? | SELECT DISTINCT premises_type FROM premises | customers_campaigns_ecommerce |
[
"Show the type for all premises.",
"Also add their details.",
"Order them by the premise type."
] | [
"SELECT premises_type FROM premises",
"SELECT premises_type , premise_details FROM premises",
"SELECT premises_type , premise_details FROM premises ORDER BY premises_type"
] | Find the types and details for all premises and order by the premise type. | SELECT premises_type , premise_details FROM premises ORDER BY premises_type | customers_campaigns_ecommerce |
[
"Show all premise types.",
"Show the number of premises in each type."
] | [
"SELECT premises_type FROM premises",
"SELECT premises_type , count(*) FROM premises GROUP BY premises_type"
] | Show each premise type and the number of premises in that type. | SELECT premises_type , count(*) FROM premises GROUP BY premises_type | customers_campaigns_ecommerce |
[
"Show the number of mailshot campaigns.",
"Breakdown the number by product category."
] | [
"SELECT count(*) FROM mailshot_campaigns",
"SELECT product_category , count(*) FROM mailshot_campaigns GROUP BY product_category"
] | Show all distinct product categories along with the number of mailshots in each category. | SELECT product_category , count(*) FROM mailshot_campaigns GROUP BY product_category | customers_campaigns_ecommerce |
[
"Show all customers id with a mailshot.",
"How about customer ids without any?",
"Display the name and phone number for those customers."
] | [
"SELECT customer_id FROM mailshot_customers",
"SELECT customer_id FROM customers WHERE customer_id NOT IN (SELECT customer_id FROM mailshot_customers)",
"SELECT customer_name , customer_phone FROM customers WHERE customer_id NOT IN (SELECT customer_id FROM mailshot_customers)"
] | Show the name and phone of the customer without any mailshot. | SELECT customer_name , customer_phone FROM customers WHERE customer_id NOT IN (SELECT customer_id FROM mailshot_customers) | customers_campaigns_ecommerce |
[
"Show the name and phone for all customers.",
"Only show the results for those customers with a mailshot.",
"Among those, how about the results for customers also with the outcome code 'No Response'."
] | [
"SELECT customer_name , customer_phone FROM customers",
"SELECT T1.customer_name , T1.customer_phone FROM customers AS T1 JOIN mailshot_customers AS T2 ON T1.customer_id = T2.customer_id",
"SELECT T1.customer_name , T1.customer_phone FROM customers AS T1 JOIN mailshot_customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.outcome_code = 'No Response'"
] | Show the name and phone for customers with a mailshot with outcome code 'No Response'. | SELECT T1.customer_name , T1.customer_phone FROM customers AS T1 JOIN mailshot_customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.outcome_code = 'No Response' | customers_campaigns_ecommerce |
[
"Show the outcome code for all mailshot customers.",
"Show the count of the number of mailshots in each of those codes."
] | [
"SELECT outcome_code FROM mailshot_customers",
"SELECT outcome_code , count(*) FROM mailshot_customers GROUP BY outcome_code"
] | Show the outcome code of mailshots along with the number of mailshots in each outcome code. | SELECT outcome_code , count(*) FROM mailshot_customers GROUP BY outcome_code | customers_campaigns_ecommerce |
[
"Show the names of customers.",
"How about the names for those who have an outcome code 'Order' of mailshots.",
"Only show the names of those who have at least two such codes."
] | [
"SELECT customer_name FROM customers",
"SELECT T2.customer_name FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE outcome_code = 'Order'",
"SELECT T2.customer_name FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE outcome_code = 'Order' GROUP BY T1.customer_id HAVING count(*) >= 2"
] | Show the names of customers who have at least 2 mailshots with outcome code 'Order'. | SELECT T2.customer_name FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE outcome_code = 'Order' GROUP BY T1.customer_id HAVING count(*) >= 2 | customers_campaigns_ecommerce |
[
"Show the name of customers with a mailshot.",
"Order them by the number of mailshots in descending order.",
"Who has the most mailshots among them?"
] | [
"SELECT T2.customer_name FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id",
"SELECT T2.customer_name FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC",
"SELECT T2.customer_name FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1"
] | Show the names of customers who have the most mailshots. | SELECT T2.customer_name FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1 | customers_campaigns_ecommerce |
[
"Show the name for customers.",
"Also show their payment methods.",
"How about the results for those haing mailshots in 'Order' outcome",
"What about those also having mailshots in 'No Response' outcome?"
] | [
"SELECT customer_name from customers",
"SELECT customer_name , payment_method from customers",
"SELECT T2.customer_name , T2.payment_method FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.outcome_code = 'Order'",
"SELECT T2.customer_name , T2.payment_method FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.outcome_code = 'Order' INTERSECT SELECT T2.customer_name , T2.payment_method FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.outcome_code = 'No Response'"
] | What are the name and payment method of customers who have both mailshots in 'Order' outcome and mailshots in 'No Response' outcome. | SELECT T2.customer_name , T2.payment_method FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.outcome_code = 'Order' INTERSECT SELECT T2.customer_name , T2.payment_method FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.outcome_code = 'No Response' | customers_campaigns_ecommerce |
[
"Show the address type code for all customer addresses.",
"For each of them, also show the premise type."
] | [
"SELECT address_type_code FROM customer_addresses",
"SELECT T2.premises_type , T1.address_type_code FROM customer_addresses AS T1 JOIN premises AS T2 ON T1.premise_id = T2.premise_id"
] | Show the premise type and address type code for all customer addresses. | SELECT T2.premises_type , T1.address_type_code FROM customer_addresses AS T1 JOIN premises AS T2 ON T1.premise_id = T2.premise_id | customers_campaigns_ecommerce |
[
"Show information for all customer addresses.",
"Show the address type code for all customer addresses.",
"Filter for distinctness."
] | [
"SELECT * FROM customer_addresses",
"SELECT address_type_code FROM customer_addresses",
"SELECT DISTINCT address_type_code FROM customer_addresses"
] | What are the distinct address type codes for all customer addresses? | SELECT DISTINCT address_type_code FROM customer_addresses | customers_campaigns_ecommerce |
[
"List the shipping charge and customer id for all customer orders.",
"How about the results with order status 'Cancelled'?",
"How about the results with order status 'Paid'.",
"Show the results of both."
] | [
"SELECT order_shipping_charges , customer_id FROM customer_orders",
"SELECT order_shipping_charges , customer_id FROM customer_orders WHERE order_status_code = 'Cancelled'",
"SELECT order_shipping_charges , customer_id FROM customer_orders WHERE order_status_code = 'Paid'",
"SELECT order_shipping_charges , customer_id FROM customer_orders WHERE order_status_code = 'Cancelled' OR order_status_code = 'Paid'"
] | Show the shipping charge and customer id for customer orders with order status Cancelled or Paid. | SELECT order_shipping_charges , customer_id FROM customer_orders WHERE order_status_code = 'Cancelled' OR order_status_code = 'Paid' | customers_campaigns_ecommerce |
[
"What are all the cross reference codes?",
"Show me the cross references with code as Tax.",
"What are the details of the cmi masters of them?"
] | [
"SELECT source_system_code FROM CMI_Cross_References GROUP BY source_system_code",
"SELECT * FROM CMI_Cross_References WHERE source_system_code = 'Tax'",
"SELECT T1.cmi_details FROM Customer_Master_Index AS T1 JOIN CMI_Cross_References AS T2 ON T1.master_customer_id = T2.master_customer_id WHERE T2.source_system_code = 'Tax'"
] | what are the details of the cmi masters that have the cross reference code 'Tax'? | SELECT T1.cmi_details FROM Customer_Master_Index AS T1 JOIN CMI_Cross_References AS T2 ON T1.master_customer_id = T2.master_customer_id WHERE T2.source_system_code = 'Tax' | local_govt_mdm |
[
"Show me all the council tax entries.",
"Show me distinct cmi cross reference ids in those.",
"What about their corresponding source system code?"
] | [
"SELECT * FROM Council_Tax",
"SELECT cmi_cross_ref_id FROM Council_Tax GROUP By cmi_cross_ref_id",
"SELECT T1.cmi_cross_ref_id , T1.source_system_code FROM CMI_Cross_References AS T1 JOIN Council_Tax AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id GROUP BY T1.cmi_cross_ref_id HAVING count(*) >= 1"
] | What is the cmi cross reference id that is related to at least one council tax entry? List the cross reference id and source system code. | SELECT T1.cmi_cross_ref_id , T1.source_system_code FROM CMI_Cross_References AS T1 JOIN Council_Tax AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id GROUP BY T1.cmi_cross_ref_id HAVING count(*) >= 1 | local_govt_mdm |
[
"How many business rates are there?",
"What are the distinct cmi cross reference ids in those business rates?",
"Show me the number of business rates related to each of them.",
"Include the master customer id too."
] | [
"SELECT count(*) FROM Business_Rates",
"SELECT cmi_cross_ref_id FROM Business_Rates GROUP BY cmi_cross_ref_id",
"SELECT cmi_cross_ref_id,count(*) FROM Business_Rates GROUP BY cmi_cross_ref_id",
"SELECT T2.cmi_cross_ref_id , T2.master_customer_id , count(*) FROM Business_Rates AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id GROUP BY T2.cmi_cross_ref_id"
] | How many business rates are related to each cmi cross reference? List cross reference id, master customer id and the number of business rates. | SELECT T2.cmi_cross_ref_id , T2.master_customer_id , count(*) FROM Business_Rates AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id GROUP BY T2.cmi_cross_ref_id | local_govt_mdm |
[
"What are the cmi cross reference ids that are related to the benefits and overpayments.",
"Show me their source system codes along with the benefit id.",
"Order them by the benefit id."
] | [
"SELECT cmi_cross_ref_id FROM Benefits_Overpayments",
"SELECT T1.source_system_code , T2.council_tax_id FROM CMI_Cross_References AS T1 JOIN Benefits_Overpayments AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id",
"SELECT T1.source_system_code , T2.council_tax_id FROM CMI_Cross_References AS T1 JOIN Benefits_Overpayments AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id ORDER BY T2.council_tax_id"
] | What is the tax source system code related to the benefits and overpayments? List the code and the benefit id, order by benefit id. | SELECT T1.source_system_code , T2.council_tax_id FROM CMI_Cross_References AS T1 JOIN Benefits_Overpayments AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id ORDER BY T2.council_tax_id | local_govt_mdm |
[
"Show me the detail of all the customer master indices.",
"Show me the id of those whose detial is not 'Schmidt, Kertzmann and Lubowitz'.",
"What are the renting arears tax ids related to them?"
] | [
"SELECT cmi_details FROM Customer_Master_Index",
"SELECT master_customer_id FROM Customer_Master_Index WHERE cmi_details != 'Schmidt , Kertzmann and Lubowitz'",
"SELECT T1.council_tax_id FROM Rent_Arrears AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id JOIN Customer_Master_Index AS T3 ON T3.master_customer_id = T2.master_customer_id WHERE T3.cmi_details != 'Schmidt , Kertzmann and Lubowitz'"
] | What are the renting arrears tax ids related to the customer master index whose detail is not 'Schmidt, Kertzmann and Lubowitz'? | SELECT T1.council_tax_id FROM Rent_Arrears AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id JOIN Customer_Master_Index AS T3 ON T3.master_customer_id = T2.master_customer_id WHERE T3.cmi_details != 'Schmidt , Kertzmann and Lubowitz' | local_govt_mdm |
[
"What are the ids of all the electoral register?",
"What about their cross reference source system codes?",
"Show me those with source system code 'Electoral' or 'Tax'."
] | [
"SELECT electoral_register_id FROM Electoral_Register",
"SELECT T1.electoral_register_id, T2.source_system_code FROM Electoral_Register AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id",
"SELECT T1.electoral_register_id FROM Electoral_Register AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id WHERE T2.source_system_code = 'Electoral' OR T2.source_system_code = 'Tax'"
] | What are the register ids of electoral registries that have the cross reference source system code 'Electoral' or 'Tax'? | SELECT T1.electoral_register_id FROM Electoral_Register AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id WHERE T2.source_system_code = 'Electoral' OR T2.source_system_code = 'Tax' | local_govt_mdm |
[
"What are the details of all the master customers?",
"Show me the id of one with details 'Gottlieb, Becker and Wyman'.",
"Show me the distinct cross reference source system codes related to it."
] | [
"SELECT cmi_details FROM customer_master_index",
"SELECT master_customer_id FROM customer_master_index WHERE cmi_details = 'Gottlieb, Becker and Wyman'",
"SELECT DISTINCT T2.source_system_code FROM customer_master_index AS T1 JOIN cmi_cross_references AS T2 ON T1.master_customer_id = T2.master_customer_id WHERE T1.cmi_details = 'Gottlieb, Becker and Wyman'"
] | What are the distinct cross reference source system codes which are related to the master customer details 'Gottlieb, Becker and Wyman'? | SELECT DISTINCT T2.source_system_code FROM customer_master_index AS T1 JOIN cmi_cross_references AS T2 ON T1.master_customer_id = T2.master_customer_id WHERE T1.cmi_details = 'Gottlieb, Becker and Wyman' | local_govt_mdm |
[
"Show me all the cmi cross reference ids.",
"What about those not related to any parking taxes?"
] | [
"SELECT cmi_cross_ref_id FROM cmi_cross_references",
"SELECT cmi_cross_ref_id FROM cmi_cross_references EXCEPT SELECT cmi_cross_ref_id FROM parking_fines"
] | Which cmi cross reference id is not related to any parking taxes? | SELECT cmi_cross_ref_id FROM cmi_cross_references EXCEPT SELECT cmi_cross_ref_id FROM parking_fines | local_govt_mdm |