question
string
answer
string
context
string
dialect
string
spider_hardness
string
extended_hardness
string
classification_status
string
syntax_status
string
ddl_syntax_status
string
schema_status
string
syntax_errors
list
ddl_syntax_errors
list
schema_errors
list
classification_errors
list
status_history
list
correction_status
string
component1
int64
component2
int64
others
int64
validation_source
dict
How many characteristics does the product named "laurel" have?
SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = 'laurel'
CREATE TABLE CHARACTERISTICS (characteristic_id VARCHAR(255), characteristic_name VARCHAR(255)); CREATE TABLE products (product_id VARCHAR(255), product_name VARCHAR(255)); CREATE TABLE product_characteristics (product_id VARCHAR(255), characteristic_id VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
3
0
0
{ "split": "train", "row_index": 3151 }
Find the number of characteristics that the product "flax" has.
SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = 'flax'
CREATE TABLE CHARACTERISTICS (characteristic_id VARCHAR(255), characteristic_name VARCHAR(255)); CREATE TABLE products (product_id VARCHAR(255), product_name VARCHAR(255)); CREATE TABLE product_characteristics (product_id VARCHAR(255), characteristic_id VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
3
0
0
{ "split": "train", "row_index": 3152 }
How many products have the characteristic named "hot"?
SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t3.characteristic_name = 'hot'
CREATE TABLE products (product_id VARCHAR(255), product_name VARCHAR(255)); CREATE TABLE CHARACTERISTICS (characteristic_id VARCHAR(255), characteristic_name VARCHAR(255)); CREATE TABLE product_characteristics (product_id VARCHAR(255), characteristic_id VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
3
0
0
{ "split": "train", "row_index": 3154 }
List the all the distinct names of the products with the characteristic name 'warm'.
SELECT DISTINCT t1.product_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t3.characteristic_name = 'warm'
CREATE TABLE CHARACTERISTICS (characteristic_id VARCHAR(255), characteristic_name VARCHAR(255)); CREATE TABLE products (product_name VARCHAR(255), product_id VARCHAR(255)); CREATE TABLE product_characteristics (product_id VARCHAR(255), characteristic_id VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
3
0
0
{ "split": "train", "row_index": 3155 }
Find the number of the products that have their color described as "red" and have a characteristic named "slow".
SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = 'red' AND t3.characteristic_name = 'slow'
CREATE TABLE CHARACTERISTICS (characteristic_id VARCHAR(255), characteristic_name VARCHAR(255)); CREATE TABLE ref_colors (color_code VARCHAR(255), color_description VARCHAR(255)); CREATE TABLE products (product_id VARCHAR(255), color_code VARCHAR(255)); CREATE TABLE product_characteristics (product_id VARCHAR(255), cha...
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
4
0
1
{ "split": "train", "row_index": 3156 }
Count the products that have the color description "white" or have the characteristic name "hot".
SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = 'white' OR t3.characteristic_name = 'hot'
CREATE TABLE CHARACTERISTICS (characteristic_id VARCHAR(255), characteristic_name VARCHAR(255)); CREATE TABLE ref_colors (color_code VARCHAR(255), color_description VARCHAR(255)); CREATE TABLE products (product_id VARCHAR(255), color_code VARCHAR(255)); CREATE TABLE product_characteristics (product_id VARCHAR(255), cha...
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
5
0
1
{ "split": "train", "row_index": 3157 }
What is the unit of measuerment of the product category code "Herbs"?
SELECT unit_of_measure FROM ref_product_categories WHERE product_category_code = 'Herbs'
CREATE TABLE ref_product_categories (unit_of_measure VARCHAR(255), product_category_code VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
0
{ "split": "train", "row_index": 3158 }
Find the product category description of the product category with code "Spices".
SELECT product_category_description FROM ref_product_categories WHERE product_category_code = 'Spices'
CREATE TABLE ref_product_categories (product_category_description VARCHAR(255), product_category_code VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
0
{ "split": "train", "row_index": 3159 }
What is the product category description and unit of measurement of category "Herbs"?
SELECT product_category_description, unit_of_measure FROM ref_product_categories WHERE product_category_code = 'Herbs'
CREATE TABLE ref_product_categories (product_category_description VARCHAR(255), unit_of_measure VARCHAR(255), product_category_code VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
1
{ "split": "train", "row_index": 3160 }
What is the unit of measurement of product named "cumin"?
SELECT t2.unit_of_measure FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code WHERE t1.product_name = 'cumin'
CREATE TABLE ref_product_categories (unit_of_measure VARCHAR(255), product_category_code VARCHAR(255)); CREATE TABLE products (product_category_code VARCHAR(255), product_name VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
0
{ "split": "train", "row_index": 3161 }
Find the unit of measurement and product category code of product named "chervil".
SELECT t2.unit_of_measure, t2.product_category_code FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code WHERE t1.product_name = 'chervil'
CREATE TABLE ref_product_categories (unit_of_measure VARCHAR(255), product_category_code VARCHAR(255)); CREATE TABLE products (product_category_code VARCHAR(255), product_name VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
1
{ "split": "train", "row_index": 3162 }
Find the product names that are colored 'white' but do not have unit of measurement "Handful".
SELECT t1.product_name FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code JOIN ref_colors AS t3 ON t1.color_code = t3.color_code WHERE t3.color_description = 'white' AND t2.unit_of_measure <> 'Handful'
CREATE TABLE products (product_name VARCHAR(255), product_category_code VARCHAR(255), color_code VARCHAR(255)); CREATE TABLE ref_colors (color_code VARCHAR(255), color_description VARCHAR(255)); CREATE TABLE ref_product_categories (product_category_code VARCHAR(255), unit_of_measure VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
3
0
1
{ "split": "train", "row_index": 3163 }
What is the description of the color for most products?
SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code GROUP BY t2.color_description ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE ref_colors (color_description VARCHAR(255), color_code VARCHAR(255)); CREATE TABLE products (color_code VARCHAR(255), product_name VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
4
0
0
{ "split": "train", "row_index": 3164 }
What is the description of the color used by least products?
SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code GROUP BY t2.color_description ORDER BY COUNT(*) LIMIT 1
CREATE TABLE ref_colors (color_description VARCHAR(255), color_code VARCHAR(255)); CREATE TABLE products (color_code VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
4
0
0
{ "split": "train", "row_index": 3165 }
What is the characteristic name used by most number of the products?
SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id GROUP BY t3.characteristic_name ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE products (product_id VARCHAR(255), name VARCHAR(255)); CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR(255), characteristic_id VARCHAR(255)); CREATE TABLE product_characteristics (product_id VARCHAR(255), characteristic_id VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
5
0
0
{ "split": "train", "row_index": 3166 }
What are characteristic names used at least twice across all products?
SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id GROUP BY t3.characteristic_name HAVING COUNT(*) >= 2
CREATE TABLE products (product_id VARCHAR(255), name VARCHAR(255)); CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR(255), characteristic_id VARCHAR(255)); CREATE TABLE product_characteristics (product_id VARCHAR(255), characteristic_id VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
3
0
0
{ "split": "train", "row_index": 3168 }
How many colors are never used by any product?
SELECT COUNT(*) FROM Ref_colors WHERE NOT color_code IN (SELECT color_code FROM products)
CREATE TABLE products (color_code VARCHAR(255)); CREATE TABLE Ref_colors (color_code VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
1
1
{ "split": "train", "row_index": 3169 }
How many events are there?
SELECT COUNT(*) FROM event
CREATE TABLE event (Id VARCHAR(255), name VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
0
0
{ "split": "train", "row_index": 3170 }
List all the event names by year from the most recent to the oldest.
SELECT name FROM event ORDER BY YEAR DESC
CREATE TABLE event (name VARCHAR(255), YEAR VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
0
{ "split": "train", "row_index": 3171 }
What is the name of the event that happened in the most recent year?
SELECT name FROM event ORDER BY YEAR DESC LIMIT 1
CREATE TABLE event (name VARCHAR(255), YEAR VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
0
{ "split": "train", "row_index": 3172 }
How many stadiums are there?
SELECT COUNT(*) FROM stadium
CREATE TABLE stadium (Id VARCHAR(255), name VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
0
0
{ "split": "train", "row_index": 3173 }
Find the name of the stadium that has the maximum capacity.
SELECT name FROM stadium ORDER BY capacity DESC LIMIT 1
CREATE TABLE stadium (name VARCHAR(255), capacity VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
0
{ "split": "train", "row_index": 3174 }
Find the names of stadiums whose capacity is smaller than the average capacity.
SELECT name FROM stadium WHERE capacity < (SELECT AVG(capacity) FROM stadium)
CREATE TABLE stadium (name VARCHAR(255), capacity INTEGER)
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
1
0
{ "split": "train", "row_index": 3175 }
Find the country that has the most stadiums.
SELECT country FROM stadium GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE stadium (country VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
3
0
0
{ "split": "train", "row_index": 3176 }
Which country has at most 3 stadiums listed?
SELECT country FROM stadium GROUP BY country HAVING COUNT(*) <= 3
CREATE TABLE stadium (country VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
0
{ "split": "train", "row_index": 3177 }
Which country has both stadiums with capacity greater than 60000 and stadiums with capacity less than 50000?
SELECT country FROM stadium WHERE capacity > 60000 INTERSECT SELECT country FROM stadium WHERE capacity < 50000
CREATE TABLE stadium (country VARCHAR(255), capacity INTEGER)
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
1
0
{ "split": "train", "row_index": 3178 }
How many cities have a stadium that was opened before the year of 2006?
SELECT COUNT(DISTINCT city) FROM stadium WHERE opening_year < 2006
CREATE TABLE stadium (city VARCHAR(255), opening_year INTEGER)
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
0
{ "split": "train", "row_index": 3179 }
How many stadiums does each country have?
SELECT country, COUNT(*) FROM stadium GROUP BY country
CREATE TABLE stadium (country VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
1
{ "split": "train", "row_index": 3180 }
Which countries do not have a stadium that was opened after 2006?
SELECT country FROM stadium EXCEPT SELECT country FROM stadium WHERE opening_year > 2006
CREATE TABLE stadium (country VARCHAR(255), opening_year INTEGER)
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
1
0
{ "split": "train", "row_index": 3181 }
How many stadiums are not in country "Russia"?
SELECT COUNT(*) FROM stadium WHERE country <> 'Russia'
CREATE TABLE stadium (country VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
0
{ "split": "train", "row_index": 3182 }
Find the names of all swimmers, sorted by their 100 meter scores in ascending order.
SELECT name FROM swimmer ORDER BY meter_100
CREATE TABLE swimmer (name VARCHAR(255), meter_100 VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
0
{ "split": "train", "row_index": 3183 }
How many different countries are all the swimmers from?
SELECT COUNT(DISTINCT nationality) FROM swimmer
CREATE TABLE swimmer (nationality VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
0
0
{ "split": "train", "row_index": 3184 }
List countries that have more than one swimmer.
SELECT nationality, COUNT(*) FROM swimmer GROUP BY nationality HAVING COUNT(*) > 1
CREATE TABLE swimmer (nationality VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
1
{ "split": "train", "row_index": 3185 }
Find all 200 meter and 300 meter results of swimmers with nationality "Australia".
SELECT meter_200, meter_300 FROM swimmer WHERE nationality = 'Australia'
CREATE TABLE swimmer (meter_200 VARCHAR(255), meter_300 VARCHAR(255), nationality VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
1
{ "split": "train", "row_index": 3186 }
What is the name of the stadium which held the most events?
SELECT t1.name FROM stadium AS t1 JOIN event AS t2 ON t1.id = t2.stadium_id GROUP BY t2.stadium_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE stadium (name VARCHAR(255), id VARCHAR(255)); CREATE TABLE event (stadium_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
4
0
0
{ "split": "train", "row_index": 3188 }
Find the name and capacity of the stadium where the event named "World Junior" happened.
SELECT t1.name, t1.capacity FROM stadium AS t1 JOIN event AS t2 ON t1.id = t2.stadium_id WHERE t2.name = 'World Junior'
CREATE TABLE event (stadium_id VARCHAR(255), name VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE stadium (name VARCHAR(255), capacity VARCHAR(255), id VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
1
{ "split": "train", "row_index": 3189 }
Find the names of stadiums which have never had any event.
SELECT name FROM stadium WHERE NOT id IN (SELECT stadium_id FROM event)
CREATE TABLE stadium (name VARCHAR(255), id VARCHAR(255), stadium_id VARCHAR(255)); CREATE TABLE event (name VARCHAR(255), id VARCHAR(255), stadium_id VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
1
0
{ "split": "train", "row_index": 3190 }
Find the name of the swimmer who has the most records.
SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id GROUP BY t2.swimmer_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE record (swimmer_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE swimmer (name VARCHAR(255), id VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
4
0
0
{ "split": "train", "row_index": 3191 }
Find the name of the swimmer who has at least 2 records.
SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id GROUP BY t2.swimmer_id HAVING COUNT(*) >= 2
CREATE TABLE record (swimmer_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE swimmer (name VARCHAR(255), id VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
0
{ "split": "train", "row_index": 3192 }
Find the names of the swimmers who have no record.
SELECT name FROM swimmer WHERE NOT id IN (SELECT swimmer_id FROM record)
CREATE TABLE swimmer (name VARCHAR(255), id VARCHAR(255), swimmer_id VARCHAR(255)); CREATE TABLE record (name VARCHAR(255), id VARCHAR(255), swimmer_id VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
1
0
{ "split": "train", "row_index": 3194 }
Find the names of stadiums that some Australian swimmers have been to.
SELECT t4.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id JOIN event AS t3 ON t2.event_id = t3.id JOIN stadium AS t4 ON t4.id = t3.stadium_id WHERE t1.nationality = 'Australia'
CREATE TABLE swimmer (id VARCHAR(255), nationality VARCHAR(255)); CREATE TABLE record (swimmer_id VARCHAR(255), event_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE stadium (name VARCHAR(255), id VARCHAR(255)); CREATE TABLE event (id VARCHAR(255), stadium_id VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
4
0
0
{ "split": "train", "row_index": 3196 }
Find the names of stadiums that the most swimmers have been to.
SELECT t3.name FROM record AS t1 JOIN event AS t2 ON t1.event_id = t2.id JOIN stadium AS t3 ON t3.id = t2.stadium_id GROUP BY t2.stadium_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE record (event_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE stadium (name VARCHAR(255), id VARCHAR(255)); CREATE TABLE event (stadium_id VARCHAR(255), id VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
5
0
0
{ "split": "train", "row_index": 3197 }
What is the average capacity of the stadiums that were opened in year 2005?
SELECT AVG(capacity) FROM stadium WHERE opening_year = 2005
CREATE TABLE stadium (capacity INTEGER, opening_year VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
0
{ "split": "train", "row_index": 3199 }
How many railways are there?
SELECT COUNT(*) FROM railway
CREATE TABLE railway (Id VARCHAR(255), name VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
0
0
{ "split": "train", "row_index": 3200 }
List the builders of railways in ascending alphabetical order.
SELECT Builder FROM railway ORDER BY Builder
CREATE TABLE railway (Builder VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
0
{ "split": "train", "row_index": 3201 }
List the wheels and locations of the railways.
SELECT Wheels, LOCATION FROM railway
CREATE TABLE railway (Wheels VARCHAR(255), LOCATION VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
0
1
{ "split": "train", "row_index": 3202 }
What is the maximum level of managers in countries that are not "Australia"?
SELECT MAX(LEVEL) FROM manager WHERE Country <> 'Australia '
CREATE TABLE manager (LEVEL INTEGER, Country VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
0
{ "split": "train", "row_index": 3203 }
What is the average age for all managers?
SELECT AVG(Age) FROM manager
CREATE TABLE manager (Age INTEGER, id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
0
0
{ "split": "train", "row_index": 3204 }
What are the names of managers in ascending order of level?
SELECT Name FROM manager ORDER BY LEVEL
CREATE TABLE manager (Name VARCHAR(255), LEVEL VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
0
{ "split": "train", "row_index": 3205 }
What are the names and arrival times of trains?
SELECT Name, Arrival FROM train
CREATE TABLE train (Name VARCHAR(255), Arrival VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
0
1
{ "split": "train", "row_index": 3206 }
What is the name of the oldest manager?
SELECT Name FROM manager ORDER BY Age DESC LIMIT 1
CREATE TABLE manager (Name VARCHAR(255), Age VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
0
{ "split": "train", "row_index": 3207 }
Show the names of trains and locations of railways they are in.
SELECT T2.Name, T1.Location FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID
CREATE TABLE railway (Location VARCHAR(255), Railway_ID VARCHAR(255)); CREATE TABLE train (Name VARCHAR(255), Railway_ID VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
1
{ "split": "train", "row_index": 3208 }
Show the builder of railways associated with the trains named "Andaman Exp".
SELECT T1.Builder FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID WHERE T2.Name = 'Andaman Exp'
CREATE TABLE railway (Builder VARCHAR(255), Railway_ID VARCHAR(255)); CREATE TABLE train (Railway_ID VARCHAR(255), Name VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
0
{ "split": "train", "row_index": 3209 }
Show id and location of railways that are associated with more than one train.
SELECT T2.Railway_ID, T1.Location FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID GROUP BY T2.Railway_ID HAVING COUNT(*) > 1
CREATE TABLE railway (Location VARCHAR(255), Railway_ID VARCHAR(255)); CREATE TABLE train (Railway_ID VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
1
{ "split": "train", "row_index": 3210 }
Show the id and builder of the railway that are associated with the most trains.
SELECT T2.Railway_ID, T1.Builder FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID GROUP BY T2.Railway_ID ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE train (Railway_ID VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE railway (Builder VARCHAR(255), Railway_ID VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
4
0
1
{ "split": "train", "row_index": 3211 }
Show different builders of railways, along with the corresponding number of railways using each builder.
SELECT Builder, COUNT(*) FROM railway GROUP BY Builder
CREATE TABLE railway (Builder VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
1
{ "split": "train", "row_index": 3212 }
Show the most common builder of railways.
SELECT Builder FROM railway GROUP BY Builder ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE railway (Builder VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
3
0
0
{ "split": "train", "row_index": 3213 }
Show different locations of railways along with the corresponding number of railways at each location.
SELECT LOCATION, COUNT(*) FROM railway GROUP BY LOCATION
CREATE TABLE railway (LOCATION VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
1
{ "split": "train", "row_index": 3214 }
Show the locations that have more than one railways.
SELECT LOCATION FROM railway GROUP BY LOCATION HAVING COUNT(*) > 1
CREATE TABLE railway (LOCATION VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
0
{ "split": "train", "row_index": 3215 }
List the object number of railways that do not have any trains.
SELECT ObjectNumber FROM railway WHERE NOT Railway_ID IN (SELECT Railway_ID FROM train)
CREATE TABLE train (ObjectNumber VARCHAR(255), Railway_ID VARCHAR(255)); CREATE TABLE railway (ObjectNumber VARCHAR(255), Railway_ID VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
1
0
{ "split": "train", "row_index": 3216 }
Show the countries that have both managers of age above 50 and managers of age below 46.
SELECT Country FROM manager WHERE Age > 50 INTERSECT SELECT Country FROM manager WHERE Age < 46
CREATE TABLE manager (Country VARCHAR(255), Age INTEGER, id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
1
0
{ "split": "train", "row_index": 3217 }
Show the distinct countries of managers.
SELECT DISTINCT Country FROM manager
CREATE TABLE manager (Country VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT, manager_name VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
0
0
{ "split": "train", "row_index": 3218 }
Show the working years of managers in descending order of their level.
SELECT Working_year_starts FROM manager ORDER BY LEVEL DESC
CREATE TABLE manager (Working_year_starts VARCHAR(255), LEVEL VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
0
{ "split": "train", "row_index": 3219 }
Show the countries that have managers of age above 50 or below 46.
SELECT Country FROM manager WHERE Age > 50 OR Age < 46
CREATE TABLE manager (Country VARCHAR(255), Age VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
1
{ "split": "train", "row_index": 3220 }
How many addresses are there in country USA?
SELECT COUNT(*) FROM addresses WHERE country = 'USA'
CREATE TABLE addresses (country VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT, address_line VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
0
{ "split": "train", "row_index": 3221 }
Show all distinct cities in the address record.
SELECT DISTINCT city FROM addresses
CREATE TABLE addresses (city VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT, country VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
0
0
{ "split": "train", "row_index": 3222 }
Show each state and the number of addresses in each state.
SELECT state_province_county, COUNT(*) FROM addresses GROUP BY state_province_county
CREATE TABLE addresses (state_province_county VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT, city VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
1
{ "split": "train", "row_index": 3223 }
Show names and phones of customers who do not have address information.
SELECT customer_name, customer_phone FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM customer_address_history)
CREATE TABLE customer_address_history (customer_name VARCHAR(255), customer_phone VARCHAR(255), customer_id VARCHAR(255)); CREATE TABLE customers (customer_name VARCHAR(255), customer_phone VARCHAR(255), customer_id VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
1
1
{ "split": "train", "row_index": 3224 }
Show the name of the customer who has the most orders.
SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE customers (customer_name VARCHAR(255), customer_id VARCHAR(255)); CREATE TABLE customer_orders (customer_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
4
0
0
{ "split": "train", "row_index": 3225 }
Show the product type codes which have at least two products.
SELECT product_type_code FROM products GROUP BY product_type_code HAVING COUNT(*) >= 2
CREATE TABLE products (product_type_code VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT, product_name VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
0
{ "split": "train", "row_index": 3226 }
Show the names of customers who have both an order in completed status and an order in part status.
SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = 'Completed' INTERSECT SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = 'Part'
CREATE TABLE customers (customer_name VARCHAR(255), customer_id VARCHAR(255)); CREATE TABLE customer_orders (customer_id VARCHAR(255), order_status_code VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
1
0
{ "split": "train", "row_index": 3227 }
Show the name, phone, and payment method code for all customers in descending order of customer number.
SELECT customer_name, customer_phone, payment_method_code FROM customers ORDER BY customer_number DESC
CREATE TABLE customers (customer_name VARCHAR(255), customer_phone VARCHAR(255), payment_method_code VARCHAR(255), customer_number VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
1
{ "split": "train", "row_index": 3228 }
Show the product name and total order quantity for each product.
SELECT T1.product_name, SUM(T2.order_quantity) FROM products AS T1 JOIN order_items AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_id
CREATE TABLE products (product_name VARCHAR(255), product_id VARCHAR(255)); CREATE TABLE order_items (order_quantity INTEGER, product_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
1
{ "split": "train", "row_index": 3229 }
Show the minimum, maximum, average price for all products.
SELECT MIN(product_price), MAX(product_price), AVG(product_price) FROM products
CREATE TABLE products (product_price INTEGER, id INTEGER PRIMARY KEY AUTO_INCREMENT, product_name VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
0
2
{ "split": "train", "row_index": 3230 }
How many products have a price higher than the average?
SELECT COUNT(*) FROM products WHERE product_price > (SELECT AVG(product_price) FROM products)
CREATE TABLE products (product_price INTEGER, id INTEGER PRIMARY KEY AUTO_INCREMENT, product_name VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
1
0
{ "split": "train", "row_index": 3231 }
Show the customer name, customer address city, date from, and date to for each customer address history.
SELECT T2.customer_name, T3.city, T1.date_from, T1.date_to FROM customer_address_history AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id JOIN addresses AS T3 ON T1.address_id = T3.address_id
CREATE TABLE addresses (city VARCHAR(255), address_id VARCHAR(255)); CREATE TABLE customers (customer_name VARCHAR(255), customer_id VARCHAR(255)); CREATE TABLE customer_address_history (date_from VARCHAR(255), date_to VARCHAR(255), customer_id VARCHAR(255), address_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMEN...
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
1
{ "split": "train", "row_index": 3232 }
Show the names of customers who use Credit Card payment method and have more than 2 orders.
SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.payment_method_code = 'Credit Card' GROUP BY T1.customer_id HAVING COUNT(*) > 2
CREATE TABLE customers (customer_name VARCHAR(255), customer_id VARCHAR(255), payment_method_code VARCHAR(255)); CREATE TABLE customer_orders (customer_id VARCHAR(255), order_id VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
3
0
0
{ "split": "train", "row_index": 3233 }
What are the name and phone of the customer with the most ordered product quantity?
SELECT T1.customer_name, T1.customer_phone FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id JOIN order_items AS T3 ON T3.order_id = T2.order_id GROUP BY T1.customer_id ORDER BY SUM(T3.order_quantity) DESC LIMIT 1
CREATE TABLE order_items (order_id VARCHAR(255), order_quantity INTEGER); CREATE TABLE customers (customer_name VARCHAR(255), customer_phone VARCHAR(255), customer_id VARCHAR(255)); CREATE TABLE customer_orders (customer_id VARCHAR(255), order_id VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
5
0
1
{ "split": "train", "row_index": 3234 }
Show the product type and name for the products with price higher than 1000 or lower than 500.
SELECT product_type_code, product_name FROM products WHERE product_price > 1000 OR product_price < 500
CREATE TABLE products (product_type_code VARCHAR(255), product_name VARCHAR(255), product_price VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
2
{ "split": "train", "row_index": 3235 }
Find the name of dorms only for female (F gender).
SELECT dorm_name FROM dorm WHERE gender = 'F'
CREATE TABLE dorm (dorm_name VARCHAR(255), gender VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
0
{ "split": "train", "row_index": 3236 }
Find the name of dorms that can accommodate more than 300 students.
SELECT dorm_name FROM dorm WHERE student_capacity > 300
CREATE TABLE dorm (dorm_name VARCHAR(255), student_capacity INTEGER)
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
0
{ "split": "train", "row_index": 3237 }
How many female students (sex is F) whose age is below 25?
SELECT COUNT(*) FROM student WHERE sex = 'F' AND age < 25
CREATE TABLE student (sex VARCHAR(255), age VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
1
{ "split": "train", "row_index": 3238 }
Find the first name of students who is older than 20.
SELECT fname FROM student WHERE age > 20
CREATE TABLE student (fname VARCHAR(255), age INTEGER)
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
0
{ "split": "train", "row_index": 3239 }
Find the first name of students living in city PHL whose age is between 20 and 25.
SELECT fname FROM student WHERE city_code = 'PHL' AND age BETWEEN 20 AND 25
CREATE TABLE student (fname VARCHAR(255), city_code VARCHAR(255), age VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
1
{ "split": "train", "row_index": 3240 }
How many dorms are there?
SELECT COUNT(*) FROM dorm
CREATE TABLE dorm (Id VARCHAR(255), name VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
0
0
{ "split": "train", "row_index": 3241 }
Find the number of distinct amenities.
SELECT COUNT(*) FROM dorm_amenity
CREATE TABLE dorm_amenity (Id VARCHAR(255), amenity_name VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
0
0
{ "split": "train", "row_index": 3242 }
Find the total capacity of all dorms.
SELECT SUM(student_capacity) FROM dorm
CREATE TABLE dorm (student_capacity INTEGER, id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
0
0
{ "split": "train", "row_index": 3243 }
Find the average age of all students living in the each city.
SELECT AVG(age), city_code FROM student GROUP BY city_code
CREATE TABLE student (city_code VARCHAR(255), age INTEGER)
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
1
{ "split": "train", "row_index": 3244 }
Find the average and total capacity of dorms for the students with gender X.
SELECT AVG(student_capacity), SUM(student_capacity) FROM dorm WHERE gender = 'X'
CREATE TABLE dorm (student_capacity INTEGER, gender VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
2
{ "split": "train", "row_index": 3245 }
Find the number of dorms that have some amenity.
SELECT COUNT(DISTINCT dormid) FROM has_amenity
CREATE TABLE has_amenity (dormid VARCHAR(255), amenity_id VARCHAR(255))
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
0
0
{ "split": "train", "row_index": 3246 }
Find the name of dorms that do not have any amenity
SELECT dorm_name FROM dorm WHERE NOT dormid IN (SELECT dormid FROM has_amenity)
CREATE TABLE dorm (dorm_name VARCHAR(255), dormid VARCHAR(255)); CREATE TABLE has_amenity (dorm_name VARCHAR(255), dormid VARCHAR(255))
generic
hard
hard
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
1
0
{ "split": "train", "row_index": 3247 }
Find the number of distinct gender for dorms.
SELECT COUNT(DISTINCT gender) FROM dorm
CREATE TABLE dorm (gender VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
0
0
{ "split": "train", "row_index": 3248 }
Find the capacity and gender type of the dorm whose name has substring ‘Donor’.
SELECT student_capacity, gender FROM dorm WHERE dorm_name LIKE '%Donor%'
CREATE TABLE dorm (student_capacity VARCHAR(255), gender VARCHAR(255), dorm_name VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
1
{ "split": "train", "row_index": 3249 }
Find the name and gender type of the dorms whose capacity is greater than 300 or less than 100.
SELECT dorm_name, gender FROM dorm WHERE student_capacity > 300 OR student_capacity < 100
CREATE TABLE dorm (dorm_name VARCHAR(255), gender VARCHAR(255), student_capacity VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
2
{ "split": "train", "row_index": 3250 }
Find the numbers of different majors and cities.
SELECT COUNT(DISTINCT major), COUNT(DISTINCT city_code) FROM student
CREATE TABLE student (major VARCHAR(255), city_code VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
0
0
2
{ "split": "train", "row_index": 3251 }
Find the name of dorms which have both TV Lounge and Study Room as amenities.
SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge' INTERSECT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3...
CREATE TABLE dorm (dorm_name VARCHAR(255), dormid VARCHAR(255)); CREATE TABLE has_amenity (dormid VARCHAR(255), amenid VARCHAR(255)); CREATE TABLE dorm_amenity (amenid VARCHAR(255), amenity_name VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
3
1
0
{ "split": "train", "row_index": 3252 }
Find the name of dorms which have TV Lounge but no Study Room as amenity.
SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge' EXCEPT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.am...
CREATE TABLE dorm (dorm_name VARCHAR(255), dormid VARCHAR(255)); CREATE TABLE has_amenity (dormid VARCHAR(255), amenid VARCHAR(255)); CREATE TABLE dorm_amenity (amenid VARCHAR(255), amenity_name VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
3
1
0
{ "split": "train", "row_index": 3253 }
Find the last name of students who is either female (sex is F) and living in the city of code BAL or male (sex is M) and in age of below 20.
SELECT lname FROM student WHERE sex = 'F' AND city_code = 'BAL' UNION SELECT lname FROM student WHERE sex = 'M' AND age < 20
CREATE TABLE student (lname VARCHAR(255), sex VARCHAR(255), city_code VARCHAR(255), age VARCHAR(255))
generic
extra
extra
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
1
1
{ "split": "train", "row_index": 3254 }
Find the name of the dorm with the largest capacity.
SELECT dorm_name FROM dorm ORDER BY student_capacity DESC LIMIT 1
CREATE TABLE dorm (dorm_name VARCHAR(255), student_capacity VARCHAR(255))
generic
medium
medium
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
2
0
0
{ "split": "train", "row_index": 3255 }
List in alphabetic order all different amenities.
SELECT amenity_name FROM dorm_amenity ORDER BY amenity_name
CREATE TABLE dorm_amenity (amenity_name VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT)
generic
easy
easy
classified
valid
valid
valid
[]
[]
[]
[]
[ "validated", "extended", "classified" ]
null
1
0
0
{ "split": "train", "row_index": 3256 }