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 songs do not have a back vocal?",
"Show me the titles of those songs."
] | [
"SELECT count(DISTINCT title) FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid WHERE TYPE = \"back\"",
"SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid WHERE TYPE = \"back\""
] | Find all the songs that do not have a back vocal. | SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid WHERE TYPE = "back" | music_2 |
[
"Show me all vocal types played by a bandmate with first name \"Solveig\".",
"Which one is played the most?"
] | [
"SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE firstname = \"Solveig\" GROUP BY TYPE",
"SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE firstname = \"Solveig\" GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1"
] | Which vocal type has the band mate with first name "Solveig" played the most? | SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE firstname = "Solveig" GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1 | music_2 |
[
"Which vocal type is played in the song \"Der Kapitan\"?",
"Which vocal type did the musician with last name \"Heilo\" play?"
] | [
"SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid JOIN band AS T3 ON T1.bandmate = T3.id WHERE T2.title = \"Der Kapitan\"",
"SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid JOIN band AS T3 ON T1.bandmate = T3.id WHERE T3.lastname = \"Heilo\" AND T2.title = \"Der Kapitan\""
] | Which vocal type did the musician with last name "Heilo" played in the song with title "Der Kapitan"? | SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid JOIN band AS T3 ON T1.bandmate = T3.id WHERE T3.lastname = "Heilo" AND T2.title = "Der Kapitan" | music_2 |
[
"Which band mate performed in most songs? Show me the last name.",
"Show the first name."
] | [
"SELECT t2.lastname FROM Performance AS t1 JOIN Band AS t2 ON t1.bandmate = t2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId GROUP BY firstname ORDER BY count(*) DESC LIMIT 1",
"SELECT t2.firstname FROM Performance AS t1 JOIN Band AS t2 ON t1.bandmate = t2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId GROUP BY firstname ORDER BY count(*) DESC LIMIT 1"
] | Find the first name of the band mate that has performed in most songs. | SELECT t2.firstname FROM Performance AS t1 JOIN Band AS t2 ON t1.bandmate = t2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId GROUP BY firstname ORDER BY count(*) DESC LIMIT 1 | music_2 |
[
"Which vocal type has the band mate with first name \"Marianne\" played?",
"Which one did she play the most?"
] | [
"SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE firstname = \"Marianne\" GROUP BY TYPE",
"SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE firstname = \"Marianne\" GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1"
] | Which vocal type has the band mate with first name "Marianne" played the most? | SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE firstname = "Marianne" GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1 | music_2 |
[
"Which bandmates are performing in the song \"Der Kapitan\"? Show the first name and last name.",
"Who plays in the back stage position? Show first and last names."
] | [
"SELECT T2.firstname , T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = \"Der Kapitan\"",
"SELECT T2.firstname , T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = \"Der Kapitan\" AND T1.StagePosition = \"back\""
] | Who is performing in the back stage position for the song "Der Kapitan"? Show the first name and last name. | SELECT T2.firstname , T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = "Der Kapitan" AND T1.StagePosition = "back" | music_2 |
[
"How many songs are there in album \"A Kiss Before You Go: Live in Hamburg\"?",
"What are those songs? Show me the title."
] | [
"SELECT count(T3.title) FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE T1.title = \"A Kiss Before You Go: Live in Hamburg\"",
"SELECT T3.title FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE T1.title = \"A Kiss Before You Go: Live in Hamburg\""
] | What are the songs in album "A Kiss Before You Go: Live in Hamburg"? | SELECT T3.title FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE T1.title = "A Kiss Before You Go: Live in Hamburg" | music_2 |
[
"How many songs are in albums under label \"Universal Music Group\"?",
"Show me the titles of those songs."
] | [
"SELECT count(T3.title) FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE t1.label = \"Universal Music Group\"",
"SELECT T3.title FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE t1.label = \"Universal Music Group\""
] | What are all the songs in albums under label "Universal Music Group"? | SELECT T3.title FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE t1.label = "Universal Music Group" | music_2 |
[
"Tell me the country of the league named \"France Ligue 1\".",
"How about that of the league named \"Poland Ekstraklasa\"",
"How many leagues are there in England?"
] | [
"SELECT T1.name FROM Country AS T1 JOIN League AS T2 ON T1.id = T2.country_id WHERE T2.name = \"France Ligue 1\"",
"SELECT T1.name FROM Country AS T1 JOIN League AS T2 ON T1.id = T2.country_id WHERE T2.name = \"Poland Ekstraklasa\"",
"SELECT count(*) FROM Country AS T1 JOIN League AS T2 ON T1.id = T2.country_id WHERE T1.name = \"England\""
] | How many leagues are there in England? | SELECT count(*) FROM Country AS T1 JOIN League AS T2 ON T1.id = T2.country_id WHERE T1.name = "England" | soccer_1 |
[
"Tell me the birthday of the player named Aaron Hunt.",
"How about his weight?",
"tell me the maximum and minimum weight of all players."
] | [
"SELECT birthday FROM Player WHERE player_name = \"Aaron Hunt\"",
"SELECT weight FROM Player WHERE player_name = \"Aaron Hunt\"",
"SELECT max(weight) , min(weight) FROM Player"
] | What is the maximum and minimum weight of all players? | SELECT max(weight) , min(weight) FROM Player | soccer_1 |
[
"Tell me the potential of the player named \"Abasse Ba\".",
"How about his finishing times?",
"list all player names who have an overall rating higher than the average."
] | [
"SELECT T2.potential FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T1.player_name = \"Abasse Ba\"",
"SELECT T2.finishing FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T1.player_name = \"Abasse Ba\"",
"SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.overall_rating > ( SELECT avg(overall_rating) FROM Player_Attributes )"
] | List all player names who have an overall rating higher than the average. | SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.overall_rating > ( SELECT avg(overall_rating) FROM Player_Attributes ) | soccer_1 |
[
"What are the names of players who have the best crossing?",
"What are the names of players who have the best short passing?",
"What are the names of players who have the best dribbling?"
] | [
"SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.crossing = ( SELECT max(crossing) FROM Player_Attributes)",
"SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.short_passing = ( SELECT max(short_passing) FROM Player_Attributes)",
"SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.dribbling = ( SELECT max(dribbling) FROM Player_Attributes)"
] | What are the names of players who have the best dribbling? | SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.dribbling = ( SELECT max(dribbling) FROM Player_Attributes) | soccer_1 |
[
"Tell me all the players whose defensive work rate is high.",
"How about players whose attacking work rate is high?",
"Tell me the names of all players who have a crossing score higher than 90 and prefer their right foot."
] | [
"SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.defensive_work_rate = \"high\"",
"SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.defensive_work_rate = \"high\" AND T2.attacking_work_rate = \"high\"",
"SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.crossing > 90 AND T2.preferred_foot = \"right\""
] | List the names of all players who have a crossing score higher than 90 and prefer their right foot. | SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.crossing > 90 AND T2.preferred_foot = "right" | soccer_1 |
[
"Tell me the names of players who have an overall rating larger than 80.",
"Tell me their preferred foot.",
"tell me the names of all left-footed players who have overall rating between 85 and 90."
] | [
"SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.overall_rating > 80",
"SELECT DISTINCT T1.player_name, T2.preferred_foot FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.overall_rating > 80",
"SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.preferred_foot = \"left\" AND T2.overall_rating >= 85 AND T2.overall_rating <= 90"
] | List the names of all left-footed players who have overall rating between 85 and 90. | SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.preferred_foot = "left" AND T2.overall_rating >= 85 AND T2.overall_rating <= 90 | soccer_1 |
[
"How many players have an overall rating of 60 or greater?",
"How many players have potential of 80 or greater?",
"Of all players with an overall rating greater than 80, how many are right-footed and left-footed?"
] | [
"SELECT COUNT(DISTINCT T1.player_name) FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.overall_rating >= 60",
"SELECT COUNT(DISTINCT T1.player_name) FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.potential >= 80",
"SELECT preferred_foot , count(*) FROM Player_Attributes WHERE overall_rating > 80 GROUP BY preferred_foot"
] | Of all players with an overall rating greater than 80, how many are right-footed and left-footed? | SELECT preferred_foot , count(*) FROM Player_Attributes WHERE overall_rating > 80 GROUP BY preferred_foot | soccer_1 |
[
"What is the height of the player named Abdoulaye Toure?",
"What is his overall rating?",
"Tell me all of the player ids with a height of at least 180cm and an overall rating higher than 85."
] | [
"SELECT height FROM Player WHERE player_name = \"Abdoulaye Toure\"",
"SELECT T2.overall_rating FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T1.player_name = \"Abdoulaye Toure\"",
"SELECT player_api_id FROM Player WHERE height >= 180 INTERSECT SELECT player_api_id FROM Player_Attributes WHERE overall_rating > 85"
] | List all of the player ids with a height of at least 180cm and an overall rating higher than 85. | SELECT player_api_id FROM Player WHERE height >= 180 INTERSECT SELECT player_api_id FROM Player_Attributes WHERE overall_rating > 85 | soccer_1 |
[
"Tell me the birthday of the player named \"Aaron Hunt\".",
"What is his preferred foot?",
"List all of the ids for left-footed players with a height between 180cm and 190cm."
] | [
"SELECT birthday FROM Player WHERE player_name = \"Aaron Hunt\"",
"SELECT T2.preferred_foot FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T1.player_name = \"Aaron Hunt\"",
"SELECT player_api_id FROM Player WHERE height >= 180 AND height <= 190 INTERSECT SELECT player_api_id FROM Player_Attributes WHERE preferred_foot = \"left\""
] | List all of the ids for left-footed players with a height between 180cm and 190cm. | SELECT player_api_id FROM Player WHERE height >= 180 AND height <= 190 INTERSECT SELECT player_api_id FROM Player_Attributes WHERE preferred_foot = "left" | soccer_1 |
[
"How many players have heading accuracy larger than 70?",
"Tell me the top three of these?",
"Who are the top 3 players in terms of overall rating?"
] | [
"SELECT COUNT(DISTINCT T1.player_name) FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.heading_accuracy > 70",
"SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.heading_accuracy > 70 ORDER BY overall_rating DESC LIMIT 3",
"SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id ORDER BY overall_rating DESC LIMIT 3"
] | Who are the top 3 players in terms of overall rating? | SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id ORDER BY overall_rating DESC LIMIT 3 | soccer_1 |
[
"How many different products are available to order?",
"Order them by the number of times they have been ordered.",
"Which has been ordered the greatest number of times?",
"Only show the name and price."
] | [
"SELECT count(DISTINCT product_id) FROM products",
"SELECT * FROM products AS t1 JOIN regular_order_products AS t2 ON t1.product_id = t2.product_id GROUP BY t2.product_id ORDER BY count(*)",
"SELECT * FROM products AS t1 JOIN regular_order_products AS t2 ON t1.product_id = t2.product_id GROUP BY t2.product_id ORDER BY count(*) DESC LIMIT 1",
"SELECT t1.product_name , t1.product_price FROM products AS t1 JOIN regular_order_products AS t2 ON t1.product_id = t2.product_id GROUP BY t2.product_id ORDER BY count(*) DESC LIMIT 1"
] | Find the name and price of the product that has been ordered the greatest number of times. | SELECT t1.product_name , t1.product_price FROM products AS t1 JOIN regular_order_products AS t2 ON t1.product_id = t2.product_id GROUP BY t2.product_id ORDER BY count(*) DESC LIMIT 1 | customer_deliveries |
[
"What is the average price of all products?",
"Which of the procucts cost more than this?",
"Which is the name of the most expensive product?"
] | [
"SELECT avg(product_price) FROM products",
"SELECT * FROM products WHERE product_price > (SELECT avg(product_price) FROM products)",
"SELECT product_name FROM products ORDER BY product_price DESC LIMIT 1"
] | Find the name of the most expensive product. | SELECT product_name FROM products ORDER BY product_price DESC LIMIT 1 | customer_deliveries |
[
"How many customers have addresses on file?",
"What different states are they from?",
"Show all information for customers living in the state of California.",
"Show the names of all customers except these."
] | [
"SELECT count(DISTINCT customer_id) FROM customer_addresses AS t1 JOIN addresses AS t2 ON t1.address_id = t2.address_id",
"SELECT DISTINCT state_province_county FROM addresses",
"SELECT * FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = 'California'",
"SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = 'California'"
] | Find the names of customers who are not living in the state of California. | SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = 'California' | customer_deliveries |
[
"What state or province are the most customer addresses located?",
"How many customers have addresses in the state of California",
"What are their names and phone numbers?"
] | [
"SELECT state_province_county, count(*) FROM customer_addresses AS t1 JOIN addresses AS t2 ON t1.address_id = t2.address_id GROUP BY state_province_county ORDER BY count(*) DESC LIMIT 1",
"SELECT count(*) FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = 'California'",
"SELECT t1.customer_name , t1.customer_phone FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = 'California'"
] | Find the names and phone numbers of customers living in California state. | SELECT t1.customer_name , t1.customer_phone FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = 'California' | customer_deliveries |
[
"What are all the different employee address details?",
"At which adresses do no employees live?",
"What states or provinces are they in?"
] | [
"SELECT DISTINCT address_details FROM addresses AS t1 JOIN employees AS t2 ON t1.address_id = t2.employee_address_id",
"SELECT * FROM addresses WHERE address_id NOT IN (SELECT employee_address_id FROM employees)",
"SELECT state_province_county FROM addresses WHERE address_id NOT IN (SELECT employee_address_id FROM employees)"
] | Find the states which do not have any employee in their record. | SELECT state_province_county FROM addresses WHERE address_id NOT IN (SELECT employee_address_id FROM employees) | customer_deliveries |
[
"What is the customer ID of the person who became a customer most recently?",
"What is their name?",
"How about the earliest 5 customers?"
] | [
"SELECT customer_id FROM customers ORDER BY date_became_customer DESC LIMIT 1",
"SELECT customer_name FROM customers ORDER BY date_became_customer DESC LIMIT 1",
"SELECT customer_name FROM customers ORDER BY date_became_customer LIMIT 5"
] | Find the name of the first 5 customers. | SELECT customer_name FROM customers ORDER BY date_became_customer LIMIT 5 | customer_deliveries |
[
"Order all customer payment methods alphabetically.",
"Which is last alphabetically?",
"Which appears most often?"
] | [
"SELECT payment_method FROM customers ORDER BY payment_method",
"SELECT payment_method FROM customers ORDER BY payment_method DESC LIMIT 1",
"SELECT payment_method FROM customers GROUP BY payment_method ORDER BY count(*) DESC LIMIT 1"
] | Find the payment method that is used most frequently. | SELECT payment_method FROM customers GROUP BY payment_method ORDER BY count(*) DESC LIMIT 1 | customer_deliveries |
[
"What are all location codes for the delivery locations?",
"Which route has had the fewest orders delivered?",
"Which route has the highest number of delivery locations?"
] | [
"SELECT location_code FROM delivery_route_locations",
"SELECT route_id FROM order_deliveries AS t1 JOIN delivery_route_locations AS t2 ON t1.location_code = t2.location_code ORDER BY t2.route_id LIMIT 1",
"SELECT t1.route_name FROM delivery_routes AS t1 JOIN delivery_route_locations AS t2 ON t1.route_id = t2.route_id GROUP BY t1.route_id ORDER BY count(*) DESC LIMIT 1"
] | Find the name of route that has the highest number of deliveries. | SELECT t1.route_name FROM delivery_routes AS t1 JOIN delivery_route_locations AS t2 ON t1.route_id = t2.route_id GROUP BY t1.route_id ORDER BY count(*) DESC LIMIT 1 | customer_deliveries |
[
"What are all the documents?",
"Show the name and access counts of them in alphabetic order of the name."
] | [
"SELECT * FROM documents",
"SELECT document_name , access_count FROM documents ORDER BY document_name"
] | Find the name and access counts of all documents, in alphabetic order of the document name. | SELECT document_name , access_count FROM documents ORDER BY document_name | document_management |
[
"What are the names and access counts of all the documents?",
"Which one has been accessed the greatest number of times?"
] | [
"SELECT document_name, access_count FROM documents",
"SELECT document_name , access_count FROM documents ORDER BY access_count DESC LIMIT 1"
] | Find the name of the document that has been accessed the greatest number of times, as well as the count of how many times it has been accessed? | SELECT document_name , access_count FROM documents ORDER BY access_count DESC LIMIT 1 | document_management |
[
"What are all the documents?",
"Which document types are there?",
"Which types have more than 4 documents?"
] | [
"SELECT * FROM documents",
"SELECT document_type_code FROM documents GROUP BY document_type_code",
"SELECT document_type_code FROM documents GROUP BY document_type_code HAVING count(*) > 4"
] | Find the types of documents with more than 4 documents. | SELECT document_type_code FROM documents GROUP BY document_type_code HAVING count(*) > 4 | document_management |
[
"What are all the documents?",
"What are the total access counts of documents in terms of document type?",
"Which is the largest among them?"
] | [
"SELECT * FROM documents",
"SELECT sum(access_count) FROM documents GROUP BY document_type_code",
"SELECT sum(access_count) FROM documents GROUP BY document_type_code ORDER BY count(*) DESC LIMIT 1"
] | Find the total access count of all documents in the most popular document type. | SELECT sum(access_count) FROM documents GROUP BY document_type_code ORDER BY count(*) DESC LIMIT 1 | document_management |
[
"What are access counts all the documents?",
"Show their average."
] | [
"SELECT access_count FROM documents",
"SELECT avg(access_count) FROM documents"
] | What is the average access count of documents? | SELECT avg(access_count) FROM documents | document_management |
[
"What are all the documents?",
"Show the type of the one named \"David CV\"."
] | [
"SELECT * FROM documents",
"SELECT document_type_code FROM documents WHERE document_name = \"David CV\""
] | What is the type of the document named "David CV"? | SELECT document_type_code FROM documents WHERE document_name = "David CV" | document_management |
[
"What are all the documents?",
"Which document types have more than 10000 total access number?"
] | [
"SELECT * FROM documents",
"SELECT document_type_code FROM documents GROUP BY document_type_code HAVING sum(access_count) > 10000"
] | What document types do have more than 10000 total access number. | SELECT document_type_code FROM documents GROUP BY document_type_code HAVING sum(access_count) > 10000 | document_management |
[
"What is the document named \"David CV\"?",
"What are all the section titils of it?"
] | [
"SELECT * FROM documents WHERE document_name = \"David CV\"",
"SELECT t2.section_title FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code WHERE t1.document_name = \"David CV\""
] | What are all the section titles of the document named "David CV"? | SELECT t2.section_title FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code WHERE t1.document_name = "David CV" | document_management |
[
"What are all the documents?",
"Show those without any sections."
] | [
"SELECT * FROM documents",
"SELECT document_name FROM documents WHERE document_code NOT IN (SELECT document_code FROM document_sections)"
] | Find all the name of documents without any sections. | SELECT document_name FROM documents WHERE document_code NOT IN (SELECT document_code FROM document_sections) | document_management |
[
"What are all the documents with functional area \"Acknowledgement\"?",
"Show the average access counts for each of them."
] | [
"SELECT * FROM documents AS t1 JOIN document_functional_areas AS t2 ON t1.document_code = t2.document_code JOIN functional_areas AS t3 ON t2.functional_area_code = t3.functional_area_code WHERE t3.functional_area_description = \"Acknowledgement\"",
"SELECT avg(t1.access_count) FROM documents AS t1 JOIN document_functional_areas AS t2 ON t1.document_code = t2.document_code JOIN functional_areas AS t3 ON t2.functional_area_code = t3.functional_area_code WHERE t3.functional_area_description = \"Acknowledgement\""
] | Find the average access counts of documents with functional area "Acknowledgement". | SELECT avg(t1.access_count) FROM documents AS t1 JOIN document_functional_areas AS t2 ON t1.document_code = t2.document_code JOIN functional_areas AS t3 ON t2.functional_area_code = t3.functional_area_code WHERE t3.functional_area_description = "Acknowledgement" | document_management |
[
"What are all the documents?",
"Show those without any images."
] | [
"SELECT * FROM documents",
"SELECT document_name FROM documents EXCEPT SELECT t1.document_name FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code JOIN document_sections_images AS t3 ON t2.section_id = t3.section_id"
] | Find names of the document without any images. | SELECT document_name FROM documents EXCEPT SELECT t1.document_name FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code JOIN document_sections_images AS t3 ON t2.section_id = t3.section_id | document_management |
[
"What are all the documents?",
"Show their names in the order of number of sections.",
"What is the name of the one with the most number of sections?"
] | [
"SELECT * FROM documents",
"SELECT t1.document_name FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code GROUP BY t1.document_code ORDER BY count(*)",
"SELECT t1.document_name FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code GROUP BY t1.document_code ORDER BY count(*) DESC LIMIT 1"
] | What is the name of the document with the most number of sections? | SELECT t1.document_name FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code GROUP BY t1.document_code ORDER BY count(*) DESC LIMIT 1 | document_management |
[
"What are the names of all the documents?",
"Show those that contain \"CV\"."
] | [
"SELECT document_name FROM documents",
"SELECT document_name FROM documents WHERE document_name LIKE \"%CV%\""
] | List all the document names which contains "CV". | SELECT document_name FROM documents WHERE document_name LIKE "%CV%" | document_management |
[
"Who are all the users?",
"Show those who are logged in."
] | [
"SELECT * FROM users",
"SELECT count(*) FROM users WHERE user_login = 1"
] | How many users are logged in? | SELECT count(*) FROM users WHERE user_login = 1 | document_management |
[
"What are all the users that have logged in?",
"Among those users, which role is the most popular one?",
"Show the description of that role."
] | [
"SELECT * FROM users WHERE user_login = 1",
"SELECT role_code FROM users WHERE user_login = 1 GROUP BY role_code ORDER BY count(*) DESC LIMIT 1",
"SELECT role_description FROM ROLES WHERE role_code = (SELECT role_code FROM users WHERE user_login = 1 GROUP BY role_code ORDER BY count(*) DESC LIMIT 1)"
] | Find the description of the most popular role among the users that have logged in. | SELECT role_description FROM ROLES WHERE role_code = (SELECT role_code FROM users WHERE user_login = 1 GROUP BY role_code ORDER BY count(*) DESC LIMIT 1) | document_management |
[
"What are all the documents?",
"What are the average access counts in terms of each document structure?",
"Show the one with the least popular structure."
] | [
"SELECT * FROM documents",
"SELECT avg(access_count) FROM documents GROUP BY document_structure_code",
"SELECT avg(access_count) FROM documents GROUP BY document_structure_code ORDER BY count(*) ASC LIMIT 1"
] | Find the average access count of documents with the least popular structure. | SELECT avg(access_count) FROM documents GROUP BY document_structure_code ORDER BY count(*) ASC LIMIT 1 | document_management |
[
"Show all the images.",
"Show their names and URLs in the order of their names."
] | [
"SELECT * FROM images",
"SELECT image_name , image_url FROM images ORDER BY image_name"
] | List all the image name and URLs in the order of their names. | SELECT image_name , image_url FROM images ORDER BY image_name | document_management |
[
"What are all the users?",
"What are the different kinds of roles among them?",
"Show the number of users in each role."
] | [
"SELECT * FROM users",
"SELECT role_code FROM users GROUP BY role_code",
"SELECT count(*) , role_code FROM users GROUP BY role_code"
] | Find the number of users in each role. | SELECT count(*) , role_code FROM users GROUP BY role_code | document_management |
[
"Show me all the policy types.",
"Show me the type with most records in the database."
] | [
"SELECT policy_type_code FROM available_policies",
"SELECT policy_type_code FROM available_policies GROUP BY policy_type_code ORDER BY count(*) DESC LIMIT 1"
] | Which policy type has the most records in the database? | SELECT policy_type_code FROM available_policies GROUP BY policy_type_code ORDER BY count(*) DESC LIMIT 1 | insurance_fnol |
[
"What is the most popular policy type?",
"Show me all the customer phone numbers associated with it."
] | [
"SELECT policy_type_code FROM available_policies GROUP BY policy_type_code ORDER BY count(*) DESC LIMIT 1",
"SELECT customer_phone FROM available_policies WHERE policy_type_code = (SELECT policy_type_code FROM available_policies GROUP BY policy_type_code ORDER BY count(*) DESC LIMIT 1)"
] | What are all the customer phone numbers under the most popular policy type? | SELECT customer_phone FROM available_policies WHERE policy_type_code = (SELECT policy_type_code FROM available_policies GROUP BY policy_type_code ORDER BY count(*) DESC LIMIT 1) | insurance_fnol |
[
"Show me the policy type used by more than 3 customers.",
"Show me the same for more than 4 customers."
] | [
"SELECT policy_type_code FROM available_policies GROUP BY policy_type_code HAVING count(*) > 3",
"SELECT policy_type_code FROM available_policies GROUP BY policy_type_code HAVING count(*) > 4"
] | Find the policy type used by more than 4 customers. | SELECT policy_type_code FROM available_policies GROUP BY policy_type_code HAVING count(*) > 4 | insurance_fnol |
[
"What is the maximum amount of settlements?",
"What is the total amount of settlements?",
"What is the average?"
] | [
"SELECT max(settlement_amount) FROM settlements",
"SELECT sum(settlement_amount) FROM settlements",
"SELECT avg(settlement_amount) FROM settlements"
] | Find the total and average amount of settlements. | SELECT sum(settlement_amount) , avg(settlement_amount) FROM settlements | insurance_fnol |
[
"Find the name of services that have been used in first notification of loss.",
"Find services used more than twice in first notification of loss."
] | [
"SELECT t2.service_name FROM first_notification_of_loss AS t1 JOIN services AS t2 ON t1.service_id = t2.service_id GROUP BY t1.service_id HAVING count(*) > 0",
"SELECT t2.service_name FROM first_notification_of_loss AS t1 JOIN services AS t2 ON t1.service_id = t2.service_id GROUP BY t1.service_id HAVING count(*) > 2"
] | Find the name of services that have been used for more than 2 times in first notification of loss. | SELECT t2.service_name FROM first_notification_of_loss AS t1 JOIN services AS t2 ON t1.service_id = t2.service_id GROUP BY t1.service_id HAVING count(*) > 2 | insurance_fnol |
[
"What is the ID of the claim that has the smallest amount of total settlement?",
"What is its effective date?",
"Show me the same for the effective date of claim with largest amount of total sum."
] | [
"SELECT t1.Claim_ID FROM claims AS t1 JOIN settlements AS t2 ON t1.claim_id = t2.claim_id GROUP BY t1.claim_id ORDER BY sum(t2.settlement_amount) ASC LIMIT 1",
"SELECT t1.Effective_Date FROM claims AS t1 JOIN settlements AS t2 ON t1.claim_id = t2.claim_id GROUP BY t1.claim_id ORDER BY sum(t2.settlement_amount) ASC LIMIT 1",
"SELECT t1.Effective_Date FROM claims AS t1 JOIN settlements AS t2 ON t1.claim_id = t2.claim_id GROUP BY t1.claim_id ORDER BY sum(t2.settlement_amount) DESC LIMIT 1"
] | What is the effective date of the claim that has the largest amount of total settlement? | SELECT t1.Effective_Date FROM claims AS t1 JOIN settlements AS t2 ON t1.claim_id = t2.claim_id GROUP BY t1.claim_id ORDER BY sum(t2.settlement_amount) DESC LIMIT 1 | insurance_fnol |
[
"Show me the policies listed for the customer named \"Dayana Robel\".",
"How many are there?"
] | [
"SELECT * FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = \"Dayana Robel\"",
"SELECT count(*) FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = \"Dayana Robel\""
] | How many policies are listed for the customer named "Dayana Robel"? | SELECT count(*) FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = "Dayana Robel" | insurance_fnol |
[
"What is the name of the customer who has the least policies listed?",
"How about the most policies listed?"
] | [
"SELECT t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_name ORDER BY count(*) ASC LIMIT 1",
"SELECT t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_name ORDER BY count(*) DESC LIMIT 1"
] | What is the name of the customer who has the most policies listed? | SELECT t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_name ORDER BY count(*) DESC LIMIT 1 | insurance_fnol |
[
"What is the phone number of the customer named \"Dayana Robel\"?",
"Show me all the policy types associated with that phone number."
] | [
"SELECT DISTINCT t3.customer_phone FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id JOIN available_policies AS t3 ON t2.policy_id = t3.policy_id WHERE t1.customer_name = \"Dayana Robel\"",
"SELECT DISTINCT t3.policy_type_code FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id JOIN available_policies AS t3 ON t2.policy_id = t3.policy_id WHERE t1.customer_name = \"Dayana Robel\""
] | What are all the policy types of the customer named "Dayana Robel"? | SELECT DISTINCT t3.policy_type_code FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id JOIN available_policies AS t3 ON t2.policy_id = t3.policy_id WHERE t1.customer_name = "Dayana Robel" | insurance_fnol |
[
"What is the name of the customer who has the most policies listed?",
"How many policy types has the customer listed?",
"List all of them please."
] | [
"SELECT t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_name ORDER BY count(*) DESC LIMIT 1",
"SELECT DISTINCT count(*) FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id JOIN available_policies AS t3 ON t2.policy_id = t3.policy_id WHERE t1.customer_name = (SELECT t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_name ORDER BY count(*) DESC LIMIT 1)",
"SELECT DISTINCT t3.policy_type_code FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id JOIN available_policies AS t3 ON t2.policy_id = t3.policy_id WHERE t1.customer_name = (SELECT t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_name ORDER BY count(*) DESC LIMIT 1)"
] | What are all the policy types of the customer that has the most policies listed? | SELECT DISTINCT t3.policy_type_code FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id JOIN available_policies AS t3 ON t2.policy_id = t3.policy_id WHERE t1.customer_name = (SELECT t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_name ORDER BY count(*) DESC LIMIT 1) | insurance_fnol |
[
"Find the ids of customers without first notification of loss record.",
"Show me their names."
] | [
"SELECT customer_id FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id",
"SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id"
] | Find the names of users who do not have a first notification of loss record. | SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id | insurance_fnol |
[
"Find me names of customers who have used the service \"Close a policy\".",
"Find me names of customers who have also used the service \"Upgrade a policy\".",
"Find me names of customers who have used either of the two services."
] | [
"SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = \"Close a policy\"",
"SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = \"Close a policy\" AND t3.service_name = \"Upgrade a policy\"",
"SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = \"Close a policy\" OR t3.service_name = \"Upgrade a policy\""
] | Find the names of customers who have used either the service "Close a policy" or the service "Upgrade a policy". | SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = "Close a policy" OR t3.service_name = "Upgrade a policy" | insurance_fnol |
[
"Find the names of customers who have used both the service \"Close a policy\" or the service \"Upgrade a policy\".",
"How about customers who have used both \"Close a policy\" and \"New policy application\"?"
] | [
"SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = \"Close a policy\" INTERSECT SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = \"Upgrade a policy\"",
"SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = \"Close a policy\" INTERSECT SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = \"New policy application\""
] | Find the names of customers who have used both the service "Close a policy" and the service "New policy application". | SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = "Close a policy" INTERSECT SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = "New policy application" | insurance_fnol |
[
"How many customers are there whose name contains \"Diana\"?",
"Show me their IDs"
] | [
"SELECT count(*) FROM customers WHERE customer_name LIKE \"%Diana%\"",
"SELECT customer_id FROM customers WHERE customer_name LIKE \"%Diana%\""
] | Find the IDs of customers whose name contains "Diana". | SELECT customer_id FROM customers WHERE customer_name LIKE "%Diana%" | insurance_fnol |
[
"What is the average settlement amount on record?",
"What are the maximum and minimum?"
] | [
"SELECT avg(settlement_amount) FROM settlements",
"SELECT max(settlement_amount) , min(settlement_amount) FROM settlements"
] | What are the maximum and minimum settlement amount on record? | SELECT max(settlement_amount) , min(settlement_amount) FROM settlements | insurance_fnol |
[
"show all info of wines.",
"what is their average rated score?",
"find the name of the lowest rated wine.",
"what about the highest rated one?"
] | [
"SELECT * FROM WINE",
"SELECT avg(Score) FROM WINE",
"SELECT Name FROM WINE ORDER BY Score LIMIT 1",
"SELECT Name FROM WINE ORDER BY Score DESC LIMIT 1"
] | What is the name of the highest rated wine? | SELECT Name FROM WINE ORDER BY Score DESC LIMIT 1 | wine_1 |
[
"what is the name of the highest rated wine?",
"Which winery is it from?"
] | [
"SELECT Name FROM WINE ORDER BY Score DESC LIMIT 1",
"SELECT Winery FROM WINE ORDER BY SCORE DESC LIMIT 1"
] | Which winery is the wine that has the highest score from? | SELECT Winery FROM WINE ORDER BY SCORE DESC LIMIT 1 | wine_1 |
[
"how many wines are there?",
"how many are made of red color grape?",
"only show their names."
] | [
"SELECT count(*) FROM WINE",
"SELECT count(*) FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = \"Red\"",
"SELECT DISTINCT T2.Name FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = \"Red\""
] | List the names of all distinct wines that are made of red color grape. | SELECT DISTINCT T2.Name FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = "Red" | wine_1 |
[
"what are all appellations?",
"which of them are in the North Coast area?",
"Find the names of all distinct wines from those appellations."
] | [
"SELECT Appelation FROM APPELLATIONS",
"SELECT Appelation FROM APPELLATIONS WHERE Area = \"North Coast\"",
"SELECT DISTINCT T2.Name FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.Area = \"North Coast\""
] | Find the names of all distinct wines that have appellations in North Coast area. | SELECT DISTINCT T2.Name FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.Area = "North Coast" | wine_1 |
[
"what appellations does Sonoma County have?",
"Give me the name of wines that are produced by them.",
"what is their average price?"
] | [
"SELECT Appelation FROM APPELLATIONS WHERE County = \"Sonoma\"",
"SELECT T2.Name FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = \"Sonoma\"",
"SELECT AVG(T2.Price) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = \"Sonoma\""
] | Give me the average prices of wines that are produced by appellations in Sonoma County. | SELECT AVG(T2.Price) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Sonoma" | wine_1 |
[
"what are all the different colors of grapes?",
"What are the names of wines that are made of white color grapes?",
"also show their scores."
] | [
"SELECT distinct Color FROM GRAPES",
"SELECT T2.Name FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = \"White\"",
"SELECT T2.Name, T2.Score FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = \"White\""
] | What are the names and scores of wines that are made of white color grapes? | SELECT T2.Name, T2.Score FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = "White" | wine_1 |
[
"how many wines were produced before the year of 2005?",
"how many of them were made by appelations in the Central Coast area?",
"what is the maximum price among them?"
] | [
"SELECT count(*) FROM WINE WHERE year < 2005",
"SELECT count(*) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.Area = \"Central Coast\" AND T2.year < 2005",
"SELECT max(T2.Price) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.Area = \"Central Coast\" AND T2.year < 2005"
] | Find the maximum price of wines from the appelations in Central Coast area and produced before the year of 2005. | SELECT max(T2.Price) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.Area = "Central Coast" AND T2.year < 2005 | wine_1 |
[
"show the name of the wines with scores higher than 90.",
"among them, which are made from white grapes?",
"what different grape varieties were they made from?"
] | [
"SELECT Name FROM WINE WHERE Score > 90",
"SELECT T2.name FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = \"White\" AND T2.score > 90",
"SELECT DISTINCT T1.Grape FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = \"White\" AND T2.score > 90"
] | Find the different white color grapes that produced wines with scores higher than 90. | SELECT DISTINCT T1.Grape FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = "White" AND T2.score > 90 | wine_1 |
[
"how many wines are there?",
"how many of them have a price higher than 50?",
"find their names.",
"which are made from red colored grapes?"
] | [
"SELECT count(*) FROM WINE",
"SELECT count(*) FROM WINE WHERE price > 50",
"SELECT name FROM WINE WHERE price > 50",
"SELECT T2.Name FROM Grapes AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = \"Red\" AND T2.price > 50"
] | What are the wines that have prices higher than 50 and made of Red color grapes? | SELECT T2.Name FROM Grapes AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = "Red" AND T2.price > 50 | wine_1 |
[
"Find the name of the wines that have prices lower than 50.",
"which ones have appellations from Monterey county?"
] | [
"SELECT name FROM WINE WHERE price < 50",
"SELECT T2.Name FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = \"Monterey\" AND T2.price < 50"
] | What are the wines that have prices lower than 50 and have appelations in Monterey county? | SELECT T2.Name FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Monterey" AND T2.price < 50 | wine_1 |
[
"find the lowest price of all wines.",
"how about among those from John Anthony winery?",
"Find the distinct names of all wines that have prices higher than that."
] | [
"SELECT min(Price) FROM WINE",
"SELECT min(Price) FROM wine WHERE Winery = \"John Anthony\"",
"SELECT DISTINCT Name FROM WINE WHERE Price > (SELECT min(Price) FROM wine WHERE Winery = \"John Anthony\")"
] | Find the distinct names of all wines that have prices higher than some wines from John Anthony winery. | SELECT DISTINCT Name FROM WINE WHERE Price > (SELECT min(Price) FROM wine WHERE Winery = "John Anthony") | wine_1 |
[
"how many wines were produced before the year of 2010?",
"which appellation produced the highest number of these?",
"What is the area where that appellation is from?"
] | [
"SELECT count(*) FROM WINE WHERE year < 2010",
"SELECT Appelation FROM WINE WHERE year < 2010 GROUP BY Appelation ORDER BY count(*) DESC LIMIT 1",
"SELECT T1.Area FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation GROUP BY T2.Appelation HAVING T2.year < 2010 ORDER BY count(*) DESC LIMIT 1"
] | What is the area of the appelation that produces the highest number of wines before the year of 2010? | SELECT T1.Area FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation GROUP BY T2.Appelation HAVING T2.year < 2010 ORDER BY count(*) DESC LIMIT 1 | wine_1 |
[
"what are all different colors of grapes?",
"which one produces the wines with the highest average price?"
] | [
"SELECT distinct Color FROM GRAPES",
"SELECT T1.Color FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape GROUP BY T2.Grape ORDER BY AVG(Price) DESC LIMIT 1"
] | What is the color of the grape whose wine products have the highest average price? | SELECT T1.Color FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape GROUP BY T2.Grape ORDER BY AVG(Price) DESC LIMIT 1 | wine_1 |
[
"Find the distinct names of wines produced before the year of 2000.",
"also list the different names of wines produced after 2010."
] | [
"SELECT DISTINCT Name FROM WINE WHERE YEAR < 2000",
"SELECT DISTINCT Name FROM WINE WHERE YEAR < 2000 OR YEAR > 2010"
] | Find the distinct names of wines produced before the year of 2000 or after the year of 2010. | SELECT DISTINCT Name FROM WINE WHERE YEAR < 2000 OR YEAR > 2010 | wine_1 |
[
"how many wines are made from Zinfandel grapes?",
"What are the average prices and number of cases for these wines?",
"only show numbers for the ones produced in 2009."
] | [
"SELECT count(*) FROM WINE WHERE Grape = \"Zinfandel\"",
"SELECT AVG(Price) , AVG(Cases) FROM WINE WHERE Grape = \"Zinfandel\"",
"SELECT AVG(Price) , AVG(Cases) FROM WINE WHERE YEAR = 2009 AND Grape = \"Zinfandel\""
] | What are the average prices and cases of wines produced in the year of 2009 and made of Zinfandel grape? | SELECT AVG(Price) , AVG(Cases) FROM WINE WHERE YEAR = 2009 AND Grape = "Zinfandel" | wine_1 |
[
"find the names of all wines produced by the St. Helena appelation.",
"which one is the most expensive?",
"what is its price?",
"also show the best score earned by these wines."
] | [
"SELECT name FROM WINE WHERE Appelation = \"St. Helena\"",
"SELECT name FROM WINE WHERE Appelation = \"St. Helena\" ORDER BY price DESC LIMIT 1",
"SELECT max(Price) FROM WINE WHERE Appelation = \"St. Helena\"",
"SELECT max(Price) , max(Score) FROM WINE WHERE Appelation = \"St. Helena\""
] | What are the maximum price and score of wines produced by St. Helena appelation? | SELECT max(Price) , max(Score) FROM WINE WHERE Appelation = "St. Helena" | wine_1 |
[
"how many wines were produced in each year?",
"What are the maximum price and score of wines in each year?"
] | [
"SELECT count(*), YEAR FROM WINE GROUP BY YEAR",
"SELECT max(Price) , max(Score) , YEAR FROM WINE GROUP BY YEAR"
] | What are the maximum price and score of wines in each year? | SELECT max(Price) , max(Score) , YEAR FROM WINE GROUP BY YEAR | wine_1 |
[
"how many different appellations are there?",
"what is the average price for wines from each of them?",
"what are their average scores too?"
] | [
"SELECT count(DISTINCT Appelation) FROM APPELLATIONS",
"SELECT avg(Price), Appelation FROM WINE GROUP BY Appelation",
"SELECT avg(Price) , avg(Score) , Appelation FROM WINE GROUP BY Appelation"
] | What are the average price and score of wines grouped by appelation? | SELECT avg(Price) , avg(Score) , Appelation FROM WINE GROUP BY Appelation | wine_1 |
[
"what are all the different wineries?",
"how many are there?",
"show those that have at least four wines."
] | [
"SELECT distinct Winery FROM WINE",
"SELECT count(distinct Winery) FROM WINE",
"SELECT Winery FROM WINE GROUP BY Winery HAVING count(*) >= 4"
] | Find the wineries that have at least four wines. | SELECT Winery FROM WINE GROUP BY Winery HAVING count(*) >= 4 | wine_1 |
[
"find the appellations that have more three wines.",
"how about those that have at most three?",
"find the countries of these appellations."
] | [
"SELECT Appelation FROM WINE GROUP BY Appelation HAVING count(*) > 3",
"SELECT Appelation FROM WINE GROUP BY Appelation HAVING count(*) <= 3",
"SELECT T1.County FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation GROUP BY T2.Appelation HAVING count(*) <= 3"
] | Find the country of all appelations who have at most three wines. | SELECT T1.County FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation GROUP BY T2.Appelation HAVING count(*) <= 3 | wine_1 |
[
"show the name and year of all wines by Brander winery.",
"which one was made the earliest?",
"What are the names of all wines that were produced before this year?"
] | [
"SELECT name, year FROM WINE WHERE Winery = \"Brander\"",
"SELECT name, year FROM WINE WHERE Winery = \"Brander\" ORDER BY year LIMIT 1",
"SELECT Name FROM WINE WHERE YEAR < (SELECT min(YEAR) FROM WINE WHERE Winery = \"Brander\")"
] | What are the names of wines whose production year are before the year of all wines by Brander winery? | SELECT Name FROM WINE WHERE YEAR < (SELECT min(YEAR) FROM WINE WHERE Winery = "Brander") | wine_1 |
[
"what are the names of wines made during the year 2006?",
"which one is the most expensive?",
"what is the price?",
"What are the names of wines that are more expensive than that?"
] | [
"SELECT name FROM WINE WHERE YEAR = 2006",
"SELECT name FROM WINE WHERE YEAR = 2006 ORDER BY price DESC LIMIT 1",
"SELECT max(Price) FROM WINE WHERE YEAR = 2006",
"SELECT Name FROM WINE WHERE Price > (SELECT max(Price) FROM WINE WHERE YEAR = 2006)"
] | What are the names of wines that are more expensive than all wines made in the year 2006? | SELECT Name FROM WINE WHERE Price > (SELECT max(Price) FROM WINE WHERE YEAR = 2006) | wine_1 |
[
"how many wines are made of white colored grapes?",
"which winery produced the greatest number of these wines?",
"how the top 3 wineries?"
] | [
"SELECT count(*) FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.GRAPE = T2.GRAPE WHERE T1.Color = \"White\"",
"SELECT T2.Winery FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.GRAPE = T2.GRAPE WHERE T1.Color = \"White\" GROUP BY T2.Winery ORDER BY count(*) DESC LIMIT 1",
"SELECT T2.Winery FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.GRAPE = T2.GRAPE WHERE T1.Color = \"White\" GROUP BY T2.Winery ORDER BY count(*) DESC LIMIT 3"
] | Find the top 3 wineries with the greatest number of wines made of white color grapes. | SELECT T2.Winery FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.GRAPE = T2.GRAPE WHERE T1.Color = "White" GROUP BY T2.Winery ORDER BY count(*) DESC LIMIT 3 | wine_1 |
[
"how many wines cost more than 100?",
"List the grape, winery and year of these wines.",
"order them by their produce year."
] | [
"SELECT count(*) FROM WINE WHERE Price > 100",
"SELECT Grape , Winery , YEAR FROM WINE WHERE Price > 100",
"SELECT Grape , Winery , YEAR FROM WINE WHERE Price > 100 ORDER BY YEAR"
] | List the grape, winery and year of the wines whose price is bigger than 100 ordered by year. | SELECT Grape , Winery , YEAR FROM WINE WHERE Price > 100 ORDER BY YEAR | wine_1 |
[
"list all info for wines ordered by their names.",
"only show those whose score is higher than 93.",
"show their name only.",
"also give me their grapes and appellations."
] | [
"SELECT * FROM WINE ORDER BY Name",
"SELECT * FROM WINE WHERE Score > 93 ORDER BY Name",
"SELECT name FROM WINE WHERE Score > 93 ORDER BY Name",
"SELECT Grape , Appelation , Name FROM WINE WHERE Score > 93 ORDER BY Name"
] | List the grape, appelation and name of wines whose score is higher than 93 ordered by Name. | SELECT Grape , Appelation , Name FROM WINE WHERE Score > 93 ORDER BY Name | wine_1 |
[
"how many wines were made after the year 2008?",
"what are their appellations?",
"which of them are not in the Central Coast area?"
] | [
"SELECT count(*) FROM WINE WHERE YEAR > 2008",
"SELECT Appelation FROM WINE WHERE YEAR > 2008",
"SELECT Appelation FROM WINE WHERE YEAR > 2008 EXCEPT SELECT Appelation FROM APPELLATIONS WHERE Area = \"Central Coast\""
] | Find the appelations that produce wines after the year of 2008 but not in Central Coast area. | SELECT Appelation FROM WINE WHERE YEAR > 2008 EXCEPT SELECT Appelation FROM APPELLATIONS WHERE Area = "Central Coast" | wine_1 |
[
"Find the average price of wines.",
"how about for the wines with appellations from Sonoma county?",
"what is the average for wines that are not produced from there?"
] | [
"SELECT avg(price) FROM wine",
"SELECT avg(t2.price) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = 'Sonoma'",
"SELECT avg(price) FROM wine WHERE Appelation NOT IN (SELECT T1.Appelation FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = 'Sonoma')"
] | Find the average price of wines that are not produced from Sonoma county. | SELECT avg(price) FROM wine WHERE Appelation NOT IN (SELECT T1.Appelation FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = 'Sonoma') | wine_1 |
[
"Show me the sales for each company!",
"Also, include the industry they are in!",
"Which ones are not in the Banking industry?",
"What are the minimum and maximum sales?"
] | [
"SELECT id, sales_billion FROM Companies",
"SELECT id, sales_billion, industry FROM Companies",
"SELECT id, sales_billion, industry FROM Companies WHERE Industry != \"Banking\"",
"SELECT max(Sales_billion) , min(Sales_billion) FROM Companies WHERE Industry != \"Banking\""
] | What are the maximum and minimum sales of the companies whose industries are not "Banking". | SELECT max(Sales_billion) , min(Sales_billion) FROM Companies WHERE Industry != "Banking" | company_office |
[
"Show me the heights of each building.",
"What is the average height?",
"How about the max height?",
"How many stories does the building with this height have?"
] | [
"SELECT id, height FROM buildings",
"SELECT avg(height) FROM buildings",
"SELECT height FROM buildings ORDER BY Height DESC LIMIT 1",
"SELECT Stories FROM buildings ORDER BY Height DESC LIMIT 1"
] | Find the stories of the building with the largest height. | SELECT Stories FROM buildings ORDER BY Height DESC LIMIT 1 | company_office |
[
"What are names of all the companies?",
"How many of them have office locations?",
"Which are they?",
"Also, provide the names all the office locations for each!"
] | [
"SELECT name FROM companies",
"SELECT count(*) FROM Office_locations AS T1 JOIN Companies AS T2 ON T1.company_id = T2.id",
"SELECT T2.name FROM Office_locations AS T1 JOIN Companies AS T2 ON T1.company_id = T2.id",
"SELECT T3.name , T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id"
] | List the name of a building along with the name of a company whose office is in the building. | SELECT T3.name , T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id | company_office |
[
"What are the names of all the buildings?",
"Which ones have at least one company office?",
"How about at least two?"
] | [
"SELECT name FROM buildings",
"SELECT T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id",
"SELECT T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T1.building_id HAVING COUNT(*) > 1"
] | Show the names of the buildings that have more than one company offices. | SELECT T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T1.building_id HAVING COUNT(*) > 1 | company_office |
[
"What are the buildings with at least one company office?",
"How many offices do they each have?",
"Which one has the most?",
"What is its name?"
] | [
"SELECT * FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id",
"SELECT T1.building_id, count(*) FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T1.building_id",
"SELECT * FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T1.building_id ORDER BY COUNT(*) DESC LIMIT 1",
"SELECT T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T1.building_id ORDER BY COUNT(*) DESC LIMIT 1"
] | Show the name of the building that has the most company offices. | SELECT T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T1.building_id ORDER BY COUNT(*) DESC LIMIT 1 | company_office |
[
"List the names of the buildings that have a status on-hold.",
"Also, list their height and number of stories.",
"Actually just show the names and number of stories for each!",
"Can you just show the names sorted by number of stories FROM least to greatest?"
] | [
"SELECT name FROM buildings WHERE Status = \"on-hold\"",
"SELECT name, height, stories FROM buildings WHERE Status = \"on-hold\"",
"SELECT name, stories FROM buildings WHERE Status = \"on-hold\"",
"SELECT name FROM buildings WHERE Status = \"on-hold\" ORDER BY Stories ASC"
] | Please show the names of the buildings whose status is "on-hold", in ascending order of stories. | SELECT name FROM buildings WHERE Status = "on-hold" ORDER BY Stories ASC | company_office |
[
"Show each company id and its industry.",
"Show how many companies are in each industry.",
"Sort industries by the number of companies in a descending order!",
"Actually, can you just show the industries!"
] | [
"SELECT id, industry FROM companies",
"SELECT Industry, count(*) FROM Companies GROUP BY Industry",
"SELECT Industry, count(*) FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC",
"SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC"
] | Please show the industries of companies in descending order of the number of companies. | SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC | company_office |
[
"How many different company industries are there?",
"What are they?",
"Which one has the least number of companies?",
"How about the most?"
] | [
"SELECT count(distinct industry) FROM companies",
"SELECT distinct Industry FROM Companies",
"SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) ASC LIMIT 1",
"SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC LIMIT 1"
] | List the industry shared by the most companies. | SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC LIMIT 1 | company_office |
[
"How many buildings are there?",
"How many have a company office?",
"What are their building names?",
"What are the names of the buildings other than those?"
] | [
"SELECT count(*) FROM buildings",
"SELECT count(distinct building_id) FROM Office_locations",
"SELECT T2.name FROM Office_locations as T1 join buildings as T2 on T1.building_id = T2.id group by T2.id",
"SELECT name FROM buildings WHERE id NOT IN (SELECT building_id FROM Office_locations)"
] | List the names of buildings that have no company office. | SELECT name FROM buildings WHERE id NOT IN (SELECT building_id FROM Office_locations) | company_office |
[
"How many different industries have companies have headquarters in USA?",
"headquarters in China?",
"how about both?",
"Which ones?"
] | [
"SELECT count(distinct Industry) FROM companies where Headquarters = \"USA\"",
"SELECT count(distinct Industry) FROM companies where Headquarters = \"China\"",
"SELECT count(*) FROM (SELECT Industry FROM Companies WHERE Headquarters = \"USA\" INTERSECT SELECT Industry FROM Companies WHERE Headquarters = \"China\")",
"SELECT Industry FROM Companies WHERE Headquarters = \"USA\" INTERSECT SELECT Industry FROM Companies WHERE Headquarters = \"China\""
] | Show the industries shared by companies whose headquarters are "USA" and companies whose headquarters are "China". | SELECT Industry FROM Companies WHERE Headquarters = "USA" INTERSECT SELECT Industry FROM Companies WHERE Headquarters = "China" | company_office |
[
"What industry is each company in?",
"How many companies are in Banking industry?",
"How about in the industry Conglomerate?",
"How many in total are in either one?"
] | [
"SELECT id, industry FROM companies",
"SELECT count(*) FROM Companies WHERE Industry = \"Banking\"",
"SELECT count(*) FROM Companies WHERE Industry = \"Conglomerate\"",
"SELECT count(*) FROM Companies WHERE Industry = \"Banking\" OR Industry = \"Conglomerate\""
] | Find the number of companies whose industry is "Banking" or "Conglomerate", | SELECT count(*) FROM Companies WHERE Industry = "Banking" OR Industry = "Conglomerate" | company_office |
[
"Show all info about artists.",
"How many are there?"
] | [
"SELECT * FROM artist",
"SELECT count(*) FROM artist"
] | How many artists do we have? | SELECT count(*) FROM artist | theme_gallery |
[
"Show all info about artists",
"Can you just give me their name and age?",
"Ohh also add their country.",
"Sort them by the year they joined."
] | [
"SELECT * FROM artist",
"SELECT name , age FROM artist",
"SELECT name , age , country FROM artist",
"SELECT name , age , country FROM artist ORDER BY Year_Join"
] | Show all artist name, age, and country ordered by the year they joined. | SELECT name , age , country FROM artist ORDER BY Year_Join | theme_gallery |
[
"Show all artists.",
"What are their countries?",
"Just give me distinct ones."
] | [
"SELECT * FROM artist",
"SELECT country FROM artist",
"SELECT DISTINCT country FROM artist"
] | What are all distinct country for artists? | SELECT DISTINCT country FROM artist | theme_gallery |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.