context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_57903 ( "Entrant" text, "Constructor" text, "Chassis" text, "Engine" text, "Tyre" text, "Driver" text, "Rounds" text )
Which chassis had an entrant of John Mecom?
SELECT "Chassis" FROM table_57903 WHERE "Entrant" = 'john mecom'
wikisql
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...
what is the number of patients whose discharge location is home health care and procedure icd9 code is 3892?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "HOME HEALTH CARE" AND procedures.icd9_code = "3892"
mimicsql_data
CREATE TABLE table_61131 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is Country, when Player is 'Tom Watson'?
SELECT "Country" FROM table_61131 WHERE "Player" = 'tom watson'
wikisql
CREATE TABLE table_6121 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What was his result against dan bobish?
SELECT "Res." FROM table_6121 WHERE "Opponent" = 'dan bobish'
wikisql
CREATE TABLE table_63228 ( "Player" text, "Country" text, "Year won" real, "Total" real, "To par" text, "Finish" text )
Which year won has a Finish of t24, and a Country of england?
SELECT AVG("Year won") FROM table_63228 WHERE "Finish" = 't24' AND "Country" = 'england'
wikisql
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE prescriptions ( row_id number, subject_id number, h...
for the first time, what procedure did until 2103 patient 78221 receive?
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 = 78221) AND STRFTIME('%y', procedures_icd.charttime) <= '2103' ORDER ...
mimic_iii
CREATE TABLE table_204_882 ( id number, "number" number, "builder" text, "entered service" text, "withdrawn" text, "notes" text )
how many locomotives were still in service after the year 1950 ?
SELECT COUNT(*) FROM table_204_882 WHERE "entered service" <= 1950 AND "withdrawn" >= 1950
squall
CREATE TABLE table_7542 ( "Date" text, "Opponent" text, "Location" text, "Result" text, "Attendance" real )
What was the total attendance on 10/05/1974?
SELECT COUNT("Attendance") FROM table_7542 WHERE "Date" = '10/05/1974'
wikisql
CREATE TABLE table_name_28 ( visiting_team VARCHAR, date VARCHAR )
Who was the visiting team on November 10?
SELECT visiting_team FROM table_name_28 WHERE date = "november 10"
sql_create_context
CREATE TABLE table_name_30 ( total VARCHAR, player VARCHAR, country VARCHAR, to_par VARCHAR )
When the tom watson is playing for the United States and the To par is under 14, what's the total?
SELECT total FROM table_name_30 WHERE country = "united states" AND to_par < 14 AND player = "tom watson"
sql_create_context
CREATE TABLE table_1968 ( "Year" real, "Formula" text, "Driver" text, "Constructor" text, "Location" text, "Report" text )
Who is the constructor for the car driven by George Heath?
SELECT "Constructor" FROM table_1968 WHERE "Driver" = 'George Heath'
wikisql
CREATE TABLE zyb ( CLINIC_ID 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, INSU_TYPE text, IN...
在编码为3120762的医院里根据不同的科室编码和入院诊断疾病编码把所有医疗就诊记录中患者的平均年龄计算出来?
SELECT qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_CD, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '3120762' GROUP BY qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_CD UNION SELECT gyb.MED_ORG_DEPT_CD, gyb.IN_DIAG_DIS_CD, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '3120762' GROUP BY gyb.MED_ORG_DEPT_CD, gyb.IN_...
css
CREATE TABLE table_name_24 ( date VARCHAR, fastest_lap VARCHAR, round VARCHAR )
On what date does Yuji Tachikawa have the fastest lap in round 1?
SELECT date FROM table_name_24 WHERE fastest_lap = "yuji tachikawa" AND round = 1
sql_create_context
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 prescriptions ( subject_id text, hadm_id...
give me the number of patients whose drug code is bupr75?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "BUPR75"
mimicsql_data
CREATE TABLE table_80144 ( "Year" real, "Number" real, "Team" text, "Co-driver" text, "Position" text, "Laps" real )
Who was the co-driver for the team with more than 160 laps and the number 6 after 2010?
SELECT "Co-driver" FROM table_80144 WHERE "Laps" > '160' AND "Year" > '2010' AND "Number" = '6'
wikisql
CREATE TABLE table_name_21 ( stage VARCHAR, winner VARCHAR )
Which Stage has a Winner of jeremy hunt?
SELECT stage FROM table_name_21 WHERE winner = "jeremy hunt"
sql_create_context
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
项目6599-i在医疗机构0036548的检查记录有多少?
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '0036548' AND t_kc22.SOC_SRT_DIRE_CD = '6599-i'
css
CREATE TABLE hz_info_mzjzjlb ( JZLSH number, YLJGDM number, mzjzjlb_id number ) 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, BGR...
就诊的病患33852265号其检验报告单上对应的检查结果指标均不正常的单号是多少?
SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info...
css
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, ...
住院诊断中开支的编号为20186568174检测报告单对应的患者名号叫什么?
SELECT hz_info.person_info_XM FROM hz_info JOIN zyjzjlb JOIN jybgb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND zyjzjlb.YLJGDM = jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZJLB WHERE jybgb.BGDH = '20186568174'
css
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, ...
Most popular tags for october 2015.
SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS MayRank, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS QuestionsInMay, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AN...
sede
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) 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_gradu...
Regarding upper level electives for next Winter after 12:00 A.M. , which ones will be available ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.start_time > '12:00' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester...
advising
CREATE TABLE table_name_4 ( publisher VARCHAR, title VARCHAR )
Which publisher has Far Cry as the title?
SELECT publisher FROM table_name_4 WHERE title = "far cry"
sql_create_context
CREATE TABLE table_name_59 ( round VARCHAR, prize_money VARCHAR )
What is the Round with a Prize of money that is 120,000?
SELECT round FROM table_name_59 WHERE prize_money = "£120,000"
sql_create_context
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, ...
列出患者37982575门诊诊断名称包含龈炎的在医院3085666中有什么门诊就诊记录?
SELECT * FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '37982575' AND hz_info.YLJGDM = '3085666' AND mzjzjlb.JZZDSM LIKE '%龈炎%'
css
CREATE TABLE table_name_42 ( year VARCHAR, driver VARCHAR )
When did Hans Hartmann drive?
SELECT COUNT(year) FROM table_name_42 WHERE driver = "hans hartmann"
sql_create_context
CREATE TABLE table_75953 ( "Tournament" text, "2006" text, "2009" text, "2012" text, "2013" text )
What shows for 2006, when 2013 is 2 4?
SELECT "2006" FROM table_75953 WHERE "2013" = '2–4'
wikisql
CREATE TABLE mountain ( mountain_id number, name text, height number, prominence number, range text, country text ) CREATE TABLE climber ( climber_id number, name text, country text, time text, points number, mountain_id number )
Which range contains the most mountains?
SELECT range FROM mountain GROUP BY range ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_25037 ( "Year" text, "Network" text, "Play-by-play" text, "Color commentator(s)" text, "Ice level reporters" text, "Studio host" text, "Studio analysts" text )
Who is the studio host for the year 2010?
SELECT "Studio host" FROM table_25037 WHERE "Year" = '2010'
wikisql
CREATE TABLE table_22756549_1 ( party VARCHAR, runner_up_a VARCHAR )
What party was the winner when A. Krishnaswamy was the runner-up?
SELECT party FROM table_22756549_1 WHERE runner_up_a = "A. Krishnaswamy"
sql_create_context
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit te...
how many patients were prescribed the drug sanctura xr?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'sanctura xr')
mimic_iii
CREATE TABLE table_28652521_1 ( for_shank_type VARCHAR, storage_case VARCHAR )
What's the shank type of the buttonholer with red plastic box as storage case?
SELECT for_shank_type FROM table_28652521_1 WHERE storage_case = "red plastic box"
sql_create_context
CREATE TABLE table_68173 ( "Year" real, "Fighter" text, "Nation represented" text, "Sport" text, "Sanctioning body or league" text, "Weight class represented or contested" text )
What is the latest result where a person from the Philippines won?
SELECT MAX("Year") FROM table_68173 WHERE "Nation represented" = 'philippines'
wikisql
CREATE TABLE table_32047 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Event" text )
Where did the Paris Marathon occur?
SELECT "Venue" FROM table_32047 WHERE "Competition" = 'paris marathon'
wikisql
CREATE TABLE table_name_83 ( round INTEGER, overall VARCHAR )
What round did the overall pick of 91 occur in the 1982 NFL draft?
SELECT MIN(round) FROM table_name_83 WHERE overall = 91
sql_create_context
CREATE TABLE table_203_182 ( id number, "no. in\nseries" number, "no. in\nseason" number, "title" text, "directed by" text, "written by" text, "original air date" text, "production\ncode" number )
which episode is listed at the top of the list ?
SELECT "title" FROM table_203_182 ORDER BY id LIMIT 1
squall
CREATE TABLE table_5876 ( "Rank" text, "Quarterback" text, "Streak start" text, "Streak end" text, "Teams" text, "Regular season" real, "Playoffs" real, "Total" real )
What is the highest playoffs that has tampa bay as the team?
SELECT MAX("Playoffs") FROM table_5876 WHERE "Teams" = 'tampa bay'
wikisql
CREATE TABLE table_44845 ( "Tournament" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text )
What is Tournament, when 2006 is 'A', and when 2009 is 'A'?
SELECT "Tournament" FROM table_44845 WHERE "2006" = 'a' AND "2009" = 'a'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE patients ( row_id number, subject_id num...
calculate the number of patients who received a surg tooth extract nec since 2105.
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'surg tooth extract nec') AND STRFTIME('%y', procedur...
mimic_iii
CREATE TABLE table_17186 ( "Unit" text, "Commander" text, "Complement" text, "Killed" text, "Wounded" text, "Missing" text )
Who were the commanders when 8 off 0 men were wounded?
SELECT "Commander" FROM table_17186 WHERE "Wounded" = '8 off 0 men'
wikisql
CREATE TABLE table_313 ( "Player" text, "Position" text, "School" text, "Hometown" text, "College" text )
Which player is from Joliet Catholic HIgh School?
SELECT "Player" FROM table_313 WHERE "School" = 'Joliet Catholic High School'
wikisql
CREATE TABLE table_name_7 ( party VARCHAR, results VARCHAR, first_elected VARCHAR )
What is the party for the representative who was first elected before 2002 and the results were re-elected?
SELECT party FROM table_name_7 WHERE results = "re-elected" AND first_elected < 2002
sql_create_context
CREATE TABLE table_34693 ( "Date" real, "Name" text, "Developer" text, "Clock" text, "Process" text, "Cores per die / Dies per module" text )
Which date has a Clock of 0.8-1.6ghz?
SELECT "Date" FROM table_34693 WHERE "Clock" = '0.8-1.6ghz'
wikisql
CREATE TABLE table_52675 ( "Name" text, "Title" text, "Start term" real, "End term" real, "House" text )
Which Title has an 1825 end term?
SELECT "Title" FROM table_52675 WHERE "End term" = '1825'
wikisql
CREATE TABLE table_72627 ( "Year" real, "Mens singles" text, "Womens singles" text, "Mens doubles" text, "Womens doubles" text, "Mixed doubles" text )
In the year 2006, the womens singles had no competition and the mens doubles were roland hilti kilian pfister, what were the womens doubles
SELECT "Womens doubles" FROM table_72627 WHERE "Womens singles" = 'no competition' AND "Mens doubles" = 'Roland Hilti Kilian Pfister' AND "Year" = '2006'
wikisql
CREATE TABLE table_name_80 ( other_mozilla VARCHAR, period VARCHAR )
What other mozilla has January 2010 as the period?
SELECT other_mozilla FROM table_name_80 WHERE period = "january 2010"
sql_create_context
CREATE TABLE class ( class_code text, crs_code text, class_section text, class_time text, class_room text, prof_num number ) CREATE TABLE student ( stu_num number, stu_lname text, stu_fname text, stu_init text, stu_dob time, stu_hrs number, stu_class text, stu_gp...
What is the code of the school where the accounting department belongs to?
SELECT school_code FROM department WHERE dept_name = "Accounting"
spider
CREATE TABLE Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) CREATE TABLE Claims ( Claim_ID INTEGER, Policy_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER ) CREATE TABLE Customer_Policies ( Policy_ID INTEGE...
Bar chart x axis date claim settled y axis the number of date claim settled, rank from high to low by the Y-axis.
SELECT Date_Claim_Settled, COUNT(Date_Claim_Settled) FROM Settlements ORDER BY COUNT(Date_Claim_Settled) DESC
nvbench
CREATE TABLE table_12074 ( "Show" text, "Theme" text, "Song" text, "Original artist" text, "Order" text, "Result" text )
For the week 1 show and order 2, what was the theme?
SELECT "Theme" FROM table_12074 WHERE "Show" = 'week 1' AND "Order" = '2'
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
provide the number of patients whose admission type is emergency and days of hospital stay is greater than 2?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.days_stay > "2"
mimicsql_data
CREATE TABLE table_27239 ( "No." real, "#" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text )
What episode number was written by Gregg Hurwitz?
SELECT "No." FROM table_27239 WHERE "Written by" = 'Gregg Hurwitz'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
How many inpatient hospital admitted patients had potassium whole blood lab test?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND lab.label = "Potassium, Whole Blood"
mimicsql_data
CREATE TABLE endowment ( endowment_id int, School_id int, donator_name text, amount real ) CREATE TABLE budget ( School_id int, Year int, Budgeted int, total_budget_percent_budgeted real, Invested int, total_budget_percent_invested real, Budget_invested_percent text ) CREAT...
Show each county along with the number of schools, and display Y in desc order.
SELECT County, COUNT(*) FROM School GROUP BY County ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_15118 ( "Year" real, "Division I" text, "Division II" text, "Division III" text, "Division IV" text, "Division V" text )
With a Division II of Portsmouth, what is the Division IV?
SELECT "Division IV" FROM table_15118 WHERE "Division III" = 'portsmouth'
wikisql
CREATE TABLE table_40556 ( "Season" text, "Winner" text, "Score" text, "Runner-up" text, "Losing Semifinalists" text )
What was the Score during the Season in which the Winner was C.F. Atlante?
SELECT "Score" FROM table_40556 WHERE "Winner" = 'c.f. atlante'
wikisql
CREATE TABLE table_name_20 ( white VARCHAR, opening VARCHAR, moves VARCHAR, black VARCHAR, result VARCHAR )
What's the white for a black of Anand, a result of , 39 moves, and an opening of d37 queen's gambit declined?
SELECT white FROM table_name_20 WHERE black = "anand" AND result = "½–½" AND moves = 39 AND opening = "d37 queen's gambit declined"
sql_create_context
CREATE TABLE table_17482534_1 ( written_by VARCHAR, production_code VARCHAR )
How many writers are listed for the episode with a production code of 5008?
SELECT COUNT(written_by) FROM table_17482534_1 WHERE production_code = "5008"
sql_create_context
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, ...
95072739患者开出的药品在哪几次医疗记录中被均高于8153.6元?列出医疗就诊编号都是什么?
SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '95072739' AND NOT gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 8153.6) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '95072739' AND NOT fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLI...
css
CREATE TABLE table_name_84 ( team VARCHAR, laps VARCHAR, year VARCHAR )
Name the team with laps more than 333 and year less than 2004
SELECT team FROM table_name_84 WHERE laps > 333 AND year < 2004
sql_create_context
CREATE TABLE table_30970 ( "Episode" text, "First broadcast" text, "Andrew and Jacks guest" text, "Jamies guests Peter Crouch replaced Jamie Redknapp as team captain for one week in series 5, episode 2." text, "Scores" text )
When were episodes first broadcast with jessica ennis as andrew and jacks guest?
SELECT "First broadcast" FROM table_30970 WHERE "Andrew and Jacks guest" = 'Jessica Ennis'
wikisql
CREATE TABLE table_72054 ( "Representative" text, "Years" text, "State" text, "Party" text, "Lifespan" text )
Which party did Thomas L. Young belong to?
SELECT "Party" FROM table_72054 WHERE "Representative" = 'thomas l. young'
wikisql
CREATE TABLE table_11004 ( "Player" text, "Att." real, "Yards" real, "Avg." real, "Fumbles" real )
What is the most fumbles for more than 44 yards and att of 32?
SELECT MAX("Fumbles") FROM table_11004 WHERE "Yards" > '44' AND "Att." = '32'
wikisql
CREATE TABLE table_26375386_22 ( public VARCHAR, couple VARCHAR )
Name the public for mikey and melanie
SELECT public FROM table_26375386_22 WHERE couple = "Mikey and Melanie"
sql_create_context
CREATE TABLE table_name_16 ( races INTEGER, team_name VARCHAR, points VARCHAR )
Can you tell me the lowest Races that has the Team Name of piquet gp, and the Points larger than 24?
SELECT MIN(races) FROM table_name_16 WHERE team_name = "piquet gp" AND points > 24
sql_create_context
CREATE TABLE table_name_73 ( points VARCHAR, position VARCHAR, wins VARCHAR, club VARCHAR )
WHAT ARE THE TOTAL NUMBER OF POINTS WITH WINS SMALLER THAN 14, AT SD INDAUCHU, POSITION BIGGER THAN 12?
SELECT COUNT(points) FROM table_name_73 WHERE wins < 14 AND club = "sd indauchu" AND position > 12
sql_create_context
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 patient ( uniquep...
did patient 005-4044 get any kind of surgery until 2101?
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-4044')) AND STRFTIME('%y', treatment.treatmenttime) <= '2101'
eicu
CREATE TABLE table_203_117 ( id number, "region/country" text, "1882-\n1918" number, "1919-\n1948" number, "1948-\n1951" number, "1952-\n1960" number, "1961-\n1971" number, "1972-\n1979" number, "1980-\n1989" number, "1990-\n2001" number, "2002-\n2010" number, "2011-\n201...
how many immigrants came from cuba in the period 1972-1979 ?
SELECT "1972-\n1979" FROM table_203_117 WHERE "region/country" = 'cuba'
squall
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
Bar chart of total number of height from each sex, rank by the y axis in asc.
SELECT Sex, SUM(Height) FROM people GROUP BY Sex ORDER BY SUM(Height)
nvbench
CREATE TABLE table_2668243_8 ( first_elected VARCHAR, incumbent VARCHAR )
How many first elected years are provided for Thomas P. Moore?
SELECT COUNT(first_elected) FROM table_2668243_8 WHERE incumbent = "Thomas P. Moore"
sql_create_context
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufac...
what flights are available saturday to SAN FRANCISCO from DALLAS
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 = 'SAN FRANCISCO' AND date_day.day_number = 26 AND date_day.month_number = 7...
atis
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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,...
患者29261183在2011年5月8日至18年3月30日内被开出的所有检验报告单的科室编码还有名称能列出都是什么吗?
SELECT jybgb.KSBM, jybgb.KSMC 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...
css
CREATE TABLE table_name_92 ( wins INTEGER, loses VARCHAR, draws VARCHAR )
What average Wins has Losses 2, and Draws less than 0?
SELECT AVG(wins) FROM table_name_92 WHERE loses = 2 AND draws < 0
sql_create_context
CREATE TABLE table_23308178_9 ( score VARCHAR, date VARCHAR )
How many scores had a date of March 6?
SELECT COUNT(score) FROM table_23308178_9 WHERE date = "March 6"
sql_create_context
CREATE TABLE table_11926114_1 ( chinese_title VARCHAR, english_title VARCHAR )
what is the Chinese name for Forensic heroes ii?
SELECT chinese_title FROM table_11926114_1 WHERE english_title = "Forensic Heroes II"
sql_create_context
CREATE TABLE table_74593 ( "Year" real, "Race name" text, "Rider status" text, "Winner" text, "Team/Country" text )
What is the rider status for the 1971 netherlands team?
SELECT "Rider status" FROM table_74593 WHERE "Team/Country" = 'netherlands' AND "Year" = '1971'
wikisql
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Draw a pie chart about the proportion of All_Road and ACC_Percent.
SELECT All_Road, ACC_Percent FROM basketball_match
nvbench
CREATE TABLE table_name_13 ( score VARCHAR, runner_up VARCHAR, champion VARCHAR, venue VARCHAR )
What was the score when Nacional was the champion, River Plate was the runner-up, and the venue was Centenario?
SELECT score FROM table_name_13 WHERE champion = "nacional" AND venue = "centenario" AND runner_up = "river plate"
sql_create_context
CREATE TABLE table_21205 ( "Episode number Production number" text, "Title" text, "Sydney" real, "Melbourne" real, "Brisbane" real, "Adelaide" real, "Perth" real, "TOTAL" real, "WEEKLY RANK" text, "NIGHTLY RANK" text )
what is the nightly rank where the episode number production number is 06 1-06?
SELECT COUNT("NIGHTLY RANK") FROM table_21205 WHERE "Episode number Production number" = '06 1-06'
wikisql
CREATE TABLE Companies ( id int, name text, Headquarters text, Industry text, Sales_billion real, Profits_billion real, Assets_billion real, Market_Value_billion text ) CREATE TABLE buildings ( id int, name text, City text, Height int, Stories int, Status text ) ...
Return a bar chart showing the number of each company whose office is located in the building, show y axis in asc order.
SELECT T3.name, COUNT(T3.name) FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T3.name ORDER BY COUNT(T3.name)
nvbench
CREATE TABLE table_name_67 ( year VARCHAR, points INTEGER )
Which year had more than 0 points?
SELECT COUNT(year) FROM table_name_67 WHERE points > 0
sql_create_context
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), ...
Find the last name and age of the student who has allergy to both milk and cat Show a bar chart, sort from low to high by the LName.
SELECT LName, Age FROM Student WHERE StuID IN (SELECT StuID FROM Has_Allergy WHERE Allergy = "Milk" INTERSECT SELECT StuID FROM Has_Allergy WHERE Allergy = "Cat") ORDER BY LName
nvbench
CREATE TABLE table_48749 ( "Rank" real, "Team" text, "Played" real, "Wins" real, "Ties" real, "Losses" real, "Points" real )
What is the sum of Wins, when Played is less than 5?
SELECT SUM("Wins") FROM table_48749 WHERE "Played" < '5'
wikisql
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_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE procedures_icd ( ...
when was patient 15135 diagnosed with undeterm pois-psychotrop for the first time?
SELECT diagnoses_icd.charttime FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'undeterm pois-psychotrop') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15135) ORDER BY d...
mimic_iii
CREATE TABLE table_2279413_1 ( conversion_from_patent_application VARCHAR, maximum_term VARCHAR, pct_route_available VARCHAR )
When the PCT route available is yes and the maximum term is 10 years, what are the available conversions from patent applications?
SELECT conversion_from_patent_application FROM table_2279413_1 WHERE maximum_term = "10 years" AND pct_route_available = "Yes"
sql_create_context
CREATE TABLE table_name_30 ( airdate VARCHAR, adapted_by VARCHAR, title VARCHAR )
What is the Airdate for the episode titled thirteen to centaurus Adapted by stanley miller?
SELECT airdate FROM table_name_30 WHERE adapted_by = "stanley miller" AND title = "“thirteen to centaurus”"
sql_create_context
CREATE TABLE table_name_53 ( team_1 VARCHAR )
When Team 1 is Aalborg BK, what is the 1st Leg?
SELECT 1 AS st_leg FROM table_name_53 WHERE team_1 = "aalborg bk"
sql_create_context
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId n...
How Popular is my name?. Inspired by MSO/q/111104/, I threw this together for the fun of it. Displays the most popular usernames and the number of users with that name. A name must have over 50 users to be counted.
SELECT DisplayName AS Name, COUNT(DisplayName) AS "Number of Users With This Name" FROM Users GROUP BY DisplayName HAVING DisplayName = 'Matthias Klupsch' ORDER BY COUNT(DisplayName) DESC
sede
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 diagnoses ( ...
provide the number of office admission patients who are diagnosed with unspecified obesity.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND diagnoses.short_title = "Obesity NOS"
mimicsql_data
CREATE TABLE table_41136 ( "S No" real, "Team (A)" text, "Team (B)" text, "Winner" text, "Margin" text, "Match Date" text )
What is Team (B), when S No is greater than 17?
SELECT "Team (B)" FROM table_41136 WHERE "S No" > '17'
wikisql
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, ...
在02年9月13日到16年10月12日期间,患者97726285看得最多的病有那些?
SELECT gwyjzb.IN_DIAG_DIS_CD, gwyjzb.IN_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_ID = '97726285' AND gwyjzb.IN_HOSP_DATE BETWEEN '2002-09-13' AND '2016-10-12' GROUP BY gwyjzb.IN_DIAG_DIS_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, fgwyjzb.IN_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_ID...
css
CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), EMP_HIREDATE datetime, EMP_DOB datetime ) CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NU...
Count different addresses of each school Show bar chart, sort from high to low by the Y-axis.
SELECT SCHOOL_CODE, COUNT(DISTINCT DEPT_ADDRESS) FROM DEPARTMENT ORDER BY COUNT(DISTINCT DEPT_ADDRESS) DESC
nvbench
CREATE TABLE table_12737 ( "Year" real, "Competition Description" text, "Location" text, "Apparatus" text, "Rank-Final" real )
What is Year, when Competition Description is 'U.S. Championships', when Rank-Final is less than 3, and when Apparatus is 'All-Around'?
SELECT "Year" FROM table_12737 WHERE "Competition Description" = 'u.s. championships' AND "Rank-Final" < '3' AND "Apparatus" = 'all-around'
wikisql
CREATE TABLE table_name_39 ( song VARCHAR, draw VARCHAR, place VARCHAR, points VARCHAR )
Which song has a place greater than 7, more than 13 points, and draw of 5?
SELECT song FROM table_name_39 WHERE place > 7 AND points > 13 AND draw = 5
sql_create_context
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE Badges ( Id number, UserId number, Name text, ...
Question answered after >30 days.
SELECT COUNT(*) FROM Posts AS questions LEFT JOIN Posts AS answers ON questions.AcceptedAnswerId = answers.Id WHERE questions.PostTypeId = 1 AND DATEDIFF(day, questions.CreationDate, creationdate) > 30
sede
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, ...
what is the total amount of output amt-chest tube a output that in a day before patient 005-48105 has had?
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 = '005-48105')) AND intakeoutput.celllabel = 'outpu...
eicu
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
provide the number of patients whose age is less than 43 and drug code is hepbase?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "43" AND prescriptions.formulary_drug_cd = "HEPBASE"
mimicsql_data
CREATE TABLE table_78120 ( "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text )
what is at 10:00 when at 8:30 it is scrubs?
SELECT "10:00" FROM table_78120 WHERE "8:30" = 'scrubs'
wikisql
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, g...
Is BIOLCHEM 673 a difficult class ?
SELECT COUNT(*) > 0, program_course.workload FROM course, program_course WHERE course.department = 'BIOLCHEM' AND course.number = 673 AND program_course.course_id = course.course_id AND program_course.workload > 3
advising
CREATE TABLE table_name_46 ( result VARCHAR, location VARCHAR, opponent VARCHAR )
What was the result of the game against the Miami Dolphins held at the Riverfront Stadium?
SELECT result FROM table_name_46 WHERE location = "riverfront stadium" AND opponent = "miami dolphins"
sql_create_context
CREATE TABLE table_name_19 ( points_for VARCHAR, played VARCHAR, lost VARCHAR )
What is the points number when 20 shows for played, and lost is 0?
SELECT points_for FROM table_name_19 WHERE played = "20" AND lost = "0"
sql_create_context
CREATE TABLE table_28524 ( "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" text, "Left" text, "Nickname" text, "Primary Conference when joining the MSFA" text, "Current Primary Conference" text )
How many schools left in 2002-03?
SELECT COUNT("Location") FROM table_28524 WHERE "Left" = '2002-03'
wikisql