context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_25667 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Prod. code" text, "Viewers (millions)" text )
For the episode directed by Matthew Penn, what is the total number in the series?
SELECT "No. in series" FROM table_25667 WHERE "Directed by" = 'Matthew Penn'
wikisql
CREATE TABLE table_20116 ( "Pos." real, "Driver" text, "Qualifying" real, "Race 1" text, "Race 2" text, "Race 3" text, "Points" real )
Name the race 1 when race 3 is 8
SELECT "Race 1" FROM table_20116 WHERE "Race 3" = '8'
wikisql
CREATE TABLE table_name_74 ( lane INTEGER, name VARCHAR )
what lane did inna nikitina have?
SELECT MAX(lane) FROM table_name_74 WHERE name = "inna nikitina"
sql_create_context
CREATE TABLE table_203_673 ( id number, "#" number, "date" text, "opponent" text, "score" text, "win" text, "loss" text, "save" text, "attendance" number, "record" text )
what team was the opponent in the first game with over 35,000 attendees ?
SELECT "opponent" FROM table_203_673 WHERE "attendance" > 35000 ORDER BY "date" LIMIT 1
squall
CREATE TABLE table_name_94 ( time INTEGER, lane VARCHAR, rank VARCHAR )
Which Time has a Lane smaller than 4, and a Rank larger than 6?
SELECT AVG(time) FROM table_name_94 WHERE lane < 4 AND rank > 6
sql_create_context
CREATE TABLE table_68764 ( "Group" real, "Half-Life (s)" real, "Decay Constant (s \u22121 )" real, "Yield, Neutrons per Fission" real, "Fraction" real )
What is the lowest group number that has a Fraction less than 0.000748, a Half-Life of 55.72 and a Decay Constant larger than 0.012400000000000001?
SELECT MIN("Group") FROM table_68764 WHERE "Fraction" < '0.000748' AND "Half-Life (s)" = '55.72' AND "Decay Constant (s \u22121 )" > '0.012400000000000001'
wikisql
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, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments ...
Physiology Masters Research Project will be offered at what times ?
SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM semester INNER JOIN course_offering ON semester.semester_id = course_o...
advising
CREATE TABLE table_name_59 ( title VARCHAR, arranger VARCHAR, length VARCHAR )
What is the title track that is 3:50 and arranged by Tarek Akef?
SELECT title FROM table_name_59 WHERE arranger = "tarek akef" AND length = "3:50"
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...
count the number of patients admitted through emergency hospital room who had lata5os drug code.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND prescriptions.formulary_drug_cd = "LATA5OS"
mimicsql_data
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime t...
when did the last lab test of patient 007-8317 on their first hospital visit take place?
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-8317' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitalad...
eicu
CREATE TABLE table_name_29 ( wins VARCHAR, season VARCHAR, podiums VARCHAR )
How many wins had a podium larger than 6 after season 2008?
SELECT COUNT(wins) FROM table_name_29 WHERE season > 2008 AND podiums > 6
sql_create_context
CREATE TABLE procedures ( code number, name text, cost number ) CREATE TABLE trained_in ( physician number, treatment number, certificationdate time, certificationexpires time ) CREATE TABLE medication ( code number, name text, brand text, description text ) CREATE TABLE b...
Which nurses are in charge of patients undergoing treatments?
SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN nurse AS T2 ON T1.assistingnurse = T2.employeeid
spider
CREATE TABLE table_12626 ( "Result" text, "Opponent" text, "Method" text, "Event" text, "Notes" text )
What are the Notes when the Method is decision?
SELECT "Notes" FROM table_12626 WHERE "Method" = 'decision'
wikisql
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varc...
What sections of PSYCH 730 are offered after 14:30 P.M. ?
SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.start_time > '14:30' AND course.course_id = course_offering.course_id AND course.department = 'PSYCH' AND course.number = 730 AND semester.semester = 'WN' AND...
advising
CREATE TABLE table_59234 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text )
Who lost with 142 points for?
SELECT "Lost" FROM table_59234 WHERE "Points for" = '142'
wikisql
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
报告超过4份检验报告单的人在医疗就诊20704005189中有哪些?列出这些报告人的工号及姓名
SELECT jybgb.BGRGH, jybgb.BGRXM FROM jybgb WHERE jybgb.JZLSH = '20704005189' GROUP BY jybgb.BGRGH HAVING COUNT(*) > 4
css
CREATE TABLE table_40204 ( "Nat." text, "Name" text, "Since" real, "App(L/C/E)" text, "Goals(L/C/E)" text, "Ends" real, "Transfer fee" text, "Notes" text )
What is Notes, when App(L/C/E) is 13 (7/2/4)?
SELECT "Notes" FROM table_40204 WHERE "App(L/C/E)" = '13 (7/2/4)'
wikisql
CREATE TABLE table_name_80 ( opened INTEGER, system VARCHAR, daily_ridership VARCHAR )
Which Opened has a System of c-train, and a Daily ridership smaller than 269,600?
SELECT MAX(opened) FROM table_name_80 WHERE system = "c-train" AND daily_ridership < 269 OFFSET 600
sql_create_context
CREATE TABLE table_name_31 ( date VARCHAR, loss VARCHAR )
When was the date that had a Loss of Shirley (0-1)?
SELECT date FROM table_name_31 WHERE loss = "shirley (0-1)"
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, ...
参保人29701487年门诊医护费总额是多少?
SELECT SUM(gwyjzb.MED_AMOUT) FROM gwyjzb WHERE gwyjzb.PERSON_ID = '29701487' AND gwyjzb.CLINIC_TYPE = '门诊' UNION SELECT SUM(fgwyjzb.MED_AMOUT) FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '29701487' AND fgwyjzb.CLINIC_TYPE = '门诊'
css
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and the sum of code , and group by attribute name, and I want to list by the X in asc.
SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name
nvbench
CREATE TABLE table_name_61 ( area VARCHAR, roll VARCHAR, gender VARCHAR, authority VARCHAR, decile VARCHAR )
Where is the coed school with state authority, a Decile larger than 6 and 26 enrolled?
SELECT area FROM table_name_61 WHERE authority = "state" AND decile > 6 AND gender = "coed" AND roll = 26
sql_create_context
CREATE TABLE table_name_64 ( time_retired VARCHAR, driver VARCHAR )
The driver Jacky Ickx had what time/retired?
SELECT time_retired FROM table_name_64 WHERE driver = "jacky ickx"
sql_create_context
CREATE TABLE table_48319 ( "Player" text, "Nationality" text, "Position" text, "Years for Grizzlies" text, "School/Club Team" text )
What is the nationality of the Team Georgia Tech?
SELECT "Nationality" FROM table_48319 WHERE "School/Club Team" = 'georgia tech'
wikisql
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGu...
Top 50 voted comments in november.
SELECT * FROM Comments ORDER BY 'Score' DESC LIMIT 50
sede
CREATE TABLE table_10030 ( "Date" text, "H/A/N" text, "Opponent" text, "Score" text, "Record" text )
What is H/A/N, when Record is 20-48?
SELECT "H/A/N" FROM table_10030 WHERE "Record" = '20-48'
wikisql
CREATE TABLE table_78246 ( "D 48" text, "D 47" text, "D 46" text, "D 45" text, "D 44" text, "D 43" text, "D 42" text, "D 41" text )
Name the D 47 when it has a D 48 of d 49 and D 42 of r 42
SELECT "D 47" FROM table_78246 WHERE "D 48" = 'd 49' AND "D 42" = 'r 42'
wikisql
CREATE TABLE table_60295 ( "Team" text, "CF appearances" real, "CF wins" real, "Cup wins" real, "Last CF" real )
What is the lowest number of cf wins of the chicago blackhawks, which has more than 4 cf appearances, a last cf in 2013, and more than 2 cup wins?
SELECT MIN("CF wins") FROM table_60295 WHERE "CF appearances" > '4' AND "Last CF" = '2013' AND "Team" = 'chicago blackhawks' AND "Cup wins" > '2'
wikisql
CREATE TABLE table_22765887_1 ( track VARCHAR, date VARCHAR )
Which track was used on September 12, 1981?
SELECT track FROM table_22765887_1 WHERE date = "September 12, 1981"
sql_create_context
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, va...
tell me the duration of patient 23224's first stay in the hospital.
SELECT STRFTIME('%j', admissions.dischtime) - STRFTIME('%j', admissions.admittime) FROM admissions WHERE admissions.subject_id = 23224 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1
mimic_iii
CREATE TABLE table_15361 ( "D 48" text, "D 47" text, "D 46" text, "D 45" text, "D 44" text, "D 43" text, "D 42" text, "D 41" text )
Name the D 45 which has D 44 of d 53
SELECT "D 45" FROM table_15361 WHERE "D 44" = 'd 53'
wikisql
CREATE TABLE table_train_170 ( "id" int, "alt" float, "hemoglobin_a1c_hba1c" float, "ast" float, "allergy_to_peanuts" bool, "a1c" float, "bilirubin" float, "NOUSE" float )
screening alt or ast > 1.5 x upper limit of normal ( uln )
SELECT * FROM table_train_170 WHERE alt > 1.5 OR ast > 1.5
criteria2sql
CREATE TABLE table_24031 ( "Ep." real, "Season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Prod. Code" text )
Name the least episode for november 29, 1985
SELECT MIN("Ep.") FROM table_24031 WHERE "Original air date" = 'November 29, 1985'
wikisql
CREATE TABLE wdmzjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH number, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZD...
在编号为6465172的医院就诊的病患36808605在入院时科室名称中含有优生的住院就诊记录都有哪几条?
SELECT * FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '36808605' AND hz_info.YLJGDM = '6465172' AND wdmzjzjlb.JZKSMC LIKE '%优生%' UNION SELECT * FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjlb.YLJGDM AND hz_i...
css
CREATE TABLE table_34817 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Time" text, "Att." text, "Record" text )
when is Record of 66-95?
SELECT "Time" FROM table_34817 WHERE "Record" = '66-95'
wikisql
CREATE TABLE table_53652 ( "Place (Posici\u00f3n)" real, "Team (Equipo)" text, "Played (PJ)" real, "Won (PG)" real, "Draw (PE)" real, "Lost (PP)" real, "Goals Scored (GF)" real, "Goals Conceded (GC)" real, "+/- (Dif.)" real, "Points (Pts.)" real )
What is the highest number of games won where less than 21 games were conceded and less than 18 games were actually played?
SELECT MAX("Won (PG)") FROM table_53652 WHERE "Goals Conceded (GC)" < '21' AND "Played (PJ)" < '18'
wikisql
CREATE TABLE ftxmzjzjlb ( 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, MZZYZD...
从2007年10月16日到2020年3月16日,列出病人沈智勇这期间所有检验报告单的审核日期时间
SELECT jybgb.SHSJ FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '沈...
css
CREATE TABLE table_name_78 ( elevator VARCHAR, cardinalatial_title VARCHAR )
What is listed for the Elevator, that also has the Cardinalatial title of Deacon of S. Maria in Portico?
SELECT elevator FROM table_name_78 WHERE cardinalatial_title = "deacon of s. maria in portico"
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title te...
count the number of patients who had a int insert dual-cham dev in the same month after having been diagnosed with opioid abuse-unspec this year.
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'opioid abuse-unspe...
mimic_iii
CREATE TABLE table_name_41 ( year INTEGER, outcome VARCHAR, championship VARCHAR )
Tell me the sum of Year for outcome of runner-up for world darts championship
SELECT SUM(year) FROM table_name_41 WHERE outcome = "runner-up" AND championship = "world darts championship"
sql_create_context
CREATE TABLE table_14181578_1 ( games_played INTEGER, goals_for_against VARCHAR )
what is the minimum games played with goals for/against being 7-5
SELECT MIN(games_played) FROM table_14181578_1 WHERE goals_for_against = "7-5"
sql_create_context
CREATE TABLE table_72911 ( "Country" text, "Preliminary" text, "Interview" text, "Swimsuit" text, "Evening Gown" text, "Average" text )
What was the swimsuit score for the country with the average score of 8.848?
SELECT "Swimsuit" FROM table_72911 WHERE "Average" = '8.848'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, lan...
how many hours has it been since the last intake of tf residual for patient 18866 on the current icu visit?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18866) AND icustays.outtime IS NULL)...
mimic_iii
CREATE TABLE table_29168 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Incoming manager" text, "Date of appointment" text )
Who was the incoming manager for the date of appointment of 15 january 2011?
SELECT "Incoming manager" FROM table_29168 WHERE "Date of appointment" = '15 January 2011'
wikisql
CREATE TABLE table_73114 ( "Song" text, "Porsgrunn" real, "Bergen" real, "Bod\u00f8" real, "Stavanger" real, "\u00c5lesund" real, "Elverum" real, "Troms\u00f8" real, "Fredrikstad" real, "Trondheim" real, "Oslo" real, "Total" real )
When oslo is 48, what is stavanger?
SELECT MIN("Stavanger") FROM table_73114 WHERE "Oslo" = '48'
wikisql
CREATE TABLE table_name_24 ( loss VARCHAR, record VARCHAR )
What's the Loss for the game that had a 22-24 record?
SELECT loss FROM table_name_24 WHERE record = "22-24"
sql_create_context
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE time_interval ( period text, begin_time int...
display all flights from TORONTO to SAN DIEGO on US with a layover in PHOENIX
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN DIEGO' AND CITY_2...
atis
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 ) ...
what is days of hospital stay and discharge time of subject id 87275?
SELECT demographic.days_stay, demographic.dischtime FROM demographic WHERE demographic.subject_id = "87275"
mimicsql_data
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE flight_leg ( flight_id int, leg_number int, ...
what types of aircraft can i get a FIRST class ticket from PHILADELPHIA to DALLAS
SELECT DISTINCT aircraft.aircraft_code FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, equipment_sequence, fare, fare_basis, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND fare_basis...
atis
CREATE TABLE table_72181 ( "Route Name" text, "Direction" text, "Termini" text, "Junctions" text, "Length" text, "Population Area" text, "Remarks" text )
How many junctions have 'replaced by bsi-35' listed in their remarks section?
SELECT COUNT("Junctions") FROM table_72181 WHERE "Remarks" = 'Replaced by BSI-35'
wikisql
CREATE TABLE table_name_68 ( county VARCHAR, listed VARCHAR, construction_completed VARCHAR )
In what county is the entry that has a Construction Completed date of 07/19/2000 and a Listed date of 09/21/1984 located?
SELECT county FROM table_name_68 WHERE listed = "09/21/1984" AND construction_completed = "07/19/2000"
sql_create_context
CREATE TABLE table_name_99 ( notes VARCHAR, year VARCHAR )
What are the notes in 1981?
SELECT notes FROM table_name_99 WHERE year = "1981"
sql_create_context
CREATE TABLE table_6840 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
What is the To Par for Player Chris Riley?
SELECT "To par" FROM table_6840 WHERE "Player" = 'chris riley'
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 prescription...
by which route is the medication d5lr administered?
SELECT prescriptions.route FROM prescriptions WHERE prescriptions.drug = "D5LR"
mimicsql_data
CREATE TABLE table_name_89 ( venue VARCHAR, team_2 VARCHAR )
Team 2 Al-Ain played in what venue?
SELECT venue FROM table_name_89 WHERE team_2 = "al-ain"
sql_create_context
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...
在2012年5月4日之后,3398509这个医疗机构的住院就诊记录中有多少入院登记
SELECT COUNT(*) FROM zyjzjlb JOIN hz_info_zyjzjlb JOIN hz_info ON hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.zyjzjlb_id = zyjzjlb.zyjzjlb_id AND hz_info_zyjzjlb.YLJGDM = hz_info.YLJGDM WHERE hz_info.YLJGDM = '33...
css
CREATE TABLE table_14608759_1 ( result VARCHAR, week VARCHAR )
What are week 4 results?
SELECT result FROM table_14608759_1 WHERE week = 4
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...
what is the number of patients on main type of drug prescription who have the diagnoses of other respiratory problems after birth?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Other respiratory problems after birth" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE table_23059 ( "Series #" real, "Episode #" real, "Title" text, "Written by" text, "Directed by" text, "Viewers" real, "Original airdate" text )
What is the title for the episode that written by Michael Miller?
SELECT "Title" FROM table_23059 WHERE "Written by" = 'Michael Miller'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, ...
找出哪些检测指标结果定量单位、检测指标名称和检测指标结果定量跟编号60466839676的检验指标记录完全相同?
SELECT * FROM jyjgzbb WHERE JCZBMC = (SELECT JCZBMC FROM jyjgzbb WHERE JYZBLSH = '60466839676') AND JCZBJGDW = (SELECT JCZBJGDW FROM jyjgzbb WHERE JYZBLSH = '60466839676') AND JCZBJGDL = (SELECT JCZBJGDL FROM jyjgzbb WHERE JYZBLSH = '60466839676')
css
CREATE TABLE table_72902 ( "Position" real, "Team" text, "Played" real, "Won" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Average 1" text, "Points 2" real )
How many times did the Lancaster City team play?
SELECT COUNT("Played") FROM table_72902 WHERE "Team" = 'Lancaster City'
wikisql
CREATE TABLE table_15550 ( "Ensemble" text, "Gold Medals" real, "Silver Medals" real, "Bronze Medals" real, "Total Medals" real )
Name the total number of bronze medals when gold medals was 2, total medals more than 4 and silver medals less than 5
SELECT COUNT("Bronze Medals") FROM table_15550 WHERE "Gold Medals" = '2' AND "Total Medals" > '4' AND "Silver Medals" < '5'
wikisql
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PendingFlags ( Id nu...
AWS Questions: Time until Answer that was accepted.
SELECT Question.Id AS "post_link", CAST(Answer.CreationDate - Question.CreationDate AS FLOAT) AS Days, Question.CreationDate, Answer.CreationDate FROM Posts AS Question JOIN Posts AS Answer ON Answer.Id = Question.AcceptedAnswerId WHERE Question.PostTypeId = 1 AND Question.ClosedDate IS NULL AND (Question.Tags LIKE '%<...
sede
CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, end_station_name TEXT, end_station_id INTEGER, bike_id INTEGER, subscription_type TEXT, zip_code INTEGER ) CREATE TABLE station ( id INTEG...
What is the frequency of the dates (bin into year interval) that had the top 5 cloud cover rates? You can draw me a bar chart for this purpose, I want to sort Y in descending order.
SELECT date, COUNT(date) FROM weather ORDER BY COUNT(date) DESC
nvbench
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...
患者在医疗就诊85614606716中具体有哪些病情描述
SELECT MAIN_COND_DES FROM t_kc21 WHERE MED_CLINIC_ID = '85614606716'
css
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, ...
看看80300861713的这次医疗就诊的住院时长
SELECT t_kc21.IN_HOSP_DAYS FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '80300861713'
css
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...
Who has , is , or will be teaching Regulatory Issues ?
SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN course ON course.course_id = course_offering.course_id WHERE course.name L...
advising
CREATE TABLE table_name_77 ( episode VARCHAR )
What is the 1st Edition for the Episode 4?
SELECT 1 AS st_edition FROM table_name_77 WHERE episode = "4"
sql_create_context
CREATE TABLE table_23601267_2 ( final_score VARCHAR, date VARCHAR )
What was the score on September 20?
SELECT final_score FROM table_23601267_2 WHERE date = "September 20"
sql_create_context
CREATE TABLE table_14249278_1 ( bits_14_12 INTEGER, description VARCHAR )
Name the most bits 14-12 for output from accumulator to character bus
SELECT MIN(bits_14_12) FROM table_14249278_1 WHERE description = "Output from accumulator to character bus"
sql_create_context
CREATE TABLE table_66272 ( "School" text, "Mascot" text, "Location" text, "Enrollment" real, "IHSAA Class" text, "IHSAA Football Class" text, "County" text )
What county has a school mascot of the Pioneers?
SELECT "County" FROM table_66272 WHERE "Mascot" = 'pioneers'
wikisql
CREATE TABLE table_name_16 ( away_team VARCHAR, home_team VARCHAR )
What Away team is from Fitzroy?
SELECT away_team FROM table_name_16 WHERE home_team = "fitzroy"
sql_create_context
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE microbiologyevents ( row_i...
what was the maximum value of patient 22648's monocytes in the current hospital encounter?
SELECT MAX(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22648 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'monocytes')
mimic_iii
CREATE TABLE table_1939214_1 ( year VARCHAR, league VARCHAR )
In what year did the team compete in the USISL Pro League?
SELECT year FROM table_1939214_1 WHERE league = "USISL Pro league"
sql_create_context
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, ...
Programming languages used with Postgres.
SELECT t.TagName, COUNT(*) AS num_questions FROM PostTags AS pt JOIN Tags AS t ON t.Id = pt.TagId WHERE pt.PostId IN (SELECT p.Id FROM Posts AS p JOIN PostTags AS pt2 ON pt2.PostId = p.Id JOIN Tags AS t2 ON t2.Id = pt2.TagId WHERE t2.TagName LIKE 'postgresql%') AND t.TagName IN ('java', 'c#', 'python', 'perl', 'javascr...
sede
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 ) ...
get me the type of admission and short title of procedure for patient with patient id 2560.
SELECT demographic.admission_type, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_12707313_2 ( constr VARCHAR, first_win VARCHAR )
Name the number of constr with the first win at the 1978 brazilian grand prix
SELECT COUNT(constr) FROM table_12707313_2 WHERE first_win = "1978 Brazilian Grand Prix"
sql_create_context
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...
被门诊诊断为D87.114这个病的患者04324529,看看他的检测指标451191的结果定量及其单位
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jyb...
css
CREATE TABLE table_train_159 ( "id" int, "hemoglobin_a1c_hba1c" float, "estimated_glomerular_filtration_rate_egfr" int, "kidney_disease" bool, "serum_triglyceride" int, "body_mass_index_bmi" float, "age" float, "NOUSE" float )
hba1c value of > 6.5 to < 9.5 %
SELECT * FROM table_train_159 WHERE hemoglobin_a1c_hba1c > 6.5 AND hemoglobin_a1c_hba1c < 9.5
criteria2sql
CREATE TABLE table_15887683_17 ( hdtv VARCHAR, television_service VARCHAR )
Name the total number of hdtv for eurotic tv
SELECT COUNT(hdtv) FROM table_15887683_17 WHERE television_service = "Eurotic TV"
sql_create_context
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, ...
病人71927625购买的九味镇心颗粒都是在哪些医院买的?
SELECT gwyjzb.MED_SER_ORG_NO FROM gwyjzb WHERE gwyjzb.PERSON_ID = '71927625' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '九味镇心颗粒') UNION SELECT fgwyjzb.MED_SER_ORG_NO FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '71927625' AND fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED...
css
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
Do you know who is the MDE classes teacher next Winter ?
SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr...
advising
CREATE TABLE table_13021 ( "Team" text, "2005\u201306 Pts" real, "2006\u201307 Pts" real, "2007\u201308 Pts" real, "Total Pts" real, "Total Pld" real )
Which 2006 07 Pts has a 2005 06 Pts smaller than 51, a Team of hurac n, and a 2007 08 Pts larger than 52?
SELECT AVG("2006\u201307 Pts") FROM table_13021 WHERE "2005\u201306 Pts" < '51' AND "Team" = 'huracán' AND "2007\u201308 Pts" > '52'
wikisql
CREATE TABLE table_name_59 ( nickname_s_ VARCHAR, enrollment__2013_14_ VARCHAR )
What is the nickname with an enrollment (2013/14) of 160?
SELECT nickname_s_ FROM table_name_59 WHERE enrollment__2013_14_ = "160"
sql_create_context
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
患者90265376的全部检查结果指标记录在在00年7月28日到11年6月19日内的质检人为32482264的检测指标流水号是多少?
SELECT jyjgzbb.JYZBLSH 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.BGDH WHERE hz...
css
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid...
how many days it has been since patient 007-849 received the last congestive heart failure - systolic diagnosis during their current hospital encounter?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnosis.diagnosistime)) FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-849' A...
eicu
CREATE TABLE table_name_95 ( opponent VARCHAR, record VARCHAR )
Who was the opponent at the game when the record was 22-13?
SELECT opponent FROM table_name_95 WHERE record = "22-13"
sql_create_context
CREATE TABLE Settlements ( Settlement_ID INTEGER, Claim_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER, Customer_Policy_ID INTEGER ) CREATE TABLE Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) CREATE TABLE...
A bar chart for returning the number of the claim start date for the claims whose claimed amount is no more than the average, and sort Y in desc order.
SELECT Date_Claim_Made, COUNT(Date_Claim_Made) FROM Claims WHERE Amount_Settled <= (SELECT AVG(Amount_Settled) FROM Claims) ORDER BY COUNT(Date_Claim_Made) DESC
nvbench
CREATE TABLE table_name_67 ( venue VARCHAR, home_team VARCHAR )
What venue featured the home side of st kilda?
SELECT venue FROM table_name_67 WHERE home_team = "st kilda"
sql_create_context
CREATE TABLE table_9707 ( "Date" text, "Home team" text, "Score" text, "Away team" text, "Venue" text, "Box Score" text, "Report" text )
Which date had a venue of the Gold Coast Convention Centre?
SELECT "Date" FROM table_9707 WHERE "Venue" = 'gold coast convention centre'
wikisql
CREATE TABLE table_name_33 ( rider VARCHAR, time VARCHAR )
Name the Rider which has a Time of +59.304?
SELECT rider FROM table_name_33 WHERE time = "+59.304"
sql_create_context
CREATE TABLE table_69172 ( "Film" text, "Director(s)" text, "Producer(s)" text, "Writer(s)" text, "Date" text, "Award" text )
Which producer worked with Robert Sproul-cran as writer?
SELECT "Producer(s)" FROM table_69172 WHERE "Writer(s)" = 'robert sproul-cran'
wikisql
CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) ) CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) )
Return a pie chart on how many students are enrolled in colleges that have student accepted during tryouts, and in which states are those colleges?
SELECT state, enr FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes'
nvbench
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...
秦霞雰这个患者在02年6月24日到15年12月19期间买了多少次西药
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '秦霞雰' AND t_kc22.STA_DATE BETWEEN '2002-06-24' AND '2015-12-19' AND t_kc22.MED_INV_ITEM_TYPE = '西药费'
css
CREATE TABLE table_21058836_1 ( opponents VARCHAR, opponent VARCHAR )
Santa Clara was played how many times?
SELECT opponents FROM table_21058836_1 WHERE opponent = "Santa Clara"
sql_create_context
CREATE TABLE table_2668173_4 ( district VARCHAR, incumbent VARCHAR )
What was the district of the incumbent Mathias Morris?
SELECT district FROM table_2668173_4 WHERE incumbent = "Mathias Morris"
sql_create_context
CREATE TABLE table_17972193_1 ( attendance VARCHAR, date VARCHAR )
How many total numbers of attendance are there during the game in October 27?
SELECT COUNT(attendance) FROM table_17972193_1 WHERE date = "October 27"
sql_create_context
CREATE TABLE table_1604 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What team played on March 20?
SELECT "Team" FROM table_1604 WHERE "Date" = 'March 20'
wikisql
CREATE TABLE table_75003 ( "Medal" text, "Name" text, "Games" text, "Sport" text, "Event" text )
Which Sport had an Event of men's 400 m hurdles?
SELECT "Sport" FROM table_75003 WHERE "Event" = 'men''s 400 m hurdles'
wikisql
CREATE TABLE table_34987 ( "School Year" text, "Class A" text, "Class AA" text, "Class AAA" text, "Class AAAA" text )
Whcih was the Class AAA in school year 2006-07?
SELECT "Class AAA" FROM table_34987 WHERE "School Year" = '2006-07'
wikisql