context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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,
... | 想知道3559148这个医疗机构在两千年一月十三日到零一年六月十五日的这一年多患者对医疗项目自付比例的平均值 | SELECT AVG(t_kc22.SELF_PAY_PRO) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '3559148' AND t_kc22.STA_DATE BETWEEN '2000-01-13' AND '2001-06-15' UNION SELECT AVG(t_kc22.SELF_PAY_PRO) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fg... | css |
CREATE TABLE table_54737 (
"Date" real,
"Country" text,
"Place" text,
"Building" text,
"Size" text
) | Name the least date for the place which has a building of victoria hall | SELECT MIN("Date") FROM table_54737 WHERE "Building" = 'victoria hall' | wikisql |
CREATE TABLE table_66175 (
"play" text,
"author" text,
"company" text,
"base" text,
"country" text
) | Who is the author of the Play Electra? | SELECT "author" FROM table_66175 WHERE "play" = 'electra' | wikisql |
CREATE TABLE table_name_4 (
grid INTEGER,
time_retired VARCHAR,
laps VARCHAR
) | What is the high grid that has a Time/Retired of +6 laps, and under 69 laps? | SELECT MAX(grid) FROM table_name_4 WHERE time_retired = "+6 laps" AND laps < 69 | sql_create_context |
CREATE TABLE table_name_78 (
points_for VARCHAR,
points_against VARCHAR
) | What were the points for that had a game where there was 678 against? | SELECT points_for FROM table_name_78 WHERE points_against = "678" | sql_create_context |
CREATE TABLE table_name_32 (
name VARCHAR,
left_office VARCHAR
) | Who left office on January 9, 1893 | SELECT name FROM table_name_32 WHERE left_office = "january 9, 1893" | sql_create_context |
CREATE TABLE table_2140071_5 (
season VARCHAR,
premier_date VARCHAR
) | How many seasons have a premier date of January 6, 2005? | SELECT COUNT(season) FROM table_2140071_5 WHERE premier_date = "January 6, 2005" | sql_create_context |
CREATE TABLE wine (
no number,
grape text,
winery text,
appelation text,
state text,
name text,
year number,
price number,
score number,
cases number,
drink text
)
CREATE TABLE grapes (
id number,
grape text,
color text
)
CREATE TABLE appellations (
no numbe... | Find the distinct names of wines produced before the year of 2000 or after the year of 2010. | SELECT DISTINCT name FROM wine WHERE year < 2000 OR year > 2010 | spider |
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
... | Show me a scatter chart for how many students are there for each major? | SELECT Major, COUNT(*) FROM Student GROUP BY Major | nvbench |
CREATE TABLE table_16388478_4 (
home_team VARCHAR,
away_team VARCHAR
) | Who was the home team when the away team is Carlton? | SELECT home_team FROM table_16388478_4 WHERE away_team = "Carlton" | sql_create_context |
CREATE TABLE table_27002 (
"Name of Village" text,
"Name in Syriac" text,
"Number of Believers" real,
"Number of Priests" real,
"Number of Churches" real
) | Name the number of believers for patavur | SELECT COUNT("Number of Believers") FROM table_27002 WHERE "Name of Village" = 'Patavur' | wikisql |
CREATE TABLE table_25917 (
"Episode" text,
"First broadcast" text,
"Seans team" text,
"Daves team" text,
"Scores" text
) | What was the first broadcast date of episode 4x03? | SELECT "First broadcast" FROM table_25917 WHERE "Episode" = '4x03' | wikisql |
CREATE TABLE table_75143 (
"Player" text,
"Position" text,
"Date of Birth (Age)" text,
"Caps" real,
"Club/province" text
) | Paddy Wallace who plays the position of fly-half has how many Caps? | SELECT "Caps" FROM table_75143 WHERE "Position" = 'fly-half' AND "Player" = 'paddy wallace' | wikisql |
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 prescriptions... | familiarize me with the death status and primary disease of the patient joseph dillman. | SELECT demographic.expire_flag, demographic.diagnosis FROM demographic WHERE demographic.name = "Joseph Dillman" | mimicsql_data |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | 从09年8月30日到12年10月24日这段时间内70984037号患者的所有检验报告单都在什么时间审核的? | (SELECT jybgb.SHSJ FROM hz_info JOIN mzjzjlb JOIN jybgb ON 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 WHERE hz_info.RYBH = '70984037' AND jybgb.BGRQ BETWEEN '2009-08-30' AND '2012-10-24') UNI... | css |
CREATE TABLE table_name_95 (
country VARCHAR,
player VARCHAR
) | What Country is Tom Kite from? | SELECT country FROM table_name_95 WHERE player = "tom kite" | sql_create_context |
CREATE TABLE table_203_298 (
id number,
"rank" number,
"name" text,
"nation(s)" text,
"born" text,
"ascended" text,
"years reigned" text
) | name the two kingdoms whose monarchs have the longest and second longest reign . | SELECT "nation(s)" FROM table_203_298 ORDER BY "years reigned" DESC LIMIT 2 | squall |
CREATE TABLE table_name_60 (
pct__percentage INTEGER,
goals_against INTEGER
) | What is the highest Pct %, when Goals Against is less than 229? | SELECT MAX(pct__percentage) FROM table_name_60 WHERE goals_against < 229 | sql_create_context |
CREATE TABLE table_71039 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
) | Which loss happened april 18? | SELECT "Loss" FROM table_71039 WHERE "Date" = 'april 18' | wikisql |
CREATE TABLE table_name_15 (
top_25 INTEGER,
wins INTEGER
) | What is the highest number of top-25s for events with 0 wins? | SELECT MAX(top_25) FROM table_name_15 WHERE wins < 0 | sql_create_context |
CREATE TABLE table_name_58 (
format VARCHAR,
frequency VARCHAR
) | what is the format when the frequency is fm 94.5? | SELECT format FROM table_name_58 WHERE frequency = "fm 94.5" | sql_create_context |
CREATE TABLE table_name_71 (
year_s__won VARCHAR,
total INTEGER
) | What year won has a total less than 281? | SELECT year_s__won FROM table_name_71 WHERE total < 281 | sql_create_context |
CREATE TABLE Lots (
lot_id INTEGER,
investor_id INTEGER,
lot_details VARCHAR(255)
)
CREATE TABLE Sales (
sales_transaction_id INTEGER,
sales_details VARCHAR(255)
)
CREATE TABLE Purchases (
purchase_transaction_id INTEGER,
purchase_details VARCHAR(255)
)
CREATE TABLE Investors (
invest... | Show the average transaction amount for different transaction types, show in ascending by the X-axis. | SELECT transaction_type_code, AVG(amount_of_transaction) FROM Transactions GROUP BY transaction_type_code ORDER BY transaction_type_code | nvbench |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | how many patients whose admission location is emergency room admit and diagnoses short title is ac kidny fail, tubr necr? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND diagnoses.short_title = "Ac kidny fail, tubr necr" | mimicsql_data |
CREATE TABLE table_name_2 (
record VARCHAR,
event VARCHAR,
method VARCHAR
) | What is Record, when Event is 'Independent Event', and when Method is 'Submission (Peruvian Necktie)'? | SELECT record FROM table_name_2 WHERE event = "independent event" AND method = "submission (peruvian necktie)" | sql_create_context |
CREATE TABLE table_32501 (
"Rank" real,
"Rider" text,
"Team" text,
"Speed" text,
"Time" text
) | What was #7 BMW's speed? | SELECT "Speed" FROM table_32501 WHERE "Team" = 'bmw' AND "Rank" = '7' | wikisql |
CREATE TABLE table_name_42 (
province_region VARCHAR,
home_campus VARCHAR
) | Where is the Holy Cross of Davao College campus located? | SELECT province_region FROM table_name_42 WHERE home_campus = "holy cross of davao college" | sql_create_context |
CREATE TABLE table_name_43 (
away_team VARCHAR,
home_team VARCHAR
) | Who faced off against St Kilda at their home? | SELECT away_team AS score FROM table_name_43 WHERE home_team = "st kilda" | sql_create_context |
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... | Visualize 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_name_69 (
height_in_ft VARCHAR,
no_s_ VARCHAR,
school_club_team_country VARCHAR
) | How tall is player 42 from Long Beach State? | SELECT height_in_ft FROM table_name_69 WHERE no_s_ = "42" AND school_club_team_country = "long beach state" | sql_create_context |
CREATE TABLE table_4773 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the home team score at windy hill? | SELECT "Home team score" FROM table_4773 WHERE "Venue" = 'windy hill' | wikisql |
CREATE TABLE table_72031 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | On what day was the record 30-31? | SELECT "Date" FROM table_72031 WHERE "Record" = '30-31' | wikisql |
CREATE TABLE table_name_4 (
budget VARCHAR,
year VARCHAR
) | What is 2005's budget figure? | SELECT budget FROM table_name_4 WHERE year = 2005 | sql_create_context |
CREATE TABLE table_19744915_18 (
rank INTEGER,
result VARCHAR,
public VARCHAR
) | When 8 is the public and the result is safe what is the highest rank? | SELECT MAX(rank) FROM table_19744915_18 WHERE result = "Safe" AND public = 8 | 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 the admission location of the patient id 6983? | SELECT demographic.admission_location FROM demographic WHERE demographic.subject_id = "6983" | mimicsql_data |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Na... | Top 20 users from Karur, Tamilnadu, India. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%karur%' OR UPPER(Location) LIKE '%karur' ORDER BY Reputation DESC LIMIT 20 | sede |
CREATE TABLE table_name_86 (
score VARCHAR,
visitor VARCHAR
) | What was the score when Minnesota visited? | SELECT score FROM table_name_86 WHERE visitor = "minnesota" | sql_create_context |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (... | what is the first time that patient 23858 received a prescription for d10w in 07/last year? | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23858) AND prescriptions.drug = 'd10w' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m'... | mimic_iii |
CREATE TABLE table_79031 (
"Shooter" text,
"Event" text,
"Rank points" text,
"Score points" text,
"Total" text
) | With a total of 11, and 10 rank points, what are the score points? | SELECT "Score points" FROM table_79031 WHERE "Rank points" = '10' AND "Total" = '11' | wikisql |
CREATE TABLE table_29534 (
"Country" text,
"Series Programmes" text,
"Series Seasons Programmes" text,
"Television channel" text,
"Television network" text,
"Series premiere" text,
"Series end" text,
"Status" text,
"Available" text
) | What is the television network with the television channel of Astro Pelangi & Astro Bintang? | SELECT "Television network" FROM table_29534 WHERE "Television channel" = 'Astro Pelangi & Astro Bintang' | wikisql |
CREATE TABLE table_59100 (
"Original NFL team" text,
"Player" text,
"Pos." text,
"College" text,
"Conf." text
) | What college had Jim Leonhard Category:articles with hcards? | SELECT "College" FROM table_59100 WHERE "Player" = 'jim leonhard category:articles with hcards' | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | what is the number of patients whose ethnicity is american indian/alaska native and lab test name is lymphs? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND lab.label = "Lymphs" | mimicsql_data |
CREATE TABLE table_44744 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What is the lowest Game, when High Assists is 'Maurice Williams (8)'? | SELECT MIN("Game") FROM table_44744 WHERE "High assists" = 'maurice williams (8)' | wikisql |
CREATE TABLE table_1826 (
"Episodes" text,
"Monday" text,
"Tuesday" text,
"Wednesday" text,
"Thursday" text,
"Friday" text
) | which episode was Transmitted on wednesday if the episode of '319 sucker punch' was transmitted on tuesday? | SELECT COUNT("Wednesday") FROM table_1826 WHERE "Tuesday" = '319 Sucker Punch' | 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 ... | 28140515这个病人的检验报告单结果指标均异常的有哪些?看看检验报告的单号 | SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb ON 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 WHERE hz_info.RYBH = '28140515' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WH... | css |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE p... | what was the first time patient 017-88691 has had the maximum systemicdiastolic today? | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-88691')) AND NOT vitalperiodic.systemicdiastoli... | eicu |
CREATE TABLE table_33537 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the average number of bronzes when the rank is below 11 for trinidad and tobago with less than 1 total medal? | SELECT AVG("Bronze") FROM table_33537 WHERE "Rank" < '11' AND "Nation" = 'trinidad and tobago' AND "Total" < '1' | wikisql |
CREATE TABLE table_14415 (
"Sunday Surya (the Sun)" text,
"Monday Soma (the Moon)" text,
"Tuesday Mangala (Mars)" text,
"Friday Shukra (Venus)" text,
"Saturday Shani (Saturn)" text
) | What is the result on Sunday that's somav r on Monday and mangalav r on Tuesday? | SELECT "Sunday Surya (the Sun)" FROM table_14415 WHERE "Monday Soma (the Moon)" = 'सोमवार somavār' AND "Tuesday Mangala (Mars)" = 'मंगलवार mangalavār' | wikisql |
CREATE TABLE takes (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
grade varchar(2)
)
CREATE TABLE teaches (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0)
)
CREATE TABLE secti... | Visualize a bar chart about the distribution of dept_name and the sum of salary , and group by attribute dept_name. | SELECT dept_name, SUM(salary) FROM instructor GROUP BY dept_name ORDER BY salary | nvbench |
CREATE TABLE table_1982 (
"Name" text,
"Home or representative town or province" text,
"Age" real,
"Season" text,
"Total days in PBB House" real,
"Duration" text,
"Status" text
) | When cindy miranda is the name what is the home or representative town or province? | SELECT "Home or representative town or province" FROM table_1982 WHERE "Name" = 'Cindy Miranda' | wikisql |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit... | what test was given to patient 74624 for the first time this month. | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 74624) AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month... | mimic_iii |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight i... | what are the flights from MONTREAL to CHICAGO | 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 = 'MONTREAL' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CHICA... | atis |
CREATE TABLE table_name_97 (
mls_team VARCHAR,
affiliation VARCHAR
) | What MLS team is affiliated with yale university? | SELECT mls_team FROM table_name_97 WHERE affiliation = "yale university" | sql_create_context |
CREATE TABLE table_name_21 (
date VARCHAR,
away_team VARCHAR
) | What was the date that featured a game against Gold Coast Blaze? | SELECT date FROM table_name_21 WHERE away_team = "gold coast blaze" | sql_create_context |
CREATE TABLE table_204_779 (
id number,
"network name" text,
"flagship" text,
"programming type" text,
"owner" text,
"affiliates" number
) | what is the only network owned by national polytechnic institute ? | SELECT "network name" FROM table_204_779 WHERE "owner" = 'national polytechnic institute' | squall |
CREATE TABLE table_train_127 (
"id" int,
"depression" bool,
"mini_mental_state_examination_mmse" int,
"back_pain" bool,
"renal_disease" bool,
"osteoarthritis" bool,
"hamilton_depression_scale_hds" int,
"liver_disease" bool,
"painful_condition" bool,
"other_chronic_musculoskeletal... | history of a typically painful condition, such as osteoarthritis, back pain, or other chronic musculoskeletal pain | SELECT * FROM table_train_127 WHERE painful_condition = 1 OR (osteoarthritis = 1 OR back_pain = 1 OR other_chronic_musculoskeletal_pain = 1) | criteria2sql |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 医疗就诊28989122618给病号93310389开的每种药品具体的名称及其每次的用量和频次都分别是什么? | SELECT SOC_SRT_DIRE_NM, EACH_DOSAGE, USE_FRE FROM t_kc22 WHERE MED_CLINIC_ID = '28989122618' | css |
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 (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
... | i want a flight from TORONTO to SAN DIEGO | 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 = 'TORONTO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN DI... | atis |
CREATE TABLE table_name_24 (
theme VARCHAR,
special_notes VARCHAR
) | What theme has special notes from calgary flames gift set? | SELECT theme FROM table_name_24 WHERE special_notes = "from calgary flames gift set" | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE allergy (
allergyid number,... | oh what is the average value of triglycerides on patient 028-70851 on the first hospital visit? | SELECT AVG(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 = '028-70851' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospital... | eicu |
CREATE TABLE table_name_92 (
launch_date VARCHAR,
odds_of_winning VARCHAR
) | What is the launch date odds of winning 1 in 4.44? | SELECT launch_date FROM table_name_92 WHERE odds_of_winning = "1 in 4.44" | sql_create_context |
CREATE TABLE table_50046 (
"Rank" real,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
) | What is the 2012 with a mini in 2009? | SELECT "2012" FROM table_50046 WHERE "2009" = 'mini' | wikisql |
CREATE TABLE table_70688 (
"Season" real,
"Champion" text,
"Motorcycle" text,
"Wins" real,
"2nd pl." real,
"3rd pl." real,
"Team" text
) | Who is the champion when the motorcycle is ducati 916 and 2nd place is less than 5? | SELECT "Champion" FROM table_70688 WHERE "Motorcycle" = 'ducati 916' AND "2nd pl." < '5' | wikisql |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | 在哪几次医疗记录中,患者02519154被开出过金额不低于6518.86元的药品?列出有什么医疗就诊编号? | SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '02519154' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT >= 6518.86) | css |
CREATE TABLE table_10717 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | How many grids for heinz-harald frentzen with 61 laps? | SELECT COUNT("Grid") FROM table_10717 WHERE "Laps" = '61' AND "Driver" = 'heinz-harald frentzen' | wikisql |
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREA... | is there a flight from BALTIMORE to SAN FRANCISCO with a stop in DENVER on TW | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND CI... | atis |
CREATE TABLE table_name_43 (
tries_against VARCHAR,
losing_bonus VARCHAR
) | What Tries against has a Losing bonus of 7? | SELECT tries_against FROM table_name_43 WHERE losing_bonus = "7" | sql_create_context |
CREATE TABLE table_name_19 (
rank INTEGER,
headquarters VARCHAR,
screens VARCHAR
) | What is the rank of the cinema when the headquarters are in toronto, ON and the screens is less than 1,438? | SELECT AVG(rank) FROM table_name_19 WHERE headquarters = "toronto, on" AND screens < 1 OFFSET 438 | sql_create_context |
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
... | Name all of the classes Dr. Amy Schrank has previously taught . | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course_offering.semester < (SELECT SEMESTERalias0.semester_id FROM semester AS SEMESTERalias0 WHERE SEMESTERalias0.semester = 'WN' AND SEMESTERalias0.year = 2016) AND course.course_id = cour... | advising |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostsWithDe... | Questions with highest amount of bounties. | SELECT SUM(v.BountyAmount), p.Id AS "post_link", p.ViewCount FROM Posts AS p JOIN Votes AS v ON v.PostId = p.Id WHERE v.VoteTypeId = 8 GROUP BY p.Id, p.ViewCount ORDER BY SUM(v.BountyAmount) DESC LIMIT 500 | sede |
CREATE TABLE table_64809 (
"Class" text,
"Railway number(s)" text,
"DRG number(s)" text,
"Quantity" real,
"Year(s) of manufacture" text,
"Axle arrangement ( UIC ) Bauart" text
) | What is average quantity, when DRG number is 99 011? | SELECT AVG("Quantity") FROM table_64809 WHERE "DRG number(s)" = '99 011' | wikisql |
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_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
... | how many patients the last year were staying in the careunit micu? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'micu' AND DATETIME(transfers.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) | mimic_iii |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
... | the number of patients in ward 290 since 5 years ago? | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 290 AND DATETIME(patient.unitadmittime) >= DATETIME(CURRENT_TIME(), '-5 year') | eicu |
CREATE TABLE table_name_32 (
conference_finals INTEGER,
finals INTEGER
) | Can you tell me the average Conference Finals that has Finals smaller than 5? | SELECT AVG(conference_finals) FROM table_name_32 WHERE finals < 5 | sql_create_context |
CREATE TABLE table_77936 (
"Race Title" text,
"Circuit" text,
"City / State" text,
"Date" text,
"Winner" text,
"Team" text
) | Name the date for race title lakeside | SELECT "Date" FROM table_77936 WHERE "Race Title" = 'lakeside' | 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,
... | provide the number of patients whose admission type is elective and admission year is less than 2105? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.admityear < "2105" | mimicsql_data |
CREATE TABLE table_35855 (
"Season" real,
"Overall" text,
"Slalom" text,
"Giant Slalom" text,
"Super G" text,
"Combined" text
) | What is the earliest season with a Giant Slalom of 5? | SELECT MIN("Season") FROM table_35855 WHERE "Giant Slalom" = '5' | wikisql |
CREATE TABLE table_48226 (
"Rank" real,
"Player" text,
"Years" text,
"Games" real,
"Reb. Avg." real,
"Total Rebounds" real
) | How many rebounds have a Player of herb estes? | SELECT COUNT("Total Rebounds") FROM table_48226 WHERE "Player" = 'herb estes' | 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 lab (
subject_id text,
hadm_id text,
... | what is diagnoses short title and procedure icd9 code of subject id 74032? | SELECT diagnoses.short_title, procedures.icd9_code FROM diagnoses INNER JOIN procedures ON diagnoses.hadm_id = procedures.hadm_id WHERE diagnoses.subject_id = "74032" | mimicsql_data |
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,
... | how many patients who had been diagnosed with heavy-for-date infan nec since 2102? | 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 = 'heavy-for-date infan nec') AND STRFTIME('%y', diagnoses_ic... | mimic_iii |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (... | what is diagnoses short title of diagnoses icd9 code 2875? | SELECT diagnoses.short_title FROM diagnoses WHERE diagnoses.icd9_code = "2875" | mimicsql_data |
CREATE TABLE table_name_37 (
region VARCHAR,
date VARCHAR,
catalog VARCHAR
) | What region is dated April 30, 2004, and cataloged Nebdj058? | SELECT region FROM table_name_37 WHERE date = "april 30, 2004" AND catalog = "nebdj058" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE microlab (
microlabid number,
... | patient 032-32248 had undergone a wound care - special care bed in other hospitals? | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '032-32248' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '032-32248' AND patient.hospitaldischargetime IS NULL)) AND tr... | eicu |
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 (... | among patients on urgent admission, how many of them had a lab test for amylase and body fluid? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.label = "Amylase, Body Fluid" | mimicsql_data |
CREATE TABLE table_3956 (
"Code" text,
"District" text,
"Headquarters" text,
"Population (2001 Census)" real,
"Population (2011 Census)" real,
"Area (km\u00b2)" real,
"Density in 2011 (/km\u00b2)" text
) | How big (in km2) is the district with a code BW? | SELECT MIN("Area (km\u00b2)") FROM table_3956 WHERE "Code" = 'BW' | wikisql |
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,
... | how much is the price for ondansetron 2 mg/1 ml 2ml sdv inj? | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'ondansetron 2 mg/1 ml 2ml sdv inj') | eicu |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | When was the patient with id 29961 discharged? Specify the time and location | SELECT demographic.discharge_location, demographic.dischtime FROM demographic WHERE demographic.subject_id = "29961" | mimicsql_data |
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... | 列出开出的检验报告单在医院4651944中,不同检测指标名称以及不同检测指标结果定量单位下,检测指标结果定量的平均值在2006-10-08到2007-11-01内是多少,保留平均值最小的1项? | SELECT jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDW, AVG(jyjgzbb.JCZBJGDL) FROM jyjgzbb JOIN jybgb_jyjgzbb JOIN jybgb ON jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JYZBLSH AND jybgb_jyjgzbb.jyjgzbb_id = jyjgzbb.jyjgzbb_id AND jybgb_jyjgzbb.YLJGDM = jybgb.YLJGDM WHERE jybgb.YLJGDM = '4651944' AND jyjgzbb.BGRQ BETWEEN '2006-10-08' AND '2007-11... | css |
CREATE TABLE table_name_24 (
player VARCHAR,
school VARCHAR
) | who is the player when the school is spring hs (spring, texas)? | SELECT player FROM table_name_24 WHERE school = "spring hs (spring, texas)" | sql_create_context |
CREATE TABLE table_name_23 (
venue VARCHAR,
date VARCHAR
) | What venue was the 11 September 2012 game? | SELECT venue FROM table_name_23 WHERE date = "11 september 2012" | sql_create_context |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id numbe... | what was the last value of patient 80555's laboratory test for ptt in the current hospital encounter? | SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 80555 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'ptt') ORDER BY labevents.charttime DESC LIMIT 1 | mimic_iii |
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight re... | A bar chart shows the distribution of Sex and the sum of Height , and group by attribute Sex, order in desc by the y-axis. | SELECT Sex, SUM(Height) FROM people GROUP BY Sex ORDER BY SUM(Height) DESC | nvbench |
CREATE TABLE table_51726 (
"Player" text,
"Nationality" text,
"Position" text,
"Years for Jazz" text,
"School/Club Team" text
) | At Position of guard, from the School/Club Team Notre Dame, how many Years for Jazz did that person play? | SELECT "Years for Jazz" FROM table_51726 WHERE "Position" = 'guard' AND "School/Club Team" = 'notre dame' | wikisql |
CREATE TABLE table_name_38 (
to_par INTEGER,
total VARCHAR,
country VARCHAR,
year_s__won VARCHAR
) | What is the sum of the to par for the United States in the winning year of 1967, and has a total of more than 146? | SELECT SUM(to_par) FROM table_name_38 WHERE country = "united states" AND year_s__won = "1967" AND total > 146 | sql_create_context |
CREATE TABLE table_3540 (
"Week" real,
"Date" text,
"Kickoff" text,
"Opponent" text,
"Final score" text,
"Team record" text,
"Game site" text,
"Attendance" real
) | How many different kickoffs happened when the opponent was the Scottish Claymores | SELECT COUNT("Kickoff") FROM table_3540 WHERE "Opponent" = 'Scottish Claymores' | wikisql |
CREATE TABLE table_51189 (
"Player" text,
"Position" text,
"First-Team Appearances" text,
"First-Team Goals" text,
"Current Club" text
) | Who is the player who has had 7 first team appearances? | SELECT "Player" FROM table_51189 WHERE "First-Team Appearances" = '7' | wikisql |
CREATE TABLE table_1341423_38 (
party VARCHAR,
incumbent VARCHAR
) | How many parties is the incumbent Bob Brady a member of? | SELECT COUNT(party) FROM table_1341423_38 WHERE incumbent = "Bob Brady" | sql_create_context |
CREATE TABLE table_23248910_9 (
team VARCHAR,
date VARCHAR
) | What is every team on March 5? | SELECT team FROM table_23248910_9 WHERE date = "March 5" | sql_create_context |
CREATE TABLE table_name_87 (
venue VARCHAR,
away_team VARCHAR
) | What venue had footscray play at it? | SELECT venue FROM table_name_87 WHERE away_team = "footscray" | sql_create_context |
CREATE TABLE table_name_52 (
goal_difference INTEGER,
points VARCHAR,
wins VARCHAR
) | What is the highest goal difference that the club with 33-5 points and less than 12 wins? | SELECT MAX(goal_difference) FROM table_name_52 WHERE points = "33-5" AND wins < 12 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.