context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
... | Is ANTHRCUL 375 only offered in the Fall ? | SELECT COUNT(*) > 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'ANTHRCUL' AND course.number = 375 AND semester.semester <> 'Fall' | advising |
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... | Give me the comparison about School_ID over the ACC_Road , and group by attribute All_Home, could you display from high to low by the Y-axis? | SELECT ACC_Road, School_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY School_ID DESC | nvbench |
CREATE TABLE table_name_55 (
country VARCHAR,
notes VARCHAR,
time VARCHAR
) | What country has sa/b as the notes, and a time of 5:51.30? | SELECT country FROM table_name_55 WHERE notes = "sa/b" AND time = "5:51.30" | sql_create_context |
CREATE TABLE table_204_978 (
id number,
"position" number,
"nation" number,
"number" number,
"name" text,
"soproni liga" number,
"uefa cup" number,
"hungarian cup" number,
"league cup" number,
"total" number
) | how many goals does zolt n kiss have ? | SELECT "total" FROM table_204_978 WHERE "name" = 'zoltan kiss' | squall |
CREATE TABLE table_204_974 (
id number,
"season" number,
"level" text,
"division" text,
"section" text,
"administration" text,
"position" text,
"movements" text
) | how many times were they in tier 3 ? | SELECT COUNT(*) FROM table_204_974 WHERE "level" = 'tier 3' | squall |
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,
... | what is the number of patients whose admission type is emergency and procedure icd9 code is 331? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.icd9_code = "331" | mimicsql_data |
CREATE TABLE table_68321 (
"Name of Ship" text,
"Length" text,
"Max speed" text,
"Crew/Capacity" text,
"Class" text,
"Builder" text,
"Delivery" real
) | Who built the ship that is 42.8 m long and was delivered in 2007? | SELECT "Builder" FROM table_68321 WHERE "Length" = '42.8 m' AND "Delivery" = '2007' | wikisql |
CREATE TABLE table_name_89 (
to_par VARCHAR,
score VARCHAR
) | What is the To par of the Player with a Score of 73-67-68=208? | SELECT to_par FROM table_name_89 WHERE score = 73 - 67 - 68 = 208 | sql_create_context |
CREATE TABLE table_name_45 (
country VARCHAR,
format VARCHAR,
catalog VARCHAR
) | What country has CD format and catalog RCD 10523? | SELECT country FROM table_name_45 WHERE format = "cd" AND catalog = "rcd 10523" | sql_create_context |
CREATE TABLE table_78777 (
"Edition" text,
"Date" text,
"Winner" text,
"Country" text,
"Time ( h : m : s )" text
) | On what date was the 48th Edition raced? | SELECT "Date" FROM table_78777 WHERE "Edition" = '48th' | wikisql |
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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE T... | Compute the number of each type of job ids for employees who make more than the highest-earning employee with title PU_MAN, with a bar chart. | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE SALARY > (SELECT MAX(SALARY) FROM employees WHERE JOB_ID = 'PU_MAN') GROUP BY JOB_ID | nvbench |
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS varchar(20),
DEPT_EXTENSION varchar(4)
)
CREATE TABLE EMPLOYEE (
EMP_NUM int,
EMP_LNAME varchar(15),
EMP_FNAME varchar(12),
EMP_INITIAL varchar(1),
EMP_J... | Show the number of courses for each course description in a bar chart, and sort bar from low to high order please. | SELECT CRS_DESCRIPTION, COUNT(CRS_DESCRIPTION) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY CRS_DESCRIPTION ORDER BY CRS_DESCRIPTION | nvbench |
CREATE TABLE table_name_95 (
loss INTEGER,
name VARCHAR,
long VARCHAR
) | What is the lowest Loss for the player named total that has a long greater than 55? | SELECT MIN(loss) FROM table_name_95 WHERE name = "total" AND long > 55 | 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... | provide the number of patients whose admission type is emergency and diagnosis long title is chronic obstructive asthma, unspecified. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Chronic obstructive asthma, unspecified" | mimicsql_data |
CREATE TABLE teaches (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0)
)
CREATE TABLE advisor (
s_ID varchar(5),
i_ID varchar(5)
)
CREATE TABLE prereq (
course_id varchar(8),
prereq_id varchar(8)
)
CREATE TABLE takes (
ID varchar(... | Find the number of courses provided in each year with a group line chart that groups by semester. | SELECT year, COUNT(*) FROM section GROUP BY semester, year | nvbench |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 在医疗就诊52743423301中,列出开的药品名称中包含乳胶的药品及金额 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.AMOUNT FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '52743423301' AND t_kc22.SOC_SRT_DIRE_NM LIKE '%乳胶%' | css |
CREATE TABLE table_36510 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School/Club Team" text
) | How many Pick has a Round smaller than 13, and a Position of fullback? | SELECT COUNT("Pick") FROM table_36510 WHERE "Round" < '13' AND "Position" = 'fullback' | wikisql |
CREATE TABLE table_name_22 (
level VARCHAR,
domestic_cup VARCHAR
) | Which level is quarterfinals domestic cup? | SELECT level FROM table_name_22 WHERE domestic_cup = "quarterfinals" | sql_create_context |
CREATE TABLE table_name_97 (
year VARCHAR,
champion VARCHAR,
date VARCHAR
) | WHAT YEAR WAS ROBERT COOMBES CHAMPION ON MAY 7? | SELECT COUNT(year) FROM table_name_97 WHERE champion = "robert coombes" AND date = "may 7" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | what is minimum age of patients whose discharge location is disch-tran to psych hosp and primary disease is angioedema? | SELECT MIN(demographic.age) FROM demographic WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND demographic.diagnosis = "ANGIOEDEMA" | mimicsql_data |
CREATE TABLE table_186468_1 (
property VARCHAR,
ka_band VARCHAR
) | When 2 is the ka-band how many properties are there? | SELECT COUNT(property) FROM table_186468_1 WHERE ka_band = "2" | sql_create_context |
CREATE TABLE table_name_60 (
monarch VARCHAR,
status VARCHAR
) | Which Monarch has succession unclear 1100-1103 as his Status? | SELECT monarch FROM table_name_60 WHERE status = "succession unclear 1100-1103" | sql_create_context |
CREATE TABLE table_name_29 (
top_5 INTEGER,
wins VARCHAR,
top_25 VARCHAR,
cuts_made VARCHAR
) | what is the highest top-5 when the top-25 is less than 4, cuts made is more than 3 and wins is 0? | SELECT MAX(top_5) FROM table_name_29 WHERE top_25 < 4 AND cuts_made > 3 AND wins < 0 | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | how many patients with admission type emergency had diagnoses titled gastrointest hemorr nos? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.short_title = "Gastrointest hemorr NOS" | mimicsql_data |
CREATE TABLE table_71199 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | Which event resulted in loss with an Opponent of maurice smith? | SELECT "Event" FROM table_71199 WHERE "Res." = 'loss' AND "Opponent" = 'maurice smith' | 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,
... | what is the number of patients whose primary disease is brain mass;intracranial hemorrhage and lab test fluid is blood? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" AND lab.fluid = "Blood" | mimicsql_data |
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 me the number of patients whose admission year is less than 2144 and diagnoses icd9 code is 5720? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2144" AND diagnoses.icd9_code = "5720" | mimicsql_data |
CREATE TABLE table_59717 (
"Country" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) | What is the date for catalog RCD 10160? | SELECT "Date" FROM table_59717 WHERE "Catalog" = 'rcd 10160' | wikisql |
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 intakeoutput (
intakeou... | how many hours has it been from the first time patient 015-23047 received a rdw lab test in their current hospital visit? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', lab.labresulttime)) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-23047' AND patient.hosp... | eicu |
CREATE TABLE zyjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
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,
... | 检验报告单在住院就诊08934000082中开出了几份? | SELECT COUNT(*) FROM zyjybgb WHERE zyjybgb.JZLSH = '08934000082' UNION SELECT COUNT(*) FROM mzjybgb WHERE mzjybgb.JZLSH = '08934000082' | css |
CREATE TABLE table_59616 (
"Combined" text,
"50 yard Freestyle" text,
"100 yard Freestyle" text,
"200 yard Freestyle" text,
"500 yard Freestyle" text,
"100 yard Backstroke" text,
"100 yard Butterfly" text
) | What 50 yard Freestyle has a 100 yard Butterfly of diving? | SELECT "50 yard Freestyle" FROM table_59616 WHERE "100 yard Butterfly" = 'diving' | wikisql |
CREATE TABLE table_1049 (
"Season" real,
"Episodes" real,
"Premiere Date" text,
"End Date" text,
"Timeslot" text
) | Name the timeslot for season 5 | SELECT "Timeslot" FROM table_1049 WHERE "Season" = '5' | wikisql |
CREATE TABLE table_414 (
"Jurisdiction" text,
"Voted Yes" real,
"Percent Yes" text,
"Voted No" real,
"Percent No" text
) | what's the jurisdiction where percent yes is 43.4 | SELECT "Jurisdiction" FROM table_414 WHERE "Percent Yes" = '43.4' | wikisql |
CREATE TABLE table_name_89 (
role VARCHAR,
teams VARCHAR
) | What role has the team of Troyes AC Grenoble Foot? | SELECT role FROM table_name_89 WHERE teams = "troyes ac grenoble foot" | sql_create_context |
CREATE TABLE table_37953 (
"picture" text,
"Dual Archimedean solid" text,
"Faces" real,
"Edges" real,
"Vertices" real,
"Face Polygon" text
) | Which Vertices have a Dual Archimedean solid of truncated dodecahedron? | SELECT MAX("Vertices") FROM table_37953 WHERE "Dual Archimedean solid" = 'truncated dodecahedron' | wikisql |
CREATE TABLE table_name_93 (
locomotive_type VARCHAR,
name VARCHAR
) | What kind of locomotive is Winston Churchill? | SELECT locomotive_type FROM table_name_93 WHERE name = "winston churchill" | sql_create_context |
CREATE TABLE table_7175 (
"Year" real,
"League" text,
"Average Attendance" real,
"# of Home Games" real,
"League Rank" text,
"Canada - USA Rank" text
) | What was the Average Attendance during the Year in which there were 9 Home Games? | SELECT MAX("Average Attendance") FROM table_7175 WHERE "# of Home Games" = '9' | wikisql |
CREATE TABLE table_254 (
"Player" text,
"No." text,
"Nationality" text,
"Position" text,
"Years for Jazz" text,
"School/Club Team" text
) | What number does the player from Ohio play with? | SELECT "No." FROM table_254 WHERE "School/Club Team" = 'Ohio' | wikisql |
CREATE TABLE table_13050822_2 (
length VARCHAR,
stage VARCHAR
) | Name the length for stage ss22 | SELECT length FROM table_13050822_2 WHERE stage = "SS22" | sql_create_context |
CREATE TABLE table_name_71 (
score VARCHAR,
home VARCHAR
) | What was the score of the Red Wings game when Vancouver was the home team? | SELECT score FROM table_name_71 WHERE home = "vancouver" | sql_create_context |
CREATE TABLE table_name_28 (
decay_mode VARCHAR,
discovery_year VARCHAR,
isotope VARCHAR
) | What is the decay mode of the 265m hs isotope discovered in 1984? | SELECT decay_mode FROM table_name_28 WHERE discovery_year = "1984" AND isotope = "265m hs" | sql_create_context |
CREATE TABLE table_name_29 (
time INTEGER,
rank VARCHAR
) | What is the average time in a rank of 61? | SELECT AVG(time) FROM table_name_29 WHERE rank = 61 | sql_create_context |
CREATE TABLE table_72733 (
"N\u00b0" real,
"Television service" text,
"Country" text,
"Language" text,
"Content" text,
"DAR" text,
"HDTV" text,
"Package/Option" text
) | what television service are in the united kingdom and n is greater than 854.0? | SELECT "Television service" FROM table_72733 WHERE "Country" = 'United Kingdom' AND "N\u00b0" > '854.0' | wikisql |
CREATE TABLE table_70267 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
) | Which Decile has an Authority of state, a Roll smaller than 61, and an Area of kotemaori? | SELECT "Decile" FROM table_70267 WHERE "Authority" = 'state' AND "Roll" < '61' AND "Area" = 'kotemaori' | wikisql |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 患者46795591在2006年9月16日到2014年7月16日内所有检验结果指标记录的检测人为16084519的检验指标流水号都是多少? | SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE hz_info.RYBH = '46795591' AND jyjgzbb.JYRQ BETWEEN '2006-09-1... | css |
CREATE TABLE table_203_137 (
id number,
"title" text,
"album details" text,
"peak chart positions\nus" number,
"peak chart positions\nus r&b" number,
"certifications" text
) | how many albums had a higher position on either chart than 50 ? | SELECT COUNT("title") FROM table_203_137 WHERE "peak chart positions\nus" <= 50 OR "peak chart positions\nus r&b" <= 50 | squall |
CREATE TABLE table_35176 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | What was the result of the game on November 7, 1999? | SELECT "Result" FROM table_35176 WHERE "Date" = 'november 7, 1999' | 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,
... | 患者李凯唱的异常情况,之前有哪些? | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJG... | css |
CREATE TABLE table_1776943_1 (
archive VARCHAR,
run_time VARCHAR
) | Name the archive where run time 24:04 | SELECT archive FROM table_1776943_1 WHERE run_time = "24:04" | sql_create_context |
CREATE TABLE course (
course_id varchar(8),
title varchar(50),
dept_name varchar(20),
credits numeric(2,0)
)
CREATE TABLE student (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
tot_cred numeric(3,0)
)
CREATE TABLE instructor (
ID varchar(5),
name varchar(20),
dep... | How many students in each department? Give me a bar chart. | SELECT dept_name, COUNT(dept_name) FROM student GROUP BY dept_name ORDER BY tot_cred | nvbench |
CREATE TABLE table_37007 (
"Player" text,
"Sacks" real,
"INT'S" real,
"Yards" real,
"Average" real,
"Long" text
) | What is the sum of values for INT'S with Mossy Cade for 0 yards and less than 3 sacks? | SELECT SUM("INT'S") FROM table_37007 WHERE "Yards" = '0' AND "Sacks" < '3' AND "Player" = 'mossy cade' | wikisql |
CREATE TABLE table_204_475 (
id number,
"home team" text,
"score" text,
"away team" text,
"date" text,
"agg" text
) | what is the number of ties listed ? | SELECT COUNT(*) FROM table_204_475 WHERE "score" = "score" | squall |
CREATE TABLE table_59809 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real
) | How much To par has a Total larger than 149, and a Country of united states, and a Year(s) won of 1997? | SELECT SUM("To par") FROM table_59809 WHERE "Total" > '149' AND "Country" = 'united states' AND "Year(s) won" = '1997' | wikisql |
CREATE TABLE table_33650 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the lowest attendance at a Fitzroy match? | SELECT MIN("Crowd") FROM table_33650 WHERE "Home team" = 'fitzroy' | wikisql |
CREATE TABLE table_name_81 (
bronze INTEGER,
gold VARCHAR,
silver VARCHAR,
nation VARCHAR
) | What is the most bronze can be when silver is larger than 2, and the nation is germany, and gold is more than 8? | SELECT MAX(bronze) FROM table_name_81 WHERE silver > 2 AND nation = "germany" AND gold > 8 | sql_create_context |
CREATE TABLE table_name_39 (
rank VARCHAR,
average VARCHAR,
season VARCHAR
) | What is the total rank of the celebrity with a 34.66 average and a season greater than 1? | SELECT COUNT(rank) FROM table_name_39 WHERE average = 34.66 AND season > 1 | sql_create_context |
CREATE TABLE table_29504351_2 (
money_list_rank INTEGER,
player VARCHAR
) | What is the money list rank for player Doug Barron? | SELECT MAX(money_list_rank) FROM table_29504351_2 WHERE player = "Doug Barron" | sql_create_context |
CREATE TABLE table_11961582_10 (
high_rebounds VARCHAR,
high_assists VARCHAR
) | Who had the high rebounds when the high assists were from J. Johnson (7)? | SELECT high_rebounds FROM table_11961582_10 WHERE high_assists = "J. Johnson (7)" | sql_create_context |
CREATE TABLE table_name_56 (
type VARCHAR,
group VARCHAR
) | Which type is filed under the Group Animated? | SELECT type FROM table_name_56 WHERE group = "animated" | sql_create_context |
CREATE TABLE table_77762 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | What is the low week from october 15, 1961? | SELECT MIN("Week") FROM table_77762 WHERE "Date" = 'october 15, 1961' | wikisql |
CREATE TABLE table_26842 (
"Team #1" text,
"Points" text,
"Team #2" text,
"1st leg" text,
"2nd leg" text
) | What was the 2nd leg for team #1 River Plate? | SELECT "2nd leg" FROM table_26842 WHERE "Team #1" = 'River Plate' | wikisql |
CREATE TABLE table_74499 (
"Aircraft" text,
"Origin" text,
"Type" text,
"Versions" text,
"In service" text
) | Tell me the versions for czechoslovakia? | SELECT "Versions" FROM table_74499 WHERE "Origin" = 'czechoslovakia' | wikisql |
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... | provide the number of patients whose ethnicity is white - russian 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 = "WHITE - RUSSIAN" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREAT... | is the rbc of patient 012-27355's measured at 2100-08-27 07:42:00 greater than measured at 2100-08-21 09:08:00? | SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-27355')) AND lab.labname = 'rbc' AND lab.labresulttime = '2100-08-27 07:42:... | eicu |
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... | 给患有结膜炎的那些病患们给其开的药物的编号和名称分别是什么? | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.IN_DIAG_DIS_NM = '结膜炎' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.IN_DIAG_DIS_NM = '结膜炎' UNION SELE... | css |
CREATE TABLE table_3686 (
"Date" text,
"Battles" text,
"Conflict" text,
"Combatants A" text,
"Combatants B" text,
"Result" text
) | How many battles resulted in Battle of the Yellow Sea? | SELECT COUNT("Result") FROM table_3686 WHERE "Battles" = 'Battle of the Yellow Sea' | wikisql |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college 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_id varchar... | Who was the past teacher for CMBIOL 685 ? | SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN semester... | advising |
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_DIRE_CD text,
MED_DIRE_NM text,... | 查一查医院9861939全部医疗就诊的记录里按科室和入院时的诊断不同算出病人平均岁数有多大,然后把其中平均值小于3岁的记录留下 | SELECT t_kc21.MED_ORG_DEPT_NM, t_kc21.IN_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '9861939' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.IN_DIAG_DIS_NM HAVING AVG(t_kc21.PERSON_AGE) < 3 | css |
CREATE TABLE plays_games (
stuid number,
gameid number,
hours_played number
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE video_games (
gameid number,
gname text,
... | Find the last name and gender of the students who are playing both Call of Destiny and Works of Widenius games. | SELECT lname, sex FROM student WHERE stuid IN (SELECT T1.stuid FROM plays_games AS T1 JOIN video_games AS T2 ON T1.gameid = T2.gameid WHERE T2.gname = "Call of Destiny" INTERSECT SELECT T1.stuid FROM plays_games AS T1 JOIN video_games AS T2 ON T1.gameid = T2.gameid WHERE T2.gname = "Works of Widenius") | spider |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilege... | My answers to bad questions. | SELECT CASE WHEN q.AcceptedAnswerId = a.Id THEN 1 ELSE 0 END AS "accepted", a.Score AS "score", a.Id AS "post_link", q.ClosedDate AS "date_closed", a.CreationDate AS "date_posted" FROM Posts AS a INNER JOIN Posts AS q ON a.ParentId = q.Id WHERE NOT q.ClosedDate IS NULL AND NOT EXISTS(SELECT 1 FROM PostHistory WHERE Pos... | sede |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE restriction (
restriction_c... | show me the cheapest one way fares from SAN DIEGO to MIAMI | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN DIEGO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.ci... | atis |
CREATE TABLE Faculty_Participates_in (
FacID INTEGER,
actid INTEGER
)
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
... | Return a bar chart on how many faculty members does each building have? List the result with the name of the building, and rank from low to high by the x-axis. | SELECT Building, COUNT(*) FROM Faculty GROUP BY Building ORDER BY Building | nvbench |
CREATE TABLE table_2226817_12 (
title VARCHAR,
production_code VARCHAR
) | what is the name of the episode when the production code is 11.01? | SELECT title FROM table_2226817_12 WHERE production_code = "11.01" | sql_create_context |
CREATE TABLE table_1973729_1 (
nickname VARCHAR,
location VARCHAR
) | How many nicknames were associated with Milton, Massachusetts? | SELECT COUNT(nickname) FROM table_1973729_1 WHERE location = "Milton, Massachusetts" | sql_create_context |
CREATE TABLE table_35744 (
"Name" text,
"Location" text,
"State" text,
"Opened (closing date if defunct)" text,
"Surface" text,
"Length" text
) | What is the Location for the newington international airport? | SELECT "Location" FROM table_35744 WHERE "Name" = 'newington international airport' | wikisql |
CREATE TABLE table_204_73 (
id number,
"date" text,
"opponent" text,
"score" text,
"result" text,
"record" text
) | how many total wins did they have in july ? | SELECT COUNT(*) FROM table_204_73 WHERE "result" = 'win' AND "date" = 7 | squall |
CREATE TABLE table_13477468_3 (
original_air_date VARCHAR,
directed_by VARCHAR
) | What is the original air date of the episode directed by Jeff Melman? | SELECT original_air_date FROM table_13477468_3 WHERE directed_by = "Jeff Melman" | sql_create_context |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JO... | For those employees who did not have any job in the past, show me the trend about salary over hire_date with a line chart, could you sort x-axis from low to high order? | SELECT HIRE_DATE, SALARY FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY HIRE_DATE | nvbench |
CREATE TABLE table_203_611 (
id number,
"player" text,
"hr" number,
"date reached 500 hr" text,
"team" text,
"seasons played" text
) | how many players hit more than 600 runs in their career ? | SELECT COUNT("player") FROM table_203_611 WHERE "hr" > 600 | squall |
CREATE TABLE table_name_10 (
home_team VARCHAR,
away_team VARCHAR
) | What did the team score at home in north melbourne? | SELECT home_team AS score FROM table_name_10 WHERE away_team = "north melbourne" | sql_create_context |
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 text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | count the number of hispanic or latino patients who were born before 2110. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND demographic.dob_year < "2110" | mimicsql_data |
CREATE TABLE table_name_67 (
bronze VARCHAR,
silver VARCHAR,
total VARCHAR
) | What is the total number of bronze medals of the team with more than 8 silvers and a total of 50 medals? | SELECT COUNT(bronze) FROM table_name_67 WHERE silver > 8 AND total = 50 | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREAT... | when was patient 012-25893 last discharged this year from the hospital? | SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '012-25893' AND DATETIME(patient.hospitaldischargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY patient.hospitaldischargetime DESC LIMIT 1 | eicu |
CREATE TABLE table_name_18 (
position VARCHAR,
nominated_work VARCHAR,
award VARCHAR
) | What was the position that the nominated work La Quinta Esencia, which also won an award for best CD coverbox, won? | SELECT position FROM table_name_18 WHERE nominated_work = "la quinta esencia" AND award = "best cd coverbox" | sql_create_context |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CR... | Question bodies containing a <br> tag.. | SELECT p.Id FROM Posts AS p WHERE p.Body LIKE '%<br>%' AND p.PostTypeId = 1 ORDER BY p.Id DESC LIMIT 128 | sede |
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... | count the number of patients with diagnoses icd9 code 75261. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "75261" | mimicsql_data |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
s... | what was the name of the output that patient 8016 got first on 11/27/this year? | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT outputevents.itemid 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 = 8016)) AND DATETIME(outputevents.charttime... | mimic_iii |
CREATE TABLE table_58416 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What is the time/retired with 22 laps and a grid of 29? | SELECT "Time/Retired" FROM table_58416 WHERE "Laps" = '22' AND "Grid" = '29' | wikisql |
CREATE TABLE table_name_89 (
round INTEGER,
method VARCHAR
) | What is the average round for the TKO (punches and elbows) method? | SELECT AVG(round) FROM table_name_89 WHERE method = "tko (punches and elbows)" | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | what is days of hospital stay and procedure long title of subject id 29541? | SELECT demographic.days_stay, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "29541" | mimicsql_data |
CREATE TABLE fzzmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZD... | 从08年7月20日到13年10月17日这段时间里,患者38917711所有检验结果指标记录中的检测方法都有什么啊? | SELECT jyjgzbb.JCFF FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH... | css |
CREATE TABLE table_25122 (
"Details" text,
"Host Nation(s)" text,
"Final Venue" text,
"Winner" text,
"Result" text,
"Runner-up" text
) | Who was the winner if the final venue is Kowloon Cricket Club? | SELECT "Winner" FROM table_25122 WHERE "Final Venue" = 'Kowloon Cricket Club' | wikisql |
CREATE TABLE table_18792 (
"City of license /Market" text,
"Station" text,
"Channel TV ( DT )" text,
"Owned since" text,
"Primary affiliation" text
) | How many channel tv (dt)s are in austin, texas? | SELECT COUNT("Channel TV ( DT )") FROM table_18792 WHERE "City of license /Market" = 'Austin, Texas' | wikisql |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | 50 most viewed questions on 2015-03-08 on Ask Ubuntu. | SELECT * FROM Posts, PostTypes WHERE Posts.PostTypeId = PostTypes.Id AND PostTypes.Id = 1 AND Posts.CreationDate BETWEEN '2015-03-08 00:00:00' AND '2015-03-08 23:59:59' ORDER BY Posts.ViewCount DESC LIMIT 50 | sede |
CREATE TABLE mzb (
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... | 患者在进行78371715301医疗就诊时对应的是哪个门诊号或住院号 | SELECT qtb.CLINIC_ID FROM qtb WHERE qtb.MED_CLINIC_ID = '78371715301' UNION SELECT gyb.CLINIC_ID FROM gyb WHERE gyb.MED_CLINIC_ID = '78371715301' UNION SELECT zyb.CLINIC_ID FROM zyb WHERE zyb.MED_CLINIC_ID = '78371715301' UNION SELECT mzb.CLINIC_ID FROM mzb WHERE mzb.MED_CLINIC_ID = '78371715301' | css |
CREATE TABLE table_name_90 (
icao VARCHAR,
country VARCHAR,
iata VARCHAR
) | What is the ICAO in India with IATA TRZ? | SELECT icao FROM table_name_90 WHERE country = "india" AND iata = "trz" | sql_create_context |
CREATE TABLE table_name_67 (
name VARCHAR,
country VARCHAR,
index VARCHAR
) | What is the name of the player from Malaysia, Kuala Lumpur in Index f8? | SELECT name FROM table_name_67 WHERE country = "malaysia, kuala lumpur" AND index = "f8" | sql_create_context |
CREATE TABLE table_56076 (
"Round" real,
"Overall" text,
"Player" text,
"Position" text,
"Nationality" text,
"Club team" text
) | What is the average round of a player with an overall of 138? | SELECT AVG("Round") FROM table_56076 WHERE "Overall" = '138' | wikisql |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | What is the relationship between Team_ID and ACC_Percent , and group by attribute Team_Name? | SELECT Team_ID, ACC_Percent FROM basketball_match GROUP BY Team_Name | nvbench |
CREATE TABLE table_33978 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | What is the record of the team with a St. Louis home? | SELECT "Record" FROM table_33978 WHERE "Home" = 'st. louis' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.