context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_67611 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text )
Which club has a try bonus of 2 ?
SELECT "Club" FROM table_67611 WHERE "Try bonus" = '2'
wikisql
CREATE TABLE table_name_19 ( match VARCHAR, competition VARCHAR, location VARCHAR )
Which Match played in a Location of San Francisco has a Competition of Semifinal?
SELECT match FROM table_name_19 WHERE competition = "semifinal" AND location = "san francisco"
sql_create_context
CREATE TABLE pilot_record ( Record_ID int, Pilot_ID int, Aircraft_ID int, Date text ) CREATE TABLE aircraft ( Aircraft_ID int, Order_Year int, Manufacturer text, Model text, Fleet_Series text, Powertrain text, Fuel_Propulsion text ) CREATE TABLE pilot ( Pilot_ID int, ...
Draw a bar chart for what are the different nationalities of pilots? Show each nationality and the number of pilots of each nationality, and could you display total number from low to high order?
SELECT Nationality, COUNT(*) FROM pilot GROUP BY Nationality ORDER BY COUNT(*)
nvbench
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostHistoryTypes ( Id number, ...
Top 200 from Chennai, India.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%chennai%india%' ORDER BY Reputation DESC LIMIT 200
sede
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREAT...
tell me the name of the drug which patient 010-1155 was prescribed within 2 days after receiving a oxygen therapy (40% to 60%) - 50-60% procedure since 03/2105?
SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-1155') AND treatment.treatmen...
eicu
CREATE TABLE table_2562572_25 ( largest_ethnic_group__2002_ VARCHAR, cyrillic_name_other_names VARCHAR )
When is the cyrillic name other names what is the largest ethnic group of 2002?
SELECT largest_ethnic_group__2002_ FROM table_2562572_25 WHERE cyrillic_name_other_names = "Дероње"
sql_create_context
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
在2012年4月8日到2012年5月24日这段时间药剂科的药品3174-i的开药量有多少?
SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.MED_ORG_DEPT_NM = '药剂科' AND t_kc22.STA_DATE BETWEEN '2012-04-08' AND '2012-05-24' AND t_kc22.SOC_SRT_DIRE_CD = '3174-i'
css
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, ...
hello i'd like a DL flight from ATLANTA to BOSTON
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANT...
atis
CREATE TABLE table_name_97 ( points VARCHAR, engine VARCHAR, year VARCHAR )
In 1962, what was the total number of points, when the Engine was Ferrari v6?
SELECT COUNT(points) FROM table_name_97 WHERE engine = "ferrari v6" AND year = 1962
sql_create_context
CREATE TABLE table_name_43 ( owner VARCHAR, winner VARCHAR )
Who is the owner of the Raglan Road winner?
SELECT owner FROM table_name_43 WHERE winner = "raglan road"
sql_create_context
CREATE TABLE table_45127 ( "Player" text, "Wkts" real, "Runs" real, "Econ" real, "Ovrs" real )
What is the sum of the runs when the wkts were bigger than 0 and ovrs were smaller than 2?
SELECT SUM("Runs") FROM table_45127 WHERE "Ovrs" < '2' AND "Wkts" > '0'
wikisql
CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
在965科室因疾病U57.745在08年12月24到2011年6月4日内住院的平均费用是多少?
SELECT AVG(gwyjzb.MED_AMOUT) FROM gwyjzb WHERE gwyjzb.MED_ORG_DEPT_CD = '965' AND gwyjzb.IN_HOSP_DATE BETWEEN '2008-12-24' AND '2011-06-04' AND gwyjzb.IN_DIAG_DIS_CD = 'U57.745' AND gwyjzb.CLINIC_TYPE = '住院' UNION SELECT AVG(fgwyjzb.MED_AMOUT) FROM fgwyjzb WHERE fgwyjzb.MED_ORG_DEPT_CD = '965' AND fgwyjzb.IN_HOSP_DATE ...
css
CREATE TABLE table_204_481 ( id number, "poll source" text, "date(s)\nadministered" text, "sample\nsize" number, "margin of\nerror" text, "andrew\ncuomo (d)" text, "rob\nastorino (r)" text, "other" text, "undecided" text )
is the sample size of siena more or less than the sample size of quinnipiac ?
SELECT (SELECT "sample\nsize" FROM table_204_481 WHERE "poll source" = 'siena') > (SELECT "sample\nsize" FROM table_204_481 WHERE "poll source" = 'quinnipiac')
squall
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
门诊就诊80538748012的就诊状态代码以及名称分别是什么?
SELECT mzjzjlb.JZZTDM, mzjzjlb.JZZTMC FROM mzjzjlb WHERE mzjzjlb.JZLSH = '80538748012'
css
CREATE TABLE table_203_618 ( id number, "pick" number, "player" text, "team" text, "position" text, "school" text )
who is listed after pat burrell ?
SELECT "player" FROM table_203_618 WHERE id = (SELECT id FROM table_203_618 WHERE "player" = 'pat burrell') + 1
squall
CREATE TABLE table_name_55 ( driver VARCHAR, laps VARCHAR, time_retired VARCHAR )
Who drove during the race with less than 19 laps and a time listed as ignition?
SELECT driver FROM table_name_55 WHERE laps < 19 AND time_retired = "ignition"
sql_create_context
CREATE TABLE table_name_23 ( team_1 VARCHAR, team_2 VARCHAR )
What is Team 1 where Team 2 is gombe united f.c.?
SELECT team_1 FROM table_name_23 WHERE team_2 = "gombe united f.c."
sql_create_context
CREATE TABLE table_79968 ( "Season" text, "Tier" real, "League" text, "Turkish Cup" text, "European Competitions" text )
Tier of 2, and a Season of 2000 01 is what European competitions?
SELECT "European Competitions" FROM table_79968 WHERE "Tier" = '2' AND "Season" = '2000–01'
wikisql
CREATE TABLE table_56851 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the date of the match where the home team scored 14.13 (97)
SELECT "Date" FROM table_56851 WHERE "Home team score" = '14.13 (97)'
wikisql
CREATE TABLE table_name_20 ( b_score INTEGER, gymnast VARCHAR )
what is the average b score when the gymnast is k hei uchimura ( jpn )?
SELECT AVG(b_score) FROM table_name_20 WHERE gymnast = "kōhei uchimura ( jpn )"
sql_create_context
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
has patient 005-87465 received oxygen therapy (> 60%) - >90% since 2105 in another hospital?
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '005-87465' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '005-87465' AND patient.hospitaldischargetime IS NULL)) AND tr...
eicu
CREATE TABLE table_name_82 ( competition VARCHAR, date VARCHAR )
Name the competition for november 19, 2008
SELECT competition FROM table_name_82 WHERE date = "november 19, 2008"
sql_create_context
CREATE TABLE table_75855 ( "Player" text, "Tackles" real, "Solo" real, "Assts" real, "Sacks" real, "Int yards" real, "Int avg." real, "Int TD" real, "Fum. rec" real, "Fum. rec TD" real )
What is the sum for the int yards that has an assts more than 3, and player Jay Alford?
SELECT SUM("Int yards") FROM table_75855 WHERE "Assts" > '3' AND "Player" = 'jay alford'
wikisql
CREATE TABLE table_name_34 ( attendance INTEGER, date VARCHAR )
How many people attended the game on February 3, 2008?
SELECT SUM(attendance) FROM table_name_34 WHERE date = "february 3, 2008"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
how many patients whose gender is m and age is less than 24?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.age < "24"
mimicsql_data
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
Calculate the minimum age of urgent hospital admission patients admitted in or after the year 2178.
SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.admityear >= "2178"
mimicsql_data
CREATE TABLE people ( people_id number, name text, height number, weight number, date_of_birth text ) CREATE TABLE entrepreneur ( entrepreneur_id number, people_id number, company text, money_requested number, investor text )
What are the names of people who are not entrepreneurs?
SELECT name FROM people WHERE NOT people_id IN (SELECT people_id FROM entrepreneur)
spider
CREATE TABLE table_42121 ( "City" text, "State" text, "AAM Accredited" text, "AAM Member" text, "ASTC Member" text )
What is City, when State is Florida, when AAM Member is No, and when AAM Accredited is No?
SELECT "City" FROM table_42121 WHERE "State" = 'florida' AND "AAM Member" = 'no' AND "AAM Accredited" = 'no'
wikisql
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, ...
编码为45512719的团伙成员几个最常去的医生排序都是什么?
SELECT t_kc21.OUT_DIAG_DOC_CD, t_kc21.OUT_DIAG_DOC_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '45512719' GROUP BY t_kc21.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC
css
CREATE TABLE table_22334183_3 ( date VARCHAR, circuit VARCHAR )
When was the circuit Donington Park?
SELECT date FROM table_22334183_3 WHERE circuit = "Donington Park"
sql_create_context
CREATE TABLE table_21636599_2 ( civilians VARCHAR, security_forces VARCHAR )
What are the civilian total when the security force total is 36?
SELECT civilians FROM table_21636599_2 WHERE security_forces = "36"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
how many patients whose age is less than 48 and drug name is psyllium?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "48" AND prescriptions.drug = "Psyllium"
mimicsql_data
CREATE TABLE table_15502 ( "Country" text, "Film title used in nomination" text, "Language" text, "Original name" text, "Director" text )
Name the original name for last days of the victim
SELECT "Original name" FROM table_15502 WHERE "Film title used in nomination" = 'last days of the victim'
wikisql
CREATE TABLE table_name_94 ( week INTEGER, opponent VARCHAR )
What is the lowest week number where they played against the Detroit Lions?
SELECT MIN(week) FROM table_name_94 WHERE opponent = "detroit lions"
sql_create_context
CREATE TABLE table_4398 ( "Heat Rank" real, "Lane" real, "Swimmer" text, "Country" text, "Time" real, "Overall Rank" text )
Tell me the total number of time for heat rank of 1
SELECT COUNT("Time") FROM table_4398 WHERE "Heat Rank" = '1'
wikisql
CREATE TABLE table_41469 ( "Country" text, "Population" real, "GDP 2011 (In Millions USD)" real, "GDP 2012 (In Millions USD)" real, "per capita" real )
What is the population on average with a per capita of 1,158, and a 2011 GDP less than 6,199?
SELECT AVG("Population") FROM table_41469 WHERE "per capita" = '1,158' AND "GDP 2011 (In Millions USD)" < '6,199'
wikisql
CREATE TABLE table_58392 ( "AVE- No." real, "Name" text, "Country" text, "Highest mountain" text, "Height (m)" real )
Which Height (m) has a Name of plessur alps, and a AVE-No larger than 63?
SELECT MIN("Height (m)") FROM table_58392 WHERE "Name" = 'plessur alps' AND "AVE- No." > '63'
wikisql
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE outputevents ( row_id number, subject_id number, ...
what was the name of the procedure that was given two times to patient 27172 since 65 months ago?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 271...
mimic_iii
CREATE TABLE table_16432543_3 ( enrollment INTEGER, nickname VARCHAR )
what is the enrollment for the Cavaliers?
SELECT MAX(enrollment) FROM table_16432543_3 WHERE nickname = "Cavaliers"
sql_create_context
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, ...
编号为19416849的患者在门诊诊断为慢性阻塞性肺病伴有急性加重的白蛋白的时候其结果定量是什么及其单位是什么呢?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.Y...
css
CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER )
Return a bar chart on how old is the youngest person for each job?, could you rank by the x-axis in asc?
SELECT job, MIN(age) FROM Person GROUP BY job ORDER BY job
nvbench
CREATE TABLE table_33871 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What is the sum of the weeks during which the Redskins played against the Houston Oilers and had more than 54,582 fans in attendance?
SELECT SUM("Week") FROM table_33871 WHERE "Opponent" = 'houston oilers' AND "Attendance" > '54,582'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TA...
how many days have elapsed since patient 015-23047's last stay in the ward 608 during this hospital visit?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '015-23047' AND patient.wardid = 608 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1
eicu
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE T...
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the change of commission_pct over hire_date in a line chart, and sort HIRE_DATE in ascending order.
SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY HIRE_DATE
nvbench
CREATE TABLE table_44643 ( "Election" real, "Number of PNC votes" text, "Share of votes" text, "Seats" text, "Outcome of election" text )
How many seats does the election with the outcome of election of minority in parliament and 186,226 PNC votes have?
SELECT "Seats" FROM table_44643 WHERE "Outcome of election" = 'minority in parliament' AND "Number of PNC votes" = '186,226'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age te...
when was the first time patient 033-42758 got prescribed for pantoprazole 40 mg iv recon soln and meropenem 500 mg iv solr at the same time in 11/2104?
SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'pantoprazole 40 mg iv recon soln' AND patient.uniquepid = '033-42758' AND STRFTIME('%y-%m', medication.drugstarttime) = '...
eicu
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id numbe...
what is the percentile of 9.8 in a calcium, total lab test conducted at the same age of patient 40059 in this hospital encounter?
SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'calcium, total') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admission...
mimic_iii
CREATE TABLE table_name_23 ( home_team VARCHAR, away_team VARCHAR )
What is the home team's score when south melbourne is away?
SELECT home_team AS score FROM table_name_23 WHERE away_team = "south melbourne"
sql_create_context
CREATE TABLE table_37207 ( "Season" real, "Winner" text, "Finalist" text, "Score" text, "Host City" text )
Who was the finalist in the 2010 season in the host city tartu?
SELECT "Finalist" FROM table_37207 WHERE "Host City" = 'tartu' AND "Season" = '2010'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
what is the number of patients whose ethnicity is hispanic or latino and procedure short title is closed liver biopsy?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND procedures.short_title = "Closed liver biopsy"
mimicsql_data
CREATE TABLE table_name_24 ( host_city VARCHAR, venue VARCHAR, theme VARCHAR )
What is the host city of the Singapore Indoor Stadium venue and a Valentine's Day theme?
SELECT host_city FROM table_name_24 WHERE venue = "singapore indoor stadium" AND theme = "valentine's day"
sql_create_context
CREATE TABLE table_35095 ( "Date" text, "Result" text, "Score" text, "Venue" text, "Competition" text )
Competition of friendly, and a Date of 03-jun-62 had what score?
SELECT "Score" FROM table_35095 WHERE "Competition" = 'friendly' AND "Date" = '03-jun-62'
wikisql
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREA...
give me SUNDAY nonstop flights from MEMPHIS to LAS VEGAS
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LAS VEGAS' AND days.day_name = 'SUNDAY' AND flight.flight_days = days.days_code AN...
atis
CREATE TABLE table_204_291 ( id number, "rank" number, "name" text, "nation" text, "cp" number, "fp" number, "points" number, "placings" number )
which woman finished last in the 1971 world figured skating championships ?
SELECT "name" FROM table_204_291 ORDER BY "rank" DESC LIMIT 1
squall
CREATE TABLE table_name_9 ( crowd VARCHAR, venue VARCHAR )
What was the attendance at Corio Oval?
SELECT crowd FROM table_name_9 WHERE venue = "corio oval"
sql_create_context
CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int, STU_CLASS varchar(2), ...
Show the number of courses for each course description in a bar chart, show in asc by the total number.
SELECT CRS_DESCRIPTION, COUNT(CRS_DESCRIPTION) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY CRS_DESCRIPTION ORDER BY COUNT(CRS_DESCRIPTION)
nvbench
CREATE TABLE table_30768 ( "Branding" text, "Callsign" text, "Frequency" text, "Power (kW)" text, "Station Type" text, "Location" text )
How many locations have the callsign DXGH?
SELECT COUNT("Location") FROM table_30768 WHERE "Callsign" = 'DXGH'
wikisql
CREATE TABLE table_name_8 ( record VARCHAR, score VARCHAR )
What record was reached with a score of 7 - 2?
SELECT record FROM table_name_8 WHERE score = "7 - 2"
sql_create_context
CREATE TABLE table_55491 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the smallest crowd at a home game for essendon?
SELECT MIN("Crowd") FROM table_55491 WHERE "Home team" = 'essendon'
wikisql
CREATE TABLE table_74861 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
How many top 10s when he had under 1 top 5s?
SELECT SUM("Top-10") FROM table_74861 WHERE "Top-5" < '1'
wikisql
CREATE TABLE table_name_18 ( record VARCHAR, date VARCHAR )
Which Record has a Date of january 31?
SELECT record FROM table_name_18 WHERE date = "january 31"
sql_create_context
CREATE TABLE table_203_653 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
who won the largest amount of bronze medals ?
SELECT "nation" FROM table_203_653 ORDER BY "bronze" DESC LIMIT 1
squall
CREATE TABLE table_65288 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
How much Gold has a Nation of mongolia, and a Total larger than 18?
SELECT SUM("Gold") FROM table_65288 WHERE "Nation" = 'mongolia' AND "Total" > '18'
wikisql
CREATE TABLE table_63813 ( "Title" text, "Author" text, "First Issue" text, "Last Issue" text, "Completed?" text )
What is the Author of the Title with an Ongoing Last Issue?
SELECT "Author" FROM table_63813 WHERE "Last Issue" = 'ongoing'
wikisql
CREATE TABLE table_name_73 ( year_left INTEGER, location VARCHAR )
When was the first year when Fowler joined?
SELECT MIN(year_left) FROM table_name_73 WHERE location = "fowler"
sql_create_context
CREATE TABLE county_public_safety ( County_ID int, Name text, Population int, Police_officers int, Residents_per_officer int, Case_burden int, Crime_rate real, Police_force text, Location text ) CREATE TABLE city ( City_ID int, County_ID int, Name text, White real, ...
What is the number of cities in each country? Return a bar chart.
SELECT T2.Name, COUNT(T2.Name) FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID GROUP BY T2.Name
nvbench
CREATE TABLE table_name_38 ( category VARCHAR, awards VARCHAR, year VARCHAR, result VARCHAR )
What category was nominated in 2010 fo the British Soap Awards?
SELECT category FROM table_name_38 WHERE year = 2010 AND result = "nominated" AND awards = "british soap awards"
sql_create_context
CREATE TABLE table_57557 ( "Stations" text, "Place" text, "Managed By" text, "Platforms" real, "Zone" real )
Name the average zone for waddon marsh tram stop
SELECT AVG("Zone") FROM table_57557 WHERE "Stations" = 'waddon marsh tram stop'
wikisql
CREATE TABLE table_41272 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Original title" text, "Director" text, "Result" text )
What is Result, when Director is Veljko Bulaji category:articles with hcards, and when Original title is Sarajevski Atentat?
SELECT "Result" FROM table_41272 WHERE "Director" = 'veljko bulajić category:articles with hcards' AND "Original title" = 'sarajevski atentat'
wikisql
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE diagnoses_icd ( row_id number, subject_i...
what's the total dose of gentamicin sulfate that patient 40435 has been prescribed until 11/2105?
SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 40435) AND prescriptions.drug = 'gentamicin sulfate' AND STRFTIME('%y-%m', prescriptions.startdate) <= '2105-11'
mimic_iii
CREATE TABLE table_46566 ( "Year" real, "Championship" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
What was the winning score in the year 2002?
SELECT "Winning score" FROM table_46566 WHERE "Year" = '2002'
wikisql
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...
provide the number of patients whose primary disease is s/p fall and year of death is less than or equal to 2180?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "S/P FALL" AND demographic.dod_year <= "2180.0"
mimicsql_data
CREATE TABLE table_203_812 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
what is the total amount of nations with more than 5 bronze medals ?
SELECT COUNT("nation") FROM table_203_812 WHERE "bronze" > 5
squall
CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE state ( state_code text, state...
now i'd like to see flights from DETROIT to ST. PETERSBURG on the next tuesday
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ST. PETERSBURG' AND date_day.day_number = 22 AND date_day.month_number = ...
atis
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
患者马浩浩的医疗记录中被开出不低于459.68元的药品有哪几次?查一下医疗就诊的编码
SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '马浩浩' AND NOT t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT < 459.68)
css
CREATE TABLE table_67376 ( "Position" real, "Club" text, "Played" real, "Points" text, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
What was the position of the team that had a goal difference of less than -11 and played less than 38 games?
SELECT SUM("Position") FROM table_67376 WHERE "Goal Difference" < '-11' AND "Played" < '38'
wikisql
CREATE TABLE table_name_63 ( away_team VARCHAR, venue VARCHAR )
Who was the away team at Junction Oval?
SELECT away_team FROM table_name_63 WHERE venue = "junction oval"
sql_create_context
CREATE TABLE table_7540 ( "Date" text, "Time" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Total" text, "Report" text )
What set 2 has 15:33 as the time?
SELECT "Set 2" FROM table_7540 WHERE "Time" = '15:33'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
give me the number of patients whose admission location is phys referral/normal deli and lab test name is lactate dehydrogenase, pleural?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND lab.label = "Lactate Dehydrogenase, Pleural"
mimicsql_data
CREATE TABLE table_13719 ( "Sr No" real, "Name" text, "Locale" text, "Height" text, "Floors" real, "Building Type" text )
what is the name that had 46 floors?
SELECT "Name" FROM table_13719 WHERE "Floors" = '46'
wikisql
CREATE TABLE table_3511 ( "Outcome" text, "No." text, "Date" text, "Championship" text, "Surface" text, "Opponent in the final" text, "Score in the final" text )
How many outcomes occur on the date of January 31, 2010?
SELECT COUNT("Outcome") FROM table_3511 WHERE "Date" = 'January 31, 2010'
wikisql
CREATE TABLE table_79025 ( "Position" real, "Club" text, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
What is the losses when the goal difference is larger than 26?
SELECT MAX("Losses") FROM table_79025 WHERE "Goal Difference" > '26'
wikisql
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, ...
what was the last time during their current hospital visit patient 55360 had the maximum hemoglobin.
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 55360 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'hemoglobin') ORDER BY labevents.valuenum DESC,...
mimic_iii
CREATE TABLE party ( party_id number, year number, party text, governor text, lieutenant_governor text, comptroller text, attorney_general text, us_senate text ) CREATE TABLE election ( election_id number, counties_represented text, district number, delegate text, pa...
For each county, find the name of the county and the number of delegates from that county.
SELECT T1.county_name, COUNT(*) FROM county AS T1 JOIN election AS T2 ON T1.county_id = T2.district GROUP BY T1.county_id
spider
CREATE TABLE table_23114705_7 ( original_air_date VARCHAR, nz_viewers__thousand_ VARCHAR )
What was the air date of the episod that had 456.58 thousand viewers?
SELECT original_air_date FROM table_23114705_7 WHERE nz_viewers__thousand_ = "456.58"
sql_create_context
CREATE TABLE table_2439 ( "Position" real, "Driver" text, "Points" real, "Winnings" text, "Series" text )
Which drivers won $40,000 in the NASCAR Winston Cup?
SELECT "Driver" FROM table_2439 WHERE "Series" = 'NASCAR Winston Cup' AND "Winnings" = '$40,000'
wikisql
CREATE TABLE race ( track_id VARCHAR ) CREATE TABLE track ( name VARCHAR, location VARCHAR, track_id VARCHAR )
Show the name and location of track with 1 race.
SELECT T2.name, T2.location FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id GROUP BY T1.track_id HAVING COUNT(*) = 1
sql_create_context
CREATE TABLE table_name_16 ( day_1 VARCHAR, day_3 VARCHAR )
What is the day 1 when the day 3 is math?
SELECT day_1 FROM table_name_16 WHERE day_3 = "math"
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
患者53311855自二零零四年八月二日开始,截止到二零一七年一月二十九日,由哪几位医务人员为其检测二氧化碳的,查查这些医务人员的工号及姓名
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb....
css
CREATE TABLE table_66599 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Event" text, "Notes" text )
What are the notes for 2005?
SELECT "Notes" FROM table_66599 WHERE "Year" = '2005'
wikisql
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
自2015.6.29日起,至2017.12.17日止,把患者93103311这段时间被开出的所有检验报告单中的标本采集部位给一一列出来
SELECT jybgb.BBCJBW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGD...
css
CREATE TABLE table_35714 ( "Province" text, "Kibaki" text, "Raila" text, "Wamalwa" text, "Ngilu" text, "Others" text, "Registered Voters" text, "Turnout %" text )
What is listed for the Province with a Wamalwa of 4,431?
SELECT "Province" FROM table_35714 WHERE "Wamalwa" = '4,431'
wikisql
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ...
Compare number of Questions per week, for 3 given tags, over a specified period.
SELECT DATEADD(week, DATEDIFF(week, 0, CreationDate), 0), COUNT(*) FROM PostTags AS pt JOIN Posts AS q ON q.Id = pt.PostId WHERE pt.TagId = 93513 AND q.CreationDate > '2016-07-10' GROUP BY DATEADD(week, DATEDIFF(week, 0, CreationDate), 0) ORDER BY DATEADD(week, DATEDIFF(week, 0, CreationDate), 0)
sede
CREATE TABLE table_name_7 ( producer_s_ VARCHAR, track VARCHAR )
Who produced track 7?
SELECT producer_s_ FROM table_name_7 WHERE track = 7
sql_create_context
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
has patient 14054 had any lab tests performed for eosinophils since 2105?
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'eosinophils') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14054) AND STRFTIME('%y', labevents.charttime) >= '2105'
mimic_iii
CREATE TABLE table_name_52 ( rider VARCHAR, time VARCHAR )
Who is the rider who had the time of 1:27.37.22?
SELECT rider FROM table_name_52 WHERE time = "1:27.37.22"
sql_create_context
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CR...
tell me the difference of arterial bp [diastolic] of patient 4401 second measured on the current icu visit compared to the first value measured on the current icu visit?
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4401) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_it...
mimic_iii
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
calculate the maximum age of widow patients who had elective hospital admission.
SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.admission_type = "ELECTIVE"
mimicsql_data
CREATE TABLE table_name_72 ( fa_cup INTEGER, name VARCHAR, total VARCHAR )
What is the average number of goals scored in the FA Cup by Whelan where he had more than 7 total goals?
SELECT AVG(fa_cup) FROM table_name_72 WHERE name = "whelan" AND total > 7
sql_create_context
CREATE TABLE table_1036189_1 ( bullet_tip_color VARCHAR, headstamp_id VARCHAR )
For the headstamp id of h2, what was the color of the bullet tip?
SELECT bullet_tip_color FROM table_1036189_1 WHERE headstamp_id = "H2"
sql_create_context