context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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... | 从10年4月9日到2014年5月5之中以内邹学博患者的医保金额一共花了多少? | SELECT SUM(t_kc24.PER_ACC_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '邹学博' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2010-04-09' AND '2014-05-05' | css |
CREATE TABLE table_26593762_3 (
position_in_table VARCHAR,
outgoing_manager VARCHAR
) | What was the table position for the team whose outgoing manager was Brian Laws? | SELECT position_in_table FROM table_26593762_3 WHERE outgoing_manager = "Brian Laws" | sql_create_context |
CREATE TABLE table_76266 (
"Governorate" text,
"Capital City" text,
"Area km\u00b2" real,
"Pop (2004)" real,
"Map Key" real
) | Name the amount of Map Key which has a Pop (2004) smaller than 433,819, and a Capital City of hajjah, and an Area km smaller than 9,376? Question 1 | SELECT AVG("Map Key") FROM table_76266 WHERE "Pop (2004)" < '433,819' AND "Capital City" = 'hajjah' AND "Area km\u00b2" < '9,376' | wikisql |
CREATE TABLE table_12886178_4 (
tries_against VARCHAR,
tries_for VARCHAR
) | What was the tries against count for the club whose tries for count was 29? | SELECT tries_against FROM table_12886178_4 WHERE tries_for = "29" | sql_create_context |
CREATE TABLE table_272865_20 (
years_active VARCHAR,
asian_cup_played_as_a_captain VARCHAR
) | What were the years active where Asian Cup played as a captain is Iran 1976? | SELECT years_active FROM table_272865_20 WHERE asian_cup_played_as_a_captain = "Iran 1976" | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | provide the number of patients whose ethnicity is hispanic or latino and drug type is main? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE table_name_40 (
muzzle_energy VARCHAR,
max_pressure VARCHAR
) | What is the muzzle energy with 40,000 psi max pressure? | SELECT muzzle_energy FROM table_name_40 WHERE max_pressure = "40,000 psi" | sql_create_context |
CREATE TABLE table_50896 (
"Race Title" text,
"Circuit" text,
"City / State" text,
"Date" text,
"Winner" text,
"Team" text
) | Which city or state contains Calder Park Raceway? | SELECT "City / State" FROM table_50896 WHERE "Circuit" = 'calder park raceway' | wikisql |
CREATE TABLE table_name_99 (
engine VARCHAR,
entrant VARCHAR,
chassis VARCHAR
) | Which engine did Marlboro Team Alfa Romeo used with a chassis of alfa romeo 179? | SELECT engine FROM table_name_99 WHERE entrant = "marlboro team alfa romeo" AND chassis = "alfa romeo 179" | sql_create_context |
CREATE TABLE table_65504 (
"President" text,
"Schl. 1948" text,
"Schl. 1962" text,
"M-B 1982" text,
"CT 1982" text,
"Siena 1982" text,
"Siena 1990" text,
"Siena 1994" text,
"R-McI 1996" text,
"Schl. 1996" text,
"C-SPAN 1999" text,
"WSJ 2000" text,
"Siena 2002" text,
... | what is c-span 2009 when times 2008** is 08? | SELECT "C-SPAN 2009" FROM table_65504 WHERE "Times 2008**" = '08' | wikisql |
CREATE TABLE table_2886617_3 (
pick VARCHAR,
nationality VARCHAR,
player VARCHAR
) | How many picks have canada as the nationality and larry courville is the player? | SELECT COUNT(pick) FROM table_2886617_3 WHERE nationality = "Canada" AND player = "Larry Courville" | sql_create_context |
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,
... | how many black/cape verdean patients are below 24 years of age? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.age < "24" | mimicsql_data |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instruc... | Can you tell me how many credits I have so far ? | SELECT DISTINCT total_credit FROM student WHERE student_id = 1 | advising |
CREATE TABLE table_name_67 (
state VARCHAR,
net_contribution_per_capita VARCHAR
) | What state has a Net contribution per capita of $-171? | SELECT state FROM table_name_67 WHERE net_contribution_per_capita = "$-171" | sql_create_context |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE patient (
uniquep... | what is the last time patient 031-23605 had the microbiology test when they came to the hospital first time? | SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23605' AND NOT patient.hospitaldischargetime IS NULL ORDER BY... | eicu |
CREATE TABLE table_name_11 (
knots VARCHAR,
ship VARCHAR,
passengers VARCHAR
) | How many knots did the Ms Moby Vincent have when passengers was less than 1.6? | SELECT COUNT(knots) FROM table_name_11 WHERE ship = "ms moby vincent" AND passengers < 1.6 | sql_create_context |
CREATE TABLE table_9670 (
"Team" text,
"Average" real,
"Points" real,
"Played" real,
"1992-93" text,
"1993-94" text,
"1994-1995" real
) | What is the lowest 1994-1995, when Points is 145, and when Played is less than 114? | SELECT MIN("1994-1995") FROM table_9670 WHERE "Points" = '145' AND "Played" < '114' | wikisql |
CREATE TABLE table_24330 (
"Season" real,
"Episode" real,
"Episode Summary" text,
"Premier date" text,
"External Link" text,
"Coach" text
) | Name the season for august 16, 2010 | SELECT "Season" FROM table_24330 WHERE "Premier date" = 'August 16, 2010' | wikisql |
CREATE TABLE table_46618 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" text
) | How many ties occurred with a score of 2 2? | SELECT "Tie no" FROM table_46618 WHERE "Score" = '2–2' | wikisql |
CREATE TABLE table_name_45 (
venue VARCHAR,
date VARCHAR
) | What is the venue of the match on 5 April 2000? | SELECT venue FROM table_name_45 WHERE date = "5 april 2000" | sql_create_context |
CREATE TABLE table_47247 (
"Game" real,
"Date" text,
"Score" text,
"Location" text,
"Time" text,
"Attendance" real
) | What date did a game have a time of 3:44? | SELECT "Date" FROM table_47247 WHERE "Time" = '3:44' | wikisql |
CREATE TABLE table_39364 (
"Date" text,
"Opponents" text,
"H / A" text,
"Result F \u2013 A" text,
"Attendance" real
) | When is The Opponents of lincoln city and a H / A of a? | SELECT "Date" FROM table_39364 WHERE "Opponents" = 'lincoln city' AND "H / A" = 'a' | wikisql |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Na... | Posts count for all tags. | SELECT TagName, COUNT(*) AS cnt FROM (SELECT p.Id, T.TagName FROM Posts AS p INNER JOIN PostTags AS pt ON pt.PostId = p.Id INNER JOIN Tags AS t ON t.Id = pt.TagId) AS t1 GROUP BY TagName ORDER BY cnt DESC | sede |
CREATE TABLE table_55492 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | Tell me the time/retired for riccardo patrese | SELECT "Time/Retired" FROM table_55492 WHERE "Driver" = 'riccardo patrese' | wikisql |
CREATE TABLE table_name_77 (
main_use VARCHAR,
year VARCHAR,
town VARCHAR
) | What is the main use of the structure that was in redfield, arkansas before 2004? | SELECT main_use FROM table_name_77 WHERE year < 2004 AND town = "redfield, arkansas" | sql_create_context |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
... | what were the number of times patient 4469 produced a right jp output during their last hospital encounter? | SELECT COUNT(*) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4469 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)) AND outputevents.itemid I... | mimic_iii |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid... | what were the top five most common diagnoses that patients were diagnosed during the same month after receiving intraaortic balloon pump removal until 2104? | 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 = 'intraaortic balloon pump removal' AND ST... | eicu |
CREATE TABLE table_11702 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | When did the home team score 12.17 (89)? | SELECT "Date" FROM table_11702 WHERE "Home team score" = '12.17 (89)' | wikisql |
CREATE TABLE table_60691 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To Par" real
) | Which Player has a To Par smaller than 5, and a Score of 70-72=142? | SELECT "Player" FROM table_60691 WHERE "To Par" < '5' AND "Score" = '70-72=142' | wikisql |
CREATE TABLE table_19948664_2 (
index__year_ VARCHAR,
world_ranking__1_ VARCHAR
) | How many years were recorded when world ranking was 21st? | SELECT COUNT(index__year_) FROM table_19948664_2 WHERE world_ranking__1_ = "21st" | sql_create_context |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE offering_instructor (
... | Are there Buddhism courses that have no prerequisites ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id WHERE (area.area LIKE '%Buddhism%' OR course.description LIKE '%Buddhism%' OR course.name LIKE '%Buddhism%') AND course.enforced_requirement = 'N / A' | advising |
CREATE TABLE movie (
mid number,
title text,
year number,
director text
)
CREATE TABLE rating (
rid number,
mid number,
stars number,
ratingdate time
)
CREATE TABLE reviewer (
rid number,
name text
) | What are the ids of the movies that are not reviewed by Brittany Harris. | SELECT mid FROM rating EXCEPT SELECT T1.mid FROM rating AS T1 JOIN reviewer AS T2 ON T1.rid = T2.rid WHERE T2.name = "Brittany Harris" | spider |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
Rejection... | ELT Informatica Oracle in Moscow - Data Sience. | WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", u.Id AS "user_link", u.Reputation 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 = p.Own... | sede |
CREATE TABLE table_39752 (
"Office" text,
"Democratic ticket" text,
"Republican ticket" text,
"Socialist ticket" text,
"Workers ticket" text
) | What is the name on the Democratic ticket when the Workers ticket is james p. cannon? | SELECT "Democratic ticket" FROM table_39752 WHERE "Workers ticket" = 'james p. cannon' | wikisql |
CREATE TABLE table_204_642 (
id number,
"team" text,
"domestic tournament" text,
"position" text,
"appearance" text,
"qualified" text
) | which teams were the last to qualify ? | SELECT "team" FROM table_204_642 WHERE "qualified" = (SELECT MAX("qualified") FROM table_204_642) | squall |
CREATE TABLE table_203_872 (
id number,
"year" number,
"location(s)" text,
"number of contestants" number,
"ladies winner" text,
"men's winner" text
) | who was the first winner men 's winner , in 1965 ? | SELECT "men's winner" FROM table_203_872 WHERE "year" = 1965 | squall |
CREATE TABLE table_73479 (
"Player" text,
"Games Played" real,
"Minutes" real,
"Field Goals" real,
"Three Pointers" real,
"Free Throws" real,
"Rebounds" real,
"Assists" real,
"Blocks" real,
"Steals" real,
"Points" real
) | What is the lowest number of 3 pointers that occured in games with 52 steals? | SELECT MIN("Three Pointers") FROM table_73479 WHERE "Steals" = '52' | wikisql |
CREATE TABLE table_61302 (
"Opposing Teams" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
) | Which venue has more than 9 against and a status of second test? | SELECT "Venue" FROM table_61302 WHERE "Against" > '9' AND "Status" = 'second test' | 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... | 在医院2045056中的病人75810879出院时确诊疾病名字包含皮炎的医疗就诊记录编号是几号? | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '75810879' AND t_kc21.MED_SER_ORG_NO = '2045056' AND t_kc21.OUT_DIAG_DIS_NM LIKE '%皮炎%' | css |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREA... | for patients who were given alpha/beta blocker since 4 years ago, what are the top three most common lab tests that followed within 2 months? | SELECT t3.labname FROM (SELECT t2.labname, 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 = 'alpha/beta blocker' AND DATETIME(treatment.treatment... | eicu |
CREATE TABLE table_52650 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Where did Hawthorn have their away match against North Melbourne? | SELECT "Venue" FROM table_52650 WHERE "Away team" = 'hawthorn' | wikisql |
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,
... | 列出病患杨凌霜入院科室名称包含骨肿瘤在医院7646173中的住院就诊记录是那几个? | SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '杨凌霜' AND hz_info.YLJGDM = '7646173' AND zyjzjlb.JZKSMC LIKE '%骨肿瘤%' | css |
CREATE TABLE table_name_51 (
year INTEGER,
result VARCHAR
) | What was the earliest year that the result 21-17? | SELECT MIN(year) FROM table_name_51 WHERE result = "21-17" | sql_create_context |
CREATE TABLE sqlite_sequence (
name text,
seq text
)
CREATE TABLE country (
id number,
name text
)
CREATE TABLE player_attributes (
id number,
player_fifa_api_id number,
player_api_id number,
date text,
overall_rating number,
potential number,
preferred_foot text,
attac... | List the names and birthdays of the top five players in terms of potential. | SELECT DISTINCT T1.player_name, T1.birthday FROM player AS T1 JOIN player_attributes AS T2 ON T1.player_api_id = T2.player_api_id ORDER BY potential DESC LIMIT 5 | spider |
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE field (
fieldid int... | papers with more than 10 citations | SELECT DISTINCT cite.citingpaperid FROM cite, paper WHERE paper.paperid = cite.citedpaperid GROUP BY cite.citingpaperid HAVING COUNT(DISTINCT cite.citedpaperid) > 10 | scholar |
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... | 云鸿光这位团伙成员最常开的药品的排序看一下 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '云鸿光' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC | css |
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,... | 按照科室编码和出院诊断的差异算算医院7124001所有就诊记录中病人的年龄平均数 | SELECT MED_ORG_DEPT_CD, OUT_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '7124001' GROUP BY MED_ORG_DEPT_CD, OUT_DIAG_DIS_NM | css |
CREATE TABLE table_3227 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | What CFL team got their draft pick from North Dakota? | SELECT "CFL Team" FROM table_3227 WHERE "College" = 'North Dakota' | wikisql |
CREATE TABLE table_46683 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
) | What is Opponents, when Partner is Mervana Jugi -Salki ? | SELECT "Opponents" FROM table_46683 WHERE "Partner" = 'mervana jugić-salkić' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | provide the number of patients whose age is less than 31 and procedure long title is insertion of endotracheal tube? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "31" AND procedures.long_title = "Insertion of endotracheal tube" | mimicsql_data |
CREATE TABLE table_name_30 (
opponent VARCHAR,
result VARCHAR,
date VARCHAR
) | Which Opponent has a Result of 1 1, and a Date of 28 november 1998? | SELECT opponent FROM table_name_30 WHERE result = "1–1" AND date = "28 november 1998" | sql_create_context |
CREATE TABLE table_56528 (
"Year" text,
"Starts" real,
"Cuts made" real,
"Wins" real,
"Top 10" real,
"Top 25" real,
"Earnings ($)" real,
"Money list rank" text
) | What year has a Top 25 of 0, and a Earnings ($) larger than 0? | SELECT "Year" FROM table_56528 WHERE "Top 25" = '0' AND "Earnings ($)" > '0' | wikisql |
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... | 93948131621这个医疗就诊中,把姓苗的医师开具的所有药品列出来 | SELECT SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '93948131621' AND HOSP_DOC_NM LIKE '苗%' | css |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostHistory (
Id number,
... | Find off topic minecraft quesitons. Get all the off topic closed minecraft questions | SELECT Id AS "post_link", Title AS "post_title", Body AS "post_body", Score AS "vote_count" FROM Posts WHERE NOT ClosedDate IS NULL AND Title LIKE '%minecraft%' AND Score < 0 | sede |
CREATE TABLE table_23248967_10 (
score VARCHAR,
date VARCHAR
) | What is the final score of the game on April 9? | SELECT score FROM table_23248967_10 WHERE date = "April 9" | sql_create_context |
CREATE TABLE table_80036 (
"Country" text,
"Film title used in nomination" text,
"Language" text,
"Original name" text,
"Director" text
) | What is the title of the German film that is originally called Mama, Ich Lebe? | SELECT "Film title used in nomination" FROM table_80036 WHERE "Language" = 'german' AND "Original name" = 'mama, ich lebe' | wikisql |
CREATE TABLE table_32584 (
"Round" real,
"Overall" real,
"Player" text,
"Position" text,
"School/Club Team" text
) | What is the average overall rank of all players drafted from Duke after round 9? | SELECT AVG("Overall") FROM table_32584 WHERE "School/Club Team" = 'duke' AND "Round" > '9' | wikisql |
CREATE TABLE table_name_62 (
date VARCHAR,
time VARCHAR,
set_3 VARCHAR
) | Which Date has a Time of 11:00, and a Set 3 of 25 18? | SELECT date FROM table_name_62 WHERE time = "11:00" AND set_3 = "25–18" | sql_create_context |
CREATE TABLE course (
crs_code text,
dept_code text,
crs_description text,
crs_credit number
)
CREATE TABLE class (
class_code text,
crs_code text,
class_section text,
class_time text,
class_room text,
prof_num number
)
CREATE TABLE employee (
emp_num number,
emp_lname ... | How many students are enrolled in the class taught by some professor from the accounting department? | SELECT COUNT(*) FROM class AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN department AS T4 ON T3.dept_code = T4.dept_code WHERE T4.dept_name = 'Accounting' | spider |
CREATE TABLE table_25691838_6 (
the_wørd VARCHAR,
production_code VARCHAR
) | What was The Word for production code 6084? | SELECT the_wørd FROM table_25691838_6 WHERE production_code = 6084 | sql_create_context |
CREATE TABLE table_38997 (
"Jyutping" text,
"Character" text,
"Portuguese" text,
"Relative value" text,
"Metric value" text,
"Imperial value" text
) | what's the imperial that contains a jyutping of cin4? | SELECT "Imperial value" FROM table_38997 WHERE "Jyutping" = 'cin4' | wikisql |
CREATE TABLE table_204_383 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | how many total medals did china , japan , and south korea collect ? | SELECT SUM("total") FROM table_204_383 WHERE "nation" IN ('china', 'japan', 'south korea') | squall |
CREATE TABLE Order_Items (
order_item_id INTEGER,
product_id INTEGER,
order_id INTEGER,
order_item_status VARCHAR(10),
order_item_details VARCHAR(255)
)
CREATE TABLE Customers (
customer_id INTEGER,
customer_name VARCHAR(80),
customer_details VARCHAR(255)
)
CREATE TABLE Products (
... | What is the placement date of the order whose invoice number is 10, and count them by a line chart | SELECT date_order_placed, COUNT(date_order_placed) FROM Orders AS T1 JOIN Shipments AS T2 ON T1.order_id = T2.order_id WHERE T2.invoice_number = 10 | nvbench |
CREATE TABLE table_dev_19 (
"id" int,
"glucagon_stimulated_c_peptide" float,
"c_peptide_level" float,
"hemoglobin_a1c_hba1c" float,
"diabetic" string,
"hyperlipidemia" bool,
"creatinine_clearance_cl" float,
"total_cholesterol" int,
"stimulated_c_peptide" float,
"smoking" bool,
... | type i diabetes mellitus. documentation of negative basal and stimulated c _ peptide ( a basal level of < / = 0.2 ng / ml before iv administration of 1 mg of glucagon, and a glucagon stimulated c _ peptide < / = 0.8 ng / ml ) and diagnosis of diabetes for at least 5 years. | SELECT * FROM table_dev_19 WHERE diabetic = 'i' AND negative_basal = 1 AND stimulated_c_peptide = 1 OR (c_peptide_level < 0.2 AND glucagon_stimulated_c_peptide <= 0.8) AND diabetes = 1 | criteria2sql |
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... | Calculate the number of patients with t5 fracture as primary disease and icd9 code 8105 | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "T5 FRACTURE" AND procedures.icd9_code = "8105" | mimicsql_data |
CREATE TABLE table_name_49 (
stage VARCHAR,
trofeo_fast_team VARCHAR
) | What was the stage of team Once? | SELECT stage FROM table_name_49 WHERE trofeo_fast_team = "once" | sql_create_context |
CREATE TABLE table_56534 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | What is the result when the time was 5:00 and a record of 14-4? | SELECT "Res." FROM table_56534 WHERE "Time" = '5:00' AND "Record" = '14-4' | wikisql |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayNa... | Who voted for a post. | SELECT Votes.UserId AS "user_link", CASE WHEN Votes.VoteTypeId = 2 THEN 'Upvote' WHEN Votes.VoteTypeId = 3 THEN 'Downvote' END AS "type", Votes.CreationDate, Votes.VoteTypeId FROM Votes WHERE Votes.PostId = '##PostId##' | sede |
CREATE TABLE table_name_52 (
lost VARCHAR,
match_points VARCHAR
) | Which lost has 84 as the match points? | SELECT lost FROM table_name_52 WHERE match_points = "84" | sql_create_context |
CREATE TABLE table_60970 (
"Title" text,
"Developer" text,
"Category" text,
"Release date" text,
"Version" text
) | What Version has a Title of alarm clock? | SELECT "Version" FROM table_60970 WHERE "Title" = 'alarm clock' | wikisql |
CREATE TABLE table_31199 (
"Skip (Club)" text,
"W" real,
"L" real,
"PF" real,
"PA" real,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends" real,
"Stolen Ends" real
) | What is the highest L of the tournament? | SELECT MAX("L") FROM table_31199 | wikisql |
CREATE TABLE table_204_354 (
id number,
"opus" text,
"title" text,
"genre" text,
"sub\u00addivisions" text,
"libretto" text,
"composition" text,
"premiere date" text,
"place, theatre" text
) | what was the first opera composed in the 1900s ? | SELECT "title" FROM table_204_354 WHERE "composition" >= 1900 ORDER BY "composition" LIMIT 1 | squall |
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufac... | okay i need to get a flight from HOUSTON to SEATTLE | 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, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'HOUSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SEATTL... | atis |
CREATE TABLE table_1341843_19 (
district VARCHAR,
incumbent VARCHAR
) | What's the district that Otto Passman is the incumbent of? | SELECT district FROM table_1341843_19 WHERE incumbent = "Otto Passman" | sql_create_context |
CREATE TABLE table_name_74 (
date VARCHAR,
home_team VARCHAR
) | Name the date with a home team of melbourne | SELECT date FROM table_name_74 WHERE home_team = "melbourne" | sql_create_context |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE inputevents_cv (
... | how many patients have received opn rt hemicolectomy nec during the same hospital encounter after the first treatment of contrast arteriogram-leg since 4 years ago? | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_... | 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,
... | how many patienst speak cape language and were transfered within this facility? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "CAPE" AND demographic.admission_location = "TRSF WITHIN THIS FACILITY" | mimicsql_data |
CREATE TABLE table_24398 (
"District" text,
"Vacator" text,
"Reason for change" text,
"Successor" text,
"Date successor seated" text
) | When william b. campbell (u) is the successor what is the district? | SELECT "District" FROM table_24398 WHERE "Successor" = 'William B. Campbell (U)' | wikisql |
CREATE TABLE table_204_219 (
id number,
"date" text,
"time" text,
"opponent#" text,
"rank#" text,
"site" text,
"tv" text,
"result" text,
"attendance" number
) | number of points scored by miami -lrb- oh -rrb- against the broncos . | SELECT "result" FROM table_204_219 WHERE "opponent#" = 'miami (oh)' | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | what is diagnoses long title and procedure long title of subject id 92796? | SELECT diagnoses.long_title, procedures.long_title FROM diagnoses INNER JOIN procedures ON diagnoses.hadm_id = procedures.hadm_id WHERE diagnoses.subject_id = "92796" | mimicsql_data |
CREATE TABLE table_21629 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
) | Which seasons were directed by Nelson McCormick? | SELECT "Title" FROM table_21629 WHERE "Directed by" = 'Nelson McCormick' | wikisql |
CREATE TABLE table_2578 (
"No. in series" text,
"No. in season" text,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (millions)" text
) | How many million U.s. Viewers watched episode 12 in the season? | SELECT "U.S. viewers (millions)" FROM table_2578 WHERE "No. in season" = '12' | wikisql |
CREATE TABLE table_204_828 (
id number,
"whitworth size (in)" number,
"core diameter (in)" number,
"threads per inch" number,
"pitch (in)" number,
"tapping drill size" text
) | which whitworth size is the only one with 5 threads per inch ? | SELECT "whitworth size (in)" FROM table_204_828 WHERE "threads per inch" = 5 | squall |
CREATE TABLE table_name_94 (
votes INTEGER,
rank VARCHAR,
riding VARCHAR
) | what is the lowest votes of the candidate ranked 5th and riding in victoria? | SELECT MIN(votes) FROM table_name_94 WHERE rank = "5th" AND riding = "victoria" | sql_create_context |
CREATE TABLE bdmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | 在门诊诊断为患者牙列缺失的的检测指标492909数值的平均值以及最值分别是多少? | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE wdmzjzjlb.JZZDSM = '牙列缺失' AND jyjgzbb.JCZBDM = '492... | css |
CREATE TABLE table_name_24 (
average_ratings VARCHAR,
japanese_title VARCHAR
) | What are the average ratings for ? | SELECT average_ratings FROM table_name_24 WHERE japanese_title = "プリマダム" | sql_create_context |
CREATE TABLE table_21414 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
) | Who had the most points in game 4? | SELECT "High points" FROM table_21414 WHERE "Game" = '4' | wikisql |
CREATE TABLE jybgb_jyjgzbb (
JYZBLSH number,
YLJGDM text,
jyjgzbb_id number
)
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,
... | 看看编号16846879997的检验报告单是哪位审核人审核的,工号和姓名分别是什么 | SELECT jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.BGDH = '16846879997' | css |
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... | 算算记录82601093874里的医疗明细开销里药物单价和药物数目的乘积是否等于药物总价 | SELECT (SELECT QTY * UNIVALENT FROM t_kc22 WHERE MED_EXP_DET_ID = '82601093874') = (SELECT AMOUNT FROM t_kc22 WHERE MED_EXP_DET_ID = '82601093874') | css |
CREATE TABLE table_42350 (
"Race Title" text,
"Circuit" text,
"City / State" text,
"Date" text,
"Winner" text,
"Team" text
) | What race did Glenn Seton win on the Sandown International Raceway circuit? | SELECT "Race Title" FROM table_42350 WHERE "Winner" = 'glenn seton' AND "Circuit" = 'sandown international raceway' | wikisql |
CREATE TABLE table_70696 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
) | Which Authority is set for Hauturu School? | SELECT "Authority" FROM table_70696 WHERE "Name" = 'hauturu school' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | how many of the female patients had a lab test for mcv? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "F" AND lab.label = "MCV" | mimicsql_data |
CREATE TABLE table_name_43 (
ride_name VARCHAR,
manufacturer VARCHAR
) | What ride was manufactured by Zierer? | SELECT ride_name FROM table_name_43 WHERE manufacturer = "zierer" | sql_create_context |
CREATE TABLE table_56181 (
"NGC number" real,
"Object type" text,
"Constellation" text,
"Right ascension ( J2000 )" text,
"Declination ( J2000 )" text,
"Apparent magnitude" real
) | For an apparent magnitude greater than 11.8 what Right ascension value is assigned? | SELECT "Right ascension ( J2000 )" FROM table_56181 WHERE "Apparent magnitude" > '11.8' | 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... | find the number of patients admitted in emergency who had lab test named sodium, urine. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.label = "Sodium, Urine" | mimicsql_data |
CREATE TABLE table_name_16 (
color_commentator_s_ VARCHAR,
year VARCHAR
) | Who is the color commentator in 2008? | SELECT color_commentator_s_ FROM table_name_16 WHERE year = 2008 | sql_create_context |
CREATE TABLE table_59527 (
"Result" text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Location" text
) | What is the result of a round greater than 3? | SELECT "Result" FROM table_59527 WHERE "Round" > '3' | wikisql |
CREATE TABLE table_71318 (
"School" text,
"Location" text,
"Total" real,
"Crimean War" real,
"Persian War" real,
"Indian Mutiny" real,
"1860-1878" real,
"Zulu War" real,
"Second Afghan War" text
) | How many Persian Wars have a School of rashtriya indian military college, and an 1860-1878 smaller than 0? | SELECT COUNT("Persian War") FROM table_71318 WHERE "School" = 'rashtriya indian military college' AND "1860-1878" < '0' | wikisql |
CREATE TABLE table_23670057_1 (
position VARCHAR,
height__m_ VARCHAR
) | Name the position for 2.16 | SELECT position FROM table_23670057_1 WHERE height__m_ = "2.16" | sql_create_context |
CREATE TABLE table_name_30 (
week VARCHAR,
attendance VARCHAR
) | How many weeks had an Attendance of 43,272? | SELECT COUNT(week) FROM table_name_30 WHERE attendance = "43,272" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.