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 |
---|---|---|---|---|
[
"What are the distinct address ids of the people?",
"Give the same for the students.",
"Give their cities of addresses too."
] | [
"SELECT DISTINCT address_id FROM people_addresses",
"SELECT DISTINCT T1.address_id FROM people_addresses AS T1 JOIN students AS T2 ON T1.person_id = T2.student_id",
"SELECT DISTINCT T1.city FROM addresses AS T1 JOIN people_addresses AS T2 ON T1.address_id = T2.address_id JOIN students AS T3 ON T2.person_id = T3.student_id"
] | Find distinct cities of address of students? | SELECT DISTINCT T1.city FROM addresses AS T1 JOIN people_addresses AS T2 ON T1.address_id = T2.address_id JOIN students AS T3 ON T2.person_id = T3.student_id | student_assessment |
[
"What are the ids of students who registered courses?",
"What about for students who also attended courses?",
"Give the ids for students who did either."
] | [
"SELECT student_id FROM student_course_registrations",
"SELECT student_id FROM student_course_registrations INTERSECT SELECT student_id FROM student_course_attendance",
"SELECT student_id FROM student_course_registrations UNION SELECT student_id FROM student_course_attendance"
] | What are the id of students who registered courses or attended courses? | SELECT student_id FROM student_course_registrations UNION SELECT student_id FROM student_course_attendance | student_assessment |
[
"Find the course ids of the courses registered by the student with id 171.",
"Find the same for the student with id 121.",
"Give also the id of courses which are attended by that student."
] | [
"SELECT course_id FROM student_course_registrations WHERE student_id = 171",
"SELECT course_id FROM student_course_registrations WHERE student_id = 121",
"SELECT course_id FROM student_course_registrations WHERE student_id = 121 UNION SELECT course_id FROM student_course_attendance WHERE student_id = 121"
] | Find the id of courses which are registered or attended by student whose id is 121? | SELECT course_id FROM student_course_registrations WHERE student_id = 121 UNION SELECT course_id FROM student_course_attendance WHERE student_id = 121 | student_assessment |
[
"How many students registered for courses?",
"Of them, how many did not attend course 301?",
"How many did not even attend any course?",
"Give all the info instead."
] | [
"SELECT count(*) FROM student_course_registrations",
"SELECT count(*) FROM student_course_registrations WHERE student_id NOT IN (SELECT student_id FROM student_course_attendance WHERE course_id = 301)",
"SELECT count(*) FROM student_course_registrations WHERE student_id NOT IN (SELECT student_id FROM student_course_attendance)",
"SELECT * FROM student_course_registrations WHERE student_id NOT IN (SELECT student_id FROM student_course_attendance)"
] | What are all info of students who registered courses but not attended courses? | SELECT * FROM student_course_registrations WHERE student_id NOT IN (SELECT student_id FROM student_course_attendance) | student_assessment |
[
"Give the registration dates of registrations for the course 305.",
"How about for the course statistics?",
"Give the student ids, ordered by the registration date."
] | [
"SELECT registration_date FROM student_course_registrations WHERE course_id = 305",
"SELECT T2.registration_date FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = \"statistics\"",
"SELECT T2.student_id FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = \"statistics\" ORDER BY T2.registration_date"
] | List the id of students who registered course statistics in the order of registration date. | SELECT T2.student_id FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "statistics" ORDER BY T2.registration_date | student_assessment |
[
"What are the names of the wrestlers?",
"Who has the most number of days held",
"Least number instead."
] | [
"SELECT name FROM wrestler",
"SELECT name FROM wrestler ORDER BY Days_held DESC LIMIT 1",
"SELECT name FROM wrestler ORDER BY Days_held ASC LIMIT 1"
] | What is the name of the wrestler with the fewest days held? | SELECT Name FROM wrestler ORDER BY Days_held ASC LIMIT 1 | wrestler |
[
"What are the teams in elimination?",
"Show the respective names of the wrestlers.",
"Order this by increasing time.",
"Decreasing instead.",
"Sort by days held in the same order."
] | [
"SELECT team FROM elimination",
"SELECT T2.Name, T1.Team FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID",
"SELECT T2.Name, T1.Team FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID ORDER BY T1.Time ASC",
"SELECT T2.Name, T1.Team FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID ORDER BY T1.Time DESC",
"SELECT T2.Name , T1.Team FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID ORDER BY T2.Days_held DESC"
] | List the names of wrestlers and the teams in elimination in descending order of days held. | SELECT T2.Name , T1.Team FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID ORDER BY T2.Days_held DESC | wrestler |
[
"Which wrestler has the largest reign?",
"Largest days held instead.",
"List the elimination move of this, not the name.",
"List the elimination time instead."
] | [
"SELECT name FROM wrestler ORDER BY Reign DESC LIMIT 1",
"SELECT name FROM wrestler ORDER BY Days_held DESC LIMIT 1",
"SELECT T1.Elimination_Move FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID ORDER BY Days_held DESC LIMIT 1",
"SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID ORDER BY T2.Days_held DESC LIMIT 1"
] | List the time of elimination of the wrestlers with largest days held. | SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID ORDER BY T2.Days_held DESC LIMIT 1 | wrestler |
[
"What are the names of the wrestlers who have more than 1 reign?",
"More than 50 days held instead.",
"Give the times of elimination only."
] | [
"SELECT name FROM wrestler WHERE reign > 1",
"SELECT name FROM wrestler WHERE Days_held > 50",
"SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID WHERE T2.Days_held > 50"
] | Show times of elimination of wrestlers with days held more than 50. | SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID WHERE T2.Days_held > 50 | wrestler |
[
"What are the teams who have suffered elimination?",
"Which ones have had only two eliminations?",
"Which ones have had more than three?"
] | [
"SELECT Team FROM elimination",
"SELECT Team FROM elimination GROUP BY Team HAVING COUNT(*) = 2",
"SELECT Team FROM elimination GROUP BY Team HAVING COUNT(*) > 3"
] | Show teams that have suffered more than three eliminations. | SELECT Team FROM elimination GROUP BY Team HAVING COUNT(*) > 3 | wrestler |
[
"Show the reigns of the wrestlers.",
"What is the least common reign?",
"Opposite?"
] | [
"SELECT Reign FROM wrestler",
"SELECT Reign FROM wrestler GROUP BY Reign ORDER BY COUNT(*) ASC LIMIT 1",
"SELECT Reign FROM wrestler GROUP BY Reign ORDER BY COUNT(*) DESC LIMIT 1"
] | Please show the most common reigns of wrestlers. | SELECT Reign FROM wrestler GROUP BY Reign ORDER BY COUNT(*) DESC LIMIT 1 | wrestler |
[
"List the events of the wrestlers.",
"Locations instead.",
"Which ones are shared by one wrestler?",
"More than two instead?"
] | [
"SELECT Event FROM wrestler",
"SELECT Location FROM wrestler",
"SELECT LOCATION FROM wrestler GROUP BY LOCATION HAVING COUNT(*) = 1",
"SELECT LOCATION FROM wrestler GROUP BY LOCATION HAVING COUNT(*) > 2"
] | List the locations that are shared by more than two wrestlers. | SELECT LOCATION FROM wrestler GROUP BY LOCATION HAVING COUNT(*) > 2 | wrestler |
[
"Show the names of the wrestlers.",
"Who has been eliminated?",
"Who hasn't been?"
] | [
"SELECT Name FROM wrestler",
"SELECT Name FROM wrestler WHERE Wrestler_ID IN (SELECT Wrestler_ID FROM elimination)",
"SELECT Name FROM wrestler WHERE Wrestler_ID NOT IN (SELECT Wrestler_ID FROM elimination)"
] | List the names of wrestlers that have not been eliminated. | SELECT Name FROM wrestler WHERE Wrestler_ID NOT IN (SELECT Wrestler_ID FROM elimination) | wrestler |
[
"Give the teams that have wrestlers eliminated by the move \"Go To Sleep\"",
"How about the ones eliminated by \"Orton\"",
"Give the ones that were also eliminated by \"Benjamin\""
] | [
"SELECT Team FROM Elimination WHERE Elimination_Move = \"Go To Sleep\"",
"SELECT Team FROM Elimination WHERE Eliminated_By = \"Orton\"",
"SELECT Team FROM Elimination WHERE Eliminated_By = \"Orton\" INTERSECT SELECT Team FROM Elimination WHERE Eliminated_By = \"Benjamin\""
] | Show the teams that have both wrestlers eliminated by "Orton" and wrestlers eliminated by "Benjamin". | SELECT Team FROM Elimination WHERE Eliminated_By = "Orton" INTERSECT SELECT Team FROM Elimination WHERE Eliminated_By = "Benjamin" | wrestler |
[
"How many residents are there total?",
"How many different properties are there?",
"Show the property id and count of residents for the property with the most residents.",
"Show this data for each property."
] | [
"SELECT count(*) FROM residents",
"SELECT count(DISTINCT property_id) FROM properties",
"SELECT T1.property_id, count(*) FROM properties AS T1 JOIN residents AS T2 ON T1.property_id = T2.property_id GROUP BY T1.property_id ORDER BY count(*) DESC LIMIT 1",
"SELECT T1.property_id , count(*) FROM properties AS T1 JOIN residents AS T2 ON T1.property_id = T2.property_id GROUP BY T1.property_id"
] | How many residents does each property have? List property id and resident count. | SELECT T1.property_id , count(*) FROM properties AS T1 JOIN residents AS T2 ON T1.property_id = T2.property_id GROUP BY T1.property_id | local_govt_and_lot |
[
"What is the id of the parent organization to the 'Robel-Schulist Group'?",
"What is the detail of this organization id?",
"What are the distinct service types that are provided by the organization which has detail 'Denesik and Sons Party'?"
] | [
"SELECT parent_organization_id FROM organizations WHERE organization_details = 'Robel-Schulist Group'",
"SELECT organization_details FROM organizations WHERE organization_id = (SELECT parent_organization_id FROM organizations WHERE organization_details = 'Robel-Schulist Group')",
"SELECT DISTINCT T1.service_type_code FROM services AS T1 JOIN organizations AS T2 ON T1.organization_id = T2.organization_id WHERE T2.organization_details = 'Denesik and Sons Party'"
] | What is the distinct service types that are provided by the organization which has detail 'Denesik and Sons Party'? | SELECT DISTINCT T1.service_type_code FROM services AS T1 JOIN organizations AS T2 ON T1.organization_id = T2.organization_id WHERE T2.organization_details = 'Denesik and Sons Party' | local_govt_and_lot |
[
"How many residential services were requested?",
"How about for each resident?",
"Also show the other details for each resident.",
"Order the previous table in descending order of the number of requests."
] | [
"SELECT count(*) FROM residents_services",
"SELECT t1.resident_id , count(*) FROM residents AS t1 JOIN residents_services AS t2 ON t1.resident_id = t2.resident_id GROUP BY t1.resident_id",
"SELECT t1.resident_id , t1.other_details , count(*) FROM residents AS t1 JOIN residents_services AS t2 ON t1.resident_id = t2.resident_id GROUP BY t1.resident_id",
"SELECT t1.resident_id , t1.other_details , count(*) FROM residents AS t1 JOIN residents_services AS t2 ON t1.resident_id = t2.resident_id GROUP BY t1.resident_id ORDER BY count(*) DESC"
] | How many services has each resident requested? List the resident id, details, and the count in descending order of the count. | SELECT t1.resident_id , t1.other_details , count(*) FROM residents AS t1 JOIN residents_services AS t2 ON t1.resident_id = t2.resident_id GROUP BY t1.resident_id ORDER BY count(*) DESC | local_govt_and_lot |
[
"Show the ID numbers for all the different services that are available.",
"How many times has a resident service of the type 'Moving Out' been provided?",
"Which services have not been provided, if any?",
"What is the most number of times any particular service was provided?",
"What service was it? Show the service_id and service_details."
] | [
"SELECT DISTINCT service_id FROM services",
"SELECT count(*) FROM services AS t1 JOIN residents_services AS t2 ON t1.service_id = t2.service_id WHERE service_type_code = 'Moving Out'",
"SELECT count(*) FROM services WHERE service_id NOT IN (SELECT DISTINCT t1.service_id FROM services AS t1 JOIN residents_services AS T2 ON t1.service_id = t2.service_id)",
"SELECT count(*) FROM Services AS T1 JOIN Residents_Services AS T2 ON T1.service_id = T2.service_id GROUP BY T1.service_id ORDER BY count(*) DESC LIMIT 1",
"SELECT T1.service_id , T1.service_details , count(*) FROM Services AS T1 JOIN Residents_Services AS T2 ON T1.service_id = T2.service_id GROUP BY T1.service_id ORDER BY count(*) DESC LIMIT 1"
] | What is the maximum number that a certain service is provided? List the service id, details and number. | SELECT T1.service_id , T1.service_details , count(*) FROM Services AS T1 JOIN Residents_Services AS T2 ON T1.service_id = T2.service_id GROUP BY T1.service_id ORDER BY count(*) DESC LIMIT 1 | local_govt_and_lot |
[
"Show the customer id numbers for those who have events.",
"How about those with at least 3?",
"Also show customer details."
] | [
"SELECT t1.customer_id FROM customers AS t1 JOIN customer_events AS t2 ON t1.customer_id = t2.customer_id",
"SELECT t1.customer_id FROM Customers AS t1 JOIN Customer_Events AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_id HAVING count(*) >= 3",
"SELECT t1.customer_id , t1.customer_details FROM Customers AS t1 JOIN Customer_Events AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_id HAVING count(*) >= 3"
] | What are the id and details of the customers who have at least 3 events? | SELECT T1.customer_id , T1.customer_details FROM Customers AS T1 JOIN Customer_Events AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING count(*) >= 3 | local_govt_and_lot |
[
"Show any customer event id numbers that have corresponding notes.",
"How many appear have more than 5 notes?",
"How about between 1 and 3 notes? Also show property id."
] | [
"SELECT t1.customer_event_id FROM customer_events AS t1 JOIN customer_event_notes AS t2 ON t1.customer_event_id = t2.customer_event_id",
"SELECT t1.customer_event_id FROM customer_events AS t1 JOIN customer_event_notes AS t2 ON t1.customer_event_id = t2.customer_event_id GROUP BY t1.customer_event_id HAVING count(*) > 5",
"SELECT T1.Customer_Event_ID , T1.property_id FROM Customer_Events AS T1 JOIN Customer_Event_Notes AS T2 ON T1.Customer_Event_ID = T2.Customer_Event_ID GROUP BY T1.customer_event_id HAVING count(*) BETWEEN 1 AND 3"
] | Which events have the number of notes between one and three? List the event id and the property id. | SELECT T1.Customer_Event_ID , T1.property_id FROM Customer_Events AS T1 JOIN Customer_Event_Notes AS T2 ON T1.Customer_Event_ID = T2.Customer_Event_ID GROUP BY T1.customer_event_id HAVING count(*) BETWEEN 1 AND 3 | local_govt_and_lot |
[
"What is the earliest status record date?",
"Which things have a status record before the date '2017-06-19 02:59:21'?",
"Also show the things that have the status 'Close'.",
"Show the distinct ids and also the type of thing."
] | [
"SELECT min(Date_and_Date) FROM Timed_Status_of_Things",
"SELECT * FROM Timed_Status_of_Things WHERE Date_and_Date < '2017-06-19 02:59:21'",
"SELECT * FROM Timed_Status_of_Things WHERE Status_of_Thing_Code = 'Close' OR Date_and_Date < '2017-06-19 02:59:21'",
"SELECT DISTINCT t2.thing_id , t2.Type_of_Thing_Code FROM Timed_Status_of_Things AS t1 JOIN Things AS t2 ON t1.thing_id = t2.thing_id WHERE t1.Status_of_Thing_Code = 'Close' OR t1.Date_and_Date < '2017-06-19 02:59:21'"
] | What are the distinct id and type of the thing that has the status 'Close' or has a status record before the date '2017-06-19 02:59:21' | SELECT DISTINCT T2.thing_id , T2.Type_of_Thing_Code FROM Timed_Status_of_Things AS T1 JOIN Things AS T2 ON T1.thing_id = T2.thing_id WHERE T1.Status_of_Thing_Code = 'Close' OR T1.Date_and_Date < '2017-06-19 02:59:21' | local_govt_and_lot |
[
"What are all the different types of service details for things?",
"How many of each?",
"Show only the things with the detail being 'Unsatisfied'.",
"At how many distinct locations have they been located?"
] | [
"SELECT DISTINCT service_details FROM things",
"SELECT count(*), service_details FROM things GROUP BY service_details",
"SELECT * FROM things WHERE service_details = 'Unsatisfied'",
"SELECT count(DISTINCT T2.Location_Code) FROM Things AS T1 JOIN Timed_Locations_of_Things AS T2 ON T1.thing_id = T2.thing_id WHERE T1.service_details = 'Unsatisfied'"
] | How many distinct locations have the things with service detail 'Unsatisfied' been located in? | SELECT count(DISTINCT T2.Location_Code) FROM Things AS T1 JOIN Timed_Locations_of_Things AS T2 ON T1.thing_id = T2.thing_id WHERE T1.service_details = 'Unsatisfied' | local_govt_and_lot |
[
"What are all the different parent organization ids?",
"How many organizations are their own parent?",
"Which organizations are not a parent to any others?"
] | [
"SELECT DISTINCT parent_organization_id FROM organizations",
"SELECT count(*) FROM organizations WHERE parent_organization_id = organization_id",
"SELECT organization_id FROM organizations EXCEPT SELECT parent_organization_id FROM organizations"
] | Which organizations are not a parent organization of others? List the organization id. | SELECT organization_id FROM organizations EXCEPT SELECT parent_organization_id FROM organizations | local_govt_and_lot |
[
"Order the resident list alphabetically by other details.",
"How many residents have the title of 'Prof'?",
"Alright, what about 'Miss'?"
] | [
"SELECT * FROM residents ORDER BY other_details",
"SELECT count(*) FROM residents WHERE other_details LIKE '%Prof.%'",
"SELECT other_details FROM residents WHERE other_details LIKE '%Miss%'"
] | What are the resident details containing the substring 'Miss'? | SELECT other_details FROM Residents WHERE other_details LIKE '%Miss%' | local_govt_and_lot |
[
"What are the different attribute data types?",
"How many attributes are of each type?",
"What datatypes have more than 1?",
"How about more than 3?"
] | [
"SELECT distinct attribute_data_type FROM Attribute_Definitions",
"SELECT attribute_data_type, count(*) FROM Attribute_Definitions GROUP BY attribute_data_type",
"SELECT attribute_data_type FROM Attribute_Definitions GROUP BY attribute_data_type HAVING count(*) > 1",
"SELECT attribute_data_type FROM Attribute_Definitions GROUP BY attribute_data_type HAVING count(*) > 3"
] | Find the list of attribute data types possessed by more than 3 attribute definitions. | SELECT attribute_data_type FROM Attribute_Definitions GROUP BY attribute_data_type HAVING count(*) > 3 | product_catalog |
[
"How many different catalog publishers are there?",
"How many have a name that contaSELECT count(distinct(catalog_publisher)) FROM catalogs WHERE catalog_publisher LIKE \"%Murray%\"ins \"Murray\"",
"Which ones?"
] | [
"SELECT count(distinct catalog_publisher) FROM catalogs",
"SELECT count(distinct catalog_publisher) FROM catalogs WHERE catalog_publisher LIKE \"%Murray%\"",
"SELECT distinct(catalog_publisher) FROM catalogs WHERE catalog_publisher LIKE \"%Murray%\""
] | Find all the catalog publishers whose name contains "Murray" | SELECT distinct(catalog_publisher) FROM catalogs WHERE catalog_publisher LIKE "%Murray%" | product_catalog |
[
"List all the catalog ids and their respective catalog publisher?",
"How many catalogs have each publisher published?",
"Which publisher has the least?",
"How about the most?"
] | [
"SELECT catalog_id, catalog_publisher FROM catalogs",
"SELECT catalog_publisher, count(*) FROM catalogs GROUP BY catalog_publisher",
"SELECT catalog_publisher FROM catalogs GROUP BY catalog_publisher ORDER BY count(*) ASC LIMIT 1",
"SELECT catalog_publisher FROM catalogs GROUP BY catalog_publisher ORDER BY count(*) DESC LIMIT 1"
] | Which catalog publisher has published the most catalogs? | SELECT catalog_publisher FROM catalogs GROUP BY catalog_publisher ORDER BY count(*) DESC LIMIT 1 | product_catalog |
[
"Show all the catalog information and their respective levels numbers!",
"Show me only those with a level number greater than five.",
"Show me just the names of these catalogs?",
"Also show their publication dates."
] | [
"SELECT * FROM catalogs AS t1 JOIN catalog_structure AS t2 ON t1.catalog_id = t2.catalog_id",
"SELECT * FROM catalogs AS t1 JOIN catalog_structure AS t2 ON t1.catalog_id = t2.catalog_id WHERE catalog_level_number > 5",
"SELECT t1.catalog_name FROM catalogs AS t1 JOIN catalog_structure AS t2 ON t1.catalog_id = t2.catalog_id WHERE catalog_level_number > 5",
"SELECT t1.catalog_name , t1.date_of_publication FROM catalogs AS t1 JOIN catalog_structure AS t2 ON t1.catalog_id = t2.catalog_id WHERE catalog_level_number > 5"
] | Find the names and publication dates of all catalogs that have catalog level number greater than 5. | SELECT t1.catalog_name , t1.date_of_publication FROM catalogs AS t1 JOIN catalog_structure AS t2 ON t1.catalog_id = t2.catalog_id WHERE catalog_level_number > 5 | product_catalog |
[
"How many different attributes are there?",
"What is the id of the one that is used in the most catalog content entries?",
"Which catalog content entries use this attribute value?",
"Show me just their catalog entry names?"
] | [
"SELECT count(*) FROM attribute_definitions",
"SELECT attribute_id FROM Catalog_Contents_Additional_Attributes GROUP BY attribute_id ORDER BY count(*) DESC LIMIT 1",
"SELECT * FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.attribute_id = (SELECT attribute_id FROM Catalog_Contents_Additional_Attributes GROUP BY attribute_id ORDER BY count(*) DESC LIMIT 1)",
"SELECT t1.catalog_entry_name FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.attribute_id = (SELECT attribute_id FROM Catalog_Contents_Additional_Attributes GROUP BY attribute_id ORDER BY count(*) DESC LIMIT 1)"
] | What are the entry names of catalog with the attribute possessed by most entries. | SELECT t1.catalog_entry_name FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.attribute_value = (SELECT attribute_value FROM Catalog_Contents_Additional_Attributes GROUP BY attribute_value ORDER BY count(*) DESC LIMIT 1) | product_catalog |
[
"What are prices of each catalog entry id?",
"Show me only the prices in USD!",
"Which are the contents of the catalog with the highest one?",
"What is its entry name?"
] | [
"SELECT catalog_entry_id, price_in_dollars, price_in_euros, price_in_pounds FROM catalog_contents",
"SELECT catalog_entry_id, price_in_dollars FROM catalog_contents",
"SELECT * FROM catalog_contents ORDER BY price_in_dollars DESC LIMIT 1",
"SELECT catalog_entry_name FROM catalog_contents ORDER BY price_in_dollars DESC LIMIT 1"
] | What is the entry name of the most expensive catalog (in USD)? | SELECT catalog_entry_name FROM catalog_contents ORDER BY price_in_dollars DESC LIMIT 1 | product_catalog |
[
"What are the prices of each catalog in USD?",
"What is the one with the highest price?",
"How about the lowest?",
"What is its catalog level name?"
] | [
"SELECT catalog_entry_id, price_in_dollars FROM catalog_contents",
"SELECT * FROM catalog_contents AS t1 JOIN catalog_structure AS t2 ON t1.catalog_level_number = t2.catalog_level_number ORDER BY t1.price_in_dollars DESC LIMIT 1",
"SELECT * FROM catalog_contents AS t1 JOIN catalog_structure AS t2 ON t1.catalog_level_number = t2.catalog_level_number ORDER BY t1.price_in_dollars LIMIT 1",
"SELECT t2.catalog_level_name FROM catalog_contents AS t1 JOIN catalog_structure AS t2 ON t1.catalog_level_number = t2.catalog_level_number ORDER BY t1.price_in_dollars LIMIT 1"
] | What is the level name of the cheapest catalog (in USD)? | SELECT t2.catalog_level_name FROM catalog_contents AS t1 JOIN catalog_structure AS t2 ON t1.catalog_level_number = t2.catalog_level_number ORDER BY t1.price_in_dollars LIMIT 1 | product_catalog |
[
"What are all the catalog entry names?",
"What are the prices in euros of each?",
"Show me the average price in euros!",
"Also provide the lowest price!"
] | [
"SELECT catalog_entry_name FROM catalog_contents",
"SELECT catalog_entry_name, price_in_euros FROM catalog_contents",
"SELECT avg(price_in_euros) FROM catalog_contents",
"SELECT avg(price_in_euros) , min(price_in_euros) FROM catalog_contents"
] | What are the average and minimum price (in Euro) of all products? | SELECT avg(price_in_euros) , min(price_in_euros) FROM catalog_contents | product_catalog |
[
"Show the name, length, height, and width of every catalog product.",
"Can you show me the list sorted on width FROM greatest to least!",
"How about based on height!",
"Show me the entry_name of just the first row!"
] | [
"SELECT catalog_entry_name, height, width, length FROM catalog_contents",
"SELECT catalog_entry_name, height, width, length FROM catalog_contents ORDER BY width DESC",
"SELECT catalog_entry_name, height, width, length FROM catalog_contents ORDER BY height DESC",
"SELECT catalog_entry_name FROM catalog_contents ORDER BY height DESC LIMIT 1"
] | What is the product with the highest height? Give me the catalog entry name. | SELECT catalog_entry_name FROM catalog_contents ORDER BY height DESC LIMIT 1 | product_catalog |
[
"What are the distinct capacity each catalog can have?",
"Which one is the most common?",
"Which one is the smallest?",
"What is the name of a catalog product that has this?"
] | [
"SELECT distinct capacity FROM catalog_contents",
"SELECT capacity FROM catalog_contents group by capacity order by count(*) DESC LIMIT 1",
"SELECT capacity FROM catalog_contents ORDER BY capacity ASC LIMIT 1",
"SELECT catalog_entry_name FROM catalog_contents ORDER BY capacity ASC LIMIT 1"
] | Find the name of the product that has the smallest capacity. | SELECT catalog_entry_name FROM catalog_contents ORDER BY capacity ASC LIMIT 1 | product_catalog |
[
"What are all the names of all the catalog products?",
"Could you also show me their product stock numbers?!",
"How many have stock number that starts with \"2\"?",
"What are their names?"
] | [
"SELECT catalog_entry_name FROM catalog_contents",
"SELECT catalog_entry_name, product_stock_number FROM catalog_contents",
"SELECT count(*) FROM catalog_contents WHERE product_stock_number LIKE \"2%\"",
"SELECT catalog_entry_name FROM catalog_contents WHERE product_stock_number LIKE \"2%\""
] | Find the names of all the products whose stock number starts with "2". | SELECT catalog_entry_name FROM catalog_contents WHERE product_stock_number LIKE "2%" | product_catalog |
[
"Show me each catalog entry id and their catalog level numbers.",
"Which ones have more than one catalog level number?",
"Which ones have a catalog level number of 8?",
"Show me the entry names of each!"
] | [
"SELECT catalog_entry_id, catalog_level_number FROM Catalog_Contents_Additional_Attributes",
"SELECT catalog_entry_id, catalog_level_number FROM Catalog_Contents_Additional_Attributes group by catalog_entry_id having count (distinct catalog_level_number) > 1",
"SELECT catalog_entry_id, catalog_level_number FROM Catalog_Contents_Additional_Attributes WHERE catalog_level_number = \"8\"",
"SELECT t1.catalog_entry_name FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.catalog_level_number = \"8\""
] | Find the names of catalog entries with level number 8. | SELECT t1.catalog_entry_name FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.catalog_level_number = "8" | product_catalog |
[
"What catalog products have a length smaller than 3?",
"Show me their names!",
"Also include those with a height that are greater than 5!"
] | [
"SELECT * FROM catalog_contents WHERE LENGTH < 3",
"SELECT catalog_entry_name FROM catalog_contents WHERE LENGTH < 3",
"SELECT catalog_entry_name FROM catalog_contents WHERE LENGTH < 3 OR height > 5"
] | Find the names of the products with length smaller than 3 or height greater than 5. | SELECT catalog_entry_name FROM catalog_contents WHERE LENGTH < 3 OR width > 5 | product_catalog |
[
"For each catalog id, show the attribute ids and values!!",
"Show me just those that a value of 1!",
"Actually, how about those with a value of 0?",
"What are the just the names and attribute IDs of each?"
] | [
"SELECT attribute_id, attribute_value FROM Catalog_Contents_Additional_Attributes",
"SELECT attribute_id, attribute_value FROM Catalog_Contents_Additional_Attributes WHERE attribute_value = 1",
"SELECT attribute_id, attribute_value FROM Catalog_Contents_Additional_Attributes WHERE attribute_value = 0",
"SELECT t1.attribute_name , t1.attribute_id FROM Attribute_Definitions AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.attribute_id = t2.attribute_id WHERE t2.attribute_value = 0"
] | Find the name and attribute ID of the attribute definitions with attribute value 0. | SELECT t1.attribute_name , t1.attribute_id FROM Attribute_Definitions AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.attribute_id = t2.attribute_id WHERE t2.attribute_value = 0 | product_catalog |
[
"What festivals are there?",
"What is the audience size for each of these festivals?",
"Which of these festivals has the largest audience?",
"Where is this festival located?"
] | [
"SELECT festival_name FROM festival_detail",
"SELECT festival_name, num_of_audience FROM festival_detail",
"SELECT festival_name FROM festival_detail WHERE num_of_audience = (SELECT max(num_of_audience)from festival_detail)",
"SELECT LOCATION FROM festival_detail ORDER BY Num_of_Audience DESC LIMIT 1"
] | What is the location of the festival with the largest number of audience? | SELECT LOCATION FROM festival_detail ORDER BY Num_of_Audience DESC LIMIT 1 | entertainment_awards |
[
"Tell me the names of all the festivals available.",
"When did these festivals occur?",
"Which one of these festivals occurred most recently?",
"Ok, what about the top three most recent ones?"
] | [
"SELECT festival_name FROM festival_detail",
"SELECT festival_name, year FROM festival_detail",
"SELECT festival_name FROM festival_detail ORDER BY year DESC LIMIT 1",
"SELECT Festival_Name FROM festival_detail ORDER BY YEAR DESC LIMIT 3"
] | Show the names of the three most recent festivals. | SELECT Festival_Name FROM festival_detail ORDER BY YEAR DESC LIMIT 3 | entertainment_awards |
[
"Show me the names of the artworks.",
"Can you also tell me the types of these artworks?",
"Which of these artworks were nominated in some festival?",
"What were the names of these festivals?"
] | [
"SELECT name FROM artwork",
"SELECT name, type FROM artwork",
"SELECT t1.name FROM artwork as t1 JOIN nomination AS t2 ON t1.artwork_id = t2.artwork_id JOIN festival_detail AS t3 ON t2.festival_id = t3.festival_id",
"SELECT T2.Name , T3.Festival_Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID"
] | For each nomination, show the name of the artwork and name of the festival where it is nominated. | SELECT T2.Name , T3.Festival_Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID | entertainment_awards |
[
"Tell me about the names of all the artworks.",
"What are the types of all these artworks?",
"Which of these were nominated?",
"Which of these were nominated in 2007?"
] | [
"SELECT name FROM artwork",
"SELECT DISTINCT type FROM artwork",
"SELECT DISTINCT t1.type FROM artwork as t1 JOIN nomination AS t2 ON t1.artwork_id = t2.artwork_id JOIN festival_detail AS t3 ON t2.festival_id = t3.festival_id",
"SELECT DISTINCT T2.Type FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID WHERE T3.Year = 2007"
] | Show distinct types of artworks that are nominated in festivals in 2007. | SELECT DISTINCT T2.Type FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID WHERE T3.Year = 2007 | entertainment_awards |
[
"List the names of all the artworks.",
"At which festivals were these artworks nominated?",
"What year were these artworks nominated?",
"Can you list them in ascending order?"
] | [
"SELECT name FROM artwork",
"SELECT t1.name, t3.festival_name FROM artwork as t1 JOIN nomination AS t2 ON t1.artwork_id = t2.artwork_id JOIN festival_detail AS t3 ON t2.festival_id = t3.festival_id",
"SELECT t1.name, t3.year FROM artwork as t1 JOIN nomination AS t2 ON t1.artwork_id = t2.artwork_id JOIN festival_detail AS t3 ON t2.festival_id = t3.festival_id",
"SELECT T2.Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID ORDER BY T3.Year"
] | Show the names of artworks in ascending order of the year they are nominated in. | SELECT T2.Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID ORDER BY T3.Year | entertainment_awards |
[
"What are the names of all the festivals?",
"What are the nominated artworks of these festivals?",
"Show the types of these artworks given these festivals.",
"Which of these festivals have type \"Program Talent Show\"?"
] | [
"SELECT festival_name FROM festival_detail",
"SELECT t3.festival_name, t1.name FROM artwork as t1 JOIN nomination AS t2 ON t1.artwork_id = t2.artwork_id JOIN festival_detail AS t3 ON t2.festival_id = t3.festival_id",
"SELECT t3.festival_name, t1.type FROM artwork as t1 JOIN nomination AS t2 ON t1.artwork_id = t2.artwork_id JOIN festival_detail AS t3 ON t2.festival_id = t3.festival_id",
"SELECT T3.Festival_Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID WHERE T2.Type = \"Program Talent Show\""
] | Show the names of festivals that have nominated artworks of type "Program Talent Show". | SELECT T3.Festival_Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID WHERE T2.Type = "Program Talent Show" | entertainment_awards |
[
"List the names of the festivals.",
"Show me the names of the nominated artworks for the festivals listed.",
"Which of these festivals have at least two nominations for artworks?",
"Show me their ids as well."
] | [
"SELECT festival_name FROM festival_detail",
"SELECT t3.festival_name, t1.name FROM artwork as t1 JOIN nomination AS t2 ON t1.artwork_id = t2.artwork_id JOIN festival_detail AS t3 ON t2.festival_id = t3.festival_id",
"SELECT t3.festival_name FROM artwork as t1 JOIN nomination AS t2 ON t1.artwork_id = t2.artwork_id JOIN festival_detail AS t3 ON t2.festival_id = t3.festival_id GROUP BY t3.festival_id HAVING count(*) >= 2",
"SELECT T1.Festival_ID , T3.Festival_Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID GROUP BY T1.Festival_ID HAVING COUNT(*) >= 2"
] | Show the ids and names of festivals that have at least two nominations for artworks. | SELECT T1.Festival_ID , T3.Festival_Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID GROUP BY T1.Festival_ID HAVING COUNT(*) >= 2 | entertainment_awards |
[
"Show me the ids of the festivals.",
"Show me the names as well.",
"Add in the artworks nominated as well.",
"Instead of showing the artworks nominated, show me the number of nominated artworks for each of these festivals."
] | [
"SELECT festival_id FROM festival_detail",
"SELECT festival_id, festival_name FROM festival_detail",
"SELECT t3.festival_id, t3.festival_name, t1.name FROM artwork as t1 JOIN nomination AS t2 ON t1.artwork_id = t2.artwork_id JOIN festival_detail AS t3 ON t2.festival_id = t3.festival_id",
"SELECT T1.Festival_ID , T3.Festival_Name , COUNT(*) FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID GROUP BY T1.Festival_ID"
] | Show the id, name of each festival and the number of artworks it has nominated. | SELECT T1.Festival_ID , T3.Festival_Name , COUNT(*) FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID GROUP BY T1.Festival_ID | entertainment_awards |
[
"Show me the names of all the artworks.",
"Show me their types as well.",
"What is the number of artworks for each type?",
"Which of these types is the most common?"
] | [
"SELECT name FROM artwork",
"SELECT name, type FROM artwork",
"SELECT type, count(*) FROM artwork GROUP BY type",
"SELECT TYPE FROM artwork GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1"
] | List the most common type of artworks. | SELECT TYPE FROM artwork GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1 | entertainment_awards |
[
"Show all the names of all the festivals.",
"Show me the corresponding year for these festivals.",
"What were the amount of festivals for each of these years?",
"Which of these years has more than one festival?"
] | [
"SELECT festival_name FROM festival_detail",
"SELECT festival_name, year FROM festival_detail",
"SELECT year, count(*) FROM festival_detail GROUP BY Year",
"SELECT YEAR FROM festival_detail GROUP BY YEAR HAVING COUNT(*) > 1"
] | List the year in which there are more than one festivals. | SELECT YEAR FROM festival_detail GROUP BY YEAR HAVING COUNT(*) > 1 | entertainment_awards |
[
"Tell me everything about all the artworks.",
"List only the names of all these artworks.",
"Which of these were nominated?",
"Which of those weren't?"
] | [
"SELECT * FROM artwork",
"SELECT name FROM artwork",
"SELECT t1.name FROM artwork as t1 JOIN nomination AS t2 ON t1.artwork_id = t2.artwork_id JOIN festival_detail AS t3 ON t2.festival_id = t3.festival_id",
"SELECT Name FROM Artwork WHERE Artwork_ID NOT IN (SELECT Artwork_ID FROM nomination)"
] | List the name of artworks that are not nominated. | SELECT Name FROM Artwork WHERE Artwork_ID NOT IN (SELECT Artwork_ID FROM nomination) | entertainment_awards |
[
"Show me the names of all the festivals.",
"Show the year for each of them.",
"Can you only show the audience size for year 2008?",
"Can you only show the audience sizes for year 2008 and 2010?"
] | [
"SELECT festival_name FROM festival_detail",
"SELECT festival_name, year FROM festival_detail",
"SELECT Num_of_Audience FROM festival_detail WHERE YEAR = 2008",
"SELECT Num_of_Audience FROM festival_detail WHERE YEAR = 2008 OR YEAR = 2010"
] | Show the number of audience in year 2008 or 2010. | SELECT Num_of_Audience FROM festival_detail WHERE YEAR = 2008 OR YEAR = 2010 | entertainment_awards |
[
"Show me the mobile number of the student Emma Rohan.",
"What about her email?"
] | [
"SELECT cell_mobile_number FROM Students WHERE first_name = \"Emma\" AND last_name = \"Rohan\"",
"SELECT email_address FROM Students WHERE first_name = \"Emma\" AND last_name = \"Rohan\""
] | What is the email of the student with first name "Emma" and last name "Rohan"? | SELECT email_address FROM Students WHERE first_name = "Emma" AND last_name = "Rohan" | behavior_monitoring |
[
"Show me the names of all students.",
"What are their monthly rentals?",
"Show me the maximum and minimum of them."
] | [
"SELECT first_name, last_name FROM Students",
"SELECT t1.first_name, t1.last_name, t2.monthly_rental FROM Students as t1 JOIN Student_Addresses as t2 on t1.student_id = t2.student_id",
"SELECT max(monthly_rental) , min(monthly_rental) FROM Student_Addresses"
] | Find the maximum and minimum monthly rental for all student addresses. | SELECT max(monthly_rental) , min(monthly_rental) FROM Student_Addresses | behavior_monitoring |
[
"Show me the name of all teachers.",
"What are their mobile numbers?",
"What about email addresses?",
"Which ones contain the word \"man\"?",
"Show me the first name only."
] | [
"SELECT first_name, last_name FROM Teachers",
"SELECT first_name,last_name,cell_mobile_number FROM Teachers",
"SELECT first_name,last_name,email_address FROM Teachers",
"SELECT first_name,last_name,email_address FROM Teachers WHERE email_address LIKE '%man%'",
"SELECT first_name FROM Teachers WHERE email_address LIKE '%man%'"
] | Find the first names of teachers whose email address contains the word "man". | SELECT first_name FROM Teachers WHERE email_address LIKE '%man%' | behavior_monitoring |
[
"How many assessment notes are there?",
"How many does each student have?",
"Give me the id and first name of the student with the largest number of them."
] | [
"SELECT count(*) FROM Assessment_Notes",
"SELECT student_id, count(*) FROM Assessment_Notes GROUP BY student_id",
"SELECT T1.student_id , T2.first_name FROM Assessment_Notes AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1"
] | Find the id and first name of the student that has the most number of assessment notes? | SELECT T1.student_id , T2.first_name FROM Assessment_Notes AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1 | behavior_monitoring |
[
"How many assessment notes are there?",
"How many does each teacher have?",
"List them in the descending order of number of assessment notes.",
"Show me the ids and first name of the top 3 teachers."
] | [
"SELECT count(*) FROM Assessment_Notes",
"SELECT teacher_id, count(*) FROM Assessment_Notes GROUP BY teacher_id",
"SELECT teacher_id, count(*) FROM Assessment_Notes GROUP BY teacher_id ORDER BY count(*) DESC",
"SELECT T1.teacher_id , T2.first_name FROM Assessment_Notes AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id GROUP BY T1.teacher_id ORDER BY count(*) DESC LIMIT 3"
] | Find the ids and first names of the 3 teachers that have the most number of assessment notes? | SELECT T1.teacher_id , T2.first_name FROM Assessment_Notes AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id GROUP BY T1.teacher_id ORDER BY count(*) DESC LIMIT 3 | behavior_monitoring |
[
"What behavior incident types are there?",
"How many behavior incidents are there?",
"How many does each student have?",
"Show me the id and last name of the one with the largest number."
] | [
"SELECT incident_type_code FROM Behavior_Incident GROUP BY incident_type_code",
"SELECT count(*) FROM Behavior_Incident",
"SELECT student_id, count(*) FROM Behavior_Incident GROUP BY student_id",
"SELECT T1.student_id , T2.last_name FROM Behavior_Incident AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1"
] | Find the id and last name of the student that has the most behavior incidents? | SELECT T1.student_id , T2.last_name FROM Behavior_Incident AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1 | behavior_monitoring |
[
"How many detentions are there?",
"What about detentions with type code \"AFTER\"?",
"How many does each teacher have?",
"Give me the id and last name of the teacher with the largest number."
] | [
"SELECT count(*) FROM Detention",
"SELECT count(*) FROM Detention WHERE detention_type_code = \"AFTER\"",
"SELECT T1.teacher_id , T2.last_name, count(*) FROM Detention AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id WHERE T1.detention_type_code = \"AFTER\" GROUP BY T1.teacher_id",
"SELECT T1.teacher_id , T2.last_name FROM Detention AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id WHERE T1.detention_type_code = \"AFTER\" GROUP BY T1.teacher_id ORDER BY count(*) DESC LIMIT 1"
] | Find the id and last name of the teacher that has the most detentions with detention type code "AFTER"? | SELECT T1.teacher_id , T2.last_name FROM Detention AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id WHERE T1.detention_type_code = "AFTER" GROUP BY T1.teacher_id ORDER BY count(*) DESC LIMIT 1 | behavior_monitoring |
[
"Show me the first name of all students.",
"What are their monthly rentals?",
"What about each student's average rentals across different address?",
"Give me the id and first name of the student with the highest of them."
] | [
"SELECT first_name FROM Students",
"SELECT t1.first_name, t2.monthly_rental FROM Students as t1 JOIN Student_Addresses as t2 on t1.student_id = t2.student_id",
"SELECT T2.first_name , AVG(T1.monthly_rental) FROM Student_Addresses AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T2.first_name",
"SELECT T1.student_id , T2.first_name FROM Student_Addresses AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY AVG(monthly_rental) DESC LIMIT 1"
] | What are the id and first name of the student whose addresses have the highest average monthly rental? | SELECT T1.student_id , T2.first_name FROM Student_Addresses AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY AVG(monthly_rental) DESC LIMIT 1 | behavior_monitoring |
[
"Show me all the monthly rentals from student addresses.",
"Give me the average monthly rental in terms of each address.",
"Show me their cities.",
"Give me the id and city of the one with largest average monthly rental."
] | [
"SELECT monthly_rental FROM Student_Addresses",
"SELECT address_id, AVG(monthly_rental) FROM Student_Addresses GROUP BY address_id",
"SELECT T1.city,T2.address_id , AVG(T2.monthly_rental) FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id GROUP BY T2.address_id",
"SELECT T2.address_id , T1.city FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id GROUP BY T2.address_id ORDER BY AVG(monthly_rental) DESC LIMIT 1"
] | Find the id and city of the student address with the highest average monthly rental. | SELECT T2.address_id , T1.city FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id GROUP BY T2.address_id ORDER BY AVG(monthly_rental) DESC LIMIT 1 | behavior_monitoring |
[
"What behavior incident types are there?",
"How many behavior incidents are there in terms of each type?",
"Show me the code and description of the most frequent one of them."
] | [
"SELECT incident_type_code FROM Behavior_Incident GROUP BY incident_type_code",
"SELECT incident_type_code,count(*) FROM Behavior_Incident GROUP BY incident_type_code",
"SELECT T1.incident_type_code , T2.incident_type_description FROM Behavior_Incident AS T1 JOIN Ref_Incident_Type AS T2 ON T1.incident_type_code = T2.incident_type_code GROUP BY T1.incident_type_code ORDER BY count(*) DESC LIMIT 1"
] | What are the code and description of the most frequent behavior incident type? | SELECT T1.incident_type_code , T2.incident_type_description FROM Behavior_Incident AS T1 JOIN Ref_Incident_Type AS T2 ON T1.incident_type_code = T2.incident_type_code GROUP BY T1.incident_type_code ORDER BY count(*) DESC LIMIT 1 | behavior_monitoring |
[
"What detention types are there?",
"How many detentions are there in terms of each type?",
"Show me the code and description of the least frequent one of them."
] | [
"SELECT detention_type_code FROM Detention GROUP BY detention_type_code",
"SELECT detention_type_code, count(*) FROM Detention GROUP BY detention_type_code",
"SELECT T1.detention_type_code , T2.detention_type_description FROM Detention AS T1 JOIN Ref_Detention_Type AS T2 ON T1.detention_type_code = T2.detention_type_code GROUP BY T1.detention_type_code ORDER BY count(*) ASC LIMIT 1"
] | What are the code and description of the least frequent detention type ? | SELECT T1.detention_type_code , T2.detention_type_description FROM Detention AS T1 JOIN Ref_Detention_Type AS T2 ON T1.detention_type_code = T2.detention_type_code GROUP BY T1.detention_type_code ORDER BY count(*) ASC LIMIT 1 | behavior_monitoring |
[
"How many assessment notes are there?",
"Show me the first name of students that had assessment notes in record.",
"When did Fanny have assessment nodes?"
] | [
"SELECT count(*) FROM Assessment_Notes",
"SELECT T2.first_name FROM Assessment_Notes AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id",
"SELECT T1.date_of_notes FROM Assessment_Notes AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.first_name = \"Fanny\""
] | Find the dates of assessment notes for students with first name "Fanny". | SELECT T1.date_of_notes FROM Assessment_Notes AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.first_name = "Fanny" | behavior_monitoring |
[
"How many assessment notes are there?",
"Show me the last name of teachers that had assessment notes in record.",
"Give me the texts of assessment notes that Schuster had."
] | [
"SELECT count(*) FROM Assessment_Notes",
"SELECT T2.last_name FROM Assessment_Notes AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id",
"SELECT T1.text_of_notes FROM Assessment_Notes AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id WHERE T2.last_name = \"Schuster\""
] | Find the texts of assessment notes for teachers with last name "Schuster". | SELECT T1.text_of_notes FROM Assessment_Notes AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id WHERE T2.last_name = "Schuster" | behavior_monitoring |
[
"How many behavior incidents are there in record?",
"Show me the last name of students that were in any incidents.",
"Give me the start and end dates of Fahey's ones."
] | [
"SELECT count(*) FROM Behavior_Incident",
"SELECT T2.last_name FROM Behavior_Incident AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id",
"SELECT T1.date_incident_start , date_incident_end FROM Behavior_Incident AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.last_name = \"Fahey\""
] | Find the start and end dates of behavior incidents of students with last name "Fahey". | SELECT T1.date_incident_start , date_incident_end FROM Behavior_Incident AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.last_name = "Fahey" | behavior_monitoring |
[
"How many detentions are there in record?",
"Show me the last name of teachers that were in any detentions.",
"Give me the start and end dates of Schultz's ones."
] | [
"SELECT count(*) FROM Detention",
"SELECT T2.last_name FROM Detention AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id",
"SELECT T1.datetime_detention_start , datetime_detention_end FROM Detention AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id WHERE T2.last_name = \"Schultz\""
] | Find the start and end dates of detentions of teachers with last name "Schultz". | SELECT T1.datetime_detention_start , datetime_detention_end FROM Detention AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id WHERE T2.last_name = "Schultz" | behavior_monitoring |
[
"Show me the monthly rentals for all student addresses.",
"Give me the id of address with highest monthly rental.",
"What about its zip code?"
] | [
"SELECT address_id, monthly_rental FROM Student_Addresses",
"SELECT address_id FROM Student_Addresses ORDER BY monthly_rental DESC LIMIT 1",
"SELECT T2.address_id , T1.zip_postcode FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id ORDER BY monthly_rental DESC LIMIT 1"
] | What are the id and zip code of the address with the highest monthly rental? | SELECT T2.address_id , T1.zip_postcode FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id ORDER BY monthly_rental DESC LIMIT 1 | behavior_monitoring |
[
"Show me the monthly rentals for all student addresses.",
"Give me the id of student with the lowest of them.",
"What about that student's cell phone number?"
] | [
"SELECT address_id, monthly_rental FROM Student_Addresses",
"SELECT student_id FROM Student_Addresses ORDER BY monthly_rental ASC LIMIT 1",
"SELECT T2.cell_mobile_number FROM Student_Addresses AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id ORDER BY T1.monthly_rental ASC LIMIT 1"
] | What is the cell phone number of the student whose address has the lowest monthly rental? | SELECT T2.cell_mobile_number FROM Student_Addresses AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id ORDER BY T1.monthly_rental ASC LIMIT 1 | behavior_monitoring |
[
"Show me the monthly rentals for all student addresses.",
"What are their corresponding state, province, or county?",
"Show me the monthly rentals from Texas."
] | [
"SELECT address_id, monthly_rental FROM Student_Addresses",
"SELECT T2.address_id, T2.monthly_rental,T1.state_province_county FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id",
"SELECT T2.monthly_rental FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id WHERE T1.state_province_county = \"Texas\""
] | What are the monthly rentals of student addresses in Texas state? | SELECT T2.monthly_rental FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id WHERE T1.state_province_county = "Texas" | behavior_monitoring |
[
"How many students are there in the record?",
"What about those with address in Wisconsin?",
"Show me the first and last names of those students."
] | [
"SELECT count(*) FROM Students",
"SELECT count(*) FROM Addresses AS T1 JOIN Students AS T2 ON T1.address_id = T2.address_id WHERE T1.state_province_county = \"Wisconsin\"",
"SELECT T2.first_name , T2.last_name FROM Addresses AS T1 JOIN Students AS T2 ON T1.address_id = T2.address_id WHERE T1.state_province_county = \"Wisconsin\""
] | What are the first names and last names of students with address in Wisconsin state? | SELECT T2.first_name , T2.last_name FROM Addresses AS T1 JOIN Students AS T2 ON T1.address_id = T2.address_id WHERE T1.state_province_county = "Wisconsin" | behavior_monitoring |
[
"How many students are there in file?",
"What about student addresses?",
"Show me the line 1 and average montly rentals of those addresses."
] | [
"SELECT count(*) FROM Students",
"SELECT count(*) FROM Student_Addresses",
"SELECT T1.line_1 , avg(T2.monthly_rental) FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id GROUP BY T2.address_id"
] | What are the line 1 and average monthly rentals of all student addresses? | SELECT T1.line_1 , avg(T2.monthly_rental) FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id GROUP BY T2.address_id | behavior_monitoring |
[
"Show me the first name of all teachers.",
"Which city does Lyla live?",
"What about the zip code?"
] | [
"SELECT first_name FROM Teachers",
"SELECT T1.city FROM Addresses AS T1 JOIN Teachers AS T2 ON T1.address_id = T2.address_id WHERE T2.first_name = \"Lyla\"",
"SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Teachers AS T2 ON T1.address_id = T2.address_id WHERE T2.first_name = \"Lyla\""
] | What is the zip code of the address where the teacher with first name "Lyla" lives? | SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Teachers AS T2 ON T1.address_id = T2.address_id WHERE T2.first_name = "Lyla" | behavior_monitoring |
[
"Show me the first name of all teachers.",
"Who live in addresses with zip code 918?",
"What about their email addresses?"
] | [
"SELECT first_name FROM Teachers",
"SELECT T2.first_name FROM Addresses AS T1 JOIN Teachers AS T2 ON T1.address_id = T2.address_id WHERE T1.zip_postcode = \"918\"",
"SELECT T2.email_address FROM Addresses AS T1 JOIN Teachers AS T2 ON T1.address_id = T2.address_id WHERE T1.zip_postcode = \"918\""
] | What are the email addresses of teachers whose address has zip code "918"? | SELECT T2.email_address FROM Addresses AS T1 JOIN Teachers AS T2 ON T1.address_id = T2.address_id WHERE T1.zip_postcode = "918" | behavior_monitoring |
[
"How many students are there in file?",
"Give me the id of the students involved in any behavior incident.",
"How many students are not among those?"
] | [
"SELECT count(*) FROM STUDENTS",
"SELECT distinct student_id FROM Behavior_Incident",
"SELECT count(*) FROM STUDENTS WHERE student_id NOT IN ( SELECT student_id FROM Behavior_Incident )"
] | How many students are not involved in any behavior incident? | SELECT count(*) FROM STUDENTS WHERE student_id NOT IN ( SELECT student_id FROM Behavior_Incident ) | behavior_monitoring |
[
"Show me the last name of all teachers in file.",
"How many teachers are involved in any detention?",
"Give me the last name of teachers who are not one of those."
] | [
"SELECT last_name FROM Teachers",
"SELECT count(*) FROM Teachers AS T1 JOIN Detention AS T2 ON T1.teacher_id = T2.teacher_id",
"SELECT last_name FROM Teachers EXCEPT SELECT T1.last_name FROM Teachers AS T1 JOIN Detention AS T2 ON T1.teacher_id = T2.teacher_id"
] | Find the last names of teachers who are not involved in any detention. | SELECT last_name FROM Teachers EXCEPT SELECT T1.last_name FROM Teachers AS T1 JOIN Detention AS T2 ON T1.teacher_id = T2.teacher_id | behavior_monitoring |
[
"Show information for all individuals.",
"What are their first names, middle names and last names?",
"Order the results by the last name."
] | [
"SELECT * FROM individuals",
"SELECT individual_first_name , individual_middle_name , individual_last_name FROM individuals ORDER BY individual_last_name",
"SELECT individual_first_name , individual_middle_name , individual_last_name FROM individuals ORDER BY individual_last_name"
] | List every individual's first name, middle name and last name in alphabetical order by last name. | SELECT individual_first_name , individual_middle_name , individual_last_name FROM individuals ORDER BY individual_last_name | e_government |
[
"Show all the forms.",
"What are the distinct type codes of forms?"
] | [
"SELECT * FROM forms",
"SELECT DISTINCT form_type_code FROM forms"
] | List all the types of forms. | SELECT DISTINCT form_type_code FROM forms | e_government |
[
"Show all the party forms.",
"Show the form name of each party form.",
"Which one is the most popular party form?"
] | [
"SELECT * FROM party_forms",
"SELECT t1.form_name FROM forms AS t1 JOIN party_forms AS t2 ON t1.form_id = t2.form_id",
"SELECT t1.form_name FROM forms AS t1 JOIN party_forms AS t2 ON t1.form_id = t2.form_id GROUP BY t2.form_id ORDER BY count(*) DESC LIMIT 1"
] | Find the name of the most popular party form. | SELECT t1.form_name FROM forms AS t1 JOIN party_forms AS t2 ON t1.form_id = t2.form_id GROUP BY t2.form_id ORDER BY count(*) DESC LIMIT 1 | e_government |
[
"Return all the information for each party.",
"Show me the information for the one with email \"[email protected]\".",
"What are their payment method and phone number?"
] | [
"SELECT * FROM parties",
"SELECT * FROM parties WHERE party_email = \"[email protected]\"",
"SELECT payment_method_code , party_phone FROM parties WHERE party_email = \"[email protected]\""
] | Find the payment method and phone of the party with email "[email protected]". | SELECT payment_method_code , party_phone FROM parties WHERE party_email = "[email protected]" | e_government |
[
"What is the most popular party form?",
"Find the emails of parties using this form."
] | [
"SELECT * FROM party_forms GROUP BY form_id ORDER BY count(*) DESC LIMIT 1",
"SELECT t1.party_email FROM parties AS t1 JOIN party_forms AS t2 ON t1.party_id = t2.party_id WHERE t2.form_id = (SELECT form_id FROM party_forms GROUP BY form_id ORDER BY count(*) DESC LIMIT 1)"
] | Find the emails of parties with the most popular party form. | SELECT t1.party_email FROM parties AS t1 JOIN party_forms AS t2 ON t1.party_id = t2.party_id WHERE t2.form_id = (SELECT form_id FROM party_forms GROUP BY form_id ORDER BY count(*) DESC LIMIT 1) | e_government |
[
"Show all the organizations.",
"Sort them in order of the date formed.",
"Just show the organization names."
] | [
"SELECT * FROM organizations",
"SELECT * FROM organizations ORDER BY date_formed ASC",
"SELECT organization_name FROM organizations ORDER BY date_formed ASC"
] | List all the name of organizations in order of the date formed. | SELECT organization_name FROM organizations ORDER BY date_formed ASC | e_government |
[
"When was each organization formed?",
"Find the name of the organization formed most recently."
] | [
"SELECT date_formed FROM organizations",
"SELECT organization_name FROM organizations ORDER BY date_formed DESC LIMIT 1"
] | Find the name of the youngest organization. | SELECT organization_name FROM organizations ORDER BY date_formed DESC LIMIT 1 | e_government |
[
"Show the organization whose name is \"Labour Party\".",
"What are the contact individuals for this organization?",
"Of these, find the last name of the latest contact individual."
] | [
"SELECT * FROM organizations WHERE organization_name = \"Labour Party\"",
"SELECT * FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id JOIN individuals AS t3 ON t2.individual_id = t3.individual_id WHERE t1.organization_name = \"Labour Party\"",
"SELECT t3.individual_last_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id JOIN individuals AS t3 ON t2.individual_id = t3.individual_id WHERE t1.organization_name = \"Labour Party\" ORDER BY t2.date_contact_to DESC LIMIT 1"
] | Find the last name of the latest contact individual of the organization "Labour Party". | SELECT t3.individual_last_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id JOIN individuals AS t3 ON t2.individual_id = t3.individual_id WHERE t1.organization_name = "Labour Party" ORDER BY t2.date_contact_to DESC LIMIT 1 | e_government |
[
"What is the highest UK Vat number?",
"Show the contact persons of the organization with this UK Vat number.",
"From the results, find the last name of the first ever contact person."
] | [
"SELECT max(uk_vat_number) FROM organizations",
"SELECT * FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id JOIN individuals AS t3 ON t2.individual_id = t3.individual_id WHERE t1.uk_vat_number = (SELECT max(uk_vat_number) FROM organizations)",
"SELECT t3.individual_last_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id JOIN individuals AS t3 ON t2.individual_id = t3.individual_id WHERE t1.uk_vat_number = (SELECT max(uk_vat_number) FROM organizations) ORDER BY t2.date_contact_to ASC LIMIT 1"
] | Find the last name of the first ever contact person of the organization with the highest UK Vat number. | SELECT t3.individual_last_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id JOIN individuals AS t3 ON t2.individual_id = t3.individual_id WHERE t1.uk_vat_number = (SELECT max(uk_vat_number) FROM organizations) ORDER BY t2.date_contact_to ASC LIMIT 1 | e_government |
[
"List all the available service names.",
"Which of these have been used in some party service?",
"How about those never used in any party service?"
] | [
"SELECT service_name FROM services",
"SELECT t1.service_name FROM services AS t1 JOIN party_services AS t2 ON t1.service_id = t2.service_id",
"SELECT service_name FROM services EXCEPT SELECT t1.service_name FROM services AS t1 JOIN party_services AS t2 ON t1.service_id = t2.service_id"
] | Find the names of the services that have never been used. | SELECT service_name FROM services EXCEPT SELECT t1.service_name FROM services AS t1 JOIN party_services AS t2 ON t1.service_id = t2.service_id | e_government |
[
"Show all the address information.",
"Find the names of all the cities.",
"Find the names of all the cities and states."
] | [
"SELECT * FROM addresses",
"SELECT town_city FROM addresses",
"SELECT town_city FROM addresses UNION SELECT state_province_county FROM addresses"
] | Find the name of all the cities and states. | SELECT town_city FROM addresses UNION SELECT state_province_county FROM addresses | e_government |
[
"How many addresses are there?",
"How many are in the state \"Colorado\"?"
] | [
"SELECT count(*) FROM addresses",
"SELECT count(*) FROM addresses WHERE state_province_county = \"Colorado\""
] | How many cities are there in state "Colorado"? | SELECT count(*) FROM addresses WHERE state_province_county = "Colorado" | e_government |
[
"Show the payment method codes used by parties.",
"Which of them are used by more than 3 parties"
] | [
"SELECT payment_method_code FROM parties",
"SELECT payment_method_code FROM parties GROUP BY payment_method_code HAVING count(*) > 3"
] | Find the payment method code used by more than 3 parties. | SELECT payment_method_code FROM parties GROUP BY payment_method_code HAVING count(*) > 3 | e_government |
[
"Find all the organization names.",
"Which of them contain the string \"Party\"?"
] | [
"SELECT organization_name FROM organizations",
"SELECT organization_name FROM organizations WHERE organization_name LIKE \"%Party%\""
] | Find the name of organizations whose names contain "Party". | SELECT organization_name FROM organizations WHERE organization_name LIKE "%Party%" | e_government |
[
"What is the payment method code used by each party?",
"How many distinct payment methods are used by parties?"
] | [
"SELECT payment_method_code FROM parties",
"SELECT count(DISTINCT payment_method_code) FROM parties"
] | How many distinct payment methods are used by parties? | SELECT count(DISTINCT payment_method_code) FROM parties | e_government |
[
"How many times did each party use services?",
"Which party used party services the most number of times?",
"What is their email?"
] | [
"SELECT count(*) FROM parties AS t1 JOIN party_services AS t2 ON t1.party_id = t2.customer_id GROUP BY t1.party_id",
"SELECT * FROM parties AS t1 JOIN party_services AS t2 ON t1.party_id = t2.customer_id GROUP BY t1.party_id ORDER BY count(*) DESC LIMIT 1",
"SELECT t1.party_email FROM parties AS t1 JOIN party_services AS t2 ON t1.party_id = t2.customer_id GROUP BY t1.party_id ORDER BY count(*) DESC LIMIT 1"
] | Which is the email of the party that has used the services the most number of times? | SELECT t1.party_email FROM parties AS t1 JOIN party_services AS t2 ON t1.party_id = t2.customer_id GROUP BY t1.party_email ORDER BY count(*) DESC LIMIT 1 | e_government |
[
"What is the state of each address?",
"What one has building name that contains \"6862 Kaitlyn Knolls\"?"
] | [
"SELECT state_province_county FROM addresses",
"SELECT state_province_county FROM addresses WHERE line_1_number_building LIKE \"%6862 Kaitlyn Knolls%\""
] | Which state can address "6862 Kaitlyn Knolls" possibly be in? | SELECT state_province_county FROM addresses WHERE line_1_number_building LIKE "%6862 Kaitlyn Knolls%" | e_government |
[
"How many contact individuals does each organization have?",
"What is the name of organization that has the greatest number of contact individuals?"
] | [
"SELECT count(*) FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id",
"SELECT t1.organization_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id GROUP BY t1.organization_name ORDER BY count(*) DESC LIMIT 1"
] | What is the name of organization that has the greatest number of contact individuals? | SELECT t1.organization_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id GROUP BY t1.organization_name ORDER BY count(*) DESC LIMIT 1 | e_government |
[
"Show me the name of customers.",
"What about their coupon amounts?",
"Show me those with amount 500.",
"Show me if they are bad or good."
] | [
"SELECT first_name, last_name FROM Customers",
"SELECT t1.first_name, t1.last_name, t2.coupon_amount FROM Customers as t1 JOIN discount_coupons as t2 ON t1.coupon_id = t2.coupon_id",
"SELECT t1.first_name, t1.last_name, t2.coupon_amount FROM Customers as t1 JOIN discount_coupons as t2 ON t1.coupon_id = t2.coupon_id WHERE t2.coupon_amount = 500",
"SELECT T1.good_or_bad_customer FROM customers AS T1 JOIN discount_coupons AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.coupon_amount = 500"
] | Are the customers holding coupons with amount 500 bad or good? | SELECT T1.good_or_bad_customer FROM customers AS T1 JOIN discount_coupons AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.coupon_amount = 500 | products_for_hire |
[
"Show me the first name of all customers.",
"How many bookings are there in record?",
"What about that in terms of those customers?",
"Could you also show me those customers' ids?"
] | [
"SELECT first_name FROM Customers",
"SELECT count(*) FROM bookings",
"SELECT T1.first_name , count(*) FROM Customers AS T1 JOIN bookings AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id",
"SELECT T1.customer_id , T1.first_name , count(*) FROM Customers AS T1 JOIN bookings AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id"
] | How many bookings did each customer make? List the customer id, first name, and the count. | SELECT T1.customer_id , T1.first_name , count(*) FROM Customers AS T1 JOIN bookings AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id | products_for_hire |
[
"How many payment records are there?",
"Show me the maximum amount paid?",
"What about the total maximum amount paid by a single customer?",
"Show me the customer id also."
] | [
"SELECT count(*) FROM Payments",
"SELECT amount_paid FROM Payments ORDER BY amount_paid DESC LIMIT 1",
"SELECT sum(amount_paid) FROM Payments GROUP BY customer_id ORDER BY sum(amount_paid) DESC LIMIT 1",
"SELECT customer_id , sum(amount_paid) FROM Payments GROUP BY customer_id ORDER BY sum(amount_paid) DESC LIMIT 1"
] | What is the maximum total amount paid by a customer? List the customer id and amount. | SELECT customer_id , sum(amount_paid) FROM Payments GROUP BY customer_id ORDER BY sum(amount_paid) DESC LIMIT 1 | products_for_hire |
[
"How many payments are there in record?",
"How many did each booking incur?",
"Which one has the largest number?",
"Show me its id and the amount of refund."
] | [
"SELECT count(*) FROM Payments",
"SELECT booking_id, count(*) FROM Payments GROUP BY booking_id",
"SELECT booking_id FROM Payments GROUP BY booking_id ORDER BY count(*) DESC LIMIT 1",
"SELECT T1.booking_id , T1.amount_of_refund FROM Bookings AS T1 JOIN Payments AS T2 ON T1.booking_id = T2.booking_id GROUP BY T1.booking_id ORDER BY count(*) DESC LIMIT 1"
] | What are the id and the amount of refund of the booking that incurred the most times of payments? | SELECT T1.booking_id , T1.amount_of_refund FROM Bookings AS T1 JOIN Payments AS T2 ON T1.booking_id = T2.booking_id GROUP BY T1.booking_id ORDER BY count(*) DESC LIMIT 1 | products_for_hire |
[
"Show me the number of products that have been booked.",
"How many times has each of them been booked?",
"Show me the id of the product with 3 bookings."
] | [
"SELECT product_id FROM products_booked",
"SELECT product_id,count(*) FROM products_booked GROUP BY product_id",
"SELECT product_id FROM products_booked GROUP BY product_id HAVING count(*) = 3"
] | What is the id of the product that is booked for 3 times? | SELECT product_id FROM products_booked GROUP BY product_id HAVING count(*) = 3 | products_for_hire |
[
"What are the product that have been booked?",
"Show me the one with booked amount 102.76.",
"What about its description?"
] | [
"SELECT DISTINCT product_id FROM products_booked",
"SELECT product_id FROM products_booked WHERE booked_amount = 102.76",
"SELECT T2.product_description FROM products_booked AS T1 JOIN products_for_hire AS T2 ON T1.product_id = T2.product_id WHERE T1.booked_amount = 102.76"
] | What is the product description of the product booked with an amount of 102.76? | SELECT T2.product_description FROM products_booked AS T1 JOIN products_for_hire AS T2 ON T1.product_id = T2.product_id WHERE T1.booked_amount = 102.76 | products_for_hire |
[
"Show me the name of all the products in file.",
"How many times has Book collection A been booked?",
"What are the start date and end date of those bookings?"
] | [
"SELECT product_name FROM Products_for_hire",
"SELECT count(*) FROM products_booked AS t1 JOIN Products_for_hire AS t2 on t1.product_id = t2.product_id where t2.product_name = 'Book collection A'",
"SELECT T3.booking_start_date , T3.booking_end_date FROM Products_for_hire AS T1 JOIN products_booked AS T2 ON T1.product_id = T2.product_id JOIN bookings AS T3 ON T2.booking_id = T3.booking_id WHERE T1.product_name = 'Book collection A'"
] | What are the start date and end date of the booking that has booked the product named 'Book collection A'? | SELECT T3.booking_start_date , T3.booking_end_date FROM Products_for_hire AS T1 JOIN products_booked AS T2 ON T1.product_id = T2.product_id JOIN bookings AS T3 ON T2.booking_id = T3.booking_id WHERE T1.product_name = 'Book collection A' | products_for_hire |
[
"Show me the name of all the products in file.",
"Show me those with availability equal to 1."
] | [
"SELECT product_name FROM Products_for_hire",
"SELECT T2.product_name FROM view_product_availability AS T1 JOIN products_for_hire AS T2 ON T1.product_id = T2.product_id WHERE T1.available_yn = 1"
] | What are the names of products whose availability equals to 1? | SELECT T2.product_name FROM view_product_availability AS T1 JOIN products_for_hire AS T2 ON T1.product_id = T2.product_id WHERE T1.available_yn = 1 | products_for_hire |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.