answer
stringlengths
6
3.91k
question
stringlengths
7
766
context
stringlengths
27
7.14k
SELECT "Drainage basin (km\u00b2)" FROM table_30694 WHERE "Type" = 'Gravity' AND "Reservoir surface (ha)" = '34.36'
What is listed in drainage basin when the type is gravity and the reservoir surface is 34.36?
CREATE TABLE table_30694 ( "Reservoir" text, "Basin" text, "Location" text, "Type" text, "Height (m)" text, "Length along the top (m)" text, "Drainage basin (km\u00b2)" text, "Reservoir surface (ha)" text, "Volume (hm\u00b3)" text )
SELECT d_44_√ FROM table_name_19 WHERE d_47_√ = "r 7"
What is the number for D 44 √ when D 47 √ is r 7?
CREATE TABLE table_name_19 (d_44_√ VARCHAR, d_47_√ VARCHAR)
SELECT COUNT(duration) FROM table_17641206_4 WHERE written_by = "John Sullivan"
How many episodes of 30 minutes were written by John Sullivan?
CREATE TABLE table_17641206_4 (duration VARCHAR, written_by VARCHAR)
SELECT "team" FROM table_204_772 WHERE "years won" > (SELECT "years won" FROM table_204_772 WHERE "team" = 'ballymore eustace') ORDER BY "years won" LIMIT 1
which team won after ballymore eustace ?
CREATE TABLE table_204_772 ( id number, "team" text, "county" text, "wins" number, "years won" number )
SELECT d_42_√ FROM table_name_6 WHERE d_45_√ = "r 16"
What is the D 42 √ number when the D 45 √ is r 16?
CREATE TABLE table_name_6 (d_42_√ VARCHAR, d_45_√ VARCHAR)
SELECT directed_by FROM table_17641206_4 WHERE written_by = "John Sullivan"
Who was the director when the writer was John Sullivan?
CREATE TABLE table_17641206_4 (directed_by VARCHAR, written_by VARCHAR)
SELECT children_per_donor FROM table_16175217_1 WHERE allowed_recipients = "Married or in cohabitation"
What are the children per donor in the country where the allowed recipients are married or in cohabitation?
CREATE TABLE table_16175217_1 ( children_per_donor VARCHAR, allowed_recipients VARCHAR )
SELECT d_49_√ FROM table_name_19 WHERE d_41_√ = "d 61 √"
What is the D 49 √ number when the D 41 √ is d 61 √?
CREATE TABLE table_name_19 (d_49_√ VARCHAR, d_41_√ VARCHAR)
SELECT directed_by FROM table_17641206_8 WHERE written_by = "John Sullivan" AND original_airdate = "15January2009"
What are the movies that are written and dircted by john sullivan with the airdate of 15january2009.
CREATE TABLE table_17641206_8 (directed_by VARCHAR, written_by VARCHAR, original_airdate VARCHAR)
SELECT "Away team score" FROM table_32282 WHERE "Home team score" = '20.15 (135)'
Who was the away team when the home team scored 20.15 (135)?
CREATE TABLE table_32282 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT d_42_√ FROM table_name_77 WHERE d_46_√ = "r 6"
What is the D 42 √ figure when D 46 √ is r 6?
CREATE TABLE table_name_77 (d_42_√ VARCHAR, d_46_√ VARCHAR)
SELECT COUNT(episode) FROM table_17641206_8 WHERE original_airdate = "22January2009"
How many episodes aired on 22january2009
CREATE TABLE table_17641206_8 (episode VARCHAR, original_airdate VARCHAR)
SELECT "Away team" FROM table_57429 WHERE "Home team score" = '10.9 (69)' AND "Venue" = 'glenferrie oval'
Which away team played a home team with a score of 10.9 (69) at Glenferrie Oval?
CREATE TABLE table_57429 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
SELECT d_50_√ FROM table_name_93 WHERE d_47_√ = "r 27 √"
What is the D 50 √ when the D 47 √ is r 27 √?
CREATE TABLE table_name_93 (d_50_√ VARCHAR, d_47_√ VARCHAR)
SELECT MIN(transfers_out) FROM table_17650725_1 WHERE total_transfers = 21
Name the least transfers out when transfers is 21
CREATE TABLE table_17650725_1 (transfers_out INTEGER, total_transfers VARCHAR)
SELECT COUNT("Loss") FROM table_77057 WHERE "Gain" < '1571' AND "Long" < '47' AND "Avg/G" = '36.4'
How much Loss has a Gain smaller than 1571, and a Long smaller than 47, and an Avg/G of 36.4?
CREATE TABLE table_77057 ( "Name" text, "Gain" real, "Loss" real, "Long" real, "Avg/G" real )
SELECT player FROM table_name_94 WHERE competition = "ballarat football league"
Tell me the player for ballarat football league
CREATE TABLE table_name_94 (player VARCHAR, competition VARCHAR)
SELECT MIN(total_transfers) FROM table_17650725_1 WHERE country = "Romania"
Name the least total transfers for romania
CREATE TABLE table_17650725_1 (total_transfers INTEGER, country VARCHAR)
SELECT "2010" FROM table_6242 WHERE "Tournament" = 'australian open'
What is the info for the year 2010, for the Australian Open tournament?
CREATE TABLE table_6242 ( "Tournament" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
SELECT player FROM table_name_88 WHERE team = "east perth"
Tell me the player for east perth
CREATE TABLE table_name_88 (player VARCHAR, team VARCHAR)
SELECT MIN(internal_transfers) FROM table_17650725_1
Name the least internal transfers
CREATE TABLE table_17650725_1 (internal_transfers INTEGER)
SELECT "Player" FROM table_36511 WHERE "Position" = 'end' AND "School/Club Team" = 'oregon state'
WHo has a Position of end and a School/Club Team of oregon state?
CREATE TABLE table_36511 ( "Round" real, "Pick" real, "Player" text, "Position" text, "School/Club Team" text )
SELECT score FROM table_name_67 WHERE team = "waaia"
Tell met he score for team of waaia
CREATE TABLE table_name_67 (score VARCHAR, team VARCHAR)
SELECT COUNT(status) FROM table_176529_2 WHERE official_name = "Moncton"
How many status are there for Moncton?
CREATE TABLE table_176529_2 (status VARCHAR, official_name VARCHAR)
SELECT COUNT("Joined") FROM table_23214 WHERE "Location" = 'Chestnut Hill, Massachusetts'
On how many different dates did schools from Chestnut Hill, Massachusetts join the conference?
CREATE TABLE table_23214 ( "Institution" text, "Location" text, "Nickname" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" real )
SELECT team FROM table_name_48 WHERE competition = "victorian football league"
Tell me the team for victorian football league
CREATE TABLE table_name_48 (team VARCHAR, competition VARCHAR)
SELECT census_ranking FROM table_176529_2 WHERE population = 959
What is the census ranking of the location with population of 959?
CREATE TABLE table_176529_2 (census_ranking VARCHAR, population VARCHAR)
SELECT MAX("Losses") FROM table_55996 WHERE "Wins" = '0' AND "Win %" > '0'
What is the high loss total for players with zero wins and a win % greater than 0?
CREATE TABLE table_55996 ( "Name" text, "Period" text, "Starts" real, "Wins" real, "Losses" real, "Ties" real, "Win %" real )
SELECT debut FROM table_name_58 WHERE name = "scott tunbridge"
What round was the debut of Scott Tunbridge?
CREATE TABLE table_name_58 (debut VARCHAR, name VARCHAR)
SELECT official_name FROM table_176529_2 WHERE area_km_2 = "582.20"
What is the name of the place with 582.20 square km area?
CREATE TABLE table_176529_2 (official_name VARCHAR, area_km_2 VARCHAR)
SELECT hometown__previous_school_ FROM table_name_72 WHERE name = "tim williams"
What is the Hometown of Tim Williams?
CREATE TABLE table_name_72 ( hometown__previous_school_ VARCHAR, name VARCHAR )
SELECT debut FROM table_name_11 WHERE position = "defender" AND name = "stephen laybutt"
What round was the debut of defender Stephen Laybutt?
CREATE TABLE table_name_11 (debut VARCHAR, position VARCHAR, name VARCHAR)
SELECT official_name FROM table_176529_2 WHERE area_km_2 = "578.28"
What is the name of the place where area is 578.28 square km?
CREATE TABLE table_176529_2 (official_name VARCHAR, area_km_2 VARCHAR)
SELECT Giant AS slalom FROM table_name_26 WHERE slalom = "45"
Which Giant Slalom has a Slalom of 45?
CREATE TABLE table_name_26 ( Giant VARCHAR, slalom VARCHAR )
SELECT position FROM table_name_66 WHERE debut = "round 6"
What position had a debut in round 6?
CREATE TABLE table_name_66 (position VARCHAR, debut VARCHAR)
SELECT team FROM table_17693171_1 WHERE points = "20"
If the points is 20, what was the team name?
CREATE TABLE table_17693171_1 (team VARCHAR, points VARCHAR)
SELECT "1990" FROM table_45555 WHERE "1997" = '1r' AND "Tournament" = 'hamburg'
What is 1990, when 1997 is '1R', and when Tournament is 'Hamburg'?
CREATE TABLE table_45555 ( "Tournament" text, "1988" text, "1989" text, "1990" text, "1991" text, "1992" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text, "1998" text, "1999" text, "2000" text, "2001" text, "2002" text, "2003" text...
SELECT name FROM table_name_96 WHERE debut = "round 6"
What is the name of the player that had a debut in round 6?
CREATE TABLE table_name_96 (name VARCHAR, debut VARCHAR)
SELECT time_retired FROM table_17693171_1 WHERE driver = "Marco Andretti"
What is the time/retired if the driver is Marco Andretti?
CREATE TABLE table_17693171_1 (time_retired VARCHAR, driver VARCHAR)
SELECT COUNT(*) FROM table_203_551 WHERE "result" < "result"
how many games did he score but his team lost ?
CREATE TABLE table_203_551 ( id number, "goal" number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text )
SELECT date_joined FROM table_name_27 WHERE from__club_ = "santo andrΓ©"
What date did the player from Santo AndrΓ© debut?
CREATE TABLE table_name_27 (date_joined VARCHAR, from__club_ VARCHAR)
SELECT MAX(laps) AS Led FROM table_17693171_1 WHERE laps = 191
If the laps is 191, what is the maximum laps led?
CREATE TABLE table_17693171_1 (laps INTEGER)
SELECT "nationality" FROM table_203_148 WHERE id = (SELECT id FROM table_203_148 WHERE "nationality" = 'french navy') - 1
what nationality is on top of french navy ?
CREATE TABLE table_203_148 ( id number, "date" text, "name" text, "nationality" text, "tonnage\n(grt)" number, "fate" text )
SELECT venue FROM table_name_64 WHERE score = "20½–11Β½"
what is the venue when the score is 20½–11Β½?
CREATE TABLE table_name_64 (venue VARCHAR, score VARCHAR)
SELECT time_retired FROM table_17693171_1 WHERE driver = "Ed Carpenter"
What is the time/retired if the driver is Ed Carpenter?
CREATE TABLE table_17693171_1 (time_retired VARCHAR, driver VARCHAR)
SELECT "To par" FROM table_65903 WHERE "Place" = 't1' AND "Player" = 'jiyai shin'
What is the to par for Jiyai Shin when the place is t1?
CREATE TABLE table_65903 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
SELECT winning_team FROM table_name_31 WHERE year > 2003 AND score = "19½–14Β½" AND venue = "harding park golf club"
Who is the winning team when the year is more than 2003, the score is 19½–14Β½ and the venue is harding park golf club?
CREATE TABLE table_name_31 (winning_team VARCHAR, venue VARCHAR, year VARCHAR, score VARCHAR)
SELECT MAX(laps) FROM table_17693171_1 WHERE time_retired = "+1 lap"
If the time/retired is +1 lap, what is the amount of maximum laps?
CREATE TABLE table_17693171_1 (laps INTEGER, time_retired VARCHAR)
SELECT COUNT("Reason for change") FROM table_24508 WHERE "Date successor seated" = 'May 11, 1939'
Name the number of reason for change on may 11, 1939
CREATE TABLE table_24508 ( "District" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date successor seated" text )
SELECT MAX(year) FROM table_name_61 WHERE us_captain = "ken venturi"
what is the highest year that the U.S. captain is ken venturi?
CREATE TABLE table_name_61 (year INTEGER, us_captain VARCHAR)
SELECT team FROM table_17693171_1 WHERE driver = "Milka Duno"
If the driver is Milka Duno, what is the name of the team?
CREATE TABLE table_17693171_1 (team VARCHAR, driver VARCHAR)
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2120" AND prescriptions.route = "ORAL"
how many patients are admitted before the year 2120 and administered through oral drug route?
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions...
SELECT location FROM table_name_21 WHERE year < 1998 AND international_captain = "david graham"
what is the location when the year is less than 1998 and the international captain is david graham?
CREATE TABLE table_name_21 (location VARCHAR, year VARCHAR, international_captain VARCHAR)
SELECT COUNT(stage) FROM table_17672470_19 WHERE winner = "Robbie McEwen"
How many stages were won by Robbie McEwen?
CREATE TABLE table_17672470_19 (stage VARCHAR, winner VARCHAR)
SELECT to_par FROM table_name_91 WHERE player = "peter senior"
What is the to par of player peter senior?
CREATE TABLE table_name_91 ( to_par VARCHAR, player VARCHAR )
SELECT COUNT(earnings__) AS $__ FROM table_name_64 WHERE player = "jim colbert" AND rank < 2
How much did jim colbert earned ranked above 2?
CREATE TABLE table_name_64 (earnings__ VARCHAR, player VARCHAR, rank VARCHAR)
SELECT COUNT(car__number) FROM table_1769428_2 WHERE winning_driver = "Rusty Wallace"
How many car numbers were listed for Rusty Wallace?
CREATE TABLE table_1769428_2 (car__number VARCHAR, winning_driver VARCHAR)
SELECT candidates FROM table_2668254_8 WHERE district = "Kentucky 5"
Who were the candidates in the Kentucky 5 district?
CREATE TABLE table_2668254_8 ( candidates VARCHAR, district VARCHAR )
SELECT date FROM table_name_74 WHERE venue = "junction oval"
What day did the VFL play at Junction Oval?
CREATE TABLE table_name_74 (date VARCHAR, venue VARCHAR)
SELECT MAX(season) FROM table_1769428_2 WHERE winning_driver = "Rusty Wallace"
In what season did Rusty Wallace win?
CREATE TABLE table_1769428_2 (season INTEGER, winning_driver VARCHAR)
SELECT championship FROM table_name_36 WHERE opponent = "roger federer" AND surface = "clay" AND year < 2007
Which championship has Roger Federer as an opponent on a clay surface in a year earlier than 2007?
CREATE TABLE table_name_36 ( championship VARCHAR, year VARCHAR, opponent VARCHAR, surface VARCHAR )
SELECT venue FROM table_name_41 WHERE home_team = "footscray"
Where did Footscray play as the home team?
CREATE TABLE table_name_41 (venue VARCHAR, home_team VARCHAR)
SELECT team FROM table_1769428_2 WHERE date = "June 27"
What was the represented team on June 27?
CREATE TABLE table_1769428_2 (team VARCHAR, date VARCHAR)
SELECT MAX("Played") FROM table_67377 WHERE "Goal Difference" < '27' AND "Losses" > '13' AND "Goals for" < '42' AND "Draws" = '6'
Which position had a goal difference of less than 27, lost more than 13 games, scored less than 42 goals and drew 6 games?
CREATE TABLE table_67377 ( "Position" real, "Club" text, "Played" real, "Points" text, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
SELECT away_team AS score FROM table_name_62 WHERE home_team = "footscray"
Who was the opponent when Footscray played as the home team?
CREATE TABLE table_name_62 (away_team VARCHAR, home_team VARCHAR)
SELECT winning_driver FROM table_1769428_2 WHERE team = "Hendrick Motorsports" AND make = "Chevrolet Impala SS"
Who was the winning driver for Hendrick Motorsports in a Chevrolet Impala SS?
CREATE TABLE table_1769428_2 (winning_driver VARCHAR, team VARCHAR, make VARCHAR)
SELECT COUNT(fa_cup_goals) FROM table_name_47 WHERE flt_goals > 0
What is the total number of FA Cup Goals, when FLT Goals is greater than 0?
CREATE TABLE table_name_47 ( fa_cup_goals VARCHAR, flt_goals INTEGER )
SELECT COUNT(crowd) FROM table_name_50 WHERE venue = "arden street oval"
What was the attendance when the VFL played Arden Street Oval?
CREATE TABLE table_name_50 (crowd VARCHAR, venue VARCHAR)
SELECT lost FROM table_17718005_2 WHERE drawn = 10 AND goals_for = 45
When 45 is the goals for and 10 is the drawn what is the lost?
CREATE TABLE table_17718005_2 (lost VARCHAR, drawn VARCHAR, goals_for VARCHAR)
SELECT event FROM table_22644589_4 WHERE compulsory_dance__cd_ = "23.75"
In what even was the compulsory dance scored 23.75?
CREATE TABLE table_22644589_4 ( event VARCHAR, compulsory_dance__cd_ VARCHAR )
SELECT loss FROM table_name_82 WHERE date = "june 22"
What was the score June 22?
CREATE TABLE table_name_82 (loss VARCHAR, date VARCHAR)
SELECT goals_for FROM table_17718005_2 WHERE goal_difference = "+10"
When +10 is the goal difference what is the goals for?
CREATE TABLE table_17718005_2 (goals_for VARCHAR, goal_difference VARCHAR)
SELECT FIRST_NAME, MANAGER_ID FROM employees ORDER BY MANAGER_ID
You can return a bar chart to show the employees' first name and the corresponding manager's id, and rank total number in ascending order.
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_...
SELECT school FROM table_name_68 WHERE hometown = "winter park, fl"
Which school has a hometown of winter park, FL?
CREATE TABLE table_name_68 (school VARCHAR, hometown VARCHAR)
SELECT points_1 FROM table_17718005_2 WHERE team = "Ellesmere Port & Neston"
When ellesmere port & neston is the team what are the points 1?
CREATE TABLE table_17718005_2 (points_1 VARCHAR, team VARCHAR)
SELECT "Public Debt % of GDP (2013 Q1)" FROM table_20461 WHERE "GDP % of EU (2012)" = '4.7%'
What is the public debt % of GDP in 2013 Q1 with a 4.7% GDP of EU in 2012?
CREATE TABLE table_20461 ( "Member State sorted by GDP" text, "GDP in s billion of USD (2012)" text, "GDP % of EU (2012)" text, "Annual change % of GDP (2012)" text, "GDP per capita in PPP US$ (2012)" real, "Public Debt % of GDP (2013 Q1)" text, "Deficit (-)/ Surplus (+) % of GDP (2012)" tex...
SELECT college FROM table_name_68 WHERE height = "6-4" AND school = "lake howell high school"
What's the college of the player with a height of 6-4 and went to lake howell high school?
CREATE TABLE table_name_68 (college VARCHAR, height VARCHAR, school VARCHAR)
SELECT COUNT(driver) FROM table_1771753_3 WHERE season = "2005"
When 2005 is the season how many drivers are there?
CREATE TABLE table_1771753_3 (driver VARCHAR, season VARCHAR)
SELECT AVG(yards) FROM table_name_2 WHERE long < 3
Which Yards has a Long smaller than 3?
CREATE TABLE table_name_2 ( yards INTEGER, long INTEGER )
SELECT hometown FROM table_name_51 WHERE college = "lsu"
What's the hometown of the player with a college of lsu?
CREATE TABLE table_name_51 (hometown VARCHAR, college VARCHAR)
SELECT average_speed__mph_ FROM table_1771753_3 WHERE driver = "Tony Kanaan"
When tony kanaan is the driver what is the average speed miles per hour?
CREATE TABLE table_1771753_3 (average_speed__mph_ VARCHAR, driver VARCHAR)
SELECT "Score" FROM table_24801 WHERE "Partner" = 'Rafael Osuna'
What was the score when the partner is Rafael Osuna?
CREATE TABLE table_24801 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
SELECT height FROM table_name_72 WHERE school = "lake howell high school"
What's the heigh of the player who went to lake howell high school?
CREATE TABLE table_name_72 (height VARCHAR, school VARCHAR)
SELECT chassis FROM table_1771753_3 WHERE average_speed__mph_ = "169.182"
When 169.182 is the average speed miles per hour what is the chassis?
CREATE TABLE table_1771753_3 (chassis VARCHAR, average_speed__mph_ VARCHAR)
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "3" AND diagnoses.short_title = "Ac vasc insuff intestine"
how many patients stayed in hospital for more than 3 days and were diagnosed with ac vasc insuff intestine?
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
SELECT height FROM table_name_83 WHERE player = "nolan smith"
What's the heigh of nolan smith?
CREATE TABLE table_name_83 (height VARCHAR, player VARCHAR)
SELECT miles__km_ FROM table_1771753_3 WHERE race_time = "1:34:01"
When 1:34:01 is the race time what is the miles in kilometers?
CREATE TABLE table_1771753_3 (miles__km_ VARCHAR, race_time VARCHAR)
SELECT driver FROM table_name_13 WHERE zan_1 = "19"
What driver has 19 as the zan 1?
CREATE TABLE table_name_13 ( driver VARCHAR, zan_1 VARCHAR )
SELECT height FROM table_name_64 WHERE school = "oak hill academy"
What's the height of the player who went to oak hill academy?
CREATE TABLE table_name_64 (height VARCHAR, school VARCHAR)
SELECT race_time FROM table_1771753_3 WHERE team = "Chip Ganassi Racing" AND laps = "228"
When 228 is the lap and chip ganassi racing is the team what is the race time?
CREATE TABLE table_1771753_3 (race_time VARCHAR, team VARCHAR, laps VARCHAR)
SELECT "Surface" FROM table_35496 WHERE "Score" = '7–5, 6–4'
Which Surface has a Score of 7 5, 6 4?
CREATE TABLE table_35496 ( "Date" text, "Tournament" text, "Surface" text, "Opponen" text, "Score" text )
SELECT tyre FROM table_name_67 WHERE fastest_lap = "paul russo"
What tyre did Paul Russo have on his fastest lap?
CREATE TABLE table_name_67 (tyre VARCHAR, fastest_lap VARCHAR)
SELECT MIN(tie_no) FROM table_17736890_5 WHERE home_team = "Chelsea"
What tie number featured Chelsea as the home team?
CREATE TABLE table_17736890_5 (tie_no INTEGER, home_team VARCHAR)
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions...
what are the top three common diagnoses that patients were diagnosed with within 2 months after having been diagnosed with pleural effusion nos in 2105?
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_labitems ( row_id...
SELECT date FROM table_name_28 WHERE constructor = "maserati" AND fastest_lap = "stirling moss"
What is the date that Stirling Moss had his fastest lap in a Maserati?
CREATE TABLE table_name_28 (date VARCHAR, constructor VARCHAR, fastest_lap VARCHAR)
SELECT MAX(tie_no) FROM table_17736890_5 WHERE away_team = "Leeds United"
In what tie were Leeds United the away team?
CREATE TABLE table_17736890_5 (tie_no INTEGER, away_team VARCHAR)
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_...
what was the four most frequent specimen tests that patients had during the same month after they had been diagnosed with cerv spondyl w myelopath?
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABL...
SELECT winning_driver FROM table_name_90 WHERE date = "30 may"
Who was the winning driver on 30 May?
CREATE TABLE table_name_90 (winning_driver VARCHAR, date VARCHAR)
SELECT home_team FROM table_17736890_5 WHERE away_team = "Burnley"
Who was the home team when Burnley were the away team?
CREATE TABLE table_17736890_5 (home_team VARCHAR, away_team VARCHAR)
SELECT AVG(weight), MIN(weight), sex FROM people GROUP BY sex
Find the average and minimum weight for each gender.
CREATE TABLE people ( people_id number, sex text, name text, date_of_birth text, height number, weight number ) CREATE TABLE candidate ( candidate_id number, people_id number, poll_source text, date text, support_rate number, consider_rate number, oppose_rate number,...