Database: debit_card_specializing
Question: Which customer paid the most in 2012/8/25?
Evidence: '2012/8/25' can be represented by '2012-08-25'
SQL: SELECT CustomerID FROM transactions_1k WHERE Date = '2012-08-25' GROUP BY CustomerID ORDER BY SUM(Price) DESC LIMIT 1

Database: formula_1
Question: In which years did Lewis Hamilton participate in a Formula_1 race?
SQL: SELECT DISTINCT T1.year FROM races AS T1 INNER JOIN results 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'

Database: financial
Question: How many accounts who have region in Prague are eligible for loans?
Evidence: A3 contains the data of region
SQL: SELECT COUNT(T1.account_id) FROM account AS T1 INNER JOIN loan AS T2 ON T1.account_id = T2.account_id INNER JOIN district AS T3 ON T1.district_id = T3.district_id WHERE T3.A3 = 'Prague'

Database: formula_1
Question: Please list the lap records for the circuits in Italy.
Evidence: lap record means the fastest time recorded which refers to time
SQL: WITH fastest_lap_times AS (SELECT T1.raceId, T1.FastestLapTime, (CAST(SUBSTR(T1.FastestLapTime, 1, INSTR(T1.FastestLapTime, ':') - 1) AS REAL) * 60) + (CAST(SUBSTR(T1.FastestLapTime, INSTR(T1.FastestLapTime, ':') + 1, INSTR(T1.FastestLapTime, '.') - INSTR(T1.FastestLapTime, ':') - 1) AS REAL)) + (CAST(SUBSTR(T1.FastestLapTime, INSTR(T1.FastestLapTime, '.') + 1) AS REAL) / 1000) as time_in_seconds FROM results AS T1 WHERE T1.FastestLapTime IS NOT NULL ) SELECT T1.FastestLapTime as lap_record FROM results AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId INNER JOIN circuits AS T3 on T2.circuitId = T3.circuitId INNER JOIN (SELECT MIN(fastest_lap_times.time_in_seconds) as min_time_in_seconds FROM fastest_lap_times INNER JOIN races AS T2 on fastest_lap_times.raceId = T2.raceId INNER JOIN circuits AS T3 on T2.circuitId = T3.circuitId WHERE T3.country = 'Italy' ) AS T4 ON (CAST(SUBSTR(T1.FastestLapTime, 1, INSTR(T1.FastestLapTime, ':') - 1) AS REAL) * 60) + (CAST(SUBSTR(T1.FastestLapTime, INSTR(T1.FastestLapTime, ':') + 1, INSTR(T1.FastestLapTime, '.') - INSTR(T1.FastestLapTime, ':') - 1) AS REAL)) + (CAST(SUBSTR(T1.FastestLapTime, INSTR(T1.FastestLapTime, '.') + 1) AS REAL) / 1000) = T4.min_time_in_seconds LIMIT 1

Database: debit_card_specializing
Question: For the earliest customer, what segment did he/she have?
SQL: SELECT T2.Segment FROM transactions_1k AS T1 INNER JOIN customers AS T2 ON T1.CustomerID = T2.CustomerID ORDER BY Date ASC LIMIT 1

Database: student_club
Question: What is the total amount of money spent for food?
Evidence: total amount of money spent refers to SUM(spent); spent for food refers to category = 'Food'
SQL: SELECT SUM(spent) FROM budget WHERE category = 'Food'

Database: formula_1
Question: What is reference name of Robert Kubica?
Evidence: reference name refers to driverRef;
SQL: SELECT driverRef FROM drivers WHERE forename = 'Robert' AND surname = 'Kubica'

Database: california_schools
Question: What is the telephone number for the school with the lowest average score in reading in Fresno Unified?
Evidence: Fresno Unified is a name of district;
SQL: SELECT T2.Phone FROM satscores AS T1 INNER JOIN schools AS T2 ON T1.cds = T2.CDSCode WHERE T2.District = 'Fresno Unified' AND T1.AvgScrRead IS NOT NULL ORDER BY T1.AvgScrRead ASC LIMIT 1

Database: superhero
Question: Give the alignment and superpowers of the superhero named Atom IV.
Evidence: superpowers refers to power_name;
SQL: SELECT T4.alignment, T3.power_name FROM superhero AS T1 INNER JOIN hero_power AS T2 ON T1.id = T2.hero_id INNER JOIN superpower AS T3 ON T3.id = T2.power_id INNER JOIN alignment AS T4 ON T1.alignment_id = T4.id WHERE T1.superhero_name = 'Atom IV'

