context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE Teachers (
teacher_id INTEGER,
address_id INTEGER,
first_name VARCHAR(80),
middle_name VARCHAR(80),
last_name VARCHAR(80),
gender VARCHAR(1),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
other_details VARCHAR(255)
)
CREATE TABLE Student_Addresses (
stu... | A bar chart shows the distribution of date_address_from and the average of monthly_rental bin date_address_from by weekday. | SELECT date_address_from, AVG(monthly_rental) FROM Student_Addresses ORDER BY monthly_rental DESC | nvbench |
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,
... | count the number of patients who take drug via oral route and have diagnoses of cerebral embolism with cerebral infarction. | 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 = "Cerebral embolism with cerebral infarction" AND prescriptions.route = "ORAL" | mimicsql_data |
CREATE TABLE table_56226 (
"D 50" text,
"D 49" text,
"D 48" text,
"D 47" text,
"D 46" text,
"D 45" text,
"D 44" text,
"D 43" text,
"D 42" text,
"D 41" text
) | What is the D 47 when the D 49 is r 32? | SELECT "D 47" FROM table_56226 WHERE "D 49" = 'r 32' | wikisql |
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,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE bdmzjzjlb (
HXPLC number,
HZX... | 从14年12月31日到21年1月18日当中头颈肿瘤外科的门诊量有多少吗? | SELECT COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.JZKSMC = '头颈肿瘤科' AND wdmzjzjlb.JZKSRQ BETWEEN '2014-12-31' AND '2021-01-18' UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.JZKSMC = '头颈肿瘤科' AND bdmzjzjlb.JZKSRQ BETWEEN '2014-12-31' AND '2021-01-18' | css |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE ground... | is there a flight tomorrow morning from COLUMBUS to NASHVILLE | 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 = 'NASHVILLE' AND date_day.day_number = 20 AND date_day.month_number = 1 AN... | atis |
CREATE TABLE table_name_50 (
driver VARCHAR,
fin_pos VARCHAR
) | Which driver finished in position 8? | SELECT driver FROM table_name_50 WHERE fin_pos = 8 | sql_create_context |
CREATE TABLE table_name_86 (
chapters VARCHAR,
director VARCHAR
) | How many chapters did Elmer Clifton direct? | SELECT COUNT(chapters) FROM table_name_86 WHERE director = "elmer clifton" | sql_create_context |
CREATE TABLE enzyme (
id number,
name text,
location text,
product text,
chromosome text,
omim number,
porphyria text
)
CREATE TABLE medicine (
id number,
name text,
trade_name text,
fda_approved text
)
CREATE TABLE medicine_enzyme_interaction (
enzyme_id number,
me... | What are the different names, locations, and products of the enzymes that are capable inhibitor interactions? | SELECT DISTINCT T1.name, T1.location, T1.product FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.enzyme_id = T1.id WHERE T2.interaction_type = 'inhibitor' | spider |
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 ... | what was the last lab test when they visited the hospital first time given to patient 77213? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 77213 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) ORDER BY labevents.charttime DE... | mimic_iii |
CREATE TABLE table_19085 (
"Code" real,
"County" text,
"Former Province" text,
"Area (km 2 )" text,
"Population Census 2009" real,
"Capital" text
) | what's the former province with area (km 2 ) being 12,245.9 | SELECT "Former Province" FROM table_19085 WHERE "Area (km 2 )" = '12,245.9' | wikisql |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational... | Which course of Study of Literature have 18 credits ? | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Study of Literature%' OR name LIKE '%Study of Literature%') AND credits = 18 | advising |
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... | 在编号为62645586的病人检查中有哪些检验报告单对应的检验结果指标全都异常?检验报告上面的单号是什么? | SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH ... | css |
CREATE TABLE table_name_68 (
away_team VARCHAR,
tie_no VARCHAR
) | What is the Away team of Tie no 1? | SELECT away_team FROM table_name_68 WHERE tie_no = "1" | sql_create_context |
CREATE TABLE table_24568 (
"Country" text,
"% of imports from Russia" text,
"% cut" text,
"Diversification" text,
"Gas storage" text,
"Alternative fuel" text
) | What country had a 100% cut? | SELECT "Country" FROM table_24568 WHERE "% cut" = '100%' | wikisql |
CREATE TABLE table_27469019_2 (
status VARCHAR,
television_channel VARCHAR
) | What was the status of the series that was run by tv channel Mediacorp tv12 Suria? | SELECT status FROM table_27469019_2 WHERE television_channel = "MediaCorp TV12 Suria" | sql_create_context |
CREATE TABLE table_199666_1 (
chipset VARCHAR,
codename VARCHAR,
wireless_lan VARCHAR
) | How many series had the chipset of the Intel Centrino Ultimate-N 6300 wireless LAN with the codename Arrandale? | SELECT chipset FROM table_199666_1 WHERE codename = "Arrandale" AND wireless_lan = "Intel centrino Ultimate-N 6300" | sql_create_context |
CREATE TABLE table_46673 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real,
"Money ( $ )" text
) | Which player had a To par of 13? | SELECT "Player" FROM table_46673 WHERE "To par" = '13' | wikisql |
CREATE TABLE table_name_2 (
sspec_number VARCHAR,
part_number_s_ VARCHAR
) | what is the sspec number when the part number is cw8064701470802? | SELECT sspec_number FROM table_name_2 WHERE part_number_s_ = "cw8064701470802" | sql_create_context |
CREATE TABLE table_34266 (
"Team" text,
"Winners" text,
"Runners-Up" text,
"Third Place" text,
"Fourth Place" text
) | How many runners-up did Espartanos de Margarita have? | SELECT "Runners-Up" FROM table_34266 WHERE "Team" = 'espartanos de margarita' | wikisql |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswer... | Get the name of tags used in 2011. Query for luckydonald
http://stackoverflow.com/questions/34485255/get-each-tag-in-string-stackexchange-database?noredirect | SELECT DISTINCT TagName AS Tag FROM PostHistory JOIN Tags ON PostHistory.Text LIKE ('%<' + Tags.TagName + '>%') WHERE YEAR(CreationDate) = 2011 AND PostHistoryTypeId IN (3, 6, 9) | sede |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
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,
... | what's the name of the test that patient 87733 first had until 05/2104. | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 87733) AND STRFTIME('%y-%m', labevents.charttime) <= '2104-05' ORDER BY labevents.charttime LIMIT 1) | mimic_iii |
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... | 对应的患者姓名在门诊就诊中开出的检验报告单99312004581上是什么? | SELECT person_info.XM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND 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 mz... | css |
CREATE TABLE table_201_21 (
id number,
"year" number,
"title" text,
"role" text,
"notes" text
) | which role is the most common from all the titles ? | SELECT "role" FROM table_201_21 GROUP BY "role" ORDER BY COUNT(*) DESC LIMIT 1 | squall |
CREATE TABLE files (
f_id number,
artist_name text,
file_size text,
duration text,
formats text
)
CREATE TABLE song (
song_name text,
artist_name text,
country text,
f_id number,
genre_is text,
rating number,
languages text,
releasedate time,
resolution number
)
... | What are the names of the songs that have a lower rating than at least one blues song? | SELECT song_name FROM song WHERE rating < (SELECT MAX(rating) FROM song WHERE genre_is = "blues") | spider |
CREATE TABLE table_name_29 (
draws INTEGER,
points VARCHAR,
wins VARCHAR
) | What was the biggest draws, for wins under 4, and points of 20-18? | SELECT MAX(draws) FROM table_name_29 WHERE points = "20-18" AND wins < 4 | sql_create_context |
CREATE TABLE table_25965003_3 (
access_using_a_croatian_identity_card VARCHAR,
countries_and_territories VARCHAR
) | Can one access the Faroe Islands using a Croatian identity card? | SELECT access_using_a_croatian_identity_card FROM table_25965003_3 WHERE countries_and_territories = "Faroe Islands" | sql_create_context |
CREATE TABLE table_name_33 (
uk_chart VARCHAR,
artist VARCHAR,
year VARCHAR,
at_eurovision VARCHAR
) | Where did the song by Michael Ball, which placed 2nd in Eurovision prior to 1961, place on the UK charts? | SELECT uk_chart FROM table_name_33 WHERE year > 1961 AND at_eurovision = "2nd" AND artist = "michael ball" | sql_create_context |
CREATE TABLE table_21252 (
"Pos" text,
"No" real,
"Driver" text,
"Constructor" text,
"Q1 order" real,
"Q1 time" text,
"Q1 pos" real,
"Q1+Q2 time" text
) | How many Q1 figures are given for Alexander Wurz? | SELECT COUNT("Q1 order") FROM table_21252 WHERE "Driver" = 'Alexander Wurz' | wikisql |
CREATE TABLE table_36184 (
"Games" real,
"Drawn" real,
"Lost" real,
"Points difference" text,
"Points" real
) | How many losses have draw values under 1? | SELECT COUNT("Lost") FROM table_36184 WHERE "Drawn" < '1' | wikisql |
CREATE TABLE table_64975 (
"Governor" text,
"Took office" text,
"Left office" text,
"Party" text,
"Lieutenant Governor" text,
"Terms" text
) | Which governor had William Henry Ashley as lieutenant governor? | SELECT "Governor" FROM table_64975 WHERE "Lieutenant Governor" = 'william henry ashley' | wikisql |
CREATE TABLE table_30546 (
"#" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Winnings ($)" real,
"After" real,
"Before" real
) | What is the before for the score of 63-67-66-71=267? | SELECT MIN("Before") FROM table_30546 WHERE "Score" = '63-67-66-71=267' | wikisql |
CREATE TABLE table_24883 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
) | How many episodes in the series are from season 12? | SELECT "No. in series" FROM table_24883 WHERE "No. in season" = '12' | wikisql |
CREATE TABLE table_35577 (
"Date" text,
"Territory" text,
"Screens" real,
"Rank" real,
"Gross" text
) | What is the territory with 17 screens? | SELECT "Territory" FROM table_35577 WHERE "Screens" = '17' | wikisql |
CREATE TABLE table_77002 (
"Draw" real,
"Language" text,
"Artist" text,
"Song" text,
"English translation" text,
"Place" real,
"Points" real
) | what is the english translation when the Language is english, Draw is smaller than 16, and the Artist is aysel and arash? | SELECT "English translation" FROM table_77002 WHERE "Language" = 'english' AND "Draw" < '16' AND "Artist" = 'aysel and arash' | wikisql |
CREATE TABLE table_name_35 (
position VARCHAR,
player VARCHAR
) | Which Position has a Player of patrick macdonald? | SELECT position FROM table_name_35 WHERE player = "patrick macdonald" | sql_create_context |
CREATE TABLE table_59312 (
"Position" real,
"Club" text,
"Played" real,
"Points" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
) | What was the low number of draws for Levante Ud when their goal difference was smaller than 6? | SELECT MIN("Draws") FROM table_59312 WHERE "Club" = 'levante ud' AND "Goal Difference" < '6' | wikisql |
CREATE TABLE table_name_47 (
week_3 VARCHAR,
week_1 VARCHAR
) | Who is week 3 if week 1 is Amanda Batt? | SELECT week_3 FROM table_name_47 WHERE week_1 = "amanda batt" | sql_create_context |
CREATE TABLE table_69141 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | When did the Chiefs have their first bye? | SELECT MIN("Week") FROM table_69141 WHERE "Attendance" = 'bye' | wikisql |
CREATE TABLE table_name_79 (
lane INTEGER,
name VARCHAR,
rank VARCHAR
) | What lane did Bronte Barratt, who had a rank larger than 4, swim in? | SELECT AVG(lane) FROM table_name_79 WHERE name = "bronte barratt" AND rank > 4 | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9cod... | whats the name of the organism found in the last blood, venipuncture test of patient 031-3355 in this month? | SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355')) AND microlab.culturesite = 'blood, venipuncture' AND DATETIME... | eicu |
CREATE TABLE table_40368 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the largest silver value associated with 0 golds? | SELECT MAX("Silver") FROM table_40368 WHERE "Gold" < '0' | wikisql |
CREATE TABLE table_2387461_1 (
games_played VARCHAR,
points_per_game VARCHAR
) | How many games played have 4.7 points per game? | SELECT COUNT(games_played) FROM table_2387461_1 WHERE points_per_game = "4.7" | sql_create_context |
CREATE TABLE table_13925 (
"SEASON" text,
"TEAM" text,
"LEAGUE" text,
"GAMES" text,
"GOALS" text
) | What season has a Games listed of 10? | SELECT "SEASON" FROM table_13925 WHERE "GAMES" = '10' | wikisql |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownV... | new javascript frameworks, Questions per month. How do Scala web frameworks compare to each other?
I'm restricting the questions to those tagged Scala, to avoid polluting Playframework's result. It might be unfair, but I can't think of any other way to do it. At least all frameworks are being equally discriminated a... | SELECT *, COUNT(*) FROM (SELECT DATE(CAST(TIME_TO_STR(CreationDate, '%Y') AS TEXT) + '-' + CAST(TIME_TO_STR(CreationDate, '%m') AS TEXT) + '-01') AS Month, t.TagName FROM (SELECT p.Id, p.CreationDate FROM Posts AS p JOIN PostTags AS pt ON pt.PostId = p.Id JOIN Tags AS t ON t.Id = pt.TagId) AS pp JOIN PostTags AS pt ON ... | sede |
CREATE TABLE weather (
date TEXT,
max_temperature_f INTEGER,
mean_temperature_f INTEGER,
min_temperature_f INTEGER,
max_dew_point_f INTEGER,
mean_dew_point_f INTEGER,
min_dew_point_f INTEGER,
max_humidity INTEGER,
mean_humidity INTEGER,
min_humidity INTEGER,
max_sea_level_pre... | Give me the number of the dates when the max temperature was higher than 85, and display from low to high by the Y. | SELECT date, COUNT(date) FROM weather WHERE max_temperature_f > 85 ORDER BY COUNT(date) | nvbench |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | how many patients whose insurance is medicaid and diagnoses short title is k. pneumoniae pneumonia? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Medicaid" AND diagnoses.short_title = "K. pneumoniae pneumonia" | mimicsql_data |
CREATE TABLE table_203_510 (
id number,
"township" text,
"fips" number,
"population\ncenter" text,
"population" number,
"population\ndensity\n(/mi2)" number,
"population\ndensity\n(/km2)" number,
"land area\n(mi2)" number,
"land area\n(km2)" number,
"water area\n(mi2)" number,
... | which township has the largest population ? | SELECT "township" FROM table_203_510 ORDER BY "population" DESC LIMIT 1 | squall |
CREATE TABLE table_name_9 (
pick__number INTEGER,
college VARCHAR
) | What is Colorado College's lowest pick number? | SELECT MIN(pick__number) FROM table_name_9 WHERE college = "colorado" | sql_create_context |
CREATE TABLE table_60876 (
"English Name" text,
"Simplified" text,
"Traditional" text,
"Pinyin" text,
"Area" text,
"Population" text,
"Density" text
) | What shows for traditional when the population was 44,803? | SELECT "Traditional" FROM table_60876 WHERE "Population" = '44,803' | wikisql |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 费用明细项目24644573890在医疗就诊56153578969中的处方号和处方流水号分别是多少? | SELECT t_kc22.PRESCRIPTION_CODE, t_kc22.PRESCRIPTION_ID FROM t_kc22 WHERE t_kc22.MED_EXP_DET_ID = '24644573890' | css |
CREATE TABLE table_2467150_2 (
cores VARCHAR,
tdp VARCHAR
) | What is every value for cores if TDP is 17 W? | SELECT cores FROM table_2467150_2 WHERE tdp = "17 W" | sql_create_context |
CREATE TABLE table_28884 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
) | Who were the candidates for election that had a result of a retired jacksonian gain? | SELECT "Candidates" FROM table_28884 WHERE "Result" = 'Retired Jacksonian gain' | wikisql |
CREATE TABLE table_75787 (
"Date" text,
"Time" text,
"Home" text,
"Away" text,
"Score" text,
"Ground" text
) | The Away High Park Demons was which Ground? | SELECT "Ground" FROM table_75787 WHERE "Away" = 'high park demons' | wikisql |
CREATE TABLE table_name_13 (
attendance INTEGER,
round VARCHAR,
venue VARCHAR
) | What was the lowest attendance in round r1 at H venue? | SELECT MIN(attendance) FROM table_name_13 WHERE round = "r1" AND venue = "h" | sql_create_context |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | 从00年5月9日到10年3月17日这段时间,褚静婉患者在医院就诊的次数一共是多少次? | SELECT (SELECT COUNT(*) FROM person_info JOIN hz_info JOIN mzjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND p... | 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 lab (
subject_id text,
hadm_id text,
... | count the number of patients whose discharge location is rehab/distinct part hosp and diagnoses short title is septic shock? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "REHAB/DISTINCT PART HOSP" AND diagnoses.short_title = "Septic shock" | mimicsql_data |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | count the number of patients whose admission location is clinic referral/premature and procedure icd9 code is 4233? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND procedures.icd9_code = "4233" | mimicsql_data |
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... | 医院6248314全部诊疗记录里参照科室编码的不同算算看统筹基金的花费比上医疗总费用的平均比值 | SELECT qtb.MED_ORG_DEPT_CD, AVG(t_kc24.OVE_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '6248314' GROUP BY qtb.MED_ORG_DEPT_CD UNION SELECT gyb.MED_ORG_DEPT_CD, AVG(t_kc24.OVE_PAY) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.MED_SER_ORG_... | css |
CREATE TABLE table_204_188 (
id number,
"rank" number,
"player" text,
"points" number,
"points defending" number,
"points won" number,
"new points" number,
"withdrew due to" text
) | how many total players withdrew from the 2010 french open tennis competition ? | SELECT COUNT("player") FROM table_204_188 | squall |
CREATE TABLE table_77995 (
"Round" text,
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text
) | What is the Opponent with a Round with 3, and a Venue of home? | SELECT "Opponent" FROM table_77995 WHERE "Round" = '3' AND "Venue" = 'home' | wikisql |
CREATE TABLE table_34194 (
"Club" text,
"Nickname" text,
"Years in Competition" text,
"No. of Premierships" real,
"Premiership Years" text
) | What was the Premiership Years that had in the Competition of 1983-1992? | SELECT "Premiership Years" FROM table_34194 WHERE "Years in Competition" = '1983-1992' | wikisql |
CREATE TABLE table_71460 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) | What Region is the MHCL-20004 Catalog? | SELECT "Region" FROM table_71460 WHERE "Catalog" = 'mhcl-20004' | wikisql |
CREATE TABLE table_name_10 (
position VARCHAR,
height VARCHAR,
home_town VARCHAR
) | What position does the 5-8 player from Grottoes, VA play? | SELECT position FROM table_name_10 WHERE height = "5-8" AND home_town = "grottoes, va" | sql_create_context |
CREATE TABLE table_41551 (
"Headphone Model" text,
"Headphone Class" text,
"Sensitivity (dB)" text,
"Impedance (Ohms)" real,
"Driver-matched dB" text,
"Construction" text,
"Earpads" text,
"Termination" text,
"Succeeded by" text
) | What is the headphone model which was succeeded by sr325? | SELECT "Headphone Model" FROM table_41551 WHERE "Succeeded by" = 'sr325' | wikisql |
CREATE TABLE table_name_11 (
rider VARCHAR,
laps VARCHAR,
grid VARCHAR
) | What rider went under 22 laps with grid number 2? | SELECT rider FROM table_name_11 WHERE laps < 22 AND grid = 2 | sql_create_context |
CREATE TABLE activity (
actid number,
activity_name text
)
CREATE TABLE faculty (
facid number,
lname text,
fname text,
rank text,
sex text,
phone number,
room text,
building text
)
CREATE TABLE faculty_participates_in (
facid number,
actid number
)
CREATE TABLE partic... | What is the first and last name of the student participating in the most activities? | SELECT T1.fname, T1.lname FROM student AS T1 JOIN participates_in AS T2 ON T1.stuid = T2.stuid GROUP BY T1.stuid ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_1130632_1 (
title VARCHAR,
us_viewers__million_ VARCHAR
) | Which titles have 18.73 u.s. viewers. | SELECT title FROM table_1130632_1 WHERE us_viewers__million_ = "18.73" | sql_create_context |
CREATE TABLE table_14181578_1 (
goals_for_against VARCHAR,
w_l_d VARCHAR
) | what's the goals for/against with w-l-d being 3-1-1 | SELECT goals_for_against FROM table_14181578_1 WHERE w_l_d = "3-1-1" | sql_create_context |
CREATE TABLE table_name_5 (
best VARCHAR,
qual_2 VARCHAR
) | What is the best when the qual 2 is 1:47.042? | SELECT best FROM table_name_5 WHERE qual_2 = "1:47.042" | 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 diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE... | what are the new prescriptions of patient 30826 today compared to what they were yesterday? | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30826) AND DATETIME(prescriptions.startdate, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT prescriptions.drug FROM prescriptions WHERE... | mimic_iii |
CREATE TABLE table_name_93 (
player VARCHAR,
country VARCHAR,
score VARCHAR
) | who is the player when the country is united states and the score is 71-73=144? | SELECT player FROM table_name_93 WHERE country = "united states" AND score = 71 - 73 = 144 | 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... | 患者华红豆自二零一七年十二月二日开始,截止到二零二零年二月十六日,由哪几位医务人员为其检测游离β-绒毛膜促性腺激素的,查查这些医务人员的工号及姓名 | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzj... | css |
CREATE TABLE table_name_79 (
opponent VARCHAR,
score VARCHAR
) | Which opponent has a score of 84-88 (ot)? | SELECT opponent FROM table_name_79 WHERE score = "84-88 (ot)" | sql_create_context |
CREATE TABLE table_13235 (
"Rider" text,
"Bike" text,
"Laps" real,
"Time" text,
"Grid" real
) | What is the sum of laps of the honda cbr1000rr bike, which has a time of +16.569? | SELECT SUM("Laps") FROM table_13235 WHERE "Bike" = 'honda cbr1000rr' AND "Time" = '+16.569' | wikisql |
CREATE TABLE table_66244 (
"Debut year" real,
"Player" text,
"Games" real,
"Goals" real,
"Years at club" text
) | Which Games have Years at club of 1977, and Goals of 17, and a Debut year smaller than 1977? | SELECT AVG("Games") FROM table_66244 WHERE "Years at club" = '1977' AND "Goals" = '17' AND "Debut year" < '1977' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid num... | did patient 031-4987 have the results of the microbiological tests during a month before? | SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-4987')) AND DATETIME(microlab.culturetakentime, 'start of month') = DATETI... | eicu |
CREATE TABLE table_26764 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"U.S. viewers (million)" text,
"Original air date" text,
"Production code" text
) | What episode number in the series had 2.77 million U.S. viewers? | SELECT MAX("No. in series") FROM table_26764 WHERE "U.S. viewers (million)" = '2.77' | wikisql |
CREATE TABLE table_203_5 (
id number,
"season" text,
"competition" text,
"round" text,
"opponent" text,
"home" text,
"away" text,
"aggregate" text
) | what was the last competition they took place in ? | SELECT "competition" FROM table_203_5 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE table_name_69 (
away VARCHAR,
season VARCHAR,
opponent VARCHAR
) | Which Away has a Season of 2001 02, and an Opponent of dinaburg? | SELECT away FROM table_name_69 WHERE season = "2001–02" AND opponent = "dinaburg" | sql_create_context |
CREATE TABLE table_57925 (
"Release format" text,
"Country" text,
"Label(s)" text,
"Cat. no." text,
"Release date" text
) | What is the cat no for the label mute and the standard cd format? | SELECT "Cat. no." FROM table_57925 WHERE "Label(s)" = 'mute' AND "Release format" = 'standard cd' | 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 year of death is less than or equal to 2138 and diagnoses long title is acute on chronic systolic heart failure? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dod_year <= "2138.0" AND diagnoses.long_title = "Acute on chronic systolic heart failure" | mimicsql_data |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE ground... | i would like to fly from DALLAS to DENVER on the morning of 8 27 leaving at 650 | 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 ((date_day.day_number = 27 AND date_day.month_number = 8 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time... | atis |
CREATE TABLE table_16028459_2 (
bills_points VARCHAR,
opponents VARCHAR
) | How many points did the bills score when their opponent had 14 | SELECT bills_points FROM table_16028459_2 WHERE opponents = 14 | sql_create_context |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test... | What is 320 's size ? | SELECT DISTINCT num_enrolled FROM course WHERE department = 'EECS' AND number = 320 | advising |
CREATE TABLE table_75862 (
"Round #" real,
"Pick #" text,
"Player" text,
"Position" text,
"College" text
) | What is the College with a Round # that is 290? | SELECT "College" FROM table_75862 WHERE "Round #" = '290' | wikisql |
CREATE TABLE table_31278 (
"Rank" real,
"English title" text,
"Chinese title" text,
"Average" real,
"Peak" real,
"Premiere" real,
"Finale" real,
"HK viewers" text
) | what is the number of the premiere for the 34 peak | SELECT "Premiere" FROM table_31278 WHERE "Peak" = '34' | 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... | give the number of patients whose admission type is urgent and primary disease is pneumonia. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.diagnosis = "PNEUMONIA" | mimicsql_data |
CREATE TABLE Allergy_type (
allergy VARCHAR,
allergytype VARCHAR
)
CREATE TABLE Has_allergy (
allergy VARCHAR
) | How many students have a food allergy? | SELECT COUNT(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy WHERE T2.allergytype = "food" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | what is the number of patients whose religion is christian scientist and admission year is less than 2190? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.religion = "CHRISTIAN SCIENTIST" AND demographic.admityear < "2190" | mimicsql_data |
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 demographic (
subject_id text,
hadm_id t... | what is the subject name and death status of subject id 2560? | SELECT demographic.name, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE table_18963843_1 (
_percentage_asian_american VARCHAR,
indian_american_population__2010_ VARCHAR
) | Name the % asian american for 23526 | SELECT _percentage_asian_american FROM table_18963843_1 WHERE indian_american_population__2010_ = 23526 | sql_create_context |
CREATE TABLE table_16441 (
"Interregnum began" text,
"Interregnum ended" text,
"Duration" text,
"Count Palatine of Saxony" text,
"Count Palatine of the Rhine" text
) | What is the number of interregnum for duration 3 months, 6 days? | SELECT COUNT("Interregnum ended") FROM table_16441 WHERE "Duration" = '3 months, 6 days' | wikisql |
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
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 INTEGE... | What are the average ages for male and female students Plot them as bar chart, display by the y-axis in descending. | SELECT Sex, AVG(Age) FROM Student GROUP BY Sex ORDER BY AVG(Age) DESC | nvbench |
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 demographic (
subject_id text,
hadm_id t... | provide the number of patients whose drug type is additive. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug_type = "ADDITIVE" | mimicsql_data |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | For those employees who did not have any job in the past, show me about the distribution of hire_date and the sum of department_id bin hire_date by time in a bar chart, and I want to display from high to low by the y-axis. | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(DEPARTMENT_ID) DESC | nvbench |
CREATE TABLE table_30979 (
"Season no." real,
"Series no." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real,
"U.S. viewers (millions)" text
) | What is the number in season of the episode titled 'Cadaver'? | SELECT "Season no." FROM table_30979 WHERE "Title" = 'Cadaver' | wikisql |
CREATE TABLE table_178408_1 (
location_of_the_church VARCHAR,
church_name VARCHAR
) | Name the location of the church for berle kyrkje | SELECT location_of_the_church FROM table_178408_1 WHERE church_name = "Berle kyrkje" | sql_create_context |
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 prescriptions... | what is the number of patients whose days of hospital stay is greater than 11 and lab test name is alveolar-arterial gradient? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "11" AND lab.label = "Alveolar-arterial Gradient" | mimicsql_data |
CREATE TABLE table_36076 (
"Series Ep." text,
"Episode" real,
"Netflix" text,
"Segment A" text,
"Segment B" text,
"Segment C" text,
"Segment D" text
) | Which segment A item that has a Segment D of wigs? | SELECT "Segment A" FROM table_36076 WHERE "Segment D" = 'wigs' | wikisql |
CREATE TABLE table_name_66 (
attendance VARCHAR,
date VARCHAR
) | How many people were at the match on July 13/ | SELECT attendance FROM table_name_66 WHERE date = "july 13" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.