context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
从2002年5月9日起,截止到2012年5月19日,6959651这个医院有多少科室涉及的医疗费总额不在90.82元以下
SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '6959651' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-05-09' AND '2012-05-19' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) >= 90.82) AS T
css
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...
what is the diagnosis icd9 code and procedure short title of patient with patient id 23602?
SELECT diagnoses.icd9_code, procedures.short_title FROM diagnoses INNER JOIN procedures ON diagnoses.hadm_id = procedures.hadm_id WHERE diagnoses.subject_id = "23602"
mimicsql_data
CREATE TABLE table_name_94 ( date VARCHAR, opponent_in_final VARCHAR )
What date has the opponent competing in the final of john mcenroe?
SELECT date FROM table_name_94 WHERE opponent_in_final = "john mcenroe"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
what is drug type and drug route of drug code posa200l?
SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "POSA200L"
mimicsql_data
CREATE TABLE table_5549 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
What is the tournament on 22 October 2012?
SELECT "Tournament" FROM table_5549 WHERE "Date" = '22 october 2012'
wikisql
CREATE TABLE diagnoses ( 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, ...
count the number of patients whose year of birth is less than 2066 and procedure icd9 code is 9983?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2066" AND procedures.icd9_code = "9983"
mimicsql_data
CREATE TABLE table_name_62 ( opponent VARCHAR, loss VARCHAR )
Who was the opponent when Brown (9-5) took the loss?
SELECT opponent FROM table_name_62 WHERE loss = "brown (9-5)"
sql_create_context
CREATE TABLE table_45582 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
Who scored 68-73-66=207 in South Africa?
SELECT "Place" FROM table_45582 WHERE "Country" = 'south africa' AND "Score" = '68-73-66=207'
wikisql
CREATE TABLE table_14562722_1 ( production_code VARCHAR, written_by VARCHAR, directed_by VARCHAR )
What was the production code of the episode that was written by michael dante dimartino and directed by lauren macmullan?
SELECT production_code FROM table_14562722_1 WHERE written_by = "Michael Dante DiMartino" AND directed_by = "Lauren MacMullan"
sql_create_context
CREATE TABLE table_34739 ( "Game" real, "December" real, "Opponent" text, "Score" text, "Record" text, "Points" real )
Which December is the lowest one that has Points of 52?
SELECT MIN("December") FROM table_34739 WHERE "Points" = '52'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
what is the number of patients whose marital status is single and item id is 50891?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "SINGLE" AND lab.itemid = "50891"
mimicsql_data
CREATE TABLE table_name_19 ( country VARCHAR, supermarkets VARCHAR )
What country has 50 supermarkets?
SELECT country FROM table_name_19 WHERE supermarkets = "50"
sql_create_context
CREATE TABLE table_name_50 ( overall INTEGER, pick VARCHAR )
what is the lowest overall when the pick is 20?
SELECT MIN(overall) FROM table_name_50 WHERE pick = 20
sql_create_context
CREATE TABLE table_name_9 ( high_rebounds VARCHAR, team VARCHAR )
who had the high rebounds when the team was @ toronto?
SELECT high_rebounds FROM table_name_9 WHERE team = "@ toronto"
sql_create_context
CREATE TABLE field ( fieldid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) C...
Brain research papers
SELECT DISTINCT paper.paperid FROM paper, venue WHERE venue.venueid = paper.venueid AND venue.venuename = 'Brain research'
scholar
CREATE TABLE table_name_36 ( notes VARCHAR, year VARCHAR )
What are the notes for 2005?
SELECT notes FROM table_name_36 WHERE year = 2005
sql_create_context
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal...
Bounties whose question was deleted.
SELECT 'site://q/' + CAST(Votes.PostId AS TEXT(10)) + '|link' AS Link, 'site://posts/' + CAST(Votes.PostId AS TEXT(10)) + '/timeline|timeline' AS Timeline, Votes.CreationDate FROM Votes LEFT JOIN Posts ON Posts.Id = Votes.PostId WHERE Votes.VoteTypeId = 9 AND Posts.Id IS NULL AND Votes.BountyAmount IS NULL ORDER BY Vot...
sede
CREATE TABLE table_name_32 ( nationality VARCHAR, rank VARCHAR )
What nationality has 2 as the rank?
SELECT nationality FROM table_name_32 WHERE rank = 2
sql_create_context
CREATE TABLE table_203_121 ( id number, "name" text, "pos." text, "caps" number, "goals" number, "club" text )
how many goals did the malm ff player -lrb- s -rrb- score ?
SELECT SUM("goals") FROM table_203_121 WHERE "club" = 'malmo ff'
squall
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
count the number of patients whose diagnoses icd9 code is 43820 and lab test fluid is pleural?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "43820" AND lab.fluid = "Pleural"
mimicsql_data
CREATE TABLE table_34785 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
What was the outcome of the match against Magdalena Maleeva?
SELECT "Outcome" FROM table_34785 WHERE "Opponent" = 'magdalena maleeva'
wikisql
CREATE TABLE table_8845 ( "Year" real, "Ship" text, "Departed From" text, "Departed On" text, "Returned On" text )
Which Returned On has a Year of 2011?
SELECT "Returned On" FROM table_8845 WHERE "Year" = '2011'
wikisql
CREATE TABLE table_name_43 ( lost INTEGER, pool_round VARCHAR, played VARCHAR )
Can you tell me the highest Lost that has the Pool/Round of pool 2, and the Played smaller than 6?
SELECT MAX(lost) FROM table_name_43 WHERE pool_round = "pool 2" AND played < 6
sql_create_context
CREATE TABLE table_72646 ( "Category" text, "Type" text, "Attribute" text, "Description" text, "Bubbles" text, "Cancelable" text )
what's the cancelable with bubbles being yes
SELECT "Cancelable" FROM table_72646 WHERE "Bubbles" = 'Yes'
wikisql
CREATE TABLE table_13309 ( "Entities" text, "Country" text, "Supply point" text, "Voltage (kV)" real, "Power (MW)" real )
How much Voltage (kV) has a Country of argentina, and a Power (MW) larger than 30, and a Supply point of yacyret ?
SELECT COUNT("Voltage (kV)") FROM table_13309 WHERE "Country" = 'argentina' AND "Power (MW)" > '30' AND "Supply point" = 'yacyretá'
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 microlab ( microl...
how many days have it been since patient 006-133605 got his last ondansetron hcl prescription on this hospital encounter?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', medication.drugstarttime)) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-133...
eicu
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, ...
list the patient identifications of patients who have been diagnosed with neutropenia since 2104.
SELECT patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'neutropenia' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2104')
eicu
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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 te...
被门诊诊断为D87.114这个病的患者04324529,看看他的检测指标451191的结果定量及其单位
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 jybgb.YLJGDM...
css
CREATE TABLE table_name_31 ( venue VARCHAR, opposing_team VARCHAR, status VARCHAR, against VARCHAR )
What venue was the tour match against eastern province played at with more than 0 against?
SELECT venue FROM table_name_31 WHERE status = "tour match" AND against > 0 AND opposing_team = "eastern province"
sql_create_context
CREATE TABLE table_4791 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What Home team played Richmond?
SELECT "Home team" FROM table_4791 WHERE "Away team" = 'richmond'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
how many patients whose year of birth is less than 2123 and lab test abnormal status is abnormal?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2123" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE Student_Tests_Taken ( registration_id INTEGER, date_test_taken DATETIME, test_result VARCHAR(255) ) CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, student_id INTEGER, course_id INTEGER, date_of_enrolment DATETIME, date_of_completion DATETIME ) CREATE TABL...
A bar chart about what are the student IDs and middle names of the students enrolled in at most two courses?, and I want to list x-axis in ascending order please.
SELECT T2.middle_name, T1.student_id FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id ORDER BY T2.middle_name
nvbench
CREATE TABLE table_name_8 ( leading_scorer_1 VARCHAR, season VARCHAR )
Which Leading scorer 1 has a Season of 2010 11?
SELECT leading_scorer_1 FROM table_name_8 WHERE season = "2010–11"
sql_create_context
CREATE TABLE table_name_45 ( latitude VARCHAR, ansi_code VARCHAR, township VARCHAR, land___sqmi__ VARCHAR, geo_id VARCHAR )
What is the total latitude of the greenland township with more than 34.846 sqmi of land, a geo id less than 3805529660, and an ANSI code greater than 1036405?
SELECT COUNT(latitude) FROM table_name_45 WHERE land___sqmi__ > 34.846 AND geo_id < 3805529660 AND township = "greenland" AND ansi_code > 1036405
sql_create_context
CREATE TABLE table_16494599_10 ( player VARCHAR, position VARCHAR )
How many athletes play the position of guard?
SELECT COUNT(player) FROM table_16494599_10 WHERE position = "Guard"
sql_create_context
CREATE TABLE table_58733 ( "Name" text, "Total" real, "First" text, "Last" text, "Highest rank" text )
What is the last when the first was January 2001 and more than 26 total?
SELECT "Last" FROM table_58733 WHERE "Total" > '26' AND "First" = 'january 2001'
wikisql
CREATE TABLE table_name_15 ( gold INTEGER, bronze VARCHAR, total VARCHAR )
Can you tell me the highest Gold that has the Bronze larger than 3, and the Total smaller than 24?
SELECT MAX(gold) FROM table_name_15 WHERE bronze > 3 AND total < 24
sql_create_context
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...
Return a bar chart about the distribution of Team_Name and School_ID .
SELECT Team_Name, School_ID FROM basketball_match
nvbench
CREATE TABLE table_35775 ( "Rank" real, "Building" text, "City" text, "Height (m/ft)" text, "Built" real )
What city is the bucharest tower center (btc) located in?
SELECT "City" FROM table_35775 WHERE "Building" = 'bucharest tower center (btc)'
wikisql
CREATE TABLE table_204_3 ( id number, "rank" number, "name" text, "nationality" text, "time" number )
who achieved a time that was at least faster than 54.20 ?
SELECT "name" FROM table_204_3 WHERE "time" <= 54.20
squall
CREATE TABLE table_name_89 ( round INTEGER, pick VARCHAR )
What is the sum of Round with a Pick that is 55?
SELECT SUM(round) FROM table_name_89 WHERE pick = 55
sql_create_context
CREATE TABLE representative ( representative_id number, name text, state text, party text, lifespan text ) CREATE TABLE election ( election_id number, representative_id number, date text, votes number, vote_percent number, seats number, place number )
List the names of representatives that have not participated in elections listed here.
SELECT name FROM representative WHERE NOT representative_id IN (SELECT representative_id FROM election)
spider
CREATE TABLE table_62006 ( "Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Winning constructor" text, "Report" text )
What Winning constructor has a Name of grand prix de la marne?
SELECT "Winning constructor" FROM table_62006 WHERE "Name" = 'grand prix de la marne'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
医疗机构8269235现在在医院的人数总量
SELECT COUNT(*) FROM qtb WHERE qtb.MED_SER_ORG_NO = '8269235' AND qtb.HOSP_STS > 0 UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '8269235' AND gyb.HOSP_STS > 0 UNION SELECT COUNT(*) FROM zyb WHERE zyb.MED_SER_ORG_NO = '8269235' AND zyb.HOSP_STS > 0 UNION SELECT COUNT(*) FROM mzb WHERE mzb.MED_SER_ORG_NO = '...
css
CREATE TABLE table_18600760_10 ( geo_id INTEGER, water__sqmi_ VARCHAR )
What is the geo ID for the township with 0.771 square miles of water?
SELECT MAX(geo_id) FROM table_18600760_10 WHERE water__sqmi_ = "0.771"
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 whose diagnoses short title is ac/chr syst/dia hrt fail and drug route is id?
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.short_title = "Ac/chr syst/dia hrt fail" AND prescriptions.route = "ID"
mimicsql_data
CREATE TABLE order_items ( order_item_id number, order_id number, product_id number, product_quantity text, other_order_item_details text ) CREATE TABLE customers ( customer_id number, customer_first_name text, customer_middle_initial text, customer_last_name text, gender text, ...
Show ids for all transactions whose amounts are greater than the average.
SELECT transaction_id FROM financial_transactions WHERE transaction_amount > (SELECT AVG(transaction_amount) FROM financial_transactions)
spider
CREATE TABLE table_76854 ( "Player" text, "Nationality" text, "Jersey Number(s)" real, "Position" text, "Years" text, "From" text )
What is the lowest jersey number of a player from louisiana state?
SELECT MIN("Jersey Number(s)") FROM table_76854 WHERE "From" = 'louisiana state'
wikisql
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id...
Top 50 users from Sri Lanka.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%Sri Lanka%' OR UPPER(Location) LIKE '%SRI LANKA' ORDER BY Reputation DESC LIMIT 50
sede
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
provide the number of patients whose discharge location is long term care hospital and primary disease is hemopytsis?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "LONG TERM CARE HOSPITAL" AND demographic.diagnosis = "HEMOPYTSIS"
mimicsql_data
CREATE TABLE game ( stadium_id number, id number, season number, date text, home_team text, away_team text, score text, competition text ) CREATE TABLE injury_accident ( game_id number, id number, player text, injury text, number_of_matches text, source text ) C...
What are the maximum, minimum and average home games each stadium held?
SELECT MAX(home_games), MIN(home_games), AVG(home_games) FROM stadium
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, ...
what are the four most commonly given diagnoses for patients who previously received hemodialysis - for acute renal failure within 2 months since 2105?
SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'hemodialysis - for acute renal failure' ...
eicu
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAc...
Top Android users in Russia.
WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id =...
sede
CREATE TABLE table_name_72 ( genre VARCHAR, year VARCHAR )
What is the genre of the game from 2006?
SELECT genre FROM table_name_72 WHERE year = "2006"
sql_create_context
CREATE TABLE table_24684 ( "No" real, "Driver" text, "Entrant" text, "Constructor" text, "Chassis" text, "Engine" text )
What chasis did the maserati l6s have?
SELECT "Chassis" FROM table_24684 WHERE "Engine" = 'Maserati L6s'
wikisql
CREATE TABLE table_1952065_4 ( teams_with_division_titles VARCHAR, division_championships VARCHAR )
How many division title teams were in the division championships 9 times?
SELECT COUNT(teams_with_division_titles) FROM table_1952065_4 WHERE division_championships = 9
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, ...
在门诊就诊的病人被诊断为结膜炎的,其超敏甲状腺球蛋白数值的平均值以及最值分别是多少
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJ...
css
CREATE TABLE table_204_474 ( id number, "year" number, "host" text, "champion" text, "second place" text, "third place" text, "fourth place" text )
previous third place finisher before jt marvelous
SELECT "third place" FROM table_204_474 WHERE "year" < (SELECT "year" FROM table_204_474 WHERE "third place" = 'jt marvelous') ORDER BY "year" DESC LIMIT 1
squall
CREATE TABLE hz_info_mzjzjlb ( JZLSH number, YLJGDM number, mzjzjlb_id number ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, ...
患有慢性根尖周炎的那些人确诊时同型半胱氨酸的参考值范畴下限和上限是多少?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM ...
css
CREATE TABLE table_203_586 ( id number, "#" number, "nation" text, "qualification tournament" text, "place in qt" number, "sailor" text )
which nation had their sailors as robert scheidt and bruno prada ?
SELECT "nation" FROM table_203_586 WHERE "sailor" = 'robert scheidt' INTERSECT SELECT "nation" FROM table_203_586 WHERE "sailor" = 'bruno prada'
squall
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...
出院时,医疗就诊86947036895诊断的疾病编号是什么?名称是什么?
SELECT qtb.OUT_DIAG_DIS_CD, qtb.OUT_DIAG_DIS_NM FROM qtb WHERE qtb.MED_CLINIC_ID = '86947036895' UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.MED_CLINIC_ID = '86947036895' UNION SELECT zyb.OUT_DIAG_DIS_CD, zyb.OUT_DIAG_DIS_NM FROM zyb WHERE zyb.MED_CLINIC_ID = '86947036895' UNION SELECT mzb....
css
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 diagnosis ( diagn...
how many days has it been since patient 006-172277 was admitted to the hospital?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '006-172277' AND patient.hospitaldischargetime IS NULL
eicu
CREATE TABLE table_203_400 ( id number, "district" text, "vacator" text, "reason for change" text, "successor" text, "date successor\nseated" text )
how many of the changes happened before june of 1986 ?
SELECT COUNT(*) FROM table_203_400 WHERE "date successor\nseated" < 1986 OR ("date successor\nseated" = 1986 AND "date successor\nseated" < 6)
squall
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 )
What are the names of climbers and the corresponding names of mountains that they climb?
SELECT T1.name, T2.name FROM climber AS T1 JOIN mountain AS T2 ON T1.mountain_id = T2.mountain_id
spider
CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE...
Show me about the distribution of meter_200 and the sum of meter_100 , and group by attribute meter_200 in a bar chart, show Y-axis in asc order please.
SELECT meter_200, SUM(meter_100) FROM swimmer GROUP BY meter_200 ORDER BY SUM(meter_100)
nvbench
CREATE TABLE table_12778 ( "Name" text, "Location" text, "Land" text, "Longest span in s metre ( feet )" text, "Arch type" text, "Completed" text )
What kind of arch is the pont de montanges (pont-des-pierres)?
SELECT "Arch type" FROM table_12778 WHERE "Name" = 'pont de montanges (pont-des-pierres)'
wikisql
CREATE TABLE table_203_184 ( id number, "tie no" number, "home team" text, "score" text, "away team" text, "attendance" text )
what is the difference of points in the game between birmingham city and wrexham ?
SELECT ABS("score" - "score") FROM table_203_184 WHERE "home team" = 'birmingham city' AND "away team" = 'wrexham'
squall
CREATE TABLE table_62768 ( "Constituency number" text, "Name" text, "Reserved for ( SC / ST /None)" text, "District" text, "Number of electorates (2003)" real )
Which district had SC reserved and 169 Constituents?
SELECT "District" FROM table_62768 WHERE "Reserved for ( SC / ST /None)" = 'sc' AND "Constituency number" = '169'
wikisql
CREATE TABLE county_public_safety ( county_id number, name text, population number, police_officers number, residents_per_officer number, case_burden number, crime_rate number, police_force text, location text ) CREATE TABLE city ( city_id number, county_id number, name ...
List the names of the city with the top 5 white percentages.
SELECT name FROM city ORDER BY white DESC LIMIT 5
spider
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id numbe...
have quetiapine fumarate, phenylephrine, or ondansetron been ordered for patient 1372 until 05/2101?
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1372) AND prescriptions.drug IN ('quetiapine fumarate', 'phenylephrine', 'ondansetron') AND STRFTIME('%y-%m', prescriptions.startdate) <= '2101-05'
mimic_iii
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE 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 newborn and discharge location is home?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.discharge_location = "HOME"
mimicsql_data
CREATE TABLE table_18982 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What was the score when the heat played at charlotte arena?
SELECT "Score" FROM table_18982 WHERE "Location Attendance" = 'Charlotte Arena'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text,...
what were the five most frequently prescribed drugs at the same time since 2 years ago among patients who were prescribed *nf* basiliximab?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = '*nf* basiliximab' AND DATETIME(prescriptions.startdate) >= DATETI...
mimic_iii
CREATE TABLE teaches ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0) ) CREATE TABLE prereq ( course_id varchar(8), prereq_id varchar(8) ) CREATE TABLE advisor ( s_ID varchar(5), i_ID varchar(5) ) CREATE TABLE takes ( ID varchar(...
Find the number of rooms with more than 50 capacity for each building Show bar chart, display y axis in asc order.
SELECT building, COUNT(*) FROM classroom WHERE capacity > 50 GROUP BY building ORDER BY COUNT(*)
nvbench
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 PostHistoryTypes ( I...
Top Contributors in SharePoint SE.
SELECT * FROM Users
sede
CREATE TABLE table_name_2 ( score VARCHAR, date VARCHAR )
What was the score in the August 20, 2007 match?
SELECT score FROM table_name_2 WHERE date = "august 20, 2007"
sql_create_context
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...
看看在医疗机构9046567的记录里,这位窦红旭的患者在01年2月24日到02年7月5日期间,治疗过程中给开出的西药总共有多少
SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '窦红旭' AND t_kc22.STA_DATE BETWEEN '2001-02-24' AND '2002-07-05' AND qtb.MED_SER_ORG_NO = '9046567' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLIN...
css
CREATE TABLE table_name_89 ( stage VARCHAR, course VARCHAR )
What stage of the race was held on the course Reggio Calabria to Catanzaro?
SELECT stage FROM table_name_89 WHERE course = "reggio calabria to catanzaro"
sql_create_context
CREATE TABLE table_840 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
How many different values if the number is high rebounds can be found for the game on March 13?
SELECT COUNT("High rebounds") FROM table_840 WHERE "Date" = 'March 13'
wikisql
CREATE TABLE table_name_99 ( operator VARCHAR, region VARCHAR )
What is the operator of the ensemble from Yorkshire?
SELECT operator FROM table_name_99 WHERE region = "yorkshire"
sql_create_context
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
Give me the comparison about the sum of School_ID over the ACC_Road , and group by attribute ACC_Road, and display in ascending by the total number.
SELECT ACC_Road, SUM(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY SUM(School_ID)
nvbench
CREATE TABLE table_name_62 ( length VARCHAR, fleet_number VARCHAR )
What is the length of fleet number 501-506?
SELECT length FROM table_name_62 WHERE fleet_number = "501-506"
sql_create_context
CREATE TABLE table_203_568 ( id number, "town/village" text, "population" number, "postal code" text, "municipality" text, "island" text, "location" text )
how much greater is the population of argir than glyvrar ?
SELECT (SELECT "population" FROM table_203_568 WHERE "town/village" = 'argir') - (SELECT "population" FROM table_203_568 WHERE "town/village" = 'glyvrar')
squall
CREATE TABLE table_name_97 ( opponent VARCHAR, time VARCHAR )
Who was the opponent when the fight had a time of 0:10?
SELECT opponent FROM table_name_97 WHERE time = "0:10"
sql_create_context
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...
Visualize the relationship between ACC_Percent and All_Games_Percent .
SELECT ACC_Percent, All_Games_Percent FROM basketball_match
nvbench
CREATE TABLE Documents_to_be_Destroyed ( Document_ID INTEGER, Destruction_Authorised_by_Employee_ID INTEGER, Destroyed_by_Employee_ID INTEGER, Planned_Destruction_Date DATETIME, Actual_Destruction_Date DATETIME, Other_Details VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Co...
How many documents in different starting date? Return a bar chart binning starting date by weekday interval, could you display in ascending by the y-axis?
SELECT Date_in_Location_From, COUNT(Date_in_Location_From) FROM Document_Locations ORDER BY COUNT(Date_in_Location_From)
nvbench
CREATE TABLE table_22825058_23 ( round VARCHAR, against VARCHAR )
Name the total number of round for against the netherlands
SELECT COUNT(round) FROM table_22825058_23 WHERE against = "The Netherlands"
sql_create_context
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, language text, marital_status text, ethnicity text, age number ) CREATE ...
retrieve the top four most frequent diagnoses of patients aged 20s in 2105?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN...
mimic_iii
CREATE TABLE table_11881 ( "Date" text, "Opponent" text, "Score" text, "Site/Stadium" text, "Loss" text, "Attendance" text, "Record" text )
How many people were in attendance on March 4?
SELECT "Attendance" FROM table_11881 WHERE "Date" = 'march 4'
wikisql
CREATE TABLE table_17001658_7 ( date VARCHAR, team VARCHAR )
What date was the opposing team Milwaukee?
SELECT date FROM table_17001658_7 WHERE team = "Milwaukee"
sql_create_context
CREATE TABLE table_32458 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the date of the game where Essendon is the away team?
SELECT "Date" FROM table_32458 WHERE "Away team" = 'essendon'
wikisql
CREATE TABLE table_name_44 ( lead_envoy VARCHAR, ryūkyūan_king VARCHAR )
Who was the lead envoy with the Ry ky an King sh k ?
SELECT lead_envoy FROM table_name_44 WHERE ryūkyūan_king = "shō kō"
sql_create_context
CREATE TABLE party ( party_id number, party_theme text, location text, first_year text, last_year text, number_of_hosts number ) CREATE TABLE host ( host_id number, name text, nationality text, age text ) CREATE TABLE party_host ( party_id number, host_id number, is...
Compute the average number of hosts for parties.
SELECT AVG(number_of_hosts) FROM party
spider
CREATE TABLE table_name_29 ( hdmi VARCHAR, codename VARCHAR )
Does Trinity (valhalla) have HDMI?
SELECT hdmi FROM table_name_29 WHERE codename = "trinity (valhalla)"
sql_create_context
CREATE TABLE table_39293 ( "Season" text, "Club" text, "Country" text, "Competition" text, "Caps" real, "Goals" real )
What is the sum of goals for the 2004/05 Season?
SELECT SUM("Goals") FROM table_39293 WHERE "Season" = '2004/05'
wikisql
CREATE TABLE table_name_64 ( county VARCHAR, cerclis_id VARCHAR )
What county has a CERCLIS ID of scd037405362?
SELECT county FROM table_name_64 WHERE cerclis_id = "scd037405362"
sql_create_context
CREATE TABLE table_60775 ( "Date" text, "Nationality / Opponent" text, "Ground" text, "Result" text, "Competition" text )
Name the Nationality / Opponent of the Competition of welsh rugby union challenge trophy and a Result of 38-29?
SELECT "Nationality / Opponent" FROM table_60775 WHERE "Competition" = 'welsh rugby union challenge trophy' AND "Result" = '38-29'
wikisql
CREATE TABLE table_name_34 ( time VARCHAR, lane VARCHAR )
What is the Time of the Athlete in Lane 4?
SELECT COUNT(time) FROM table_name_34 WHERE lane = 4
sql_create_context
CREATE TABLE table_17337 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Who had the high assists when the high rebounds were from Nick Collison (15)?
SELECT "High assists" FROM table_17337 WHERE "High rebounds" = 'Nick Collison (15)'
wikisql
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
what is date of birth and icu stay id of subject name troy friedman?
SELECT demographic.dob, prescriptions.icustay_id FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Troy Friedman"
mimicsql_data