Database: card_games
Question: How many cards are having future frame version and what are the legality status of these cards?
Evidence: future frame version refers to frameVersion = 'future'; legility status refers to status = 'legal';
SQL: SELECT COUNT(T1.id) FROM cards AS T1 INNER JOIN legalities AS T2 ON T1.uuid = T2.uuid WHERE T1.frameVersion = 'future'

Database: formula_1
Question: What's Lucas di Grassi's Q1 result in the race No. 345?
Evidence: race number refers to raceId;
SQL: SELECT T1.q1 FROM qualifying AS T1 INNER JOIN drivers AS T2 ON T2.driverId = T1.driverId WHERE T1.raceId = 345 AND T2.forename = 'Lucas' AND T2.surname = 'di Grassi'

Database: debit_card_specializing
Question: Which country had the gas station that sold the most expensive product id No.2 for one unit?
SQL: 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

Database: financial
Question: For the first client who opened his/her account in Prague, what is his/her account ID?
Evidence: A3 stands for region names
SQL: SELECT T1.account_id FROM account AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.A3 = 'Prague' ORDER BY T1.date ASC LIMIT 1

Database: student_club
Question: Which event has the highest budget amount?
Evidence: event refers to event_name; highest budget amount refers to MAX(amount)
SQL: SELECT T2.event_name FROM budget AS T1 INNER JOIN event AS T2 ON T1.link_to_event = T2.event_id ORDER BY T1.amount DESC LIMIT 1

Database: formula_1
Question: How many American drivers have puncture status.
Evidence: puncture status refers to status = Puncture;
SQL: SELECT COUNT(T1.driverId) FROM drivers AS T1 INNER JOIN results AS T2 on T1.driverId = T2.driverId INNER JOIN status AS T3 on T2.statusId = T3.statusId WHERE T3.status = 'Puncture' AND T1.nationality = 'American'

Database: european_football_2
Question: List the top 5 leagues in ascending order of the number of goals made in all seasons combined.
Evidence: number of goals made in all seasons combine = SUM(home_team_goal, away_team_goal);
SQL: SELECT t1.name, SUM(t2.home_team_goal) + SUM(t2.away_team_goal) FROM League AS t1 INNER JOIN Match AS t2 ON t1.id = t2.league_id GROUP BY t1.name ORDER BY SUM(t2.home_team_goal) + SUM(t2.away_team_goal) ASC LIMIT 5

Database: formula_1
Question: Which racetrack hosted the most recent race? Indicate the full location.
Evidence: full location refers to location+country; most recent race = MAX(date)


SQL: SELECT T1.location FROM circuits AS T1 INNER JOIN races AS T2 ON T1.circuitId = T2.circuitId ORDER BY T2.date DESC LIMIT 1

Database: european_football_2
Question: List all the short name of the football team that had a home team goal of 10?
Evidence: short name of the football team refers to team_short_name; home team goal refers to home_team_goal; home_team_goal = 10;
SQL: SELECT t1.team_short_name FROM Team AS t1 INNER JOIN Match AS t2 ON t1.team_api_id = t2.home_team_api_id WHERE t2.home_team_goal = 10

Database: formula_1
Question: What's Lewis Hamilton's reference name?
Evidence: reference name refers to driverRef
SQL: SELECT driverRef FROM drivers WHERE forename = 'Lewis' AND surname = 'Hamilton'

Database: card_games
Question: What is the percentage of the cards with a converted mana cost of 7 in the set Coldsnap?
Evidence: converted mana cost of 7 refers to convertedManaCost = 7; card set Coldsnap refers to name = 'Coldsnap'; percentage = DIVIDE(SUM(convertedManaCost = 7), SUM(convertedManaCost))*100
SQL: SELECT CAST(SUM(CASE WHEN T1.convertedManaCost = 7 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.id) FROM cards AS T1 INNER JOIN sets AS T2 ON T2.code = T1.setCode WHERE T2.name = 'Coldsnap'

Database: codebase_community
Question: Which user ID has the lowest view?
Evidence: lowest views refers to Min(Views)
SQL: SELECT Id FROM users WHERE Views = ( SELECT MIN(Views) FROM users )