SQL
stringlengths 29
1.45k
| difficulty
stringclasses 3
values | question_id
int64 0
1.53k
| db_id
stringclasses 11
values | evidence
stringlengths 0
591
| question
stringlengths 23
286
|
---|---|---|---|---|---|
SELECT T3.Description FROM transactions_1k AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN products AS T3 ON T1.ProductID = T3.ProductID WHERE T2.Date = '201309' | simple | 1,500 | debit_card_specializing | September 2013 refers to 201309; First 4 strings represent the year | Please list the product description of the products consumed in September, 2013. |
SELECT T2.Country FROM transactions_1k AS T1 INNER JOIN gasstations AS T2 ON T1.GasStationID = T2.GasStationID INNER JOIN yearmonth AS T3 ON T1.CustomerID = T3.CustomerID WHERE T3.Date = '201306' | moderate | 1,501 | debit_card_specializing | June 2013 refers to '201306'; First 4 strings represent the year | Please list the countries of the gas stations with transactions taken place in June, 2013. |
SELECT DISTINCT T3.ChainID FROM transactions_1k AS T1 INNER JOIN customers AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN gasstations AS T3 ON T1.GasStationID = T3.GasStationID WHERE T2.Currency = 'EUR' | simple | 1,502 | debit_card_specializing | Please list the chains of the gas stations with transactions in euro. |
|
SELECT DISTINCT T1.ProductID, T3.Description FROM transactions_1k AS T1 INNER JOIN customers AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN products AS T3 ON T1.ProductID = T3.ProductID WHERE T2.Currency = 'EUR' | simple | 1,503 | debit_card_specializing | Please list the product description of the products bought in transactions in euro. |
|
SELECT AVG(Amount) FROM transactions_1k WHERE Date LIKE '2012-01%' | simple | 1,504 | debit_card_specializing | In January, 2012 means Date contains '2012-01' | What is the average total price of the transactions taken place in January, 2012? |
SELECT COUNT(*) FROM yearmonth AS T1 INNER JOIN customers AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.Currency = 'EUR' AND T1.Consumption > 1000.00 | simple | 1,505 | debit_card_specializing | Among the customers who paid in euro, how many of them have a monthly consumption of over 1000? |
|
SELECT T3.Description FROM transactions_1k AS T1 INNER JOIN gasstations AS T2 ON T1.GasStationID = T2.GasStationID INNER JOIN products AS T3 ON T1.ProductID = T3.ProductID WHERE T2.Country = 'CZE' | moderate | 1,506 | debit_card_specializing | Gas station in the Czech Republic implies that Country = CZE | Please list the product descriptions of the transactions taken place in the gas stations in the Czech Republic. |
SELECT DISTINCT T1.Time FROM transactions_1k AS T1 INNER JOIN gasstations AS T2 ON T1.GasStationID = T2.GasStationID WHERE T2.ChainID = 11 | simple | 1,507 | debit_card_specializing | Please list the disparate time of the transactions taken place in the gas stations from chain no. 11. |
|
SELECT COUNT(T1.TransactionID) FROM transactions_1k AS T1 INNER JOIN gasstations AS T2 ON T1.GasStationID = T2.GasStationID WHERE T2.Country = 'CZE' AND T1.Price > 1000 | simple | 1,508 | debit_card_specializing | Gas station in the Czech Republic implies that Country = 'CZE' | How many transactions taken place in the gas station in the Czech Republic are with a price of over 1000? |
SELECT COUNT(T1.TransactionID) FROM transactions_1k AS T1 INNER JOIN gasstations AS T2 ON T1.GasStationID = T2.GasStationID WHERE T2.Country = 'CZE' AND strftime('%Y', T1.Date) >= '2012' | moderate | 1,509 | debit_card_specializing | Gas station in the Czech Republic implies that Country = 'CZE' | Among the transactions made in the gas stations in the Czech Republic, how many of them are taken place after 2012/1/1? |
SELECT AVG(T1.Price) FROM transactions_1k AS T1 INNER JOIN gasstations AS T2 ON T1.GasStationID = T2.GasStationID WHERE T2.Country = 'CZE' | simple | 1,510 | debit_card_specializing | Gas station in the Czech Republic implies that Country = 'CZE' | What is the average total price of the transactions taken place in gas stations in the Czech Republic? |
SELECT AVG(T1.Price) FROM transactions_1k AS T1 INNER JOIN gasstations AS T2 ON T1.GasStationID = T2.GasStationID INNER JOIN customers AS T3 ON T1.CustomerID = T3.CustomerID WHERE T3.Currency = 'EUR' | simple | 1,511 | debit_card_specializing | For the customers who paid in the euro, what is their average total price of the transactions? |
|
SELECT CustomerID FROM transactions_1k WHERE Date = '2012-08-25' GROUP BY CustomerID ORDER BY SUM(Price) DESC LIMIT 1 | simple | 1,512 | debit_card_specializing | '2012/8/25' can be represented by '2012-08-25' | Which customer paid the most in 2012/8/25? |
SELECT T2.Country FROM transactions_1k AS T1 INNER JOIN gasstations AS T2 ON T1.GasStationID = T2.GasStationID WHERE T1.Date = '2012-08-25' ORDER BY T1.Time DESC LIMIT 1 | simple | 1,513 | debit_card_specializing | '2012/8/25' can be represented by '2012-08-25' | Which country's gas station had the first paid cusomer in 2012/8/25? |
SELECT T3.Currency FROM transactions_1k AS T1 INNER JOIN gasstations AS T2 ON T1.GasStationID = T2.GasStationID INNER JOIN customers AS T3 ON T1.CustomerID = T3.CustomerID WHERE T1.Date = '2012-08-24' AND T1.Time = '16:25:00' | simple | 1,514 | debit_card_specializing | '2012/8/24' can be represented by '2012-08-24' | What kind of currency did the customer paid at 16:25:00 in 2012/8/24? |
SELECT T2.Segment FROM transactions_1k AS T1 INNER JOIN customers AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.date = '2012-08-23' AND T1.time = '21:20:00' | simple | 1,515 | debit_card_specializing | '2012/8/23 21:20:00' can refer to date = '2012-08-23' AND T1.time = '21:20:00' in the database | What segment did the customer have at 2012/8/23 21:20:00? |
SELECT COUNT(T1.TransactionID) FROM transactions_1k AS T1 INNER JOIN customers AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Date = '2012-08-26' AND T1.Time < '13:00:00' AND T2.Currency = 'EUR' | moderate | 1,516 | debit_card_specializing | '2012/8/26' can be represented by '2012-08-26'; The morning refers to the time before '13:00:00' | How many transactions were paid in EUR in the morning of 2012/8/26? |
SELECT T2.Segment FROM transactions_1k AS T1 INNER JOIN customers AS T2 ON T1.CustomerID = T2.CustomerID ORDER BY Date ASC LIMIT 1 | simple | 1,517 | debit_card_specializing | For the earliest customer, what segment did he/she have? |
|
SELECT T2.Country FROM transactions_1k AS T1 INNER JOIN gasstations AS T2 ON T1.GasStationID = T2.GasStationID WHERE T1.Date = '2012-08-24' AND T1.Time = '12:42:00' | simple | 1,518 | debit_card_specializing | '2012/8/24 12:42:00' can refer to date = '2012-08-24' AND T1.time = '12:42:00' in the database | For the deal happened at 2012/8/24 12:42:00, which country was it? |
SELECT T1.ProductID FROM transactions_1k AS T1 INNER JOIN gasstations AS T2 ON T1.GasStationID = T2.GasStationID WHERE T1.Date = '2012-08-23' AND T1.Time = '21:20:00' | simple | 1,519 | debit_card_specializing | '2012/8/23 21:20:00' can refer to date = '2012-08-23' AND T1.time = '21:20:00' in the database | What was the product id of the transaction happened at 2012/8/23 21:20:00? |
SELECT T1.CustomerID, T2.Date, T2.Consumption FROM transactions_1k AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Date = '2012-08-24' AND T1.Price = 124.05 AND T2.Date = '201201' | moderate | 1,520 | debit_card_specializing | '2012/8/24' can be represented by '2012-08-24'; expense and the consumption has the similar meaning. | For the customer who paid 124.05 in 2012/8/24, how much did he/she spend during the January of 2012? And what is the date and expenses exactly? |
SELECT COUNT(T1.TransactionID) FROM transactions_1k AS T1 INNER JOIN gasstations AS T2 ON T1.GasStationID = T2.GasStationID WHERE T1.Date = '2012-08-26' AND T1.Time BETWEEN '08:00:00' AND '09:00:00' AND T2.Country = 'CZE' | moderate | 1,521 | debit_card_specializing | Gas station in the Czech Republic implies that Country = CZE; '2012/8/26' can be represented by '2012-08-26' | For all the transactions happened during 8:00-9:00 in 2012/8/26, how many happened in CZE? |
SELECT T2.Currency FROM yearmonth AS T1 INNER JOIN customers AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Date = '201306' AND T1.Consumption = 214582.17 | simple | 1,522 | debit_card_specializing | June of 2013 means Date contains '201306' in the yearmonth.date of the database | There's one customer spent 214582.17 in the June of 2013, which currency did he/she use? |
SELECT T2.Country FROM transactions_1k AS T1 INNER JOIN gasstations AS T2 ON T1.GasStationID = T2.GasStationID WHERE T1.CardID = '667467' | simple | 1,523 | debit_card_specializing | Which country was the card owner of No.667467 in? |
|
SELECT T2.Country FROM transactions_1k AS T1 INNER JOIN gasstations AS T2 ON T1.GasStationID = T2.GasStationID WHERE T1.Date = '2012-08-24' AND T1.Price = 548.4 | simple | 1,524 | debit_card_specializing | '2012/8/24' can be represented by '2012-08-24' | What's the nationality of the customer who spent 548.4 in 2012/8/24? |
SELECT CAST(SUM(IIF(T2.Currency = 'EUR', 1, 0)) AS FLOAT) * 100 / COUNT(T1.CustomerID) FROM transactions_1k AS T1 INNER JOIN customers AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Date = '2012-08-25' | simple | 1,525 | debit_card_specializing | '2012/8/25' can be represented by '2012-08-25' | What is the percentage of the customers who used EUR in 2012/8/25? |
SELECT CAST(SUM(IIF(SUBSTRING(Date, 1, 4) = '2012', Consumption, 0)) - SUM(IIF(SUBSTRING(Date, 1, 4) = '2013', Consumption, 0)) AS FLOAT) / SUM(IIF(SUBSTRING(Date, 1, 4) = '2012', Consumption, 0)) FROM yearmonth WHERE CustomerID = ( SELECT T1.CustomerID FROM transactions_1k AS T1 INNER JOIN gasstations AS T2 ON T1.GasStationID = T2.GasStationID WHERE T1.Date = '2012-08-25' AND T1.Price = 634.8 ) | challenging | 1,526 | debit_card_specializing | '2012/8/24' can be represented by '2012-08-24'; Consumption decrease rate = (consumption_2012 - consumption_2013) / consumption_2012 | For the customer who paid 634.8 in 2012/8/25, what was the consumption decrease rate from Year 2012 to 2013? |
SELECT GasStationID FROM transactions_1k GROUP BY GasStationID ORDER BY SUM(Price) DESC LIMIT 1 | simple | 1,527 | debit_card_specializing | Which gas station has the highest amount of revenue? |
|
SELECT CAST(SUM(IIF(Country = 'SVK' AND Segment = 'Premium', 1, 0)) AS FLOAT) * 100 / SUM(IIF(Country = 'SVK', 1, 0)) FROM gasstations | simple | 1,528 | debit_card_specializing | What is the percentage of "premium" against the overall segment in "SVK"? |
|
SELECT SUM(T1.Price) , SUM(IIF(T3.Date = '201201', T1.Price, 0)) FROM transactions_1k AS T1 INNER JOIN gasstations AS T2 ON T1.GasStationID = T2.GasStationID INNER JOIN yearmonth AS T3 ON T1.CustomerID = T3.CustomerID WHERE T1.CustomerID = '38508' | moderate | 1,529 | debit_card_specializing | January 2012 refers '201201' in the table transactions_1k | What is the amount spent by customer "38508" at the gas stations? How much had the customer spent in January 2012? |
SELECT T2.Description FROM transactions_1k AS T1 INNER JOIN products AS T2 ON T1.ProductID = T2.ProductID ORDER BY T1.Amount DESC LIMIT 5 | simple | 1,530 | debit_card_specializing | Description of products contains full name | Which are the top five best selling products? Please state the full name of them. |
SELECT T2.CustomerID, SUM(T2.Price / T2.Amount), T1.Currency FROM customers AS T1 INNER JOIN transactions_1k AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.CustomerID = ( SELECT CustomerID FROM yearmonth ORDER BY Consumption DESC LIMIT 1 ) GROUP BY T2.CustomerID, T1.Currency | moderate | 1,531 | debit_card_specializing | verage price per single item = price / amount | Who is the top spending customer and how much is the average price per single item purchased by this customer? What currency was being used? |
SELECT T2.Country FROM transactions_1k AS T1 INNER JOIN gasstations AS T2 ON T1.GasStationID = T2.GasStationID WHERE T1.ProductID = 2 ORDER BY T1.Price DESC LIMIT 1 | simple | 1,532 | debit_card_specializing | Which country had the gas station that sold the most expensive product id No.2 for one unit? |
|
SELECT T2.Consumption FROM transactions_1k AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Price / T1.Amount > 29.00 AND T1.ProductID = 5 AND T2.Date = '201208' | moderate | 1,533 | debit_card_specializing | August of 2012 means Date contains '201208' in the yearmonth.date of the database; Price per unit of product = Price / Amount | For all the people who paid more than 29.00 per unit of product id No.5. Give their consumption status in the August of 2012. |
SELECT T2.Street, T2.City, T2.Zip, T2.State FROM schools AS T2 INNER JOIN (SELECT cds, CAST(NumGE1500 AS REAL) / NumTstTakr AS rate FROM satscores WHERE NumGE1500 IS NOT NULL AND NumTstTakr IS NOT NULL AND NumTstTakr != 0) AS T1 ON T2.CDSCode = T1.cds WHERE T1.rate = (SELECT MIN(CAST(NumGE1500 AS REAL) / NumTstTakr) AS min_rate FROM satscores WHERE NumGE1500 IS NOT NULL AND NumTstTakr IS NOT NULL AND NumTstTakr != 0) ORDER BY T2.CDSCode | moderate | 37 | california_schools | Execellence Rate = NumGE1500 / NumTstTakr; complete address has Street, City, Zip, State | What is the complete address of the school with the lowest excellence rate? Indicate the Street, City, Zip and State. |
SELECT County FROM (SELECT County, COUNT(School) AS SchoolCount FROM schools WHERE strftime('%Y', ClosedDate) BETWEEN '1980' AND '1989' AND StatusType = 'Closed' AND SOC = 11 GROUP BY County) WHERE SchoolCount = (SELECT MAX(SchoolCount) FROM (SELECT COUNT(School) AS SchoolCount FROM schools WHERE strftime('%Y', ClosedDate) BETWEEN '1980' AND '1989' AND StatusType = 'Closed' AND SOC = 11 GROUP BY County)) | moderate | 68 | california_schools | Youth Authority Facilities (CEA) refers to SOC = 11; 1980s = years between 1980 and 1989 | Which county reported the most number of school closure in the 1980s with school wonership code belonging to Youth Authority Facilities (CEA)? |
SELECT T1.`School Type`, T1.`School Name`, T2.Latitude FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.Latitude = (SELECT MAX(Latitude) FROM schools) | simple | 80 | california_schools | What is the school type of the school with the highest latitude? Indicate the name of the school as well as the latitude coordinates. |
|
SELECT T2.City, T1.`Low Grade`, T1.`School Name` FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.State = 'CA' AND T2.Latitude IS NOT NULL AND T2.Latitude = (SELECT MIN(Latitude) FROM schools WHERE State = 'CA' AND Latitude IS NOT NULL) | moderate | 81 | california_schools | State of California refers to state = 'CA' | In which city can you find the school in the state of California with the lowest latitude coordinates and what is its lowest grade? Indicate the school name. |
SELECT GSoffered FROM schools WHERE ABS(longitude) = (SELECT MAX(ABS(longitude)) FROM schools) | simple | 82 | california_schools | What is the grade span offered in the school with the highest longitude? |
|
SELECT account_id FROM trans WHERE STRFTIME('%Y', date) = '1995' ORDER BY date ASC LIMIT 1 | simple | 101 | financial | List out the accounts who have the earliest trading date in 1995 ? |
|
SELECT T3.account_id FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id INNER JOIN account AS T3 ON T2.district_id = T3.district_id WHERE T1.gender = 'F' AND T1.birth_date = (SELECT MIN(birth_date) FROM client WHERE gender = 'F') AND T2.A11 = (SELECT MIN(T2.A11) FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.gender = 'F' AND T1.birth_date = (SELECT MIN(birth_date) FROM client WHERE gender = 'F')) | moderate | 189 | financial | Female refers to 'F' in the gender; A11 contains information about average salary | Name the account numbers of female clients who are oldest and have lowest average salary? |
SELECT T1.label FROM molecule AS T1 INNER JOIN (SELECT T.molecule_id, COUNT(T.bond_type) AS bond_count FROM bond AS T WHERE T.bond_type = '=' GROUP BY T.molecule_id HAVING bond_count = (SELECT MAX(bond_count) FROM (SELECT molecule_id, COUNT(bond_type) AS bond_count FROM bond WHERE bond_type = '=' GROUP BY molecule_id) AS subquery) ORDER BY bond_count DESC) AS T2 ON T1.molecule_id = T2.molecule_id | moderate | 244 | toxicology | double bond refers to bond_type = ' = '; label = '+' mean molecules are carcinogenic | Is the molecule with the most double bonds carcinogenic? |
SELECT T.molecule_id FROM (SELECT T3.molecule_id, COUNT(T1.bond_type) AS bond_count FROM bond AS T1 INNER JOIN molecule AS T3 ON T1.molecule_id = T3.molecule_id WHERE T3.label = '+' AND T1.bond_type = '=' GROUP BY T3.molecule_id HAVING bond_count = (SELECT MAX(bond_count) FROM (SELECT T3.molecule_id, COUNT(T1.bond_type) AS bond_count FROM bond AS T1 INNER JOIN molecule AS T3 ON T1.molecule_id = T3.molecule_id WHERE T3.label = '+' AND T1.bond_type = '=' GROUP BY T3.molecule_id) AS subquery) ORDER BY bond_count DESC) AS T | moderate | 250 | toxicology | label = '+' mean molecules are carcinogenic; double bond refers to bond_type = ' = '; | Of all the carcinogenic molecules, which one has the most double bonds? |
SELECT name FROM cards WHERE faceConvertedManaCost IS NOT NULL AND faceConvertedManaCost = (SELECT MAX(faceConvertedManaCost) FROM cards WHERE faceConvertedManaCost IS NOT NULL) | simple | 342 | card_games | more converted mana for the face refers to Max(faceConvertedManaCost); | List the card names with value that cost more converted mana for the face. |
SELECT T1.id FROM sets AS T1 INNER JOIN set_translations AS T2 ON T1.code = T2.setCode WHERE T2.language = 'Russian' GROUP BY T1.baseSetSize HAVING COUNT(T1.id) = (SELECT MAX(card_count) FROM (SELECT COUNT(T1.id) AS card_count FROM sets AS T1 INNER JOIN set_translations AS T2 ON T1.code = T2.setCode WHERE T2.language = 'Russian' GROUP BY T1.baseSetSize) AS subquery) | moderate | 432 | card_games | Russian refers to language = 'Russian'; contains the most cards overall refers to MAX(baseSetSize) | Which Russian set of cards contains the most cards overall? |
SELECT T1.name FROM cards AS T1 INNER JOIN sets AS T2 ON T2.code = T1.setCode WHERE T2.name = 'Coldsnap' AND T1.convertedManaCost = (SELECT MAX(convertedManaCost) FROM cards AS T1 INNER JOIN sets AS T2 ON T2.code = T1.setCode WHERE T2.name = 'Coldsnap') | simple | 476 | card_games | card set Coldsnap refers to name = 'Coldsnap' | Please list the name of the cards in the set Coldsnap with the highest converted mana cost. |
SELECT T2.name FROM foreign_data AS T1 INNER JOIN cards AS T2 ON T2.uuid = T1.uuid INNER JOIN sets AS T3 ON T3.code = T2.setCode WHERE T3.name = 'Coldsnap' AND T1.language = 'Italian' AND T2.convertedManaCost = (SELECT MAX(convertedManaCost) FROM foreign_data AS T1 INNER JOIN cards AS T2 ON T2.uuid = T1.uuid INNER JOIN sets AS T3 ON T3.code = T2.setCode WHERE T3.name = 'Coldsnap' AND T1.language = 'Italian') | moderate | 484 | card_games | card set Coldsnap refers to name = 'Coldsnap'; Italian refers to language = 'Italian' | Please list the Italian names of the cards in the set Coldsnap with the highest converted mana cost. |
SELECT T1.originalReleaseDate, T2.format FROM cards AS T1 INNER JOIN legalities AS T2 ON T1.uuid = T2.uuid WHERE T1.rarity = 'mythic' AND T1.originalReleaseDate IS NOT NULL AND T2.status = 'Legal' AND T1.originalReleaseDate = (SELECT MIN(originalReleaseDate) FROM cards AS T1 INNER JOIN legalities AS T2 ON T1.uuid = T2.uuid WHERE T1.rarity = 'mythic' AND T1.originalReleaseDate IS NOT NULL AND T2.status = 'Legal') | moderate | 515 | card_games | the oldest card refers to MIN(originalReleaseDate); mythic card refers to rarity = 'mythic'; legal play refers to status = 'legal'; play format refers to format | When was the oldest mythic card released and what are its legal play formats? |
SELECT T2.name FROM users AS T1 INNER JOIN badges AS T2 ON T1.Id = T2.UserId WHERE T1.Reputation = (SELECT MAX(Reputation) FROM users) | simple | 610 | codebase_community | highest reputation refers to Max(Reputation); user refers to UserId | What are the names of badges that users who have the highest reputation obtained? |
SELECT T2.Name, T1.Reputation FROM users AS T1 INNER JOIN badges AS T2 ON T1.Id = T2.UserId WHERE T1.Reputation = (SELECT MIN(Reputation) FROM users) | simple | 621 | codebase_community | lowest reputation refers to Min(Reputation); user refers to UserId | What are the name of badges that users who have the lowest reputation obtained? |
SELECT T3.Text, T1.DisplayName FROM users AS T1 INNER JOIN posts AS T2 ON T1.Id = T2.OwnerUserId INNER JOIN comments AS T3 ON T2.Id = T3.PostId WHERE T2.Title = 'Analysing wind data with R' AND T3.CreationDate = (SELECT MAX(T4.CreationDate) FROM users AS T5 INNER JOIN posts AS T6 ON T5.Id = T6.OwnerUserId INNER JOIN comments AS T4 ON T6.Id = T4.PostId WHERE T6.Title = 'Analysing wind data with R') | moderate | 694 | codebase_community | the latest comment refers to MAX(CreationDate); | Provide the text of the latest comment to the post with the title 'Analysing wind data with R' and the display name of the user who left it. |
SELECT T1.superhero_name FROM superhero AS T1 INNER JOIN hero_attribute AS T2 ON T1.id = T2.hero_id INNER JOIN attribute AS T3 ON T2.attribute_id = T3.id WHERE T3.attribute_name = 'Intelligence' AND T2.attribute_value = (SELECT MIN(T4.attribute_value) FROM hero_attribute AS T4 INNER JOIN attribute AS T5 ON T4.attribute_id = T5.id WHERE T5.attribute_name = 'Intelligence') | moderate | 736 | superhero | the dumbest superhero refers to MIN(attribute_value) where attribute_name = 'Intelligence' | Who is the dumbest superhero? |
SELECT T1.full_name FROM superhero AS T1 INNER JOIN hero_attribute AS T2 ON T1.id = T2.hero_id INNER JOIN attribute AS T3 ON T2.attribute_id = T3.id WHERE T3.attribute_name = 'Strength' AND T2.attribute_value = (SELECT MAX(T4.attribute_value) FROM hero_attribute AS T4 INNER JOIN attribute AS T5 ON T4.attribute_id = T5.id WHERE T5.attribute_name = 'Strength') | moderate | 766 | superhero | highest attribute in strength refers to MAX(attribute_value) WHERE attribute_name = 'strength'; | What is the hero's full name with the highest attribute in strength? |
SELECT T1.superhero_name FROM superhero AS T1 INNER JOIN hero_attribute AS T2 ON T1.id = T2.hero_id INNER JOIN attribute AS T3 ON T3.id = T2.attribute_id INNER JOIN publisher AS T4 ON T4.id = T1.publisher_id WHERE T4.publisher_name = 'Dark Horse Comics' AND T2.attribute_value = (SELECT MAX(T5.attribute_value) FROM superhero AS T6 INNER JOIN hero_attribute AS T5 ON T6.id = T5.hero_id INNER JOIN publisher AS T7 ON T7.id = T6.publisher_id WHERE T7.publisher_name = 'Dark Horse Comics') | challenging | 769 | superhero | which superhero refers to superhero_name; most durability refers to MAX(attribute_value) WHERE attribute_name = 'durability'; published by Dark Horse Comics refers to publisher_name = 'Dark Horse Comics'; | Which superhero has the most durability published by Dark Horse Comics? |
SELECT superhero_name FROM superhero WHERE height_cm = (SELECT MAX(height_cm) FROM superhero) | simple | 802 | superhero | who refers to superhero_name; tallest superhero refers to MAX(height_cm); | Who is the tallest superhero? |
SELECT T3.race FROM superhero AS T1 INNER JOIN hero_attribute AS T2 ON T1.id = T2.hero_id INNER JOIN race AS T3 ON T1.race_id = T3.id WHERE T2.attribute_value = (SELECT MAX(T4.attribute_value) FROM hero_attribute AS T4) | simple | 810 | superhero | maximum attribute value refers to MAX(attribute_value); | What is the race of the superhero with maximum attribute value? |
SELECT COUNT(T3.superhero_name) FROM hero_attribute AS T1 INNER JOIN attribute AS T2 ON T1.attribute_id = T2.id INNER JOIN superhero AS T3 ON T1.hero_id = T3.id WHERE T2.attribute_name = 'Speed' AND T1.attribute_value = (SELECT MAX(T4.attribute_value) FROM hero_attribute AS T4 INNER JOIN attribute AS T5 ON T4.attribute_id = T5.id WHERE T5.attribute_name = 'Speed') | simple | 828 | superhero | fastest refers to attribute_value = 100 WHERE attribute_name = 'Speed'; | Count the fastest superheroes. |
SELECT superhero_name FROM superhero WHERE height_cm = (SELECT MAX(height_cm) FROM superhero) | simple | 832 | superhero | tallest superhero refers to MAX(height_cm); | Name the tallest superhero. |
SELECT T2.surname FROM qualifying AS T1 INNER JOIN drivers AS T2 ON T2.driverId = T1.driverId WHERE T1.raceId = 19 AND T1.q2 IS NOT NULL AND T1.q2 = (SELECT MIN(q2) AS min_q2 FROM qualifying WHERE raceId = 19 AND q2 IS NOT NULL) | simple | 847 | formula_1 | race number refers to raceId; second qualifying period refers to q2; best lap time refers to MIN(q2); | What is the surname of the driver with the best lap time in race number 19 in the second period? |
SELECT T1.name, T2.points FROM races AS T1 INNER JOIN driverStandings AS T2 ON T2.raceId = T1.raceId INNER JOIN drivers AS T3 ON T3.driverId = T2.driverId WHERE T3.forename = 'Lewis' AND T3.surname = 'Hamilton' AND T1.year = (SELECT MIN(T4.year) FROM races AS T4 INNER JOIN driverStandings AS T5 ON T5.raceId = T4.raceId INNER JOIN drivers AS T6 ON T6.driverId = T5.driverId WHERE T6.forename = 'Lewis' AND T6.surname = 'Hamilton') | moderate | 906 | formula_1 | first race refers to min(Year) | Which was Lewis Hamilton first race? What was his points recorded for his first race event? |
SELECT T3.lap, T2.name, T2.year, T1.location FROM circuits AS T1 INNER JOIN races AS T2 ON T1.circuitId = T2.circuitId INNER JOIN lapTimes AS T3 ON T3.raceId = T2.raceId WHERE T3.lap = (SELECT MAX(T4.lap) FROM lapTimes AS T4) | simple | 908 | formula_1 | What is the most laps f1 races had? Name the race, year and circuit location where the races with most laps was hosted. |
|
SELECT player_api_id FROM Player_Attributes WHERE overall_rating = (SELECT MAX(overall_rating) FROM Player_Attributes) | simple | 1,020 | european_football_2 | highest overall rating refers to MAX(overall_rating); | Which player has the highest overall rating? Indicate the player's api id. |
SELECT preferred_foot FROM Player_Attributes WHERE penalties AND potential = (SELECT MIN(potential) FROM Player_Attributes) | simple | 1,022 | european_football_2 | preferred foot when attacking refers to preferred_foot; lowest potential refers to MIN(potential); | What is the preferred foot when attacking of the player with the lowest potential? |
SELECT t3.team_long_name FROM Match AS t1 INNER JOIN Team AS t3 ON t1.home_team_api_id = t3.team_api_id WHERE t1.season = '2015/2016' AND t1.home_team_goal - t1.away_team_goal < 0 GROUP BY t1.home_team_api_id HAVING COUNT(*) = (SELECT MIN(lost_matches_count) FROM (SELECT home_team_api_id, COUNT(*) AS lost_matches_count FROM Match WHERE season = '2015/2016' AND home_team_goal - away_team_goal < 0 GROUP BY home_team_api_id)) | moderate | 1,026 | european_football_2 | home team lost the matches refers to SUBTRACT(home_team_goal, away_team_goal) < 0; 2016 season refers to season = '2015/2016'; | Which home team had lost the fewest matches in the 2016 season? |
SELECT t3.team_long_name FROM League AS t1 INNER JOIN Match AS t2 ON t1.id = t2.league_id INNER JOIN Team AS t3 ON t2.away_team_api_id = t3.team_api_id WHERE t1.name = 'Scotland Premier League' AND t2.season = '2009/2010' AND t2.away_team_goal - t2.home_team_goal > 0 GROUP BY t2.away_team_api_id HAVING COUNT(*) = (SELECT MAX(won_matches_count) FROM (SELECT away_team_api_id, COUNT(*) AS won_matches_count FROM Match AS m INNER JOIN League AS l ON m.league_id = l.id WHERE l.name = 'Scotland Premier League' AND m.season = '2009/2010' AND m.away_team_goal - m.home_team_goal > 0 GROUP BY m.away_team_api_id)) | challenging | 1,028 | european_football_2 | Scotland Premier League refers to League.name = 'Scotland Premier League'; away team refers to away_team_api_id; away team that won the most refers to MAX(SUBTRACT(away_team_goal, home_team_goal) > 0); 2010 season refers to season = '2009/2010'; | In Scotland Premier League, which away team won the most during the 2010 season? |
SELECT p.player_api_id FROM Player_Attributes AS p WHERE SUBSTR(p.date, 1, 4) = '2010' AND p.overall_rating = (SELECT MAX(pa.overall_rating) FROM Player_Attributes AS pa WHERE SUBSTR(pa.date, 1, 4) = '2010') | simple | 1,034 | european_football_2 | highest above average overall ratings refers to MAX(overall_rating); in 2010 refers to substr(date,1,4) = '2010'; | List the players' api id who had the highest above average overall ratings in 2010. |
SELECT T2.long_passing FROM Player AS T1 INNER JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T1.birthday = (SELECT MIN(birthday) FROM Player) | simple | 1,090 | european_football_2 | long passing score refers to long_passing; oldest player refers to oldest birthday; | What is the long passing score of the oldest player? |
SELECT DISTINCT T1.player_name FROM Player AS T1 INNER JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.potential = (SELECT MAX(potential) FROM Player_Attributes) | simple | 1,123 | european_football_2 | highest potential refers to MAX(potential) | What is the name of players with the highest potential? |
SELECT T1.Diagnosis FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.IGA = (SELECT MAX(IGA) FROM Laboratory WHERE IGA BETWEEN 80 AND 500) | simple | 1,253 | thrombosis_prediction | highest Ig A within the normal range refers to MAX(IGA BETWEEN 80 AND 500); | For the patient who has the highest Ig A within the normal range, what is his or her diagnosis? |
SELECT T1.`First Date` FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.LDH = (SELECT MAX(LDH) FROM Laboratory WHERE LDH < 500) | moderate | 1,284 | thrombosis_prediction | highest lactate dehydrogenase in the normal range refers to MAX(LDH < 500); when the data first recorded refers to MIN(First Date); | For the patient with the highest lactate dehydrogenase in the normal range, when was his or her data first recorded? |
SELECT Date FROM Laboratory WHERE ALB = (SELECT MAX(ALB) FROM Laboratory WHERE ALB BETWEEN 3.5 AND 5.5) | simple | 1,290 | thrombosis_prediction | examination date refers to Date; albumin is the highest in the normal range refers to MAX(ALB > 3.5 and ALB < 5.5); | What is the examination date of the patient whose albumin is the highest in the normal range? |
SELECT T1.event_name FROM event AS T1 INNER JOIN attendance AS T2 ON T1.event_id = T2.link_to_event GROUP BY T1.event_name HAVING COUNT(T2.link_to_event) = (SELECT MAX(attendance_count) FROM (SELECT COUNT(link_to_event) AS attendance_count FROM attendance GROUP BY link_to_event) AS subquery) | simple | 1,318 | student_club | event with highest attendance refers to MAX(COUNT(link_to_event)) | What is the event that has the highest attendance of the students from the Student_Club? |
SELECT T2.expense_description FROM budget AS T1 INNER JOIN expense AS T2 ON T1.budget_id = T2.link_to_budget WHERE T1.remaining = (SELECT MIN(remaining) FROM budget) | simple | 1,365 | student_club | expense of budget refers to expense_description; lowest remaining refers to MIN(remaining) | What are the expenses of the budget with the lowest remaining? |
SELECT T1.first_name, T1.last_name, T2.source FROM member AS T1 INNER JOIN income AS T2 ON T1.member_id = T2.link_to_member WHERE T2.amount = (SELECT MAX(T4.amount) FROM member AS T3 INNER JOIN income AS T4 ON T3.member_id = T4.link_to_member) | moderate | 1,388 | student_club | name of students means the full name; full name refers to first_name, last_name; generate the highest income refers to MAX(income.amount); | Which students manage to generate the highest income. State his/her full name along with the income source. |
SELECT T1.event_name FROM event AS T1 INNER JOIN budget AS T2 ON T1.event_id = T2.link_to_event INNER JOIN expense AS T3 ON T2.budget_id = T3.link_to_budget WHERE T3.cost = (SELECT MIN(T6.cost) FROM event AS T4 INNER JOIN budget AS T5 ON T4.event_id = T5.link_to_event INNER JOIN expense AS T6 ON T5.budget_id = T6.link_to_budget) | simple | 1,389 | student_club | event refers to event_name where MIN(cost) | Which event has the lowest cost? |
SELECT T2.Segment FROM transactions_1k AS T1 INNER JOIN customers AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Date = (SELECT MIN(Date) FROM transactions_1k) | simple | 1,517 | debit_card_specializing | For the earliest customer, what segment did he/she have? |