context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (... | what is days of hospital stay and discharge time of subject id 9575? | SELECT demographic.days_stay, demographic.dischtime FROM demographic WHERE demographic.subject_id = "9575" | mimicsql_data |
CREATE TABLE Hotels (
hotel_id INTEGER,
star_rating_code CHAR(15),
pets_allowed_yn CHAR(1),
price_range real,
other_hotel_details VARCHAR(255)
)
CREATE TABLE Photos (
Photo_ID INTEGER,
Tourist_Attraction_ID INTEGER,
Name VARCHAR(255),
Description VARCHAR(255),
Filename VARCHAR(2... | List all the possible ways to get to attractions, together with the number of attractions accessible by these methods Visualize by bar chart, could you show total number in desc order? | SELECT How_to_Get_There, COUNT(*) FROM Tourist_Attractions GROUP BY How_to_Get_There ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_8429 (
"Name" text,
"Country" text,
"Status" text,
"Moving to" text,
"Transfer window" text,
"Transfer fee" text
) | What is the status of the player who is moving to Nantes? | SELECT "Status" FROM table_8429 WHERE "Moving to" = 'nantes' | wikisql |
CREATE TABLE table_75659 (
"Rank" real,
"Municipality" text,
"Province" text,
"Status" text,
"Area (km 2 )" real
) | What Municipality has a Rank of 44? | SELECT "Municipality" FROM table_75659 WHERE "Rank" = '44' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | what is the number of patients whose diagnoses short title is nephritis nos and lab test category is chemistry? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Nephritis NOS" AND lab."CATEGORY" = "Chemistry" | mimicsql_data |
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 outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | what's the number of patients who have had ac alcoholic hepatitis diagnosed until 2104? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'ac alcoholic hepatitis') AND STRFTIME('%y', diagnoses_icd.... | mimic_iii |
CREATE TABLE table_78789 (
"Release" text,
"Chart" text,
"Peak Position" real,
"Sales Total" real,
"Chart Run" text
) | How much Peak Position has Sales Total larger than 1,540,088? | SELECT COUNT("Peak Position") FROM table_78789 WHERE "Sales Total" > '1,540,088' | wikisql |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number... | what is the five, the most frequent input event in this year? | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT inputevents_cv.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM inputevents_cv WHERE DATETIME(inputevents_cv.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY inputevents_cv.it... | mimic_iii |
CREATE TABLE table_10545 (
"Rank" real,
"Player" text,
"Country" text,
"Earnings ( $ )" real,
"Events" real,
"Wins" real
) | Who's ranked less than 2? | SELECT "Player" FROM table_10545 WHERE "Rank" < '2' | wikisql |
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 gsi (
course_offering_id int,
student_id int
)
CREATE TABLE cours... | Which Homological Algebra courses offer 3 credits ? | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Homological Algebra%' OR name LIKE '%Homological Algebra%') AND credits = 3 | advising |
CREATE TABLE table_34840 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | What was the score of the game when the record was 50-85? | SELECT "Score" FROM table_34840 WHERE "Record" = '50-85' | wikisql |
CREATE TABLE table_9321 (
"Articulatory class" text,
"Non- stop" text,
"Plain stop" text,
"Aspirated stop" text,
"\"Muddy\" voice" text
) | Which Articulatory class has and Aspirated stop of ? | SELECT "Articulatory class" FROM table_9321 WHERE "Aspirated stop" = 'ㅍ' | 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 hispanic or latino-puerto rican patients have warf5 drug code? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND prescriptions.formulary_drug_cd = "WARF5" | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | how many emergency hospital admitted patients were born before 2197? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.dob_year < "2197" | mimicsql_data |
CREATE TABLE table_42768 (
"Date" text,
"Home captain" text,
"Away captain" text,
"Venue" text,
"Result" text
) | What is Away Captain, when Date is 30 Dec, 1,2,3 Jan 1911/2? | SELECT "Away captain" FROM table_42768 WHERE "Date" = '30 dec, 1,2,3 jan 1911/2' | wikisql |
CREATE TABLE table_65380 (
"Nation" text,
"Birth date" text,
"Height (m)" text,
"Weight (kg)" text,
"World Rank" text
) | what is the birth date when the weight (kg) is 100 and the world rank is 2? | SELECT "Birth date" FROM table_65380 WHERE "Weight (kg)" = '100' AND "World Rank" = '2' | wikisql |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 门诊诊断为疾病Y80.333的病人的检测指标145181数值的平均值是多少?最值是多少? | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDBM = 'Y80.333' AND jyjgzbb.JCZBDM = '145181' | css |
CREATE TABLE table_33752 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | Who was the opponent on the date of November 29, 1970 and the attendance was less than 31,427? | SELECT AVG("Week") FROM table_33752 WHERE "Date" = 'november 29, 1970' AND "Attendance" < '31,427' | wikisql |
CREATE TABLE table_name_27 (
new_team VARCHAR,
round VARCHAR,
player VARCHAR
) | Which new team has a compensation-a round, and Frank Catalanotto as a player? | SELECT new_team FROM table_name_27 WHERE round = "compensation-a" AND player = "frank catalanotto" | sql_create_context |
CREATE TABLE table_name_98 (
pick VARCHAR,
school VARCHAR
) | What is the Pick # of the Player from Southern MIssissippi? | SELECT COUNT(pick) FROM table_name_98 WHERE school = "southern mississippi" | sql_create_context |
CREATE TABLE table_name_54 (
date VARCHAR,
winning_score VARCHAR
) | On what date is the winning score 8 (70-71-67=208)? | SELECT date FROM table_name_54 WHERE winning_score = –8(70 - 71 - 67 = 208) | sql_create_context |
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... | Posts with pastall files newer then 5 months, grouped by user. | SELECT Posts.Id AS "post_link", Users.Id AS "user_link", PostTypes.Name AS type FROM Posts JOIN Users ON Users.Id = Posts.OwnerUserId JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Posts.Body LIKE '%pasteall.org%' AND DATEDIFF(month, Posts.CreationDate, CURRENT_TIMESTAMP()) <= 5 ORDER BY Users.Reputation DESC,... | sede |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID... | Please tell the salary of each hire date using a line chart, and rank X-axis from high to low order. | SELECT HIRE_DATE, SALARY FROM employees ORDER BY HIRE_DATE DESC | nvbench |
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
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE instructor (
... | This Fall , how many upper-level 8 -credit ASIAN classes are offered ? | SELECT COUNT(DISTINCT course.course_id) FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.credits = 8 AND course.department = 'ASIAN' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Fall... | advising |
CREATE TABLE table_17750 (
"Pos" real,
"Manufacturer" text,
"Seasons" text,
"Starts" real,
"Wins" real,
"Sole supplier" real,
"First win" text,
"Last win" text,
"Drivers" real,
"Constr." real
) | What was the first win for pos 6? | SELECT "First win" FROM table_17750 WHERE "Pos" = '6' | wikisql |
CREATE TABLE table_205 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Kickoff [a ]" text,
"Venue" text,
"TV" text,
"Attendance" real,
"Record" text
) | How many teams did they play week 6 | SELECT COUNT("Opponent") FROM table_205 WHERE "Week" = '6' | wikisql |
CREATE TABLE table_name_41 (
result VARCHAR,
nfl_recap VARCHAR,
game_site VARCHAR
) | What is the Result with an NFL Recap, played at bank of america stadium? | SELECT result FROM table_name_41 WHERE nfl_recap = "recap" AND game_site = "bank of america stadium" | sql_create_context |
CREATE TABLE table_203_800 (
id number,
"#" number,
"president" text,
"president's party" text,
"senate with" number,
"senate opposed" number,
"house with" number,
"house opposed" number,
"years served" number,
"elections won" number
) | how many years did the first three presidents serve combined ? | SELECT SUM("years served") FROM table_203_800 WHERE "#" <= 3 | squall |
CREATE TABLE table_name_89 (
technique VARCHAR,
highest_rank VARCHAR,
total VARCHAR
) | How much Technique has the Highest rank of yokozuna, and a Total larger than 11? | SELECT COUNT(technique) FROM table_name_89 WHERE highest_rank = "yokozuna" AND total > 11 | sql_create_context |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 为患者69016896检测指标301582的医务人员工号及姓名都是什么,从14年10月26日到15年11月3日这一年内? | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyj... | css |
CREATE TABLE table_name_41 (
round INTEGER,
overall VARCHAR,
position VARCHAR,
college VARCHAR
) | What's the average round for the OT position from tulane college with an overall over 38? | SELECT AVG(round) FROM table_name_41 WHERE position = "ot" AND college = "tulane" AND overall > 38 | sql_create_context |
CREATE TABLE table_29556461_8 (
record VARCHAR,
team VARCHAR
) | When dayton is the team what is the record? | SELECT record FROM table_29556461_8 WHERE team = "Dayton" | sql_create_context |
CREATE TABLE table_204_77 (
id number,
"number" text,
"builder" text,
"type" text,
"date" text,
"works number" number,
"notes" text
) | who is at the top of the list ? | SELECT "builder" FROM table_204_77 WHERE id = 1 | squall |
CREATE TABLE table_19305 (
"Team" text,
"Average" text,
"Points" real,
"Played" real,
"1991-92" text,
"1992-93" text,
"1993-94" real
) | What is the result in 91-92 for the team with a 1.053 average? | SELECT "1991-92" FROM table_19305 WHERE "Average" = '1.053' | wikisql |
CREATE TABLE table_26757_4 (
proto_slavic VARCHAR,
polish VARCHAR
) | When gniazdo is polish what is proto-slavic? | SELECT proto_slavic FROM table_26757_4 WHERE polish = "gniazdo" | sql_create_context |
CREATE TABLE table_name_33 (
date VARCHAR,
location VARCHAR
) | Name the date for faro | SELECT date FROM table_name_33 WHERE location = "faro" | 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,
... | until 2102, what are the three most frequent medications prescribed within 2 months to the patients with age 60 or above after having been diagnosed with chest pain? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'chest pain' AND STRFTIME('%y', diagnosis.diagnosis... | eicu |
CREATE TABLE table_66231 (
"!Event" real,
"Round" text,
"Surface" text,
"Winner" text,
"Opponent" text,
"Result" text
) | Which Event has a Surface of semifinal, and a Winner of hard (i)? | SELECT MAX("!Event") FROM table_66231 WHERE "Surface" = 'semifinal' AND "Winner" = 'hard (i)' | 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... | what is the number of patients whose insurance is self pay and days of hospital stay is greater than 30? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Self Pay" AND demographic.days_stay > "30" | mimicsql_data |
CREATE TABLE table_name_92 (
location___state VARCHAR,
date VARCHAR
) | What is the location/state of the race on 16 Jun? | SELECT location___state FROM table_name_92 WHERE date = "16 jun" | sql_create_context |
CREATE TABLE table_15872 (
"Player" text,
"No." real,
"Nationality" text,
"Position" text,
"Years in Toronto" text,
"School/Club Team" text
) | what school is rudy gay from | SELECT "School/Club Team" FROM table_15872 WHERE "Player" = 'Rudy Gay' | wikisql |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE patient (
uniquep... | what is patient 006-195310's height for the first time until 19 months ago? | SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-195310') AND NOT patient.admissionheight IS NULL AND DATETIME(patient.unitadmittime) <= DATETIME(CURRENT_TIME(), '-19 month') ORDER BY patient.unit... | eicu |
CREATE TABLE table_name_53 (
celebrity VARCHAR,
exited VARCHAR,
famous_for VARCHAR
) | Which celebrity who was famous for being the ex busted member and TV presenter exited on day 19? | SELECT celebrity FROM table_name_53 WHERE exited = "day 19" AND famous_for = "ex busted member and tv presenter" | sql_create_context |
CREATE TABLE table_15793 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | WHich Places have a score smaller than 69? | SELECT "Place" FROM table_15793 WHERE "Score" < '69' | wikisql |
CREATE TABLE party (
Party_ID int,
Minister text,
Took_office text,
Left_office text,
Region_ID int,
Party_name text
)
CREATE TABLE member (
Member_ID int,
Member_Name text,
Party_ID text,
In_office text
)
CREATE TABLE party_events (
Event_ID int,
Event_Name text,
P... | Show all party names and the number of members in each party Show bar chart, and order the total number in ascending order. | SELECT Party_name, COUNT(*) FROM member AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID ORDER BY COUNT(*) | nvbench |
CREATE TABLE track (
Track_ID int,
Name text,
Location text,
Seating real,
Year_Opened real
)
CREATE TABLE race (
Race_ID int,
Name text,
Class text,
Date text,
Track_ID text
) | Show the race class and number of races in each class with a bar chart, and sort in desc by the bars. | SELECT Class, COUNT(*) FROM race GROUP BY Class ORDER BY Class DESC | nvbench |
CREATE TABLE table_name_28 (
type VARCHAR,
principal_activities VARCHAR
) | Which Type has a Principal activities of health services? | SELECT type FROM table_name_28 WHERE principal_activities = "health services" | sql_create_context |
CREATE TABLE table_26853172_1 (
hand_number VARCHAR,
player_1 VARCHAR,
prevailing_wind VARCHAR
) | What is the hand number of the hand where player 1 is south and the east wind is prevailing? | SELECT COUNT(hand_number) FROM table_26853172_1 WHERE player_1 = "South" AND prevailing_wind = "East" | sql_create_context |
CREATE TABLE table_19293 (
"Series" text,
"Presenters" text,
"Start date" text,
"End date" text,
"Days in camp" real,
"Camp mates" real,
"Winner" text,
"Highest viewers (millions)" text,
"Lowest viewers (millions)" text,
"Average viewers (millions)" text
) | What was the least amount of camp mates? | SELECT MIN("Camp mates") FROM table_19293 | 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 ... | 看看医院7093559有多少科室在门诊就诊中开出超过28张检验报告单,时间为2013年7月16日到2015年11月17日 | SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '7093559' AND jybgb.BGRQ BETWEEN '2013-07-16' AND '2015-11-17' GROUP BY jybgb.KSBM HAVING COUNT(*) > 28) AS T | css |
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... | 姓名是曹云飞的患者分别在哪几次医疗记录中被开出的药品金额都少于了6638.96元?就诊时的编号是什么? | SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '曹云飞' AND NOT t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 6638.96) | css |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE restriction (
restriction_code text,
advance_purc... | please show me airlines with service from BOSTON to DENVER | SELECT DISTINCT airline.airline_code FROM airline, 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_na... | atis |
CREATE TABLE table_25312 (
"N" real,
"P" text,
"Name" text,
"EU" text,
"Country" text,
"Age" real,
"Type" text,
"Moving from" text,
"Transfer window" text,
"Ends" text,
"Transfer fee" text,
"Source" text
) | How many names have a country of civ? | SELECT COUNT("Name") FROM table_25312 WHERE "Country" = 'CIV' | wikisql |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE hz_info (
KH text,
KLX number... | 门诊诊断的患者患有急性支气管炎的籍贯代码是多少、籍贯名称叫啥和相应人数有多少? | SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_inf... | css |
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
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_da... | show me the costs and times for flights from SAN FRANCISCO to ATLANTA | SELECT DISTINCT fare.fare_id, flight.arrival_time, flight.departure_time 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 FRANCISCO' AND CITY_1.city_... | atis |
CREATE TABLE table_70964 (
"Index" text,
"Name" text,
"Chinese Name" text,
"Country" text,
"Status" text
) | What is the Chinese name of the Eliminated player from Singapore in Index f9? | SELECT "Chinese Name" FROM table_70964 WHERE "Status" = 'eliminated' AND "Country" = 'singapore' AND "Index" = 'f9' | wikisql |
CREATE TABLE table_23252 (
"School" text,
"Baseball stadium" text,
"Softball stadium" text,
"Basketball arena" text,
"Capacity" text
) | What is the capacity for the school that has the Owl Athletic Complex baseball stadium? | SELECT "Capacity" FROM table_23252 WHERE "Baseball stadium" = 'Owl Athletic Complex' | wikisql |
CREATE TABLE table_28420 (
"No." real,
"#" real,
"Title" text,
"Directed by" text,
"Written by" text,
"U.S. viewers (million)" text,
"Rank (week)" text,
"Original air date" text,
"Production code" text
) | What was the title of the episode directed by David Mamet? | SELECT "Title" FROM table_28420 WHERE "Directed by" = 'David Mamet' | wikisql |
CREATE TABLE course (
course_id text,
title text,
dept_name text,
credits number
)
CREATE TABLE section (
course_id text,
sec_id text,
semester text,
year number,
building text,
room_number text,
time_slot_id text
)
CREATE TABLE instructor (
id text,
name text,
... | Find the year and semester when offers the largest number of courses. | SELECT semester, year FROM section GROUP BY semester, year ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE t_kc21 (
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,
... | 年龄在10岁以下的病人的医疗记录的平均医疗费总额有多少 | SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_AGE < 10) | css |
CREATE TABLE table_11891841_2 (
name VARCHAR,
p VARCHAR
) | What is the name where p is mf? | SELECT name FROM table_11891841_2 WHERE p = "MF" | sql_create_context |
CREATE TABLE table_1341522_38 (
first_elected VARCHAR,
opponent VARCHAR
) | what's the first elected with opponent being ralph regula (r) 75.0% j. michael finn (d) 25.0% | SELECT first_elected FROM table_1341522_38 WHERE opponent = "Ralph Regula (R) 75.0% J. Michael Finn (D) 25.0%" | sql_create_context |
CREATE TABLE table_24596 (
"Year" real,
"Date" text,
"Driver" text,
"Team" text,
"Manufacturer" text,
"Laps" text,
"Miles (km)" text,
"Race Time" text,
"Average Speed (mph)" text,
"Report" text
) | How many miles were driven with the average speed at 116.81? | SELECT "Miles (km)" FROM table_24596 WHERE "Average Speed (mph)" = '116.81' | wikisql |
CREATE TABLE table_30749 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
) | Who wrote episode 27 in the series that was directed by Wendey Stanzler? | SELECT "Written by" FROM table_30749 WHERE "Directed by" = 'Wendey Stanzler' AND "No. in series" = '27' | wikisql |
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE city (
city_code varchar,
... | please show me all the flights from BOSTON | SELECT DISTINCT flight.flight_id FROM airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'BOSTON' AND flight.from_airport = airport_service.airport_code | atis |
CREATE TABLE table_45888 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real
) | In what venue was the event held on 14 February 2009? | SELECT "Venue" FROM table_45888 WHERE "Date" = '14 february 2009' | wikisql |
CREATE TABLE qtb (
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... | 在04年11月24日到16年1月8期间,患者52511497被开出药品107476384共有几次? | SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '52511497' AND t_kc22.STA_DATE BETWEEN '2004-11-24' AND '2016-01-08' AND t_kc22.SOC_SRT_DIRE_CD = '107476384' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_ID ... | css |
CREATE TABLE table_name_42 (
attendance VARCHAR,
date VARCHAR
) | What is the Attendance on 11/10/1928? | SELECT attendance FROM table_name_42 WHERE date = "11/10/1928" | sql_create_context |
CREATE TABLE table_name_88 (
institution VARCHAR,
nickname VARCHAR
) | Which institution has a nickname of Blue Hens? | SELECT institution FROM table_name_88 WHERE nickname = "blue hens" | sql_create_context |
CREATE TABLE table_name_53 (
head_coach VARCHAR,
location VARCHAR
) | Who is the head coach of the team located in Mudgeeraba? | SELECT head_coach FROM table_name_53 WHERE location = "mudgeeraba" | sql_create_context |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0... | For those employees who did not have any job in the past, visualize a scatter chart about the correlation between commission_pct and manager_id . | SELECT COMMISSION_PCT, MANAGER_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | nvbench |
CREATE TABLE table_name_86 (
grid VARCHAR,
driver VARCHAR,
laps VARCHAR
) | What was the grid for anthony davidson when the laps were less than 8? | SELECT COUNT(grid) FROM table_name_86 WHERE driver = "anthony davidson" AND laps < 8 | sql_create_context |
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,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For those employees who was hired before 2002-06-21, draw a scatter chart about the correlation between employee_id and department_id . | SELECT EMPLOYEE_ID, DEPARTMENT_ID FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | provide the number of patients whose discharge location is long term care hospital and procedure short title is form cutan ileoureterost? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "LONG TERM CARE HOSPITAL" AND procedures.short_title = "Form cutan ileoureterost" | mimicsql_data |
CREATE TABLE head (
head_id VARCHAR,
born_state VARCHAR
)
CREATE TABLE department (
creation VARCHAR,
department_id VARCHAR
)
CREATE TABLE management (
department_id VARCHAR,
head_id VARCHAR
) | What are the distinct creation years of the departments managed by a secretary born in state 'Alabama'? | SELECT DISTINCT T1.creation FROM department AS T1 JOIN management AS T2 ON T1.department_id = T2.department_id JOIN head AS T3 ON T2.head_id = T3.head_id WHERE T3.born_state = 'Alabama' | 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... | how many of the patients with unspecified protein-calorie malnutrition were treated with a base drug? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Unspecified protein-calorie malnutrition" AND prescriptions.drug_type = "BASE" | mimicsql_data |
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,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For those employees whose first name is ending with the letter m, sum their salary for visualizing a pie chart. | SELECT FIRST_NAME, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%m' GROUP BY FIRST_NAME | nvbench |
CREATE TABLE table_55988 (
"School's name" text,
"School's namesake" text,
"Year opened" text,
"Principal" text,
"Mascot" text
) | What is the mascot whose school opened in 1970? | SELECT "Mascot" FROM table_55988 WHERE "Year opened" = '1970' | 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,
... | 从00年二月二十一日到0八年八月二十九日,患者91428199在哪几个医院看过病 | SELECT COUNT(gwyjzb.MED_SER_ORG_NO) FROM gwyjzb WHERE gwyjzb.PERSON_ID = '91428199' AND gwyjzb.IN_HOSP_DATE BETWEEN '2000-02-21' AND '2008-08-29' UNION SELECT COUNT(fgwyjzb.MED_SER_ORG_NO) FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '91428199' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2000-02-21' AND '2008-08-29' | css |
CREATE TABLE table_10094 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) | Tell me the date for emery and home of ottawa with attendance more than 19,575 | SELECT "Date" FROM table_10094 WHERE "Decision" = 'emery' AND "Attendance" > '19,575' AND "Home" = 'ottawa' | wikisql |
CREATE TABLE table_name_39 (
name VARCHAR,
time VARCHAR
) | Who had a time of 26.11? | SELECT name FROM table_name_39 WHERE time = "26.11" | sql_create_context |
CREATE TABLE table_1341690_21 (
party VARCHAR,
incumbent VARCHAR
) | what is the party where the incumbent is edward boland? | SELECT party FROM table_1341690_21 WHERE incumbent = "Edward Boland" | sql_create_context |
CREATE TABLE table_204_459 (
id number,
"date" text,
"time" text,
"opponent" text,
"site" text,
"tv" text,
"result" text,
"attendance" number,
"record" text
) | which game had a higher attendance : 11/09/2013 or 12/20/2013 ? | SELECT "date" FROM table_204_459 WHERE "date" IN ('11/09/2013', '12/20/2013') ORDER BY "attendance" DESC LIMIT 1 | squall |
CREATE TABLE table_name_52 (
floors INTEGER,
street_address VARCHAR
) | How many floors does the building on 800 Boylston Street have? | SELECT MAX(floors) FROM table_name_52 WHERE street_address = "800 boylston street" | sql_create_context |
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,
... | 在医院0987112中根据入院诊断疾病编码不同疾病的平均病患的年龄是多少岁? | SELECT gwyjzb.IN_DIAG_DIS_CD, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '0987112' GROUP BY gwyjzb.IN_DIAG_DIS_CD UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '0987112' GROUP BY fgwyjzb.IN_DIAG_DIS_CD | css |
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... | provide the number of patients whose gender is m and diagnoses short title is injury femoral nerve? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.short_title = "Injury femoral nerve" | mimicsql_data |
CREATE TABLE table_6451 (
"Birth" text,
"Marriage" text,
"Became Duchess" text,
"Ceased to be Duchess" text,
"Death" text,
"Spouse" text
) | Who is The Spouse of the Duchess that has a Became Duchess on 31 october 1733 husband's accession? | SELECT "Spouse" FROM table_6451 WHERE "Became Duchess" = '31 october 1733 husband''s accession' | wikisql |
CREATE TABLE wrestler (
Name VARCHAR,
Days_held INTEGER
) | What are the names of wrestlers days held less than 100? | SELECT Name FROM wrestler WHERE Days_held < 100 | sql_create_context |
CREATE TABLE table_55519 (
"Rank" real,
"Name" text,
"Nation" text,
"SP+FS" real,
"Points" real,
"Places" real
) | What is the place number for adrian vasile with less than 127.74 points? | SELECT SUM("Places") FROM table_55519 WHERE "Name" = 'adrian vasile' AND "Points" < '127.74' | wikisql |
CREATE TABLE table_name_79 (
theme VARCHAR,
episode VARCHAR
) | Which theme has a Episode of top 6? | SELECT theme FROM table_name_79 WHERE episode = "top 6" | sql_create_context |
CREATE TABLE products (
code number,
name text,
price number,
manufacturer number
)
CREATE TABLE manufacturers (
code number,
name text,
headquarter text,
founder text,
revenue number
) | How many different products are produced in each headquarter city? | SELECT COUNT(DISTINCT T1.name), T2.headquarter FROM products AS T1 JOIN manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.headquarter | spider |
CREATE TABLE table_name_17 (
wins VARCHAR,
matches VARCHAR
) | what was the win for the 6 matches? | SELECT wins FROM table_name_17 WHERE matches = "6" | sql_create_context |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admi... | Which courses are useful to take before taking MEDCHEM 528 ? | SELECT DISTINCT advisory_requirement FROM course WHERE department = 'MEDCHEM' AND number = 528 | advising |
CREATE TABLE Video_games (
gtype VARCHAR
) | Which game type has least number of games? | SELECT gtype FROM Video_games GROUP BY gtype ORDER BY COUNT(*) LIMIT 1 | 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 job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE locations (
LOCAT... | For all employees who have the letters D or S in their first name, give me the comparison about the sum of department_id over the hire_date bin hire_date by weekday by a bar chart. | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | nvbench |
CREATE TABLE table_64968 (
"Year" real,
"Game" text,
"Genre" text,
"Platform(s)" text,
"Developer(s)" text
) | What is the smallest year when Ubisoft Montreal was the developer (s)? | SELECT MIN("Year") FROM table_64968 WHERE "Developer(s)" = 'ubisoft montreal' | 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 demographic (
subject_id text,
hadm_id t... | what is average age of patients whose death status is 0 and primary disease is pneumonia;human immunodefiency virus;rule out tuberculosis? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.diagnosis = "PNEUMONIA;HUMAN IMMUNODEFIENCY VIRUS;RULE OUT TUBERCULOSIS" | mimicsql_data |
CREATE TABLE table_name_76 (
to_par VARCHAR,
player VARCHAR
) | What was Bill Glasson's score to par after 2 rounds? | SELECT to_par FROM table_name_76 WHERE player = "bill glasson" | sql_create_context |
CREATE TABLE table_204_538 (
id number,
"pos." number,
"driver" text,
"co-driver" text,
"car" text,
"time" text
) | which driver drove the same car as luis serrado ? | SELECT "driver" FROM table_204_538 WHERE "driver" <> 'luis serrado' AND "car" = (SELECT "car" FROM table_204_538 WHERE "driver" = 'luis serrado') | squall |
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,
... | how much is the cost of the cholelith w ac cholecyst diagnosing? | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'cholelith w ac cholecyst')) | mimic_iii |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.