Database: financial
Question: The transaction of 840 USD happened in 1998/10/14, when was this account opened?
SQL: SELECT T1.date FROM account AS T1 INNER JOIN trans AS T2 ON T1.account_id = T2.account_id WHERE T2.amount = 840 AND T2.date = '1998-10-14'

Database: codebase_community
Question: Which user ID has the highest reputation?
Evidence: highest reputation refers to Max(Reputation)
SQL: SELECT Id FROM users WHERE Reputation = ( SELECT MAX(Reputation) FROM users )

Database: thrombosis_prediction
Question: Who is the oldest patient with the highest total cholesterol (T-CHO). State the patient ID and T-CHO index.
Evidence: oldest patient refers to MIN(birthday); highest total cholesterol refers to MAX(T-CHO);
SQL: SELECT T1.ID, T2.`T-CHO` FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID ORDER BY T2.`T-CHO` DESC, T1.Birthday ASC LIMIT 1

Database: debit_card_specializing
Question: How much more was customer 7 consuming in April 2013 than customer 5?
Evidence: April 2013 refers to 201304 in the yearmonth.date
SQL: SELECT SUM(IIF(CustomerID = 7, Consumption, 0)) - SUM(IIF(CustomerID = 5, Consumption, 0)) FROM yearmonth WHERE Date = '201304'

Database: card_games
Question: Among the cards with a white border color, how many of them have unknown power?
Evidence: unknown power refers to power = '*' or power is null
SQL: SELECT SUM(CASE WHEN power LIKE '%*%' OR power IS NULL THEN 1 ELSE 0 END) FROM cards WHERE borderColor = 'white'

Database: toxicology
Question: Calculate the total atoms consisting of the element carbon and hydrogen.
Evidence: consisting of element carbon and hydrogen refers to element in('c', 'h')
SQL: SELECT COUNT(T.atom_id) FROM atom AS T WHERE T.element = 'c' OR T.element = 'h'

Database: formula_1
Question: State the racing year which has the fastest lap time?
Evidence: 'has the fastest lap time?' refers to fastestLapTime has values
SQL: SELECT T2.year FROM results AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId WHERE T1.fastestLapTime IS NOT NULL

Database: thrombosis_prediction
Question: Among all outpatients, list out those have low hemoglobin level. State the different IDs and their sex.
Evidence: outpatients refers to Admission = '-'; low hemoglobin level refers to HBG < 10;
SQL: SELECT DISTINCT T1.ID, T1.SEX FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.HGB < 10 AND T1.Admission = '-'

Database: codebase_community
Question: Describe the post title which got positive comments and display names of the users who posted those comments.
Evidence: positive comments refer to Score > 60;
SQL: SELECT T1.Title, T2.UserDisplayName FROM posts AS T1 INNER JOIN comments AS T2 ON T2.PostId = T2.Id WHERE T1.Score > 60

