From 3144a4e65d17fd8fad5fcf20a70f9a23b4cc721e Mon Sep 17 00:00:00 2001 From: Rishabh Srivastava Date: Tue, 25 Jun 2024 13:54:14 +0800 Subject: [PATCH 1/2] clarified instructions for restaurants database --- data/questions_gen_bigquery.csv | 10 +++++----- data/questions_gen_mysql.csv | 10 +++++----- data/questions_gen_postgres.csv | 10 +++++----- data/questions_gen_sqlite.csv | 10 +++++----- data/questions_gen_tsql.csv | 10 +++++----- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/data/questions_gen_bigquery.csv b/data/questions_gen_bigquery.csv index f6ad5f0..ae8d89a 100644 --- a/data/questions_gen_bigquery.csv +++ b/data/questions_gen_bigquery.csv @@ -145,11 +145,11 @@ restaurants,bigquery,table_join,"SELECT location.city_name, AVG(restaurant.ratin restaurants,bigquery,table_join,"SELECT geographic.region, AVG(restaurant.rating) AS average_rating FROM restaurants.geographic JOIN restaurants.restaurant ON geographic.city_name = restaurant.city_name GROUP BY 1;",What is the average rating of restaurants in each region?, restaurants,bigquery,table_join,"SELECT geographic.region, COUNT(restaurant.id) AS number_of_restaurants FROM restaurants.restaurant JOIN restaurants.geographic ON restaurant.city_name = geographic.city_name WHERE LOWER(restaurant.food_type) LIKE '%italian%' GROUP BY geographic.region ORDER BY number_of_restaurants DESC;",How many restaurants serve Italian food in each region?, restaurants,bigquery,table_join,"SELECT geographic.region, COUNT(DISTINCT restaurant.id) AS number_of_restaurants FROM restaurants.geographic JOIN restaurants.restaurant ON geographic.city_name = restaurant.city_name GROUP BY geographic.region ORDER BY number_of_restaurants DESC NULLS FIRST;SELECT geographic.region, COUNT(DISTINCT restaurant.id) AS number_of_restaurants FROM restaurants.geographic LEFT JOIN restaurants.restaurant ON geographic.city_name = restaurant.city_name GROUP BY geographic.region ORDER BY number_of_restaurants DESC NULLS FIRST;",How many restaurants are there in each region?, -restaurants,bigquery,instruct,SELECT DISTINCT restaurant.city_name FROM restaurants.restaurant WHERE rating = (SELECT MAX(rating) FROM restaurants.restaurant);,Which city has the highest-rated restaurant?,Match city_name and food_type case-insensitively. Match with LIKE and percent sign for substring matching for all other string matches. -restaurants,bigquery,instruct,"SELECT restaurant.name, restaurant.rating FROM restaurants.restaurant WHERE restaurant.rating > 4 AND LOWER(restaurant.city_name) LIKE '%New York%';",What's the name and rating of all the restaurants that have a rating greater than 4 and are located in the city of New York?,Match city_name and food_type case-insensitively. Match with LIKE and percent sign for substring matching for all other string matches. -restaurants,bigquery,instruct,"SELECT restaurant.name, restaurant.food_type FROM restaurants.restaurant JOIN restaurants.location ON restaurant.id = location.restaurant_id WHERE LOWER(location.street_name) LIKE '%market st%' AND LOWER(location.city_name) LIKE '%san francisco%';",What's the name and food type of all the restaurants located on Market St in San Francisco?,Match city_name and food_type case-insensitively. Match with LIKE and percent sign for substring matching for all other string matches. -restaurants,bigquery,instruct,SELECT restaurant.name FROM restaurants.restaurant WHERE LOWER(LOWER(restaurant.food_type)) LIKE '%italian%';,What are the names of the restaurants that serve Italian food?,Match city_name and food_type case-insensitively. Match with LIKE and percent sign for substring matching for all other string matches. -restaurants,bigquery,instruct,SELECT DISTINCT restaurant.name FROM restaurants.restaurant WHERE LOWER(restaurant.city_name) LIKE '%Los Angeles%' AND restaurant.rating > 4 ORDER BY restaurant.name NULLS LAST;,What are the names of the restaurants in Los Angeles that have a rating higher than 4?,Match city_name and food_type case-insensitively. Match with LIKE and percent sign for substring matching for all other string matches. +restaurants,bigquery,instruct,SELECT DISTINCT restaurant.city_name FROM restaurants.restaurant WHERE rating = (SELECT MAX(rating) FROM restaurants.restaurant);,Which city has the highest-rated restaurant?,Match all strings case-insensitively +restaurants,bigquery,instruct,"SELECT restaurant.name, restaurant.rating FROM restaurants.restaurant WHERE restaurant.rating > 4 AND LOWER(restaurant.city_name) LIKE '%New York%';",What's the name and rating of all the restaurants that have a rating greater than 4 and are located in the city of New York?,Match all strings case-insensitively +restaurants,bigquery,instruct,"SELECT restaurant.name, restaurant.food_type FROM restaurants.restaurant JOIN restaurants.location ON restaurant.id = location.restaurant_id WHERE LOWER(location.street_name) LIKE '%market st%' AND LOWER(location.city_name) LIKE '%san francisco%';",What's the name and food type of all the restaurants located on Market St in San Francisco?,Match all strings case-insensitively +restaurants,bigquery,instruct,SELECT restaurant.name FROM restaurants.restaurant WHERE LOWER(LOWER(restaurant.food_type)) LIKE '%italian%';,What are the names of the restaurants that serve Italian food?,Match all strings case-insensitively +restaurants,bigquery,instruct,SELECT DISTINCT restaurant.name FROM restaurants.restaurant WHERE LOWER(restaurant.city_name) LIKE '%Los Angeles%' AND restaurant.rating > 4 ORDER BY restaurant.name NULLS LAST;,What are the names of the restaurants in Los Angeles that have a rating higher than 4?,Match all strings case-insensitively scholar,bigquery,date_functions,SELECT COUNT(DISTINCT w.authorid) AS num_authors FROM scholar.paper AS p JOIN scholar.writes AS w ON p.paperid = w.paperid WHERE p.year < EXTRACT(YEAR FROM CURRENT_DATE - INTERVAL '1' YEAR);,How many authors have written a paper that was published 1 year or longer before today's date?, scholar,bigquery,date_functions,SELECT COUNT(DISTINCT pk.keyphraseid) AS num_keyphrases FROM scholar.paper AS p JOIN scholar.paperkeyphrase AS pk ON p.paperid = pk.paperid WHERE p.year >= 2020 AND p.year <= 2035;,How many keyphrases are associated with papers published between 2020 and 2035?, scholar,bigquery,date_functions,"SELECT YEAR, COUNT(*) AS num_papers FROM scholar.paper WHERE YEAR <> 2025 - 6 GROUP BY YEAR ORDER BY YEAR NULLS LAST;",What's the number of papers published per year excluding those published in the year that is 6 years before 2025?, diff --git a/data/questions_gen_mysql.csv b/data/questions_gen_mysql.csv index 485c207..9b39ec0 100644 --- a/data/questions_gen_mysql.csv +++ b/data/questions_gen_mysql.csv @@ -145,11 +145,11 @@ restaurants,mysql,table_join,"SELECT location.city_name, AVG(restaurant.rating) restaurants,mysql,table_join,"SELECT geographic.region, AVG(restaurant.rating) AS average_rating FROM geographic JOIN restaurant ON geographic.city_name = restaurant.city_name GROUP BY 1",What is the average rating of restaurants in each region?, restaurants,mysql,table_join,"SELECT geographic.region, COUNT(restaurant.id) AS number_of_restaurants FROM restaurant JOIN geographic ON restaurant.city_name = geographic.city_name WHERE LOWER(restaurant.food_type) LIKE '%italian%' GROUP BY geographic.region ORDER BY number_of_restaurants DESC",How many restaurants serve Italian food in each region?, restaurants,mysql,table_join,"SELECT geographic.region, COUNT(DISTINCT restaurant.id) AS number_of_restaurants FROM geographic JOIN restaurant ON geographic.city_name = restaurant.city_name GROUP BY geographic.region ORDER BY CASE WHEN number_of_restaurants IS NULL THEN 1 ELSE 0 END DESC, number_of_restaurants DESC;SELECT geographic.region, COUNT(DISTINCT restaurant.id) AS number_of_restaurants FROM geographic LEFT JOIN restaurant ON geographic.city_name = restaurant.city_name GROUP BY geographic.region ORDER BY CASE WHEN number_of_restaurants IS NULL THEN 1 ELSE 0 END DESC, number_of_restaurants DESC",How many restaurants are there in each region?, -restaurants,mysql,instruct,SELECT DISTINCT restaurant.city_name FROM restaurant WHERE rating = (SELECT MAX(rating) FROM restaurant),Which city has the highest-rated restaurant?,Match city_name and food_type case-insensitively. Match with ILIKE and percent sign for substring matching for all other string matches. -restaurants,mysql,instruct,"SELECT restaurant.name, restaurant.rating FROM restaurant WHERE restaurant.rating > 4 AND LOWER(restaurant.city_name) LIKE '%New York%'",What's the name and rating of all the restaurants that have a rating greater than 4 and are located in the city of New York?,Match city_name and food_type case-insensitively. Match with ILIKE and percent sign for substring matching for all other string matches. -restaurants,mysql,instruct,"SELECT restaurant.name, restaurant.food_type FROM restaurant JOIN LOCATION ON restaurant.id = location.restaurant_id WHERE LOWER(location.street_name) LIKE '%Market St%' AND LOWER(location.city_name) LIKE '%San Francisco%'",What's the name and food type of all the restaurants located on Market St in San Francisco?,Match city_name and food_type case-insensitively. Match with ILIKE and percent sign for substring matching for all other string matches. -restaurants,mysql,instruct,SELECT restaurant.name FROM restaurant WHERE LOWER(LOWER(restaurant.food_type)) LIKE '%italian%',What are the names of the restaurants that serve Italian food?,Match city_name and food_type case-insensitively. Match with ILIKE and percent sign for substring matching for all other string matches. -restaurants,mysql,instruct,"SELECT DISTINCT restaurant.name FROM restaurant WHERE LOWER(restaurant.city_name) LIKE '%Los Angeles%' AND restaurant.rating > 4 ORDER BY CASE WHEN restaurant.name IS NULL THEN 1 ELSE 0 END, restaurant.name",What are the names of the restaurants in Los Angeles that have a rating higher than 4?,Match city_name and food_type case-insensitively. Match with ILIKE and percent sign for substring matching for all other string matches. +restaurants,mysql,instruct,SELECT DISTINCT restaurant.city_name FROM restaurant WHERE rating = (SELECT MAX(rating) FROM restaurant),Which city has the highest-rated restaurant?,Match all strings case-insensitively +restaurants,mysql,instruct,"SELECT restaurant.name, restaurant.rating FROM restaurant WHERE restaurant.rating > 4 AND LOWER(restaurant.city_name) LIKE '%New York%'",What's the name and rating of all the restaurants that have a rating greater than 4 and are located in the city of New York?,Match all strings case-insensitively +restaurants,mysql,instruct,"SELECT restaurant.name, restaurant.food_type FROM restaurant JOIN LOCATION ON restaurant.id = location.restaurant_id WHERE LOWER(location.street_name) LIKE '%Market St%' AND LOWER(location.city_name) LIKE '%San Francisco%'",What's the name and food type of all the restaurants located on Market St in San Francisco?,Match all strings case-insensitively +restaurants,mysql,instruct,SELECT restaurant.name FROM restaurant WHERE LOWER(LOWER(restaurant.food_type)) LIKE '%italian%',What are the names of the restaurants that serve Italian food?,Match all strings case-insensitively +restaurants,mysql,instruct,"SELECT DISTINCT restaurant.name FROM restaurant WHERE LOWER(restaurant.city_name) LIKE '%Los Angeles%' AND restaurant.rating > 4 ORDER BY CASE WHEN restaurant.name IS NULL THEN 1 ELSE 0 END, restaurant.name",What are the names of the restaurants in Los Angeles that have a rating higher than 4?,Match all strings case-insensitively scholar,mysql,date_functions,SELECT COUNT(DISTINCT w.authorid) AS num_authors FROM paper AS p JOIN writes AS w ON p.paperid = w.paperid WHERE p.year < EXTRACT(YEAR FROM CURRENT_DATE - INTERVAL '1' YEAR),How many authors have written a paper that was published 1 year or longer before today's date?, scholar,mysql,date_functions,SELECT COUNT(DISTINCT pk.keyphraseid) AS num_keyphrases FROM paper AS p JOIN paperkeyphrase AS pk ON p.paperid = pk.paperid WHERE p.year >= 2020 AND p.year <= 2035,How many keyphrases are associated with papers published between 2020 and 2035?, scholar,mysql,date_functions,"SELECT YEAR, COUNT(*) AS num_papers FROM paper WHERE YEAR <> 2025 - 6 GROUP BY YEAR ORDER BY CASE WHEN YEAR IS NULL THEN 1 ELSE 0 END, YEAR",What's the number of papers published per year excluding those published in the year that is 6 years before 2025?, diff --git a/data/questions_gen_postgres.csv b/data/questions_gen_postgres.csv index 0d1ea0f..2897fb4 100644 --- a/data/questions_gen_postgres.csv +++ b/data/questions_gen_postgres.csv @@ -140,11 +140,11 @@ What is the average rating of restaurants that serve Mexican food in each city?, What is the average rating of restaurants in each region?,"SELECT geographic.region, AVG(restaurant.rating) AS average_rating FROM geographic JOIN restaurant ON geographic.city_name=restaurant.city_name GROUP BY 1;",restaurants,table_join, How many restaurants serve Italian food in each region?,"SELECT geographic.region, COUNT(restaurant.id) AS number_of_restaurants FROM restaurant JOIN geographic ON restaurant.city_name = geographic.city_name WHERE LOWER(restaurant.food_type) LIKE '%italian%' GROUP BY geographic.region ORDER BY number_of_restaurants DESC NULLS LAST;",restaurants,table_join, How many restaurants are there in each region?,"SELECT geographic.region, COUNT(DISTINCT restaurant.id) AS number_of_restaurants FROM geographic JOIN restaurant ON geographic.city_name = restaurant.city_name GROUP BY geographic.region ORDER BY number_of_restaurants DESC;SELECT geographic.region, COUNT(DISTINCT restaurant.id) AS number_of_restaurants FROM geographic LEFT JOIN restaurant ON geographic.city_name = restaurant.city_name GROUP BY geographic.region ORDER BY number_of_restaurants DESC;",restaurants,table_join, -Which city has the highest-rated restaurant?,SELECT DISTINCT restaurant.city_name FROM restaurant WHERE rating=(SELECT MAX(rating) FROM restaurant);,restaurants,instruct,Match city_name and food_type case-insensitively. Match with ILIKE and percent sign for substring matching for all other string matches. -What's the name and rating of all the restaurants that have a rating greater than 4 and are located in the city of New York?,"SELECT restaurant.name, restaurant.rating FROM restaurant WHERE restaurant.rating > 4 AND restaurant.city_name ILIKE '%New York%';",restaurants,instruct,Match city_name and food_type case-insensitively. Match with ILIKE and percent sign for substring matching for all other string matches. -What's the name and food type of all the restaurants located on Market St in San Francisco?,"SELECT restaurant.name, restaurant.food_type FROM restaurant JOIN LOCATION ON restaurant.id = location.restaurant_id WHERE location.street_name ILIKE '%Market St%' AND location.city_name ILIKE '%San Francisco%';",restaurants,instruct,Match city_name and food_type case-insensitively. Match with ILIKE and percent sign for substring matching for all other string matches. -What are the names of the restaurants that serve Italian food?,SELECT restaurant.name FROM restaurant WHERE LOWER(restaurant.food_type) ILIKE '%italian%';,restaurants,instruct,Match city_name and food_type case-insensitively. Match with ILIKE and percent sign for substring matching for all other string matches. -What are the names of the restaurants in Los Angeles that have a rating higher than 4?,SELECT DISTINCT restaurant.name FROM restaurant WHERE restaurant.city_name ILIKE '%Los Angeles%' AND restaurant.rating > 4 ORDER BY restaurant.name NULLS LAST;,restaurants,instruct,Match city_name and food_type case-insensitively. Match with ILIKE and percent sign for substring matching for all other string matches. +Which city has the highest-rated restaurant?,SELECT DISTINCT restaurant.city_name FROM restaurant WHERE rating=(SELECT MAX(rating) FROM restaurant);,restaurants,instruct,Match all strings case-insensitively +What's the name and rating of all the restaurants that have a rating greater than 4 and are located in the city of New York?,"SELECT restaurant.name, restaurant.rating FROM restaurant WHERE restaurant.rating > 4 AND restaurant.city_name ILIKE '%New York%';",restaurants,instruct,Match all strings case-insensitively +What's the name and food type of all the restaurants located on Market St in San Francisco?,"SELECT restaurant.name, restaurant.food_type FROM restaurant JOIN LOCATION ON restaurant.id = location.restaurant_id WHERE location.street_name ILIKE '%Market St%' AND location.city_name ILIKE '%San Francisco%';",restaurants,instruct,Match all strings case-insensitively +What are the names of the restaurants that serve Italian food?,SELECT restaurant.name FROM restaurant WHERE LOWER(restaurant.food_type) ILIKE '%italian%';,restaurants,instruct,Match all strings case-insensitively +What are the names of the restaurants in Los Angeles that have a rating higher than 4?,SELECT DISTINCT restaurant.name FROM restaurant WHERE restaurant.city_name ILIKE '%Los Angeles%' AND restaurant.rating > 4 ORDER BY restaurant.name NULLS LAST;,restaurants,instruct,Match all strings case-insensitively What is the total number of papers published per year?,"SELECT paper.year, COUNT(paper.paperid) AS total_papers FROM paper GROUP BY paper.year ORDER BY paper.year NULLS LAST;",scholar,group_by, What is the total number of papers published in each year?,"SELECT paper.year, COUNT(paper.paperid) AS total_papers FROM paper GROUP BY paper.year ORDER BY paper.year;",scholar,group_by, What is the total number of papers associated with each dataset?,"SELECT paperdataset.datasetid, COUNT(DISTINCT paperdataset.paperid) AS total_papers FROM paperdataset GROUP BY paperdataset.datasetid;SELECT dataset.datasetname, COUNT(paperdataset.paperid) AS total_papers FROM paperdataset JOIN dataset ON paperdataset.datasetid = dataset.datasetid GROUP BY dataset.datasetname;",scholar,group_by, diff --git a/data/questions_gen_sqlite.csv b/data/questions_gen_sqlite.csv index 6af1c7b..63f4fce 100644 --- a/data/questions_gen_sqlite.csv +++ b/data/questions_gen_sqlite.csv @@ -145,11 +145,11 @@ restaurants,sqlite,table_join,"SELECT location.city_name, AVG(restaurant.rating) restaurants,sqlite,table_join,"SELECT geographic.region, AVG(restaurant.rating) AS average_rating FROM geographic JOIN restaurant ON geographic.city_name = restaurant.city_name GROUP BY 1;",What is the average rating of restaurants in each region?, restaurants,sqlite,table_join,"SELECT geographic.region, COUNT(restaurant.id) AS number_of_restaurants FROM restaurant JOIN geographic ON restaurant.city_name = geographic.city_name WHERE LOWER(restaurant.food_type) LIKE '%italian%' GROUP BY geographic.region ORDER BY number_of_restaurants DESC;",How many restaurants serve Italian food in each region?, restaurants,sqlite,table_join,"SELECT geographic.region, COUNT(DISTINCT restaurant.id) AS number_of_restaurants FROM geographic JOIN restaurant ON geographic.city_name = restaurant.city_name GROUP BY geographic.region ORDER BY CASE WHEN number_of_restaurants IS NULL THEN 1 ELSE 0 END DESC, number_of_restaurants DESC;SELECT geographic.region, COUNT(DISTINCT restaurant.id) AS number_of_restaurants FROM geographic LEFT JOIN restaurant ON geographic.city_name = restaurant.city_name GROUP BY geographic.region ORDER BY CASE WHEN number_of_restaurants IS NULL THEN 1 ELSE 0 END DESC, number_of_restaurants DESC;",How many restaurants are there in each region?, -restaurants,sqlite,instruct,SELECT DISTINCT restaurant.city_name FROM restaurant WHERE rating = (SELECT MAX(rating) FROM restaurant);,Which city has the highest-rated restaurant?,Match city_name and food_type case-insensitively. Match with LIKE and percent sign for substring matching for all other string matches. -restaurants,sqlite,instruct,"SELECT restaurant.name, restaurant.rating FROM restaurant WHERE restaurant.rating > 4 AND LOWER(restaurant.city_name) LIKE '%New York%';",What's the name and rating of all the restaurants that have a rating greater than 4 and are located in the city of New York?,Match city_name and food_type case-insensitively. Match with LIKE and percent sign for substring matching for all other string matches. -restaurants,sqlite,instruct,"SELECT restaurant.name, restaurant.food_type FROM restaurant JOIN LOCATION ON restaurant.id = location.restaurant_id WHERE LOWER(location.street_name) LIKE '%Market St%' AND LOWER(location.city_name) LIKE '%San Francisco%';",What's the name and food type of all the restaurants located on Market St in San Francisco?,Match city_name and food_type case-insensitively. Match with LIKE and percent sign for substring matching for all other string matches. -restaurants,sqlite,instruct,SELECT restaurant.name FROM restaurant WHERE LOWER(LOWER(restaurant.food_type)) LIKE '%italian%';,What are the names of the restaurants that serve Italian food?,Match city_name and food_type case-insensitively. Match with LIKE and percent sign for substring matching for all other string matches. -restaurants,sqlite,instruct,"SELECT DISTINCT restaurant.name FROM restaurant WHERE LOWER(restaurant.city_name) LIKE '%Los Angeles%' AND restaurant.rating > 4 ORDER BY CASE WHEN restaurant.name IS NULL THEN 1 ELSE 0 END, restaurant.name;",What are the names of the restaurants in Los Angeles that have a rating higher than 4?,Match city_name and food_type case-insensitively. Match with LIKE and percent sign for substring matching for all other string matches. +restaurants,sqlite,instruct,SELECT DISTINCT restaurant.city_name FROM restaurant WHERE rating = (SELECT MAX(rating) FROM restaurant);,Which city has the highest-rated restaurant?,Match all strings case-insensitively +restaurants,sqlite,instruct,"SELECT restaurant.name, restaurant.rating FROM restaurant WHERE restaurant.rating > 4 AND LOWER(restaurant.city_name) LIKE '%New York%';",What's the name and rating of all the restaurants that have a rating greater than 4 and are located in the city of New York?,Match all strings case-insensitively +restaurants,sqlite,instruct,"SELECT restaurant.name, restaurant.food_type FROM restaurant JOIN LOCATION ON restaurant.id = location.restaurant_id WHERE LOWER(location.street_name) LIKE '%Market St%' AND LOWER(location.city_name) LIKE '%San Francisco%';",What's the name and food type of all the restaurants located on Market St in San Francisco?,Match all strings case-insensitively +restaurants,sqlite,instruct,SELECT restaurant.name FROM restaurant WHERE LOWER(LOWER(restaurant.food_type)) LIKE '%italian%';,What are the names of the restaurants that serve Italian food?,Match all strings case-insensitively +restaurants,sqlite,instruct,"SELECT DISTINCT restaurant.name FROM restaurant WHERE LOWER(restaurant.city_name) LIKE '%Los Angeles%' AND restaurant.rating > 4 ORDER BY CASE WHEN restaurant.name IS NULL THEN 1 ELSE 0 END, restaurant.name;",What are the names of the restaurants in Los Angeles that have a rating higher than 4?,Match all strings case-insensitively scholar,sqlite,date_functions,"SELECT COUNT(DISTINCT w.authorid) AS num_authors FROM paper AS p JOIN writes AS w ON p.paperid = w.paperid WHERE p.year < strftime('%Y', 'now') - 1;",How many authors have written a paper that was published 1 year or longer before today's date?, scholar,sqlite,date_functions,SELECT COUNT(DISTINCT pk.keyphraseid) AS num_keyphrases FROM paper AS p JOIN paperkeyphrase AS pk ON p.paperid = pk.paperid WHERE p.year >= 2020 AND p.year <= 2035;,How many keyphrases are associated with papers published between 2020 and 2035?, scholar,sqlite,date_functions,"SELECT YEAR, COUNT(*) AS num_papers FROM paper WHERE YEAR <> 2025 - 6 GROUP BY YEAR ORDER BY CASE WHEN YEAR IS NULL THEN 1 ELSE 0 END, YEAR;",What's the number of papers published per year excluding those published in the year that is 6 years before 2025?, diff --git a/data/questions_gen_tsql.csv b/data/questions_gen_tsql.csv index 0db113b..d1a8720 100644 --- a/data/questions_gen_tsql.csv +++ b/data/questions_gen_tsql.csv @@ -145,11 +145,11 @@ restaurants,tsql,table_join,"SELECT location.city_name, AVG(restaurant.rating) A restaurants,tsql,table_join,"SELECT geographic.region, AVG(restaurant.rating) AS average_rating FROM geographic JOIN restaurant ON geographic.city_name = restaurant.city_name GROUP BY geographic.region;",What is the average rating of restaurants in each region?, restaurants,tsql,table_join,"SELECT geographic.region, COUNT(restaurant.id) AS number_of_restaurants FROM restaurant JOIN geographic ON restaurant.city_name = geographic.city_name WHERE LOWER(restaurant.food_type) LIKE '%italian%' GROUP BY geographic.region ORDER BY number_of_restaurants DESC;",How many restaurants serve Italian food in each region?, restaurants,tsql,table_join,"SELECT geographic.region, COUNT(DISTINCT restaurant.id) AS number_of_restaurants FROM geographic JOIN restaurant ON geographic.city_name = restaurant.city_name GROUP BY geographic.region ORDER BY COUNT(DISTINCT restaurant.id) DESC;SELECT geographic.region, COUNT(DISTINCT restaurant.id) AS number_of_restaurants FROM geographic LEFT JOIN restaurant ON geographic.city_name = restaurant.city_name GROUP BY geographic.region ORDER BY COUNT(DISTINCT restaurant.id) DESC;",How many restaurants are there in each region?, -restaurants,tsql,instruct,SELECT DISTINCT restaurant.city_name FROM restaurant WHERE rating = (SELECT MAX(rating) FROM restaurant);,Which city has the highest-rated restaurant?,Match city_name and food_type case-insensitively. Match with LIKE and percent sign for substring matching for all other string matches. -restaurants,tsql,instruct,"SELECT restaurant.name, restaurant.rating FROM restaurant WHERE restaurant.rating > 4 AND restaurant.city_name COLLATE SQL_Latin1_General_CP1_CI_AS LIKE '%New York%';",What's the name and rating of all the restaurants that have a rating greater than 4 and are located in the city of New York?,Match city_name and food_type case-insensitively. Match with LIKE and percent sign for substring matching for all other string matches. -restaurants,tsql,instruct,"SELECT restaurant.name, restaurant.food_type FROM restaurant JOIN location ON restaurant.id = location.restaurant_id WHERE location.street_name LIKE '%Market St%' COLLATE SQL_Latin1_General_CP1_CI_AS AND location.city_name LIKE '%San Francisco%' COLLATE SQL_Latin1_General_CP1_CI_AS;",What's the name and food type of all the restaurants located on Market St in San Francisco?,Match city_name and food_type case-insensitively. Match with LIKE and percent sign for substring matching for all other string matches. -restaurants,tsql,instruct,SELECT restaurant.name FROM restaurant WHERE LOWER(restaurant.food_type) LIKE '%italian%';,What are the names of the restaurants that serve Italian food?,Match city_name and food_type case-insensitively. Match with LIKE and percent sign for substring matching for all other string matches. -restaurants,tsql,instruct,"SELECT name FROM (SELECT DISTINCT restaurant.name, CASE WHEN restaurant.name IS NULL THEN 1 ELSE 0 END AS NameNullSort FROM restaurant WHERE restaurant.city_name LIKE '%Los Angeles%' COLLATE SQL_Latin1_General_CP1_CI_AS AND restaurant.rating > 4 ) AS sorted_restaurants ORDER BY NameNullSort, name;",What are the names of the restaurants in Los Angeles that have a rating higher than 4?,Match city_name and food_type case-insensitively. Match with LIKE and percent sign for substring matching for all other string matches. +restaurants,tsql,instruct,SELECT DISTINCT restaurant.city_name FROM restaurant WHERE rating = (SELECT MAX(rating) FROM restaurant);,Which city has the highest-rated restaurant?,Match all strings case-insensitively +restaurants,tsql,instruct,"SELECT restaurant.name, restaurant.rating FROM restaurant WHERE restaurant.rating > 4 AND restaurant.city_name COLLATE SQL_Latin1_General_CP1_CI_AS LIKE '%New York%';",What's the name and rating of all the restaurants that have a rating greater than 4 and are located in the city of New York?,Match all strings case-insensitively +restaurants,tsql,instruct,"SELECT restaurant.name, restaurant.food_type FROM restaurant JOIN location ON restaurant.id = location.restaurant_id WHERE location.street_name LIKE '%Market St%' COLLATE SQL_Latin1_General_CP1_CI_AS AND location.city_name LIKE '%San Francisco%' COLLATE SQL_Latin1_General_CP1_CI_AS;",What's the name and food type of all the restaurants located on Market St in San Francisco?,Match all strings case-insensitively +restaurants,tsql,instruct,SELECT restaurant.name FROM restaurant WHERE LOWER(restaurant.food_type) LIKE '%italian%';,What are the names of the restaurants that serve Italian food?,Match all strings case-insensitively +restaurants,tsql,instruct,"SELECT name FROM (SELECT DISTINCT restaurant.name, CASE WHEN restaurant.name IS NULL THEN 1 ELSE 0 END AS NameNullSort FROM restaurant WHERE restaurant.city_name LIKE '%Los Angeles%' COLLATE SQL_Latin1_General_CP1_CI_AS AND restaurant.rating > 4 ) AS sorted_restaurants ORDER BY NameNullSort, name;",What are the names of the restaurants in Los Angeles that have a rating higher than 4?,Match all strings case-insensitively scholar,tsql,date_functions,"SELECT COUNT(DISTINCT w.authorid) AS num_authors FROM paper AS p JOIN writes AS w ON p.paperid = w.paperid WHERE p.year < DATEPART(YEAR, DATEADD(YEAR, -1, GETDATE()));",How many authors have written a paper that was published 1 year or longer before today's date?, scholar,tsql,date_functions,SELECT COUNT(DISTINCT pk.keyphraseid) AS num_keyphrases FROM paper AS p JOIN paperkeyphrase AS pk ON p.paperid = pk.paperid WHERE p.year >= 2020 AND p.year <= 2035;,How many keyphrases are associated with papers published between 2020 and 2035?, scholar,tsql,date_functions,"SELECT YEAR, COUNT(*) AS num_papers FROM paper WHERE YEAR <> 2025 - 6 GROUP BY YEAR ORDER BY CASE WHEN YEAR IS NULL THEN 1 ELSE 0 END, YEAR;",What's the number of papers published per year excluding those published in the year that is 6 years before 2025?, From 22ae3dce7a1d074078a0e2c20e3e79516c2f392c Mon Sep 17 00:00:00 2001 From: Rishabh Srivastava Date: Tue, 25 Jun 2024 14:57:00 +0800 Subject: [PATCH 2/2] modified question for clarity --- data/questions_gen_bigquery.csv | 10 +++++----- data/questions_gen_mysql.csv | 10 +++++----- data/questions_gen_postgres.csv | 10 +++++----- data/questions_gen_sqlite.csv | 10 +++++----- data/questions_gen_tsql.csv | 10 +++++----- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/data/questions_gen_bigquery.csv b/data/questions_gen_bigquery.csv index ae8d89a..15b9839 100644 --- a/data/questions_gen_bigquery.csv +++ b/data/questions_gen_bigquery.csv @@ -145,11 +145,11 @@ restaurants,bigquery,table_join,"SELECT location.city_name, AVG(restaurant.ratin restaurants,bigquery,table_join,"SELECT geographic.region, AVG(restaurant.rating) AS average_rating FROM restaurants.geographic JOIN restaurants.restaurant ON geographic.city_name = restaurant.city_name GROUP BY 1;",What is the average rating of restaurants in each region?, restaurants,bigquery,table_join,"SELECT geographic.region, COUNT(restaurant.id) AS number_of_restaurants FROM restaurants.restaurant JOIN restaurants.geographic ON restaurant.city_name = geographic.city_name WHERE LOWER(restaurant.food_type) LIKE '%italian%' GROUP BY geographic.region ORDER BY number_of_restaurants DESC;",How many restaurants serve Italian food in each region?, restaurants,bigquery,table_join,"SELECT geographic.region, COUNT(DISTINCT restaurant.id) AS number_of_restaurants FROM restaurants.geographic JOIN restaurants.restaurant ON geographic.city_name = restaurant.city_name GROUP BY geographic.region ORDER BY number_of_restaurants DESC NULLS FIRST;SELECT geographic.region, COUNT(DISTINCT restaurant.id) AS number_of_restaurants FROM restaurants.geographic LEFT JOIN restaurants.restaurant ON geographic.city_name = restaurant.city_name GROUP BY geographic.region ORDER BY number_of_restaurants DESC NULLS FIRST;",How many restaurants are there in each region?, -restaurants,bigquery,instruct,SELECT DISTINCT restaurant.city_name FROM restaurants.restaurant WHERE rating = (SELECT MAX(rating) FROM restaurants.restaurant);,Which city has the highest-rated restaurant?,Match all strings case-insensitively -restaurants,bigquery,instruct,"SELECT restaurant.name, restaurant.rating FROM restaurants.restaurant WHERE restaurant.rating > 4 AND LOWER(restaurant.city_name) LIKE '%New York%';",What's the name and rating of all the restaurants that have a rating greater than 4 and are located in the city of New York?,Match all strings case-insensitively -restaurants,bigquery,instruct,"SELECT restaurant.name, restaurant.food_type FROM restaurants.restaurant JOIN restaurants.location ON restaurant.id = location.restaurant_id WHERE LOWER(location.street_name) LIKE '%market st%' AND LOWER(location.city_name) LIKE '%san francisco%';",What's the name and food type of all the restaurants located on Market St in San Francisco?,Match all strings case-insensitively -restaurants,bigquery,instruct,SELECT restaurant.name FROM restaurants.restaurant WHERE LOWER(LOWER(restaurant.food_type)) LIKE '%italian%';,What are the names of the restaurants that serve Italian food?,Match all strings case-insensitively -restaurants,bigquery,instruct,SELECT DISTINCT restaurant.name FROM restaurants.restaurant WHERE LOWER(restaurant.city_name) LIKE '%Los Angeles%' AND restaurant.rating > 4 ORDER BY restaurant.name NULLS LAST;,What are the names of the restaurants in Los Angeles that have a rating higher than 4?,Match all strings case-insensitively +restaurants,bigquery,instruct,SELECT DISTINCT restaurant.city_name FROM restaurants.restaurant WHERE rating = (SELECT MAX(rating) FROM restaurants.restaurant);,Which city has the highest-rated restaurant?,Match all strings case-insensitively using wildcard operators +restaurants,bigquery,instruct,"SELECT restaurant.name, restaurant.rating FROM restaurants.restaurant WHERE restaurant.rating > 4 AND LOWER(restaurant.city_name) LIKE '%New York%';",What's the name and rating of all the restaurants that have a rating greater than 4 and are located in the city of New York?,Match all strings case-insensitively using wildcard operators +restaurants,bigquery,instruct,"SELECT restaurant.name, restaurant.food_type FROM restaurants.restaurant JOIN restaurants.location ON restaurant.id = location.restaurant_id WHERE LOWER(location.street_name) LIKE '%market st%' AND LOWER(location.city_name) LIKE '%san francisco%';",What's the name and food type of all the restaurants located on Market St in San Francisco?,Match all strings case-insensitively using wildcard operators +restaurants,bigquery,instruct,SELECT restaurant.name FROM restaurants.restaurant WHERE LOWER(LOWER(restaurant.food_type)) LIKE '%italian%';,What are the names of the restaurants that serve Italian food?,Match all strings case-insensitively using wildcard operators +restaurants,bigquery,instruct,SELECT DISTINCT restaurant.name FROM restaurants.restaurant WHERE LOWER(restaurant.city_name) LIKE '%Los Angeles%' AND restaurant.rating > 4 ORDER BY restaurant.name NULLS LAST;,What are the names of the restaurants in Los Angeles that have a rating higher than 4?,Match all strings case-insensitively using wildcard operators scholar,bigquery,date_functions,SELECT COUNT(DISTINCT w.authorid) AS num_authors FROM scholar.paper AS p JOIN scholar.writes AS w ON p.paperid = w.paperid WHERE p.year < EXTRACT(YEAR FROM CURRENT_DATE - INTERVAL '1' YEAR);,How many authors have written a paper that was published 1 year or longer before today's date?, scholar,bigquery,date_functions,SELECT COUNT(DISTINCT pk.keyphraseid) AS num_keyphrases FROM scholar.paper AS p JOIN scholar.paperkeyphrase AS pk ON p.paperid = pk.paperid WHERE p.year >= 2020 AND p.year <= 2035;,How many keyphrases are associated with papers published between 2020 and 2035?, scholar,bigquery,date_functions,"SELECT YEAR, COUNT(*) AS num_papers FROM scholar.paper WHERE YEAR <> 2025 - 6 GROUP BY YEAR ORDER BY YEAR NULLS LAST;",What's the number of papers published per year excluding those published in the year that is 6 years before 2025?, diff --git a/data/questions_gen_mysql.csv b/data/questions_gen_mysql.csv index 9b39ec0..c10bccf 100644 --- a/data/questions_gen_mysql.csv +++ b/data/questions_gen_mysql.csv @@ -145,11 +145,11 @@ restaurants,mysql,table_join,"SELECT location.city_name, AVG(restaurant.rating) restaurants,mysql,table_join,"SELECT geographic.region, AVG(restaurant.rating) AS average_rating FROM geographic JOIN restaurant ON geographic.city_name = restaurant.city_name GROUP BY 1",What is the average rating of restaurants in each region?, restaurants,mysql,table_join,"SELECT geographic.region, COUNT(restaurant.id) AS number_of_restaurants FROM restaurant JOIN geographic ON restaurant.city_name = geographic.city_name WHERE LOWER(restaurant.food_type) LIKE '%italian%' GROUP BY geographic.region ORDER BY number_of_restaurants DESC",How many restaurants serve Italian food in each region?, restaurants,mysql,table_join,"SELECT geographic.region, COUNT(DISTINCT restaurant.id) AS number_of_restaurants FROM geographic JOIN restaurant ON geographic.city_name = restaurant.city_name GROUP BY geographic.region ORDER BY CASE WHEN number_of_restaurants IS NULL THEN 1 ELSE 0 END DESC, number_of_restaurants DESC;SELECT geographic.region, COUNT(DISTINCT restaurant.id) AS number_of_restaurants FROM geographic LEFT JOIN restaurant ON geographic.city_name = restaurant.city_name GROUP BY geographic.region ORDER BY CASE WHEN number_of_restaurants IS NULL THEN 1 ELSE 0 END DESC, number_of_restaurants DESC",How many restaurants are there in each region?, -restaurants,mysql,instruct,SELECT DISTINCT restaurant.city_name FROM restaurant WHERE rating = (SELECT MAX(rating) FROM restaurant),Which city has the highest-rated restaurant?,Match all strings case-insensitively -restaurants,mysql,instruct,"SELECT restaurant.name, restaurant.rating FROM restaurant WHERE restaurant.rating > 4 AND LOWER(restaurant.city_name) LIKE '%New York%'",What's the name and rating of all the restaurants that have a rating greater than 4 and are located in the city of New York?,Match all strings case-insensitively -restaurants,mysql,instruct,"SELECT restaurant.name, restaurant.food_type FROM restaurant JOIN LOCATION ON restaurant.id = location.restaurant_id WHERE LOWER(location.street_name) LIKE '%Market St%' AND LOWER(location.city_name) LIKE '%San Francisco%'",What's the name and food type of all the restaurants located on Market St in San Francisco?,Match all strings case-insensitively -restaurants,mysql,instruct,SELECT restaurant.name FROM restaurant WHERE LOWER(LOWER(restaurant.food_type)) LIKE '%italian%',What are the names of the restaurants that serve Italian food?,Match all strings case-insensitively -restaurants,mysql,instruct,"SELECT DISTINCT restaurant.name FROM restaurant WHERE LOWER(restaurant.city_name) LIKE '%Los Angeles%' AND restaurant.rating > 4 ORDER BY CASE WHEN restaurant.name IS NULL THEN 1 ELSE 0 END, restaurant.name",What are the names of the restaurants in Los Angeles that have a rating higher than 4?,Match all strings case-insensitively +restaurants,mysql,instruct,SELECT DISTINCT restaurant.city_name FROM restaurant WHERE rating = (SELECT MAX(rating) FROM restaurant),Which city has the highest-rated restaurant?,Match all strings case-insensitively using wildcard operators +restaurants,mysql,instruct,"SELECT restaurant.name, restaurant.rating FROM restaurant WHERE restaurant.rating > 4 AND LOWER(restaurant.city_name) LIKE '%New York%'",What's the name and rating of all the restaurants that have a rating greater than 4 and are located in the city of New York?,Match all strings case-insensitively using wildcard operators +restaurants,mysql,instruct,"SELECT restaurant.name, restaurant.food_type FROM restaurant JOIN LOCATION ON restaurant.id = location.restaurant_id WHERE LOWER(location.street_name) LIKE '%Market St%' AND LOWER(location.city_name) LIKE '%San Francisco%'",What's the name and food type of all the restaurants located on Market St in San Francisco?,Match all strings case-insensitively using wildcard operators +restaurants,mysql,instruct,SELECT restaurant.name FROM restaurant WHERE LOWER(LOWER(restaurant.food_type)) LIKE '%italian%',What are the names of the restaurants that serve Italian food?,Match all strings case-insensitively using wildcard operators +restaurants,mysql,instruct,"SELECT DISTINCT restaurant.name FROM restaurant WHERE LOWER(restaurant.city_name) LIKE '%Los Angeles%' AND restaurant.rating > 4 ORDER BY CASE WHEN restaurant.name IS NULL THEN 1 ELSE 0 END, restaurant.name",What are the names of the restaurants in Los Angeles that have a rating higher than 4?,Match all strings case-insensitively using wildcard operators scholar,mysql,date_functions,SELECT COUNT(DISTINCT w.authorid) AS num_authors FROM paper AS p JOIN writes AS w ON p.paperid = w.paperid WHERE p.year < EXTRACT(YEAR FROM CURRENT_DATE - INTERVAL '1' YEAR),How many authors have written a paper that was published 1 year or longer before today's date?, scholar,mysql,date_functions,SELECT COUNT(DISTINCT pk.keyphraseid) AS num_keyphrases FROM paper AS p JOIN paperkeyphrase AS pk ON p.paperid = pk.paperid WHERE p.year >= 2020 AND p.year <= 2035,How many keyphrases are associated with papers published between 2020 and 2035?, scholar,mysql,date_functions,"SELECT YEAR, COUNT(*) AS num_papers FROM paper WHERE YEAR <> 2025 - 6 GROUP BY YEAR ORDER BY CASE WHEN YEAR IS NULL THEN 1 ELSE 0 END, YEAR",What's the number of papers published per year excluding those published in the year that is 6 years before 2025?, diff --git a/data/questions_gen_postgres.csv b/data/questions_gen_postgres.csv index 2897fb4..0ad0e96 100644 --- a/data/questions_gen_postgres.csv +++ b/data/questions_gen_postgres.csv @@ -140,11 +140,11 @@ What is the average rating of restaurants that serve Mexican food in each city?, What is the average rating of restaurants in each region?,"SELECT geographic.region, AVG(restaurant.rating) AS average_rating FROM geographic JOIN restaurant ON geographic.city_name=restaurant.city_name GROUP BY 1;",restaurants,table_join, How many restaurants serve Italian food in each region?,"SELECT geographic.region, COUNT(restaurant.id) AS number_of_restaurants FROM restaurant JOIN geographic ON restaurant.city_name = geographic.city_name WHERE LOWER(restaurant.food_type) LIKE '%italian%' GROUP BY geographic.region ORDER BY number_of_restaurants DESC NULLS LAST;",restaurants,table_join, How many restaurants are there in each region?,"SELECT geographic.region, COUNT(DISTINCT restaurant.id) AS number_of_restaurants FROM geographic JOIN restaurant ON geographic.city_name = restaurant.city_name GROUP BY geographic.region ORDER BY number_of_restaurants DESC;SELECT geographic.region, COUNT(DISTINCT restaurant.id) AS number_of_restaurants FROM geographic LEFT JOIN restaurant ON geographic.city_name = restaurant.city_name GROUP BY geographic.region ORDER BY number_of_restaurants DESC;",restaurants,table_join, -Which city has the highest-rated restaurant?,SELECT DISTINCT restaurant.city_name FROM restaurant WHERE rating=(SELECT MAX(rating) FROM restaurant);,restaurants,instruct,Match all strings case-insensitively -What's the name and rating of all the restaurants that have a rating greater than 4 and are located in the city of New York?,"SELECT restaurant.name, restaurant.rating FROM restaurant WHERE restaurant.rating > 4 AND restaurant.city_name ILIKE '%New York%';",restaurants,instruct,Match all strings case-insensitively -What's the name and food type of all the restaurants located on Market St in San Francisco?,"SELECT restaurant.name, restaurant.food_type FROM restaurant JOIN LOCATION ON restaurant.id = location.restaurant_id WHERE location.street_name ILIKE '%Market St%' AND location.city_name ILIKE '%San Francisco%';",restaurants,instruct,Match all strings case-insensitively -What are the names of the restaurants that serve Italian food?,SELECT restaurant.name FROM restaurant WHERE LOWER(restaurant.food_type) ILIKE '%italian%';,restaurants,instruct,Match all strings case-insensitively -What are the names of the restaurants in Los Angeles that have a rating higher than 4?,SELECT DISTINCT restaurant.name FROM restaurant WHERE restaurant.city_name ILIKE '%Los Angeles%' AND restaurant.rating > 4 ORDER BY restaurant.name NULLS LAST;,restaurants,instruct,Match all strings case-insensitively +Which city has the highest-rated restaurant?,SELECT DISTINCT restaurant.city_name FROM restaurant WHERE rating=(SELECT MAX(rating) FROM restaurant);,restaurants,instruct,Match all strings case-insensitively using wildcard operators +What's the name and rating of all the restaurants that have a rating greater than 4 and are located in the city of New York?,"SELECT restaurant.name, restaurant.rating FROM restaurant WHERE restaurant.rating > 4 AND restaurant.city_name ILIKE '%New York%';",restaurants,instruct,Match all strings case-insensitively using wildcard operators +What's the name and food type of all the restaurants located on Market St in San Francisco?,"SELECT restaurant.name, restaurant.food_type FROM restaurant JOIN LOCATION ON restaurant.id = location.restaurant_id WHERE location.street_name ILIKE '%Market St%' AND location.city_name ILIKE '%San Francisco%';",restaurants,instruct,Match all strings case-insensitively using wildcard operators +What are the names of the restaurants that serve Italian food?,SELECT restaurant.name FROM restaurant WHERE LOWER(restaurant.food_type) ILIKE '%italian%';,restaurants,instruct,Match all strings case-insensitively using wildcard operators +What are the names of the restaurants in Los Angeles that have a rating higher than 4?,SELECT DISTINCT restaurant.name FROM restaurant WHERE restaurant.city_name ILIKE '%Los Angeles%' AND restaurant.rating > 4 ORDER BY restaurant.name NULLS LAST;,restaurants,instruct,Match all strings case-insensitively using wildcard operators What is the total number of papers published per year?,"SELECT paper.year, COUNT(paper.paperid) AS total_papers FROM paper GROUP BY paper.year ORDER BY paper.year NULLS LAST;",scholar,group_by, What is the total number of papers published in each year?,"SELECT paper.year, COUNT(paper.paperid) AS total_papers FROM paper GROUP BY paper.year ORDER BY paper.year;",scholar,group_by, What is the total number of papers associated with each dataset?,"SELECT paperdataset.datasetid, COUNT(DISTINCT paperdataset.paperid) AS total_papers FROM paperdataset GROUP BY paperdataset.datasetid;SELECT dataset.datasetname, COUNT(paperdataset.paperid) AS total_papers FROM paperdataset JOIN dataset ON paperdataset.datasetid = dataset.datasetid GROUP BY dataset.datasetname;",scholar,group_by, diff --git a/data/questions_gen_sqlite.csv b/data/questions_gen_sqlite.csv index 63f4fce..a7addc4 100644 --- a/data/questions_gen_sqlite.csv +++ b/data/questions_gen_sqlite.csv @@ -145,11 +145,11 @@ restaurants,sqlite,table_join,"SELECT location.city_name, AVG(restaurant.rating) restaurants,sqlite,table_join,"SELECT geographic.region, AVG(restaurant.rating) AS average_rating FROM geographic JOIN restaurant ON geographic.city_name = restaurant.city_name GROUP BY 1;",What is the average rating of restaurants in each region?, restaurants,sqlite,table_join,"SELECT geographic.region, COUNT(restaurant.id) AS number_of_restaurants FROM restaurant JOIN geographic ON restaurant.city_name = geographic.city_name WHERE LOWER(restaurant.food_type) LIKE '%italian%' GROUP BY geographic.region ORDER BY number_of_restaurants DESC;",How many restaurants serve Italian food in each region?, restaurants,sqlite,table_join,"SELECT geographic.region, COUNT(DISTINCT restaurant.id) AS number_of_restaurants FROM geographic JOIN restaurant ON geographic.city_name = restaurant.city_name GROUP BY geographic.region ORDER BY CASE WHEN number_of_restaurants IS NULL THEN 1 ELSE 0 END DESC, number_of_restaurants DESC;SELECT geographic.region, COUNT(DISTINCT restaurant.id) AS number_of_restaurants FROM geographic LEFT JOIN restaurant ON geographic.city_name = restaurant.city_name GROUP BY geographic.region ORDER BY CASE WHEN number_of_restaurants IS NULL THEN 1 ELSE 0 END DESC, number_of_restaurants DESC;",How many restaurants are there in each region?, -restaurants,sqlite,instruct,SELECT DISTINCT restaurant.city_name FROM restaurant WHERE rating = (SELECT MAX(rating) FROM restaurant);,Which city has the highest-rated restaurant?,Match all strings case-insensitively -restaurants,sqlite,instruct,"SELECT restaurant.name, restaurant.rating FROM restaurant WHERE restaurant.rating > 4 AND LOWER(restaurant.city_name) LIKE '%New York%';",What's the name and rating of all the restaurants that have a rating greater than 4 and are located in the city of New York?,Match all strings case-insensitively -restaurants,sqlite,instruct,"SELECT restaurant.name, restaurant.food_type FROM restaurant JOIN LOCATION ON restaurant.id = location.restaurant_id WHERE LOWER(location.street_name) LIKE '%Market St%' AND LOWER(location.city_name) LIKE '%San Francisco%';",What's the name and food type of all the restaurants located on Market St in San Francisco?,Match all strings case-insensitively -restaurants,sqlite,instruct,SELECT restaurant.name FROM restaurant WHERE LOWER(LOWER(restaurant.food_type)) LIKE '%italian%';,What are the names of the restaurants that serve Italian food?,Match all strings case-insensitively -restaurants,sqlite,instruct,"SELECT DISTINCT restaurant.name FROM restaurant WHERE LOWER(restaurant.city_name) LIKE '%Los Angeles%' AND restaurant.rating > 4 ORDER BY CASE WHEN restaurant.name IS NULL THEN 1 ELSE 0 END, restaurant.name;",What are the names of the restaurants in Los Angeles that have a rating higher than 4?,Match all strings case-insensitively +restaurants,sqlite,instruct,SELECT DISTINCT restaurant.city_name FROM restaurant WHERE rating = (SELECT MAX(rating) FROM restaurant);,Which city has the highest-rated restaurant?,Match all strings case-insensitively using wildcard operators +restaurants,sqlite,instruct,"SELECT restaurant.name, restaurant.rating FROM restaurant WHERE restaurant.rating > 4 AND LOWER(restaurant.city_name) LIKE '%New York%';",What's the name and rating of all the restaurants that have a rating greater than 4 and are located in the city of New York?,Match all strings case-insensitively using wildcard operators +restaurants,sqlite,instruct,"SELECT restaurant.name, restaurant.food_type FROM restaurant JOIN LOCATION ON restaurant.id = location.restaurant_id WHERE LOWER(location.street_name) LIKE '%Market St%' AND LOWER(location.city_name) LIKE '%San Francisco%';",What's the name and food type of all the restaurants located on Market St in San Francisco?,Match all strings case-insensitively using wildcard operators +restaurants,sqlite,instruct,SELECT restaurant.name FROM restaurant WHERE LOWER(LOWER(restaurant.food_type)) LIKE '%italian%';,What are the names of the restaurants that serve Italian food?,Match all strings case-insensitively using wildcard operators +restaurants,sqlite,instruct,"SELECT DISTINCT restaurant.name FROM restaurant WHERE LOWER(restaurant.city_name) LIKE '%Los Angeles%' AND restaurant.rating > 4 ORDER BY CASE WHEN restaurant.name IS NULL THEN 1 ELSE 0 END, restaurant.name;",What are the names of the restaurants in Los Angeles that have a rating higher than 4?,Match all strings case-insensitively using wildcard operators scholar,sqlite,date_functions,"SELECT COUNT(DISTINCT w.authorid) AS num_authors FROM paper AS p JOIN writes AS w ON p.paperid = w.paperid WHERE p.year < strftime('%Y', 'now') - 1;",How many authors have written a paper that was published 1 year or longer before today's date?, scholar,sqlite,date_functions,SELECT COUNT(DISTINCT pk.keyphraseid) AS num_keyphrases FROM paper AS p JOIN paperkeyphrase AS pk ON p.paperid = pk.paperid WHERE p.year >= 2020 AND p.year <= 2035;,How many keyphrases are associated with papers published between 2020 and 2035?, scholar,sqlite,date_functions,"SELECT YEAR, COUNT(*) AS num_papers FROM paper WHERE YEAR <> 2025 - 6 GROUP BY YEAR ORDER BY CASE WHEN YEAR IS NULL THEN 1 ELSE 0 END, YEAR;",What's the number of papers published per year excluding those published in the year that is 6 years before 2025?, diff --git a/data/questions_gen_tsql.csv b/data/questions_gen_tsql.csv index d1a8720..c6b2755 100644 --- a/data/questions_gen_tsql.csv +++ b/data/questions_gen_tsql.csv @@ -145,11 +145,11 @@ restaurants,tsql,table_join,"SELECT location.city_name, AVG(restaurant.rating) A restaurants,tsql,table_join,"SELECT geographic.region, AVG(restaurant.rating) AS average_rating FROM geographic JOIN restaurant ON geographic.city_name = restaurant.city_name GROUP BY geographic.region;",What is the average rating of restaurants in each region?, restaurants,tsql,table_join,"SELECT geographic.region, COUNT(restaurant.id) AS number_of_restaurants FROM restaurant JOIN geographic ON restaurant.city_name = geographic.city_name WHERE LOWER(restaurant.food_type) LIKE '%italian%' GROUP BY geographic.region ORDER BY number_of_restaurants DESC;",How many restaurants serve Italian food in each region?, restaurants,tsql,table_join,"SELECT geographic.region, COUNT(DISTINCT restaurant.id) AS number_of_restaurants FROM geographic JOIN restaurant ON geographic.city_name = restaurant.city_name GROUP BY geographic.region ORDER BY COUNT(DISTINCT restaurant.id) DESC;SELECT geographic.region, COUNT(DISTINCT restaurant.id) AS number_of_restaurants FROM geographic LEFT JOIN restaurant ON geographic.city_name = restaurant.city_name GROUP BY geographic.region ORDER BY COUNT(DISTINCT restaurant.id) DESC;",How many restaurants are there in each region?, -restaurants,tsql,instruct,SELECT DISTINCT restaurant.city_name FROM restaurant WHERE rating = (SELECT MAX(rating) FROM restaurant);,Which city has the highest-rated restaurant?,Match all strings case-insensitively -restaurants,tsql,instruct,"SELECT restaurant.name, restaurant.rating FROM restaurant WHERE restaurant.rating > 4 AND restaurant.city_name COLLATE SQL_Latin1_General_CP1_CI_AS LIKE '%New York%';",What's the name and rating of all the restaurants that have a rating greater than 4 and are located in the city of New York?,Match all strings case-insensitively -restaurants,tsql,instruct,"SELECT restaurant.name, restaurant.food_type FROM restaurant JOIN location ON restaurant.id = location.restaurant_id WHERE location.street_name LIKE '%Market St%' COLLATE SQL_Latin1_General_CP1_CI_AS AND location.city_name LIKE '%San Francisco%' COLLATE SQL_Latin1_General_CP1_CI_AS;",What's the name and food type of all the restaurants located on Market St in San Francisco?,Match all strings case-insensitively -restaurants,tsql,instruct,SELECT restaurant.name FROM restaurant WHERE LOWER(restaurant.food_type) LIKE '%italian%';,What are the names of the restaurants that serve Italian food?,Match all strings case-insensitively -restaurants,tsql,instruct,"SELECT name FROM (SELECT DISTINCT restaurant.name, CASE WHEN restaurant.name IS NULL THEN 1 ELSE 0 END AS NameNullSort FROM restaurant WHERE restaurant.city_name LIKE '%Los Angeles%' COLLATE SQL_Latin1_General_CP1_CI_AS AND restaurant.rating > 4 ) AS sorted_restaurants ORDER BY NameNullSort, name;",What are the names of the restaurants in Los Angeles that have a rating higher than 4?,Match all strings case-insensitively +restaurants,tsql,instruct,SELECT DISTINCT restaurant.city_name FROM restaurant WHERE rating = (SELECT MAX(rating) FROM restaurant);,Which city has the highest-rated restaurant?,Match all strings case-insensitively using wildcard operators +restaurants,tsql,instruct,"SELECT restaurant.name, restaurant.rating FROM restaurant WHERE restaurant.rating > 4 AND restaurant.city_name COLLATE SQL_Latin1_General_CP1_CI_AS LIKE '%New York%';",What's the name and rating of all the restaurants that have a rating greater than 4 and are located in the city of New York?,Match all strings case-insensitively using wildcard operators +restaurants,tsql,instruct,"SELECT restaurant.name, restaurant.food_type FROM restaurant JOIN location ON restaurant.id = location.restaurant_id WHERE location.street_name LIKE '%Market St%' COLLATE SQL_Latin1_General_CP1_CI_AS AND location.city_name LIKE '%San Francisco%' COLLATE SQL_Latin1_General_CP1_CI_AS;",What's the name and food type of all the restaurants located on Market St in San Francisco?,Match all strings case-insensitively using wildcard operators +restaurants,tsql,instruct,SELECT restaurant.name FROM restaurant WHERE LOWER(restaurant.food_type) LIKE '%italian%';,What are the names of the restaurants that serve Italian food?,Match all strings case-insensitively using wildcard operators +restaurants,tsql,instruct,"SELECT name FROM (SELECT DISTINCT restaurant.name, CASE WHEN restaurant.name IS NULL THEN 1 ELSE 0 END AS NameNullSort FROM restaurant WHERE restaurant.city_name LIKE '%Los Angeles%' COLLATE SQL_Latin1_General_CP1_CI_AS AND restaurant.rating > 4 ) AS sorted_restaurants ORDER BY NameNullSort, name;",What are the names of the restaurants in Los Angeles that have a rating higher than 4?,Match all strings case-insensitively using wildcard operators scholar,tsql,date_functions,"SELECT COUNT(DISTINCT w.authorid) AS num_authors FROM paper AS p JOIN writes AS w ON p.paperid = w.paperid WHERE p.year < DATEPART(YEAR, DATEADD(YEAR, -1, GETDATE()));",How many authors have written a paper that was published 1 year or longer before today's date?, scholar,tsql,date_functions,SELECT COUNT(DISTINCT pk.keyphraseid) AS num_keyphrases FROM paper AS p JOIN paperkeyphrase AS pk ON p.paperid = pk.paperid WHERE p.year >= 2020 AND p.year <= 2035;,How many keyphrases are associated with papers published between 2020 and 2035?, scholar,tsql,date_functions,"SELECT YEAR, COUNT(*) AS num_papers FROM paper WHERE YEAR <> 2025 - 6 GROUP BY YEAR ORDER BY CASE WHEN YEAR IS NULL THEN 1 ELSE 0 END, YEAR;",What's the number of papers published per year excluding those published in the year that is 6 years before 2025?,