context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_25800134_9 ( title VARCHAR, airdate VARCHAR )
what is the title where the airdate is december 5, 1964?
SELECT title FROM table_25800134_9 WHERE airdate = "December 5, 1964"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugst...
what is the total amount of input that patient 002-34744 received on 05/05/last year.
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-34744')) AND intakeoutput.cellpath LIKE '%in...
eicu
CREATE TABLE customers ( customer_name VARCHAR, customer_id VARCHAR ) CREATE TABLE order_items ( order_id VARCHAR, order_quantity INTEGER ) CREATE TABLE customer_orders ( customer_id VARCHAR, order_id VARCHAR )
What is the name of the customer that made the order with the largest quantity?
SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t3.order_quantity = (SELECT MAX(order_quantity) FROM order_items)
sql_create_context
CREATE TABLE table_name_85 ( round VARCHAR, home VARCHAR )
In what round was the Alianza home game?
SELECT round FROM table_name_85 WHERE home = "alianza"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, ...
what procedure did patient 23550 receive the first time since 2103.
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT procedures_icd.icd9_code FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23550) AND STRFTIME('%y', procedures_icd.charttime) >= '2103' ORDER ...
mimic_iii
CREATE TABLE table_28428 ( "Club" text, "Wins" real, "Losses" real, "Points For" real, "Points Against" real, "Percentage" text, "Points" real )
What is the percentage listed for the team who scored 63 points?
SELECT "Percentage" FROM table_28428 WHERE "Points For" = '63'
wikisql
CREATE TABLE characteristics ( characteristic_id number, characteristic_type_code text, characteristic_data_type text, characteristic_name text, other_characteristic_details text ) CREATE TABLE ref_product_categories ( product_category_code text, product_category_description text, unit_...
Count the number of colors that are not used in any products.
SELECT COUNT(*) FROM ref_colors WHERE NOT color_code IN (SELECT color_code FROM products)
spider
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, ...
since 2105, how many patients were prescribed sodium bicarbonate 8.4% 50 ml inj within the same month after they were diagnosed with hyponatremia?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hyponatremia' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2105') AS t1 JOIN (SELECT patient.uniquepid, m...
eicu
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE...
count the number of patients who have received the immunology (cmv) microbiology test in the last year.
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT microbiologyevents.hadm_id FROM microbiologyevents WHERE microbiologyevents.spec_type_desc = 'immunology (cmv)' AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 yea...
mimic_iii
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( intakeoutputid numb...
what are the four most common medications prescribed during the same hospital visit to the patients aged 60 or above after being diagnosed with hypertension?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hypertension') ...
eicu
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
患者袁嘉丽的哪些门诊就诊记录对应的检验报告单的报告日期是在2016年7月27日之前的?列出它们的流水号
SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND ...
css
CREATE TABLE wdmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
韦宏峻患者在门诊诊断为多动性障碍的检测指标037121的结果还有他的定量及单位都是多少?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZ...
css
CREATE TABLE table_67704 ( "Years" text, "Coach" text, "Seasons" real, "Wins" real, "Losses" real, "Ties" text, "Pct." text )
Which Notre Dame coach lost 15 games?
SELECT "Coach" FROM table_67704 WHERE "Losses" = '15'
wikisql
CREATE TABLE table_name_17 ( crowd VARCHAR, venue VARCHAR )
How many people came to the game at Victoria Park?
SELECT COUNT(crowd) FROM table_name_17 WHERE venue = "victoria park"
sql_create_context
CREATE TABLE table_name_32 ( round INTEGER, team VARCHAR )
What was the earliest Round for Central Florida?
SELECT MIN(round) FROM table_name_32 WHERE team = "central florida"
sql_create_context
CREATE TABLE loan ( loan_ID varchar(3), loan_type varchar(15), cust_ID varchar(3), branch_ID varchar(3), amount int ) CREATE TABLE customer ( cust_ID varchar(3), cust_name varchar(20), acc_type char(1), acc_bal int, no_of_loans int, credit_score int, branch_ID int, s...
Display a pie chart for what are the names of the different bank branches, and what are their total loan amounts?
SELECT bname, SUM(amount) FROM bank AS T1 JOIN loan AS T2 ON T1.branch_ID = T2.branch_ID GROUP BY T1.bname
nvbench
CREATE TABLE table_54197 ( "Date" text, "Competition" text, "Venue" text, "Result" text, "Score" text )
What resulted in a score of 22-21?
SELECT "Result" FROM table_54197 WHERE "Score" = '22-21'
wikisql
CREATE TABLE table_20424 ( "Issuing network" text, "IIN ranges" text, "Active" text, "Length" text, "Validation" text )
What is the validation for iin ranges 5610, 560221-560225?
SELECT "Validation" FROM table_20424 WHERE "IIN ranges" = '5610, 560221-560225'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutpu...
has patient 006-167444 been prescribed medication until 3 years ago?
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-167444')) AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_T...
eicu
CREATE TABLE table_59229 ( "Year" real, "Competition Description" text, "Location" text, "Apparatus" text, "Rank-Final" text )
What was the rank final before 2007?
SELECT "Rank-Final" FROM table_59229 WHERE "Year" < '2007'
wikisql
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, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
病人21348966药品均价低于4552.52元在哪几次医疗记录中被开出的?列出医疗就诊编号都是多少?
SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '21348966' AND NOT gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 4552.52) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '21348966' AND NOT fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CL...
css
CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE paper ( pape...
What papers talk about Reinforcement Learning ?
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'Reinforcement Learning' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid
scholar
CREATE TABLE table_49305 ( "Season" text, "Race" real, "Podium" real, "Pole" real, "FLap" real )
When the Flap is less than 15 and the podium is larger than 11, what is the pole?
SELECT "Pole" FROM table_49305 WHERE "FLap" < '15' AND "Podium" > '11'
wikisql
CREATE TABLE table_name_97 ( opponents INTEGER, record VARCHAR, vikings_points VARCHAR )
Tell me the highest opponents for record of 7-3 and vikings points more than 7
SELECT MAX(opponents) FROM table_name_97 WHERE record = "7-3" AND vikings_points > 7
sql_create_context
CREATE TABLE table_2430014_8 ( title VARCHAR, episode_no VARCHAR )
What is the title of episode 2?
SELECT title FROM table_2430014_8 WHERE episode_no = 2
sql_create_context
CREATE TABLE table_name_59 ( mark VARCHAR, react INTEGER )
What is Mark, when React is less than 0.148?
SELECT mark FROM table_name_59 WHERE react < 0.148
sql_create_context
CREATE TABLE table_15869204_7 ( team VARCHAR, date VARCHAR )
How many teams are listed for February 18?
SELECT COUNT(team) FROM table_15869204_7 WHERE date = "February 18"
sql_create_context
CREATE TABLE table_25005 ( "Character" text, "Original Manchester Performer" text, "Original West End Performer" text, "Original Broadway Performer" text, "Original UK Tour Performer" text, "Original Non-Equity US Tour Performer" text, "Original Italian Tour Performer" text, "Original So...
What character did Moya Angela portray?
SELECT "Character" FROM table_25005 WHERE "Original Broadway Performer" = 'Moya Angela'
wikisql
CREATE TABLE table_52570 ( "Player" text, "No.(s)" text, "Height in Ft." text, "Position" text, "Years for Rockets" text, "School/Club Team/Country" text )
What is the player with the no. 14?
SELECT "Player" FROM table_52570 WHERE "No.(s)" = '14'
wikisql
CREATE TABLE table_23285849_7 ( date VARCHAR, record VARCHAR )
What was the date of the game when the record was 27-14?
SELECT date FROM table_23285849_7 WHERE record = "27-14"
sql_create_context
CREATE TABLE table_74156 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What is the score for the game with the record of 3 12?
SELECT "Score" FROM table_74156 WHERE "Record" = '3–12'
wikisql
CREATE TABLE table_2268216_1 ( year VARCHAR, team VARCHAR, manufacturer VARCHAR )
How many years was Pontiac the manufacturer for Joe Gibbs Racing?
SELECT COUNT(year) FROM table_2268216_1 WHERE team = "Joe Gibbs Racing" AND manufacturer = "Pontiac"
sql_create_context
CREATE TABLE station_company ( station_id number, company_id number, rank_of_the_year number ) CREATE TABLE gas_station ( station_id number, open_year number, location text, manager_name text, vice_manager_name text, representative_name text ) CREATE TABLE company ( company_id ...
find the location and Representative name of the gas stations owned by the companies with top 3 Asset amounts.
SELECT T3.location, T3.representative_name FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id ORDER BY T2.assets_billion DESC LIMIT 3
spider
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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...
how many patients admitted and transferred from hosp/extram are below 58 years of age?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.age < "58"
mimicsql_data
CREATE TABLE table_name_24 ( year VARCHAR, entrant VARCHAR )
What is the total number of years that Scuderia Guastalla was an entrant?
SELECT COUNT(year) FROM table_name_24 WHERE entrant = "scuderia guastalla"
sql_create_context
CREATE TABLE table_5470 ( "Rank" real, "Name" text, "Street Address" text, "Height feet / m" text, "Floors" real, "Year" real )
What is the building's name that is 617 / 188 in height and ranked less than 6?
SELECT "Name" FROM table_5470 WHERE "Rank" < '6' AND "Height feet / m" = '617 / 188'
wikisql
CREATE TABLE table_204_796 ( id number, "network name" text, "flagship" text, "programming type" text, "owner" text, "affiliates" number )
what is the number of affiliates of canal de las estrellas .
SELECT "affiliates" FROM table_204_796 WHERE "network name" = 'canal de las estrellas'
squall
CREATE TABLE table_27369069_1 ( province VARCHAR, founded VARCHAR )
which providence's soccer stadium was founded in 2005?
SELECT province FROM table_27369069_1 WHERE founded = 2005
sql_create_context
CREATE TABLE table_23267 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
Name the result for north carolina 7
SELECT "Result" FROM table_23267 WHERE "District" = 'North Carolina 7'
wikisql
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id nu...
Number of downvotes and upvotes on posts by a specific user.
SELECT p.Id AS "post_link", SUM(CASE WHEN v.VoteTypeId = 3 THEN 1 ELSE 0 END), SUM(CASE WHEN v.VoteTypeId = 2 THEN 1 ELSE 0 END) FROM Votes AS v JOIN Posts AS p ON v.PostId = p.Id WHERE (p.OwnerUserId = '##id?210401##') AND (v.VoteTypeId IN (2, 3)) GROUP BY p.Id ORDER BY p.Id
sede
CREATE TABLE table_name_34 ( date VARCHAR, loss VARCHAR )
What was the date of the game with a loss of White (4-5)?
SELECT date FROM table_name_34 WHERE loss = "white (4-5)"
sql_create_context
CREATE TABLE table_63366 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
Who were the runners-up in the tournament on May 26, 1996?
SELECT "Runner(s)-up" FROM table_63366 WHERE "Date" = 'may 26, 1996'
wikisql
CREATE TABLE table_18946749_1 ( elevation__m_ INTEGER, peak VARCHAR )
When mount kobowre is the peak what is the highest elevation in meters?
SELECT MAX(elevation__m_) FROM table_18946749_1 WHERE peak = "Mount Kobowre"
sql_create_context
CREATE TABLE table_name_64 ( school_club_team VARCHAR, player VARCHAR )
Which School/Club Team does Andrew Jones play for?
SELECT school_club_team FROM table_name_64 WHERE player = "andrew jones"
sql_create_context
CREATE TABLE table_40443 ( "Year" real, "Series" text, "Winning team" text, "Losing team" text, "Score" text, "Site" text )
Who was the winning team in 2008?
SELECT "Winning team" FROM table_40443 WHERE "Year" = '2008'
wikisql
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE allergy ( allergy...
has patient 007-2065 undergone any lab testing until 2 years ago?
SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-2065')) AND DATETIME(lab.labresulttime) <= DATETIME(CURRENT_TIME(), '-2 year')
eicu
CREATE TABLE table_2226817_6 ( no_in_series VARCHAR, original_air_date VARCHAR )
How many series numbers do the episodes originally aired on October 28, 1990?
SELECT COUNT(no_in_series) FROM table_2226817_6 WHERE original_air_date = "October 28, 1990"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, h...
how many patients were in the 362 hospital ward until 2 years ago?
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 362 AND DATETIME(patient.unitadmittime) <= DATETIME(CURRENT_TIME(), '-2 year')
eicu
CREATE TABLE table_59870 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real )
What place is Scott McCarron in?
SELECT "Place" FROM table_59870 WHERE "Player" = 'scott mccarron'
wikisql
CREATE TABLE table_58612 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Name the average rank for west germany when gold is more than 1
SELECT AVG("Rank") FROM table_58612 WHERE "Nation" = 'west germany' AND "Gold" > '1'
wikisql
CREATE TABLE Prescribes ( Physician INTEGER, Patient INTEGER, Medication INTEGER, Date DATETIME, Appointment INTEGER, Dose VARCHAR(30) ) CREATE TABLE On_Call ( Nurse INTEGER, BlockFloor INTEGER, BlockCode INTEGER, OnCallStart DATETIME, OnCallEnd DATETIME ) CREATE TABLE Bloc...
List the names of patients who have made appointments, and count them by a bar chart, and I want to rank by the Y in desc.
SELECT Name, COUNT(Name) FROM Appointment AS T1 JOIN Patient AS T2 ON T1.Patient = T2.SSN GROUP BY Name ORDER BY COUNT(Name) DESC
nvbench
CREATE TABLE table_52431 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
When the home team scored 17.13 (115), where was the venue?
SELECT "Venue" FROM table_52431 WHERE "Home team score" = '17.13 (115)'
wikisql
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
Dupes pointing to a question.
SELECT PostId AS "post_link", RelatedPostId AS "post_link", LinkTypeId FROM PostLinks WHERE RelatedPostId = '##dupeId:int##' AND LinkTypeId = 3 ORDER BY LinkTypeId
sede
CREATE TABLE table_53406 ( "School" text, "Mascot" text, "Location" text, "League" text, "Enrollment" real )
Which School's Mascot is Raiders?
SELECT "School" FROM table_53406 WHERE "Mascot" = 'raiders'
wikisql
CREATE TABLE table_51713 ( "Grand Prix" text, "Pole Position" text, "Fastest Lap" text, "Winning Driver" text, "Constructor" text, "Report" text )
Who had the pole at the French Grand Prix?
SELECT "Pole Position" FROM table_51713 WHERE "Grand Prix" = 'french grand prix'
wikisql
CREATE TABLE table_32210 ( "Player" text, "Nationality" text, "Position" text, "From" text, "School/Country" text )
Which nationality is associated with Temple?
SELECT "Nationality" FROM table_32210 WHERE "School/Country" = 'temple'
wikisql
CREATE TABLE table_79549 ( "Round" real, "Pick" real, "Player" text, "Nationality" text, "College/junior/club team" text )
Which College/junior/club team has a Round of 2?
SELECT "College/junior/club team" FROM table_79549 WHERE "Round" = '2'
wikisql
CREATE TABLE table_203_438 ( id number, "year" number, "title" text, "role" text, "notes" text )
what film did damon produce right after monster ?
SELECT "title" FROM table_203_438 WHERE id = (SELECT id FROM table_203_438 WHERE "title" = 'monster') - 1
squall
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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, ...
Specify the discharge time of patient id 87275 along with his total duration of hospital stay
SELECT demographic.days_stay, demographic.dischtime FROM demographic WHERE demographic.subject_id = "87275"
mimicsql_data
CREATE TABLE table_7335 ( "Census Year" real, "Number of Muslims '000" real, "Population of England and Wales '000" real, "Muslim (% of Total population)" real, "Registered Mosques" real, "Muslims per mosque" real )
What is the highest population of England and Wales that has less than 50 Muslims?
SELECT MAX("Population of England and Wales '000") FROM table_7335 WHERE "Number of Muslims '000" < '50'
wikisql
CREATE TABLE table_77245 ( "Position" real, "Team" text, "Rd 6" real, "Rd 7" real, "Rd 8" real, "Total" real )
What is the sum of values of Rd 7 with RD 6 less than 48 and Rd 8 less than 4 for TC Motorsport in a position greater than 1?
SELECT SUM("Rd 7") FROM table_77245 WHERE "Position" > '1' AND "Rd 6" < '48' AND "Team" = 'tc motorsport' AND "Rd 8" < '4'
wikisql
CREATE TABLE table_203_121 ( id number, "name" text, "pos." text, "caps" number, "goals" number, "club" text )
how many people have less than 3 caps ?
SELECT COUNT("name") FROM table_203_121 WHERE "caps" < 3
squall
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, ...
is the sao2 of patient 002-39753 last measured on the first icu visit less than first measured on the first icu visit?
SELECT (SELECT vitalperiodic.sao2 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-39753') AND NOT patient.unitdischargetime IS NULL ...
eicu
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeou...
what is patient 017-101426's change in weight from the last value measured on the last hospital visit compared to the first value measured on the last hospital visit?
SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-101426' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1) AND NOT patient.admissionweight IS N...
eicu
CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), CLASS_ROOM varchar(8), PROF_NUM int ) CREATE...
How many students that has a GPA lower than average? Show me a bar chart grouping by student's first name, order by the y axis in descending.
SELECT STU_FNAME, COUNT(STU_FNAME) FROM STUDENT WHERE STU_GPA < (SELECT AVG(STU_GPA) FROM STUDENT) GROUP BY STU_FNAME ORDER BY COUNT(STU_FNAME) DESC
nvbench
CREATE TABLE table_name_91 ( population_under_1_year_old_censo_2007_hab_ VARCHAR, population_censo_2007_hab_ VARCHAR )
What is the under 1 year-old Censo 2007(hab) population with a population censo 2007(hab) of 112.054*?
SELECT population_under_1_year_old_censo_2007_hab_ FROM table_name_91 WHERE population_censo_2007_hab_ = "112.054*"
sql_create_context
CREATE TABLE table_23465011_5 ( average VARCHAR, couple VARCHAR )
What is the average for the couple anh & luda?
SELECT average FROM table_23465011_5 WHERE couple = "Anh & Luda"
sql_create_context
CREATE TABLE table_name_15 ( matches VARCHAR, prize_money VARCHAR )
How many matches were there in the round with 1,000,000 in prize money?
SELECT COUNT(matches) FROM table_name_15 WHERE prize_money = "£1,000,000"
sql_create_context
CREATE TABLE table_14654 ( "City" text, "Province/Region" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text )
Which airport has an IATA of hgh?
SELECT "Airport" FROM table_14654 WHERE "IATA" = 'hgh'
wikisql
CREATE TABLE table_name_69 ( venue VARCHAR, away_team VARCHAR )
Where did Essendon play as the away team?
SELECT venue FROM table_name_69 WHERE away_team = "essendon"
sql_create_context
CREATE TABLE table_name_40 ( year INTEGER, length VARCHAR )
In what Year is the length of the Song 7:42?
SELECT AVG(year) FROM table_name_40 WHERE length = "7:42"
sql_create_context
CREATE TABLE wine ( no number, grape text, winery text, appelation text, state text, name text, year number, price number, score number, cases number, drink text ) CREATE TABLE grapes ( id number, grape text, color text ) CREATE TABLE appellations ( no numbe...
What is the area for the appelation which produced the most wines prior to 2010?
SELECT T1.area FROM appellations AS T1 JOIN wine AS T2 ON T1.appelation = T2.appelation GROUP BY T2.appelation HAVING T2.year < 2010 ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_name_27 ( wins INTEGER, losses VARCHAR, league VARCHAR, finish VARCHAR )
What is the highest wins for the NFL with a finish of 1st, and more than 6 losses?
SELECT MAX(wins) FROM table_name_27 WHERE league = "nfl" AND finish = "1st" AND losses > 6
sql_create_context
CREATE TABLE table_49061 ( "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Points" real )
What are the greatest points for a time/retired of +32.256 secs, and a a grid larger than 12?
SELECT MAX("Points") FROM table_49061 WHERE "Time/Retired" = '+32.256 secs' AND "Grid" > '12'
wikisql
CREATE TABLE procedures ( 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 demographic ...
list the number of patients whose hospital stay is more than 9 days and drug route is iv drip.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "9" AND prescriptions.route = "IV DRIP"
mimicsql_data
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_fl...
is there ground transportation available at the PHOENIX airport
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'PHOENIX' AND ground_service.city_code = city.city_code
atis
CREATE TABLE zzmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
6929712医疗机构在二零一四年三月十七日到二零一四年十月十四日期间一共多少特需门诊的就诊记录
SELECT COUNT(*) FROM zzmzjzjlb WHERE zzmzjzjlb.YLJGDM = '6929712' AND zzmzjzjlb.JZKSRQ BETWEEN '2014-03-17' AND '2014-10-14' AND zzmzjzjlb.TXBZ > 0 UNION SELECT COUNT(*) FROM fzzmzjzjlb WHERE fzzmzjzjlb.YLJGDM = '6929712' AND fzzmzjzjlb.JZKSRQ BETWEEN '2014-03-17' AND '2014-10-14' AND fzzmzjzjlb.TXBZ > 0
css
CREATE TABLE table_name_83 ( runner_s__up VARCHAR, date VARCHAR )
On the Date of 4 Oct 2009, who was the Runner(s)-up?
SELECT runner_s__up FROM table_name_83 WHERE date = "4 oct 2009"
sql_create_context
CREATE TABLE ref_address_types ( address_type_code text, address_type_description text ) CREATE TABLE ref_detention_type ( detention_type_code text, detention_type_description text ) CREATE TABLE behavior_incident ( incident_id number, incident_type_code text, student_id number, date_i...
Find the id and last name of the student that has the most behavior incidents?
SELECT T1.student_id, T2.last_name FROM behavior_incident AS T1 JOIN students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE gwyjzb ( 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, ...
计算一下医院2261260全部就诊记录中患者平均年纪,按科室与患者出院诊断病名的区别看看其中平均年纪比9岁大的记录
SELECT gwyjzb.MED_ORG_DEPT_NM, gwyjzb.OUT_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '2261260' GROUP BY gwyjzb.MED_ORG_DEPT_NM, gwyjzb.OUT_DIAG_DIS_NM HAVING AVG(gwyjzb.PERSON_AGE) > 9 UNION SELECT fgwyjzb.MED_ORG_DEPT_NM, fgwyjzb.OUT_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb ...
css
CREATE TABLE table_1888051_1 ( capital VARCHAR, area__km²_ VARCHAR )
How many capitals are there when area (km ) is 1111.14?
SELECT COUNT(capital) FROM table_1888051_1 WHERE area__km²_ = "1111.14"
sql_create_context
CREATE TABLE table_12962773_15 ( current_club VARCHAR, year_born VARCHAR )
Which club had a player born in 1983?
SELECT current_club FROM table_12962773_15 WHERE year_born = 1983
sql_create_context
CREATE TABLE table_12007 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
In which venue did the away team score 23.15 (153)?
SELECT "Venue" FROM table_12007 WHERE "Away team score" = '23.15 (153)'
wikisql
CREATE TABLE table_38131 ( "Date" text, "City" text, "Opponent" text, "Results\u00b9" text, "Type of game" text )
On what Date were the Results 5:1?
SELECT "Date" FROM table_38131 WHERE "Results\u00b9" = '5:1'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
查查这位钱康复的患者身高和体重指标
SELECT zzmzjzjlb.SG, zzmzjzjlb.TZ FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '钱康复' UNION SELECT fzzmzjzjlb.SG, fzzmzjzjlb.TZ FROM person_info JOIN hz_info JOIN ...
css
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
Show me courses that are 7 credits of Advanced Organizational Psychology .
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Advanced Organizational Psychology%' OR name LIKE '%Advanced Organizational Psychology%') AND credits = 7
advising
CREATE TABLE table_29063233_1 ( original_air_date VARCHAR, uk_viewers__million_ VARCHAR )
What was the airdate of the episode with a UK viewership of 6.02 million?
SELECT original_air_date FROM table_29063233_1 WHERE uk_viewers__million_ = "6.02"
sql_create_context
CREATE TABLE table_66745 ( "Supplier" text, "Basic shape" text, "Keys (x modes)" text, "Wrist pad" text, "Thumb stick" text, "Backlit" text )
Which keys (x modes) have a Supplier of wolfking?
SELECT "Keys (x modes)" FROM table_66745 WHERE "Supplier" = 'wolfking'
wikisql
CREATE TABLE table_15379 ( "Category" text, "Film" text, "Director(s)" text, "Country" text, "Nominating Festival" text )
Which country made Le Portefeuille?
SELECT "Country" FROM table_15379 WHERE "Film" = 'le portefeuille'
wikisql
CREATE TABLE table_name_40 ( school_club_team VARCHAR, player VARCHAR )
What school/club team did Amal McCaskill play for?
SELECT school_club_team FROM table_name_40 WHERE player = "amal mccaskill"
sql_create_context
CREATE TABLE table_68533 ( "Venue" text, "City" text, "Tickets Sold / Available" text, "Gross Revenue (1979)" text, "Gross Revenue (2012)" text )
Which Venue has a Gross Revenue (2012) of $179,712?
SELECT "Venue" FROM table_68533 WHERE "Gross Revenue (2012)" = '$179,712'
wikisql
CREATE TABLE table_name_25 ( event VARCHAR, athlete VARCHAR )
What event was Fatima Whitbread Trine Hattestad in?
SELECT event FROM table_name_25 WHERE athlete = "fatima whitbread trine hattestad"
sql_create_context
CREATE TABLE table_40729 ( "Station" text, "Local authority [a ]" text, "Servedby" text, "Station users 2004\u201305" real, "Station users 2005\u201306" real )
Which Station users 2005 06 has a Station users 2004 05 of 2,117,300?
SELECT MIN("Station users 2005\u201306") FROM table_40729 WHERE "Station users 2004\u201305" = '2,117,300'
wikisql
CREATE TABLE table_23248940_8 ( high_rebounds VARCHAR, team VARCHAR )
Who tied for the highest rebounds during the game against Orlando?
SELECT high_rebounds FROM table_23248940_8 WHERE team = "Orlando"
sql_create_context
CREATE TABLE table_name_95 ( billboard_peak VARCHAR, label VARCHAR, date_of_release VARCHAR )
What was the Billboard peak for the album released on February 2, 1976 by MCA?
SELECT billboard_peak FROM table_name_95 WHERE label = "mca" AND date_of_release = "february 2, 1976"
sql_create_context
CREATE TABLE table_204_436 ( id number, "date" text, "time" text, "opponent" text, "site" text, "tv" text, "result" text, "attendance" number, "record" text )
which contest was held in the same site as the game versus western carolina ?
SELECT "opponent" FROM table_204_436 WHERE "opponent" <> 'western carolina' AND "site" = (SELECT "site" FROM table_204_436 WHERE "opponent" = 'western carolina')
squall
CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Movie ( mID int, title text, year int, director text )
For each director, return the director's name together with the highest rating among all of their movies and ignore movies whose director is NULL. Could you plot the result with a pie chart?
SELECT director, MAX(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE director <> "null" GROUP BY director
nvbench
CREATE TABLE table_49808 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
Which country has a total less than 289 and finished t2?
SELECT "Country" FROM table_49808 WHERE "Total" < '289' AND "Finish" = 't2'
wikisql
CREATE TABLE table_name_92 ( texas VARCHAR, north_dakota VARCHAR )
What Texas has Johnson from Nort Dakota?
SELECT texas FROM table_name_92 WHERE north_dakota = "johnson"
sql_create_context
CREATE TABLE savings ( custid number, balance number ) CREATE TABLE checking ( custid number, balance number ) CREATE TABLE accounts ( custid number, name text )
Find the name of accounts whose checking balance is higher than corresponding saving balance.
SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T2.balance > T3.balance
spider