Database: card_games
Question: For all the set of cards that has Japanese translation, what is the percentage of them are only available in non-foil?
Evidence: Japanese translation refers to language = 'Japanese'; in non-foil refers to isNonFoilOnly = 1; percentage of Japanese non foil in Japanese cards refers to DIVIDE(SUM(isNonFoilOnly = 1), SUM(language = 'Japanese'))*100
SQL: SELECT CAST(SUM(CASE WHEN isNonFoilOnly = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(id) FROM sets WHERE code IN ( SELECT setCode FROM set_translations WHERE language = 'Japanese' )

Database: financial
Question: List out the no. of districts that have female average salary is more than 6000 but less than 10000?
Evidence: A11 refers to average salary; Female mapps to gender = 'F'
SQL: SELECT COUNT(DISTINCT T2.district_id)  FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.gender = 'F' AND T2.A11 BETWEEN 6000 AND 10000

Database: formula_1
Question: Which top 20 driver created the shortest lap time ever record in a Formula_1 race? Please give them full names.
Evidence: shortest lap time refers to MIN(time); the time format for the shortest lap time is 'MM:SS.mmm' or 'M:SS.mmm'; full name of the driver refers to forename, surname
SQL: WITH lap_times_in_seconds AS (SELECT driverId, (CASE WHEN SUBSTR(time, 1, INSTR(time, ':') - 1) <> '' THEN CAST(SUBSTR(time, 1, INSTR(time, ':') - 1) AS REAL) * 60 ELSE 0 END + CASE WHEN SUBSTR(time, INSTR(time, ':') + 1, INSTR(time, '.') - INSTR(time, ':') - 1) <> '' THEN CAST(SUBSTR(time, INSTR(time, ':') + 1, INSTR(time, '.') - INSTR(time, ':') - 1) AS REAL) ELSE 0 END + CASE WHEN SUBSTR(time, INSTR(time, '.') + 1) <> '' THEN CAST(SUBSTR(time, INSTR(time, '.') + 1) AS REAL) / 1000 ELSE 0 END) AS time_in_seconds FROM lapTimes) SELECT T2.forename, T2.surname, T1.driverId FROM (SELECT driverId, MIN(time_in_seconds) AS min_time_in_seconds FROM lap_times_in_seconds GROUP BY driverId) AS T1 INNER JOIN drivers AS T2 ON T1.driverId = T2.driverId ORDER BY T1.min_time_in_seconds ASC LIMIT 20

Database: thrombosis_prediction
Question: How many patients with a normal Ig A level came to the hospital after 1990/1/1?
Evidence: normal Ig A level refers to IGA > 80 AND IGA < 500; came to the hospital after 1990/1/1 refers to YEAR(`First Date`) > = 1990;
SQL: SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.IGA BETWEEN 80 AND 500 AND  strftime('%Y',  T1.`First Date`) > '1990'

Database: superhero
Question: List the name of superheroes with flight power.
Evidence: name of superheroes refers to superhero_name; flight power refers to power_name = 'Flight';
SQL: SELECT T1.superhero_name FROM superhero AS T1 INNER JOIN hero_power AS T2 ON T1.id = T2.hero_id INNER JOIN superpower AS T3 ON T2.power_id = T3.id WHERE T3.power_name = 'Flight'

Database: formula_1
Question: Which was the fastest lap for Lewis Hamilton in the 2008 Australian Grand Prix?
SQL: SELECT T1.fastestLap FROM results AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId INNER JOIN drivers AS T3 on T1.driverId = T3.driverId WHERE T2.name = 'Australian Grand Prix' AND T2.year = 2008 AND T3.forename = 'Lewis' AND T3.surname = 'Hamilton'

Database: california_schools
Question: Please list the phone numbers of the direct charter-funded schools that are opened after 2000/1/1.
Evidence: Charter schools refers to `Charter School (Y/N)` = 1 in the frpm
SQL: SELECT T2.Phone FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T1.`Charter Funding Type` = 'Directly funded' AND T1.`Charter School (Y/N)` = 1 AND T2.OpenDate > '2000-01-01'

Database: financial
Question: Who placed the order with the id 32423?
SQL: SELECT T3.client_id FROM `order` AS T1 INNER JOIN account AS T2 ON T1.account_id = T2.account_id INNER JOIN disp AS T4 ON T4.account_id = T2.account_id  INNER JOIN client AS T3 ON T4.client_id = T3.client_id WHERE T1.order_id = 32423

Database: card_games
Question: What is the language and flavor text of the card that has colorpie watermark? List out the type of this card.
SQL: SELECT DISTINCT T2.language, T2.flavorText FROM cards AS T1 INNER JOIN foreign_data AS T2 ON T2.uuid = T1.uuid WHERE T1.watermark = 'colorpie'

Database: superhero
Question: How many bad superheroes are there?
Evidence: bad superheroes refers to alignment_id = Bad
SQL: SELECT COUNT(T1.id) FROM superhero AS T1 INNER JOIN alignment AS T2 ON T1.alignment_id = T2.id WHERE T2.alignment = 'Bad'

Database: superhero
Question: How many female superheroes have a strength value of 100?
Evidence: female refers to gender = 'Female'; strength value of 100 refers to attribute_name = 'Strength' AND attribute_value = 100
SQL: SELECT COUNT(T1.id) 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 INNER JOIN gender AS T4 ON T1.gender_id = T4.id WHERE T3.attribute_name = 'Strength' AND T2.attribute_value = 100 AND T4.gender = 'Female'