context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE airport_servic... | like to book a flight from BURBANK to MILWAUKEE | 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 = 'BURBANK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MILWAU... | atis |
CREATE TABLE table_name_18 (
runner_up VARCHAR,
rank VARCHAR,
champion VARCHAR,
fourth_place VARCHAR
) | What was the runner-up when champion is 0, 4th place is 0 and rank is 6? | SELECT runner_up FROM table_name_18 WHERE champion = "0" AND fourth_place = "0" AND rank = 6 | sql_create_context |
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 departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
... | Compare the average salary by each hire date (bin it into month interval) of employees using a bar chart. | SELECT HIRE_DATE, AVG(SALARY) FROM employees | nvbench |
CREATE TABLE table_name_82 (
language VARCHAR,
package_option VARCHAR
) | What language has sky famiglia as the package/option? | SELECT language FROM table_name_82 WHERE package_option = "sky famiglia" | sql_create_context |
CREATE TABLE table_name_12 (
round INTEGER,
nhl_team VARCHAR,
player VARCHAR
) | Which Round has a NHL team of edmonton oilers and a Player of vyacheslav trukhno? | SELECT AVG(round) FROM table_name_12 WHERE nhl_team = "edmonton oilers" AND player = "vyacheslav trukhno" | sql_create_context |
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,... | 炙远志颗粒在医疗就诊46764459204中的医疗机构三大目录编码及名称分别是是什么? | SELECT t_kc22.MED_DIRE_CD, t_kc22.MED_DIRE_NM 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 = '46764459204' AND t_kc22.SOC_SRT_DIRE_NM = '炙远志颗粒' | css |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
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,
t... | How many times has class 224 been taught by Prof. Amy Pienta ? | SELECT COUNT(*) FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.number = 224 AND instructor.name LIKE '%Amy Pienta%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.offering... | advising |
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases INTEGER,
Drink TEXT
)
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE appellations (
No... | Return a bar chart for what is the number of areas for all appellations?, and could you rank y axis in asc order please? | SELECT Area, COUNT(Area) FROM appellations GROUP BY Area ORDER BY COUNT(Area) | nvbench |
CREATE TABLE table_14330096_4 (
total_number VARCHAR,
director VARCHAR
) | How many of the episodes have Roger Goldby as the director? | SELECT total_number FROM table_14330096_4 WHERE director = "Roger Goldby" | sql_create_context |
CREATE TABLE table_34510 (
"Rank" text,
"Player" text,
"Position" text,
"Career" text,
"Points" real
) | What is the sum of the points for the player who was a rank of 61t? | SELECT SUM("Points") FROM table_34510 WHERE "Rank" = '61t' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM t... | 门诊就诊62692281748开出的检验报告单有多少? | SELECT COUNT(*) FROM jybgb WHERE JZLSH = '62692281748' | css |
CREATE TABLE table_204_20 (
id number,
"represent" text,
"contestant" text,
"age" number,
"height" text,
"hometown" text
) | what is the total number of delegates ? | SELECT COUNT("contestant") FROM table_204_20 | squall |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | 医院9223333有多少科室在门诊就诊中开出不少于13张检验报告单,在2010-12-18到2020-10-25内? | SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM zzmzjzjlb JOIN jybgb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE zzmzjzjlb.YLJGDM = '9223333' AND jybgb.BGRQ BETWEEN '2010-12-18' AND '2020-10-25' GROUP BY jybgb.KSBM HAVING COUNT(*) >= 13 UNION SELECT jybgb.KSBM FROM fzzmzjzjlb... | css |
CREATE TABLE table_name_34 (
runs INTEGER,
high_score VARCHAR,
innings VARCHAR
) | How many runs were there when the high score was 55 and there were more than 12 innings? | SELECT SUM(runs) FROM table_name_34 WHERE high_score = 55 AND innings > 12 | sql_create_context |
CREATE TABLE table_58853 (
"Drug" text,
"Mean" real,
"Pleasure" real,
"Psychological dependence" real,
"Physical dependence" real
) | What is the total number of Psychological Dependence, when Pleasure is '2.3', and when Mean is less than 1.9300000000000002? | SELECT COUNT("Psychological dependence") FROM table_58853 WHERE "Pleasure" = '2.3' AND "Mean" < '1.9300000000000002' | wikisql |
CREATE TABLE table_15955 (
"Pick" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | What high school team did Doug Nolan play for? | SELECT "College/junior/club team" FROM table_15955 WHERE "Player" = 'Doug Nolan' | wikisql |
CREATE TABLE table_204_992 (
id number,
"team" text,
"manager" text,
"city" text,
"stadium" text,
"capacity" text
) | which is the only stadium with a capacity of larger than 20,000 ? | SELECT "stadium" FROM table_204_992 WHERE "capacity" > 20000 | squall |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConce... | Comment Vote and Post count. | SELECT (SELECT COUNT(*) FROM Votes) AS VoteCount, (SELECT COUNT(*) FROM Posts) AS PostCount, (SELECT COUNT(*) FROM Comments) AS CommentCount | sede |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
... | Does Prof. Valeriy Tenishev 's ARTDES 182 class have a lab ? | SELECT COUNT(*) = 0 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 WHERE course.department = 'ARTD... | advising |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE month (
month_number int,
... | show me all round trip flights from MIAMI to NEW YORK nonstop | 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, fare, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NEW YORK' AND NOT fare.round_trip_cost IS NULL AND flight_fare.fare_i... | atis |
CREATE TABLE table_name_11 (
cuts_made INTEGER,
events INTEGER
) | What are the largest cuts made when the events are less than 21? | SELECT MAX(cuts_made) FROM table_name_11 WHERE events < 21 | sql_create_context |
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... | 根据入院诊断疾病编码,列出来不同疾病的平均患者年龄在医院5333311中分别是多少? | SELECT qtb.IN_DIAG_DIS_CD, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '5333311' GROUP BY qtb.IN_DIAG_DIS_CD UNION SELECT gyb.IN_DIAG_DIS_CD, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '5333311' GROUP BY gyb.IN_DIAG_DIS_CD UNION SELECT zyb.IN_DIAG_DIS_CD, AVG(zyb.PERSON_AGE) FROM zyb WHERE zyb.... | css |
CREATE TABLE table_49727 (
"Name" text,
"Country" text,
"Total" text,
"60mH" real,
"800m" real
) | What is the Name that has a 60mH littler than 1002, and a 800m littler than 985, and a Country of lithuania? | SELECT "Name" FROM table_49727 WHERE "60mH" < '1002' AND "800m" < '985' AND "Country" = 'lithuania' | wikisql |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
... | was there any organism detected in the last blood (toxo) test of patient 57050 this month? | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 57050) AND microbiologyevents.spec_type_desc = 'blood (toxo)' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.charttime, 'start of month') ... | mimic_iii |
CREATE TABLE table_61396 (
"Name" text,
"Bodyweight" real,
"Snatch" real,
"Clean & Jerk" real,
"Total (kg)" real
) | How much Snatch has a Total (kg) smaller than 257? | SELECT SUM("Snatch") FROM table_61396 WHERE "Total (kg)" < '257' | wikisql |
CREATE TABLE mzjybgb (
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,
... | 在69277979003这次医疗就诊中,袁姓检测人负责的所有检测指标名称是什么?结果定量与结果定量单位分别是什么 | SELECT jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM zyjybgb JOIN jyjgzbb ON zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE zyjybgb.JZLSH = '69277979003' AND jyjgzbb.JCRXM LIKE '袁%' UNION SELECT jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM mzjybgb JOIN jyjgzbb ON mzjybgb.YLJG... | css |
CREATE TABLE table_name_75 (
episode__number INTEGER,
episode_name VARCHAR
) | What is the average episode # with a name of the origin of Donnie (part 1)? | SELECT AVG(episode__number) FROM table_name_75 WHERE episode_name = "the origin of donnie (part 1)" | sql_create_context |
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,
... | provide the number of patients whose days of hospital stay is greater than 10 and lab test fluid is ascites? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "10" AND lab.fluid = "Ascites" | mimicsql_data |
CREATE TABLE table_997 (
"Variant id" text,
"5\u2019UTR splice" text,
"Coding" text,
"3\u2019UTR sequence" text,
"GenBank id" text
) | What is the 3'utr sequence with a variant id of acd'6a 3? | SELECT "3\u2019UTR sequence" FROM table_997 WHERE "Variant id" = 'ACD''6A 3' | wikisql |
CREATE TABLE table_15072 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | Name the average week for attendance of 75,111 | SELECT AVG("Week") FROM table_15072 WHERE "Attendance" = '75,111' | wikisql |
CREATE TABLE table_1057316_1 (
disposition VARCHAR,
operational_owner_s_ VARCHAR
) | Where can you find Colorado and Southern Railway #9? | SELECT disposition FROM table_1057316_1 WHERE operational_owner_s_ = "Colorado and Southern Railway #9" | sql_create_context |
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... | give me the number of patients whose year of death is less than or equal to 2115? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.dod_year <= "2115.0" | mimicsql_data |
CREATE TABLE table_203_642 (
id number,
"name" text,
"quadrant" text,
"sector" text,
"ward" text,
"type" text,
"2012\npopulation\nrank" number,
"population\n(2012)" number,
"population\n(2011)" number,
"% change" number,
"dwellings\n(2012)" number,
"area\n(km2)" number,
... | what was the most populous neighborhood in calgary in 2012 ? | SELECT "name" FROM table_203_642 ORDER BY "population\n(2012)" DESC LIMIT 1 | squall |
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_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE labevents (
row_id number,
subject_id ... | until 2102, what were the five most frequent medications prescribed to the female patients 60 or above within the same hospital visit after they were diagnosed with hyperlipidemia nec/nos? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_... | mimic_iii |
CREATE TABLE table_64605 (
"Rank" real,
"Athletes" text,
"Country" text,
"Time" text,
"Notes" text
) | What country has a time of 3:19.167? | SELECT "Country" FROM table_64605 WHERE "Time" = '3:19.167' | wikisql |
CREATE TABLE addresses (
address_id number,
address_content text,
city text,
zip_postcode text,
state_province_county text,
country text,
other_address_details text
)
CREATE TABLE customers (
customer_id number,
payment_method text,
customer_name text,
date_became_customer t... | What are the name and active date of the customers whose contact channel code is email? | SELECT t1.customer_name, t2.active_from_date FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t2.channel_code = 'Email' | spider |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE microbiologyevents... | what is patient 3097's age when they came to the hospital last time? | SELECT admissions.age FROM admissions WHERE admissions.subject_id = 3097 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1 | mimic_iii |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH te... | 查查报告单的日期,就是那个编号为61624310832的检验报告单 | SELECT jybgb.BGRQ FROM jybgb WHERE jybgb.BGDH = '61624310832' | css |
CREATE TABLE table_51402 (
"Year" text,
"Start" text,
"Qual" text,
"Rank" text,
"Finish" text,
"Laps" real
) | What was the start of the competitor with a qualifying time of 84.300? | SELECT "Start" FROM table_51402 WHERE "Qual" = '84.300' | 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... | provide the number of patients who were admitted before year 2175 and whose diagnosis short title is chronic liver disease nec. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2175" AND diagnoses.short_title = "Chronic liver dis NEC" | mimicsql_data |
CREATE TABLE table_37765 (
"Driver" text,
"Constructor" text,
"Laps" text,
"Time/Retired" text,
"Grid" text
) | Who was the constructor of the car driven by Heikki Kovalainen? | SELECT "Constructor" FROM table_37765 WHERE "Driver" = 'heikki kovalainen' | wikisql |
CREATE TABLE table_2213 (
"Poll source" text,
"Dates administered" text,
"Tom Emmer (R)" text,
"Matt Entenza (DFL)" text,
"Tom Horner (I)" text,
"Undecided" text,
"Sampling error" text
) | What percentage voted for Tom Horner according to the poll source with sampling error of 2.5%? | SELECT "Tom Horner (I)" FROM table_2213 WHERE "Sampling error" = '2.5%' | wikisql |
CREATE TABLE table_name_43 (
reserved_for___sc___st__none_ VARCHAR,
constituency_number VARCHAR
) | What's the reserved number for constituency number 108? | SELECT reserved_for___sc___st__none_ FROM table_name_43 WHERE constituency_number = "108" | sql_create_context |
CREATE TABLE table_name_7 (
member VARCHAR,
state VARCHAR
) | Which memeber has nt as the state? | SELECT member FROM table_name_7 WHERE state = "nt" | sql_create_context |
CREATE TABLE table_10905 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Where did the home team play when they scored 16.17 (113)? | SELECT "Venue" FROM table_10905 WHERE "Home team score" = '16.17 (113)' | wikisql |
CREATE TABLE table_36050 (
"Episode" text,
"Title" text,
"Writer(s)" text,
"Preservation" text,
"Original airdate" text
) | What episode was written by jonathan lewis? | SELECT "Episode" FROM table_36050 WHERE "Writer(s)" = 'jonathan lewis' | wikisql |
CREATE TABLE table_name_86 (
league VARCHAR,
regular_season VARCHAR
) | Name the League which has a Regular Season of 3rd, atlantic? | SELECT league FROM table_name_86 WHERE regular_season = "3rd, atlantic" | sql_create_context |
CREATE TABLE table_51467 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What date was the game played at Lake Oval? | SELECT "Date" FROM table_51467 WHERE "Venue" = 'lake oval' | wikisql |
CREATE TABLE table_name_40 (
outcome VARCHAR,
tournament VARCHAR,
opponent VARCHAR
) | what is the outcome when the tournament is san diego and the opponent is ann grossman? | SELECT outcome FROM table_name_40 WHERE tournament = "san diego" AND opponent = "ann grossman" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | what is minimum days of hospital stay of patients whose ethnicity is black/haitian? | SELECT MIN(demographic.days_stay) FROM demographic WHERE demographic.ethnicity = "BLACK/HAITIAN" | mimicsql_data |
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 (
CYBQDM text,
CYBQ... | 住院诊断中开支的编号为20186568174检测报告单对应的患者名号叫什么? | SELECT person_info.XM FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_ZYJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_ZYJZJLB WHERE jybgb.BGDH = '2... | css |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
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,
... | calculate the two year survival probability of patients to whom acetazolamide sodium was prescribed after they were diagnosed with ant disloc humerus-close. | SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd... | mimic_iii |
CREATE TABLE performers_in_bookings (
order_id number,
performer_id number
)
CREATE TABLE services (
service_id number,
service_type_code text,
workshop_group_id number,
product_description text,
product_name text,
product_price number,
other_product_service_details text
)
CREATE T... | Which cities have at least one customer but no performer? | SELECT T1.city_town FROM addresses AS T1 JOIN customers AS T2 ON T1.address_id = T2.address_id EXCEPT SELECT T1.city_town FROM addresses AS T1 JOIN performers AS T2 ON T1.address_id = T2.address_id | spider |
CREATE TABLE table_12591022_2 (
program VARCHAR,
focus VARCHAR
) | What is the program where the focus is general management? | SELECT program FROM table_12591022_2 WHERE focus = "General Management" | sql_create_context |
CREATE TABLE table_name_76 (
pick INTEGER,
position VARCHAR
) | What's the highest pick for SS position? | SELECT MAX(pick) FROM table_name_76 WHERE position = "ss" | sql_create_context |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
Crea... | R to Python ratio over time. | SELECT DATEADD(mm, (YEAR(Posts.CreationDate) - 1900) * 12 + MONTH(Posts.CreationDate) - 1, 0) AS Month, SUM(CASE WHEN Tags.TagName = 'r' THEN 1.0 ELSE 0 END) AS R, SUM(CASE WHEN Tags.TagName = 'python' THEN 1 ELSE 0 END) AS Python FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = Po... | sede |
CREATE TABLE table_56930 (
"Ship name" text,
"Year" real,
"Length" text,
"Width" text,
"Passengers" real,
"Vessels" real,
"Speed" real
) | How many vessels are named aqua jewel? | SELECT COUNT("Vessels") FROM table_56930 WHERE "Ship name" = 'aqua jewel' | wikisql |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airport (
... | what is the cheapest flight from BOSTON to BWI | SELECT DISTINCT flight.flight_id FROM airport, airport_service, city, fare, flight, flight_fare WHERE (airport.airport_code = 'BWI' AND city.city_code = airport_service.city_code AND city.city_name = 'BOSTON' AND flight.from_airport = airport_service.airport_code AND flight.to_airport = airport.airport_code) AND fare.o... | atis |
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,
... | give me the number of patients whose ethnicity is hispanic/latino - puerto rican and days of hospital stay is greater than 16? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND demographic.days_stay > "16" | mimicsql_data |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense... | Most popular questions per tag in a year. | SELECT p.Id, p.Body, p.CreationDate, p.Score, p.ParentId, p.Title, p.Tags, p.ViewCount, p.AnswerCount, p.FavoriteCount, p.CommentCount, p.AcceptedAnswerId FROM Posts AS p LEFT JOIN PostTags AS pt ON p.Id = pt.PostId LEFT JOIN Tags AS t ON pt.TagId = t.Id WHERE t.TagName = '##TagName:string##' AND YEAR(p.CreationDate) =... | sede |
CREATE TABLE table_204_692 (
id number,
"publication" text,
"score" text,
"review" text
) | how many reviews were in print ? | SELECT COUNT("review") FROM table_204_692 WHERE "review" = 'print' | squall |
CREATE TABLE table_name_77 (
tyre VARCHAR,
constructor VARCHAR,
driver VARCHAR
) | What was tyre that was made by cooper - bristol that was driven by bob gerard? | SELECT tyre FROM table_name_77 WHERE constructor = "cooper - bristol" AND driver = "bob gerard" | sql_create_context |
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,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | how many patients' year of birth is before 2121 with joint fluid as the lab test fluid? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2121" AND lab.fluid = "Joint Fluid" | mimicsql_data |
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,
... | give me the number of patients whose ethnicity is white and admission year is less than 2154? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE" AND demographic.admityear < "2154" | mimicsql_data |
CREATE TABLE table_name_67 (
attendance INTEGER,
h___a VARCHAR,
opponents VARCHAR
) | What is the smallest number of people to attend a game with an H/A of h and the opponent was Roma? | SELECT MIN(attendance) FROM table_name_67 WHERE h___a = "h" AND opponents = "roma" | sql_create_context |
CREATE TABLE table_name_29 (
opponent VARCHAR,
week VARCHAR,
date VARCHAR
) | What opponent has a week less than 12, with November 25, 1965 as the date? | SELECT opponent FROM table_name_29 WHERE week < 12 AND date = "november 25, 1965" | sql_create_context |
CREATE TABLE table_name_52 (
episodes INTEGER,
average_ratings VARCHAR
) | what is the most episodes when the average ratings is 18.8%? | SELECT MAX(episodes) FROM table_name_52 WHERE average_ratings = "18.8%" | sql_create_context |
CREATE TABLE table_name_37 (
rank INTEGER,
definition VARCHAR,
population VARCHAR
) | What rank was Core Districts + Inner Suburbs and had a population of 10123000? | SELECT MAX(rank) FROM table_name_37 WHERE definition = "core districts + inner suburbs" AND population = "10123000" | sql_create_context |
CREATE TABLE table_23081 (
"Scorecard" real,
"Date" text,
"Venue" text,
"Team 1" text,
"Team 2" text,
"Result" text,
"Man of the Match" text
) | How many venues were there for the match on November 6? | SELECT COUNT("Venue") FROM table_23081 WHERE "Date" = 'November 6' | wikisql |
CREATE TABLE table_name_22 (
team VARCHAR,
start VARCHAR,
year VARCHAR
) | Which team had a start of 8 in years under 2008? | SELECT team FROM table_name_22 WHERE start = 8 AND year < 2008 | sql_create_context |
CREATE TABLE table_21721351_18 (
nationality VARCHAR,
player VARCHAR
) | Which nationality is player Brian Wilks? | SELECT nationality FROM table_21721351_18 WHERE player = "Brian Wilks" | sql_create_context |
CREATE TABLE table_40752 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Which Bronze has a Gold smaller than 1, and a Rank of 17, and a Nation of china? | SELECT MAX("Bronze") FROM table_40752 WHERE "Gold" < '1' AND "Rank" = '17' AND "Nation" = 'china' | wikisql |
CREATE TABLE table_19753079_8 (
district VARCHAR,
incumbent VARCHAR
) | What district did George Miller belong to? | SELECT district FROM table_19753079_8 WHERE incumbent = "George Miller" | sql_create_context |
CREATE TABLE table_name_47 (
date VARCHAR,
visitor VARCHAR,
score VARCHAR
) | When did Montreal visit and have a score of 1-4? | SELECT date FROM table_name_47 WHERE visitor = "montreal" AND score = "1-4" | sql_create_context |
CREATE TABLE table_71515 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
) | What date was the record 38-22? | SELECT "Date" FROM table_71515 WHERE "Record" = '38-22' | wikisql |
CREATE TABLE table_name_19 (
alternate VARCHAR,
second VARCHAR
) | What is the alternate of the nation with Piotras Gerasimovici as the second? | SELECT alternate FROM table_name_19 WHERE second = "piotras gerasimovici" | sql_create_context |
CREATE TABLE Financial_Transactions (
transaction_id INTEGER,
previous_transaction_id INTEGER,
account_id INTEGER,
card_id INTEGER,
transaction_type VARCHAR(15),
transaction_date DATETIME,
transaction_amount DOUBLE,
transaction_comment VARCHAR(255),
other_transaction_details VARCHAR(... | Return a histogram on what are the different transaction types, and how many transactions of each have taken place?, and rank total number from high to low order please. | SELECT transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type ORDER BY COUNT(*) DESC | nvbench |
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,
... | 门诊就诊48598074227的就诊状态代码是什么?就诊状态名称叫什么? | SELECT zzmzjzjlb.JZZTDM, zzmzjzjlb.JZZTMC FROM zzmzjzjlb WHERE zzmzjzjlb.JZLSH = '48598074227' UNION SELECT fzzmzjzjlb.JZZTDM, fzzmzjzjlb.JZZTMC FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZLSH = '48598074227' | css |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE m... | what was the two year survival rate of retropharyngeal abscess patients who were prescribed with dobutamine? | SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd... | mimic_iii |
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,
... | 继发龋的患者在被门诊诊断后他们的妊娠相关性血浆蛋白-A数值的平均值以及最值都是什么? | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '继发龋' AND jyjgzbb.JCZBMC = '妊娠相关性血浆蛋白-A' | css |
CREATE TABLE table_1694 (
"Rank" real,
"Airport" text,
"Location" text,
"IATA" text,
"1985\u201386" real,
"1990\u201391" real,
"1995\u201396" real,
"2000\u201301" real,
"2005\u201306" real,
"2007\u201308" real,
"2009\u201310" real,
"2010-11" real
) | What is the airport with the IATA MEL? | SELECT COUNT("Airport") FROM table_1694 WHERE "IATA" = 'MEL' | wikisql |
CREATE TABLE fgwyjzb (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 85454377号参保人在门诊一年花费了多少医疗费? | SELECT SUM(gwyjzb.MED_AMOUT) FROM gwyjzb WHERE gwyjzb.PERSON_ID = '85454377' AND gwyjzb.CLINIC_TYPE = '门诊' UNION SELECT SUM(fgwyjzb.MED_AMOUT) FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '85454377' AND fgwyjzb.CLINIC_TYPE = '门诊' | css |
CREATE TABLE table_name_67 (
position VARCHAR,
pick VARCHAR,
player VARCHAR
) | WHAT POSITION HAS A PICK SMALLER THAN 33, AND PLAYER BEING DARRELL ARTHUR? | SELECT position FROM table_name_67 WHERE pick < 33 AND player = "darrell arthur" | sql_create_context |
CREATE TABLE table_33489 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the home team that scored 12.21 (93)? | SELECT "Home team" FROM table_33489 WHERE "Home team score" = '12.21 (93)' | wikisql |
CREATE TABLE table_15303 (
"Year" text,
"Venue" text,
"Winners" text,
"2nd place" text,
"3rd place" text
) | Who is listed as the Winners with a Year of 2005? | SELECT "Winners" FROM table_15303 WHERE "Year" = '2005' | wikisql |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TA... | please show me any UA flights including connections between BOSTON and SAN FRANCISCO at 1700 in the evening | 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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.departure_time = 1700 AND flight.to_airport = AIRPORT_SERVICE_... | atis |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PendingFlags (
... | Write a query that will show just the User ID and Text of a comment by a single user. You may choose. | SELECT UserId, Text FROM Comments WHERE Text LIKE '@Yvette%' | sede |
CREATE TABLE table_name_2 (
hexadecimal INTEGER,
decimal INTEGER
) | What is the average hexadecimal with a decimal greater than 57? | SELECT AVG(hexadecimal) FROM table_name_2 WHERE decimal > 57 | sql_create_context |
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... | how many patients whose diagnoses short title is acute kidney failure nos and drug route is tp? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Acute kidney failure NOS" AND prescriptions.route = "TP" | mimicsql_data |
CREATE TABLE table_name_17 (
week VARCHAR,
date VARCHAR
) | What is the Week number on December 18, 1960? | SELECT COUNT(week) FROM table_name_17 WHERE date = "december 18, 1960" | sql_create_context |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | when did patient 015-52724 first have a procedure in the current hospital visit? | SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-52724' AND patient.hospitaldischargetime IS NULL)) ORDER BY t... | eicu |
CREATE TABLE Ref_Address_Types (
address_type_code VARCHAR(15),
address_type_description VARCHAR(80)
)
CREATE TABLE Students_in_Detention (
student_id INTEGER,
detention_id INTEGER,
incident_id INTEGER
)
CREATE TABLE Addresses (
address_id INTEGER,
line_1 VARCHAR(120),
line_2 VARCHAR(1... | Give me the comparison about the amount of date_address_to over the date_address_to bin date_address_to by time. | SELECT date_address_to, COUNT(date_address_to) FROM Student_Addresses ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE table_62964 (
"Township" text,
"County" text,
"Pop. (2010)" real,
"Land ( sqmi )" real,
"Water (sqmi)" real,
"Latitude" real,
"Longitude" real,
"GEO ID" real,
"ANSI code" real
) | What is the lowest GEO ID for the longitude of -102.158045 and the water in square miles larger than 0.979? | SELECT MIN("GEO ID") FROM table_62964 WHERE "Longitude" = '-102.158045' AND "Water (sqmi)" > '0.979' | wikisql |
CREATE TABLE table_42713 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What is the Date of the Competition with a Score of 4-0 and 5-0 Result? | SELECT "Date" FROM table_42713 WHERE "Result" = '5-0' AND "Score" = '4-0' | wikisql |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE ... | list all flights on CO leaving DENVER on monday | SELECT DISTINCT flight.flight_id FROM airport_service, city, date_day, days, flight WHERE (city.city_code = airport_service.city_code AND city.city_name = 'DENVER' AND date_day.day_number = 21 AND date_day.month_number = 2 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days... | atis |
CREATE TABLE table_30660 (
"Couple" text,
"Style" text,
"Music" text,
"Trine Dehli Cleve" real,
"Tor Fl\u00f8ysvik" real,
"Karianne Gulliksen" real,
"Christer Tornell" real,
"Total" real
) | What is listed under tor floysvik when couple is maria & asmund? | SELECT MIN("Tor Fl\u00f8ysvik") FROM table_30660 WHERE "Couple" = 'Maria & Asmund' | wikisql |
CREATE TABLE table_1176162_3 (
cylinders__valves VARCHAR,
model VARCHAR
) | what's the cylinders/ valves with model being 1.8 20v | SELECT cylinders__valves FROM table_1176162_3 WHERE model = "1.8 20V" | sql_create_context |
CREATE TABLE table_58729 (
"Club" text,
"City" text,
"Stadium" text,
"Capacity" real,
"2007\u201308 season" text
) | What was the largest capacity when the club was F.C. Igea Virtus Barcellona? | SELECT MAX("Capacity") FROM table_58729 WHERE "Club" = 'f.c. igea virtus barcellona' | wikisql |
CREATE TABLE table_name_8 (
bronze INTEGER,
nation VARCHAR,
silver VARCHAR
) | What is the bronze for Kyrgyzstan nation with a silver record of greater than 0? | SELECT AVG(bronze) FROM table_name_8 WHERE nation = "kyrgyzstan" AND silver > 0 | sql_create_context |
CREATE TABLE affected_region (
region_name VARCHAR,
region_id VARCHAR
)
CREATE TABLE region (
region_name VARCHAR,
region_id VARCHAR
) | Show the name for regions not affected. | SELECT region_name FROM region WHERE NOT region_id IN (SELECT region_id FROM affected_region) | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.