context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 在号码为2471866的医院的各科室中把它们的名称、编码以及平均住院时长都列出来,并且按照平均住院时长升序排序出来? | SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.MED_ORG_DEPT_NM, AVG(t_kc21.IN_HOSP_DAYS) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '2471866' GROUP BY t_kc21.MED_ORG_DEPT_CD ORDER BY AVG(t_kc21.IN_HOSP_DAYS) | css |
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,
... | 列出在2007年3月19日到2009年3月8日内患者22871857所有检验报告单什么时候审核的? | 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 = '22871857' AND jybgb.BGRQ BETWEEN '2007-03-19' AND '2009-03-08' UNION... | css |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
war... | when did patient 6580 get admitted to the hospital via the hospital er admit for the last time in 2105? | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 6580 AND admissions.admission_location = 'emergency room admit' AND STRFTIME('%y', admissions.admittime) = '2105' ORDER BY admissions.admittime DESC LIMIT 1 | mimic_iii |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid... | how many patients received a foreign body microbiology test until 4 years ago? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT microbiologyevents.hadm_id FROM microbiologyevents WHERE microbiologyevents.spec_type_desc = 'foreign body' AND DATETIME(microbiologyevents.charttime) <= DATETIME(CURRENT_TIME(), '-4 year')) | mimic_iii |
CREATE TABLE table_name_68 (
film_title VARCHAR,
director VARCHAR
) | Name the film that Lu directed. | SELECT film_title FROM table_name_68 WHERE director = "lu" | 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 prescriptions... | provide the number of patients whose primary disease is guillain barre syndrome and year of birth is less than 2152? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "GUILLAIN BARRE SYNDROME" AND demographic.dob_year < "2152" | mimicsql_data |
CREATE TABLE table_11801 (
"Week" text,
"Date" text,
"Opponent" text,
"Result" text,
"Kickoff [a ]" text,
"Game site" text,
"Attendance" text,
"Record" text
) | What was the team record by Week 8? | SELECT "Record" FROM table_11801 WHERE "Week" = '8' | wikisql |
CREATE TABLE table_name_63 (
population__2010_ VARCHAR,
province VARCHAR
) | What was the population in North Jeolla? | SELECT population__2010_ FROM table_name_63 WHERE province = "north jeolla" | sql_create_context |
CREATE TABLE table_10577579_3 (
joined VARCHAR,
women’s_nickname VARCHAR
) | Name the joined for the wolfpack women's nickname | SELECT joined FROM table_10577579_3 WHERE women’s_nickname = "Wolfpack" | sql_create_context |
CREATE TABLE table_name_78 (
constructor VARCHAR,
chassis VARCHAR,
driver VARCHAR
) | Who is the constructor when the chassis is talbot-lago t26c and the driver is charles pozzi? | SELECT constructor FROM table_name_78 WHERE chassis = "talbot-lago t26c" AND driver = "charles pozzi" | 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... | 在病患73506592就诊期间医疗费总额使用了高于2109.01元的记录都是什么,在入院时诊断出的疾病号码与名称是多些? | SELECT gwyjzb.IN_DIAG_DIS_CD, gwyjzb.IN_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_ID = '73506592' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 2109.01) UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, fgwyjzb.IN_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '73506592' AND fgw... | css |
CREATE TABLE table_test_21 (
"id" int,
"gender" string,
"systolic_blood_pressure_sbp" int,
"tachycardia" int,
"body_weight" float,
"renal_disease" bool,
"anaemia" bool,
"creatinine_clearance_cl" float,
"estimated_glomerular_filtration_rate_egfr" int,
"cardiogenic_shock" bool,
... | severe bradycardia ( heart rate < 50 beats per minutes ) | SELECT * FROM table_test_21 WHERE severe_bradycardia = 1 AND heart_rate < 50 | criteria2sql |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 病患56819536从06年11月26日到21年1月2日内检查的次数是多少次? | SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '56819536' AND t_kc22.STA_DATE BETWEEN '2006-11-26' AND '2021-01-02' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE table_10429820_13 (
in_ames VARCHAR
) | When the value of 'since beginning of big 12' is synonymous with its' category, what are the in Ames values? | SELECT in_ames FROM table_10429820_13 WHERE "since_beginning_of_big_12" = "since_beginning_of_big_12" | sql_create_context |
CREATE TABLE table_1342149_6 (
party VARCHAR,
incumbent VARCHAR
) | Which party had Clair Engle as an incumbent? | SELECT party FROM table_1342149_6 WHERE incumbent = "Clair Engle" | sql_create_context |
CREATE TABLE table_72228 (
"Region" text,
"Country" text,
"No. of Sikhs" text,
"Sikh %" text,
"% of all Sikhs" text
) | What is the number of sikhs in Japan? | SELECT "No. of Sikhs" FROM table_72228 WHERE "Country" = 'Japan' | wikisql |
CREATE TABLE table_name_19 (
date VARCHAR,
competition VARCHAR
) | What is the date of the 1986 FIFA World Cup? | SELECT date FROM table_name_19 WHERE competition = "1986 fifa world cup" | sql_create_context |
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Participates_in (
stuid INTEGER,
actid INTEGER
)
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1),
Phone INTEGER,
Room VARCHAR(5),
... | Show all the faculty ranks and the number of students advised by each rank. Show the proportion. | SELECT Rank, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.Advisor GROUP BY T1.Rank | nvbench |
CREATE TABLE table_name_84 (
date VARCHAR,
attendance VARCHAR
) | What was the date when the attendance was 48,041? | SELECT date FROM table_name_84 WHERE attendance = "48,041" | sql_create_context |
CREATE TABLE mzb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | 查询4944209这个医院从19年11月19到20年2月23医疗的异地患者的次数 | SELECT COUNT(*) FROM qtb WHERE qtb.MED_SER_ORG_NO = '4944209' AND qtb.IN_HOSP_DATE BETWEEN '2019-11-19' AND '2020-02-23' AND qtb.REMOTE_SETTLE_FLG = '异地1' OR qtb.REMOTE_SETTLE_FLG = '异地2' UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '4944209' AND gyb.IN_HOSP_DATE BETWEEN '2019-11-19' AND '2020-02-23' AND g... | css |
CREATE TABLE table_name_98 (
name VARCHAR,
opened VARCHAR,
park VARCHAR
) | What is the name of the roller coaster that opened in 2000 in Brighton Pier? | SELECT name FROM table_name_98 WHERE opened = 2000 AND park = "brighton pier" | sql_create_context |
CREATE TABLE table_22993636_5 (
minutes VARCHAR,
player VARCHAR
) | For how long did Jordan Coleman play? | SELECT minutes FROM table_22993636_5 WHERE player = "Jordan Coleman" | sql_create_context |
CREATE TABLE table_name_79 (
goals INTEGER,
average VARCHAR,
matches VARCHAR
) | For averages of 1.58 and matches under 38, what is the average number of goals? | SELECT AVG(goals) FROM table_name_79 WHERE average = 1.58 AND matches < 38 | sql_create_context |
CREATE TABLE table_name_19 (
location___state VARCHAR,
circuit VARCHAR
) | Where is the Eastern Creek Raceway located? | SELECT location___state FROM table_name_19 WHERE circuit = "eastern creek raceway" | sql_create_context |
CREATE TABLE table_name_63 (
year_joined VARCHAR,
enrollment VARCHAR,
ihsaa_class VARCHAR
) | What year joined had an enrollment less than 438 and an AA as the IHSAA Class? | SELECT year_joined FROM table_name_63 WHERE enrollment < 438 AND ihsaa_class = "aa" | sql_create_context |
CREATE TABLE table_name_53 (
release_price___usd__ VARCHAR,
model_number VARCHAR
) | What was the release price of the Atom Z510PT processor? | SELECT release_price___usd__ FROM table_name_53 WHERE model_number = "atom z510pt" | sql_create_context |
CREATE TABLE table_16632 (
"School" text,
"Location" text,
"Enrolment" real,
"Founded" real,
"Denomination" text,
"Day/Boarding" text,
"School Colours" text,
"Abbreviation" text,
"In competition since" real
) | How many schools are located in South Brisbane? | SELECT COUNT("School") FROM table_16632 WHERE "Location" = 'South Brisbane' | wikisql |
CREATE TABLE table_11465521_2 (
week VARCHAR,
record VARCHAR
) | In which week was the game against a team with a record of 3-6 played? | SELECT COUNT(week) FROM table_11465521_2 WHERE record = "3-6" | sql_create_context |
CREATE TABLE table_25838 (
"Model" text,
"Engine" text,
"Displacement" text,
"Max. power output" text,
"Peak torque" text,
"0\u2013100km/h,s 0-62mph,s" text,
"Top speed" text,
"CO 2 emissions" text,
"Years" text,
"Note" text,
"Engine code" text
) | List the highest power output level for models that go from 0-62 MPH in 8.5 seconds. | SELECT "Max. power output" FROM table_25838 WHERE "0\u2013100km/h,s 0-62mph,s" = '8.5' | wikisql |
CREATE TABLE apartment_buildings (
building_id number,
building_short_name text,
building_full_name text,
building_description text,
building_address text,
building_manager text,
building_phone text
)
CREATE TABLE apartment_facilities (
apt_id number,
facility_code text
)
CREATE TA... | What apartment type codes and apartment numbers do the buildings managed by 'Kyle' have? | SELECT T2.apt_type_code, T2.apt_number FROM apartment_buildings AS T1 JOIN apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_manager = "Kyle" | spider |
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,... | provide the number of patients whose procedure short title is aortocor bypas-2 cor art? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.short_title = "Aortocor bypas-2 cor art" | mimicsql_data |
CREATE TABLE table_name_53 (
rank INTEGER,
nation VARCHAR,
silver VARCHAR
) | Which Rank has a Nation of south korea, and a Silver larger than 0? | SELECT SUM(rank) FROM table_name_53 WHERE nation = "south korea" AND silver > 0 | sql_create_context |
CREATE TABLE table_665 (
"Year" real,
"Dates" text,
"Champion" text,
"Country" text,
"Winning score" text,
"To par" text,
"Margin of victory" text,
"Purse ( $ )" real,
"Winners share ($)" real
) | What is the number of 'to par' in Mexico with a winning score of 67-67-69-70=273? | SELECT "To par" FROM table_665 WHERE "Country" = 'Mexico' AND "Winning score" = '67-67-69-70=273' | wikisql |
CREATE TABLE table_12795 (
"Location" text,
"Year" real,
"Champion" text,
"Runner-up" text,
"Score" text
) | When Ilie N stase beat runner-up Peter Fleming what year was it? | SELECT COUNT("Year") FROM table_12795 WHERE "Champion" = 'ilie năstase' AND "Runner-up" = 'peter fleming' | wikisql |
CREATE TABLE table_27303975_3 (
copyright_information VARCHAR,
catalog_number VARCHAR
) | how many times was the catalog number cal04 / 0091037553546? | SELECT COUNT(copyright_information) FROM table_27303975_3 WHERE catalog_number = "CAL04 / 0091037553546" | sql_create_context |
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_season int,
Title text,
Directed_by text,
Original_air_date text,
Production_code text
)
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE schedule... | Return a bar chart on what are the title and maximum price of each film? | SELECT Title, MAX(T1.Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Title | nvbench |
CREATE TABLE table_28365816_2 (
conference VARCHAR,
regular_season_winner VARCHAR
) | How many entries for conference tournament are listed when Texas Western is the regular season winner? | SELECT COUNT(conference) AS Tournament FROM table_28365816_2 WHERE regular_season_winner = "Texas Western" | sql_create_context |
CREATE TABLE table_name_94 (
drawn INTEGER,
name VARCHAR,
position VARCHAR
) | what is the least drawn when the name is sv apfeldorf and the position is more than 8? | SELECT MIN(drawn) FROM table_name_94 WHERE name = "sv apfeldorf" AND position > 8 | sql_create_context |
CREATE TABLE table_10733530_3 (
_percentage_growth__2000_2008_ VARCHAR,
nation VARCHAR
) | What is the percentage of growth in 2000-2008 in ethiopia? | SELECT _percentage_growth__2000_2008_ FROM table_10733530_3 WHERE nation = "Ethiopia" | sql_create_context |
CREATE TABLE table_name_52 (
tie_no VARCHAR,
home_team VARCHAR
) | Scunthorpe United as the home team has what tie number? | SELECT tie_no FROM table_name_52 WHERE home_team = "scunthorpe united" | sql_create_context |
CREATE TABLE table_23266 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | Name the incumbent for sue myrick (r) 69.0% jeff doctor (d) 31.0% | SELECT "Incumbent" FROM table_23266 WHERE "Candidates" = 'Sue Myrick (R) 69.0% Jeff Doctor (D) 31.0%' | wikisql |
CREATE TABLE table_15187735_18 (
segment_d VARCHAR,
segment_b VARCHAR
) | Name the number of sement d for solar water heaters | SELECT COUNT(segment_d) FROM table_15187735_18 WHERE segment_b = "Solar Water Heaters" | sql_create_context |
CREATE TABLE table_8801 (
"Runs" text,
"Wicket" text,
"Batting partners" text,
"Batting team" text,
"Fielding team" text,
"Venue" text,
"Season" text
) | Which batting team had 624 runs? | SELECT "Batting team" FROM table_8801 WHERE "Runs" = '624' | wikisql |
CREATE TABLE STUDENT (
STU_NUM int,
STU_LNAME varchar(15),
STU_FNAME varchar(15),
STU_INIT varchar(1),
STU_DOB datetime,
STU_HRS int,
STU_CLASS varchar(2),
STU_GPA float(8),
STU_TRANSFER numeric,
DEPT_CODE varchar(18),
STU_PHONE varchar(4),
PROF_NUM int
)
CREATE TABLE PR... | Find the minimum gpa of all students in each department with a bar chart, and display in desc by the Y. | SELECT DEPT_CODE, MIN(STU_GPA) FROM STUDENT GROUP BY DEPT_CODE ORDER BY MIN(STU_GPA) DESC | nvbench |
CREATE TABLE table_name_27 (
rank_by_average INTEGER,
average VARCHAR,
number_of_dances VARCHAR
) | What was the highest rank by average of a couple who had an average of 25.3 and had more than 10 dances? | SELECT MAX(rank_by_average) FROM table_name_27 WHERE average = 25.3 AND number_of_dances > 10 | sql_create_context |
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE... | Return a bar chart about the distribution of meter_200 and the sum of meter_100 , and group by attribute meter_200, order bar from high to low order. | SELECT meter_200, SUM(meter_100) FROM swimmer GROUP BY meter_200 ORDER BY meter_200 DESC | nvbench |
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE time_zone (
time_zone_cod... | is there ground transportation from SAN DIEGO airport to the downtown area | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'SAN DIEGO' AND ground_service.city_code = city.city_code | atis |
CREATE TABLE table_15051_4 (
north_carolina VARCHAR
) | Name the 132.1% for where north carolina is colorado | SELECT 1321 AS _percentage FROM table_15051_4 WHERE north_carolina = "Colorado" | sql_create_context |
CREATE TABLE table_32992 (
"Rank" text,
"Stadium" text,
"Capacity" real,
"City" text,
"Country" text
) | What is the capacity of the team in tucson, USA? | SELECT "Capacity" FROM table_32992 WHERE "Country" = 'usa' AND "City" = 'tucson' | 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,
... | what is admission type and discharge location of subject id 2560? | SELECT demographic.admission_type, demographic.discharge_location FROM demographic WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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... | 能列出在二零零二年九月十日到二零一九年十月十七日内患者严秀越被开出的所有检验报告单的科室编号以及名字给我看一下吗? | SELECT jybgb.KSBM, jybgb.KSMC FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_... | css |
CREATE TABLE orders (
order_id number,
customer_id number,
date_order_placed time,
order_details text
)
CREATE TABLE invoices (
invoice_number number,
order_id number,
invoice_date time
)
CREATE TABLE products (
product_id number,
parent_product_id number,
production_type_code ... | Return the names and ids of each account, as well as the number of transactions. | SELECT T2.account_name, T1.account_id, COUNT(*) FROM financial_transactions AS T1 JOIN accounts AS T2 ON T1.account_id = T2.account_id GROUP BY T1.account_id | spider |
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 jyjgzbb (
BGDH text,
BGRQ tim... | 那个孙清涵的病人在2017年11月21日到2019年11月23日内所有检验结果指标记录中的仪器编号以及名称能不能给我详细列举出来? | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybg... | css |
CREATE TABLE table_17625749_3 (
points VARCHAR,
losing_bonus VARCHAR,
points_for VARCHAR
) | How many points categories are there when the losing bonus is 2 and points for are 642? | SELECT COUNT(points) FROM table_17625749_3 WHERE losing_bonus = "2" AND points_for = "642" | sql_create_context |
CREATE TABLE table_27537870_6 (
opponent VARCHAR,
record VARCHAR
) | If the record was 22-21-5, who was the opponent? | SELECT opponent FROM table_27537870_6 WHERE record = "22-21-5" | sql_create_context |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
Cr... | Average Score of my Answers. | SELECT AVG(CAST(Score AS FLOAT)) AS "AverageScore" FROM Posts WHERE PostTypeId = 2 AND OwnerUserId = '##UserId##' | sede |
CREATE TABLE table_203_76 (
id number,
"pos" text,
"no" number,
"driver" text,
"constructor" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
) | which driver has the least amount of points ? | SELECT "driver" FROM table_203_76 ORDER BY "points" LIMIT 1 | squall |
CREATE TABLE table_57532 (
"Country" text,
"Interview" real,
"Swimsuit" real,
"Evening Gown" real,
"Average" real
) | Name the lowest average for interview more than 9.57 and delaware and evening gown more than 9.77 | SELECT MIN("Average") FROM table_57532 WHERE "Interview" > '9.57' AND "Country" = 'delaware' AND "Evening Gown" > '9.77' | wikisql |
CREATE TABLE table_name_28 (
gold INTEGER,
silver VARCHAR,
nation VARCHAR,
total VARCHAR,
bronze VARCHAR
) | what is the highest gold count when total is more than 3, bronze less than 3, and nation of belarus with silver count more than 2? | SELECT MAX(gold) FROM table_name_28 WHERE total > 3 AND bronze < 3 AND nation = "belarus" AND silver > 2 | sql_create_context |
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufac... | which DL flights fly from BOSTON to PHILADELPHIA | 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 = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '... | atis |
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... | 在06年1月1日到11年8月25日内病号56134698的所有检验结果指标记录中的仪器编号以及名称分别叫什么? | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH ... | css |
CREATE TABLE table_71726 (
"Number" real,
"Name" text,
"Builder" text,
"Type" text,
"Works number" real,
"Date" real
) | What number has the builder ruston hornsby, the date 1961, and the name Topsy? | SELECT COUNT("Number") FROM table_71726 WHERE "Builder" = 'ruston hornsby' AND "Date" = '1961' AND "Name" = 'topsy' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | give me the number of patients whose admission type is emergency and lab test name is gentamicin? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.label = "Gentamicin" | mimicsql_data |
CREATE TABLE table_name_7 (
date VARCHAR,
score VARCHAR
) | What is the Date with a Score with 86 108? | SELECT date FROM table_name_7 WHERE score = "86–108" | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TA... | what was the name of the output, which patient 009-5351 had first since 05/02/2100? | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-5351')) AND intakeoutput.cellpath LIKE '%output%' AND ST... | eicu |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight 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_re... | on US how many flights leaving OAKLAND on 7 27 to BOSTON nonstop | SELECT COUNT(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, date_day, days, flight WHERE (((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND date_day.day_number = 27 AND date_day.month_number =... | atis |
CREATE TABLE table_17416221_1 (
largest_city VARCHAR,
province VARCHAR
) | what is the largest city where the province is eastern cape? | SELECT largest_city FROM table_17416221_1 WHERE province = "Eastern Cape" | sql_create_context |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | In order for me to graduate will I need to take LAW 682 ? | SELECT COUNT(*) > 0 FROM course, program_course WHERE course.department = 'LAW' AND course.number = 682 AND program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id | advising |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospit... | count the number of drugs which had been prescribed since 2104 to patient 015-92657. | SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-92657')) AND STRFTIME('%y', medication.drugstarttime) >= '2104' | eicu |
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,
... | Count the number of patients who were diagnosed with sternal wound infection and have hamatology as a lab test category. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "STERNAL WOUND INFECTION" AND lab."CATEGORY" = "Hematology" | mimicsql_data |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | 在医院4316976中列举出患者81533659门诊诊断名称包含相的门诊就诊记录有哪些? | SELECT * FROM hz_info JOIN mzjzjlb 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.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.mzjzjlb... | css |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
... | in 2105, patient 40967 had undergone a percu endosc gastrostomy procedure? | SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'percu endosc gastrostomy') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 40967) AND STRFTIME('%... | mimic_iii |
CREATE TABLE table_26722 (
"Week" real,
"Date" text,
"Kickoff" text,
"Opponent" text,
"Final score" text,
"Team record" text,
"Game site" text,
"Attendance" real
) | What week did they play the amsterdam admirals? | SELECT MAX("Week") FROM table_26722 WHERE "Opponent" = 'Amsterdam Admirals' | wikisql |
CREATE TABLE table_145439_1 (
country VARCHAR,
health VARCHAR
) | what's the country with health being 91.4 | SELECT country FROM table_145439_1 WHERE health = "91.4" | sql_create_context |
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,
... | 名叫沈清涵的病患的检验报告单的报告日期在10年11月18日之后的是在哪些住院就诊的?列出流水号 | SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '沈清涵' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2010-11-18') | css |
CREATE TABLE table_name_60 (
year INTEGER,
position VARCHAR,
venue VARCHAR
) | What was the latest year with a position of 1st at Maputo, Mozambique? | SELECT MAX(year) FROM table_name_60 WHERE position = "1st" AND venue = "maputo, mozambique" | sql_create_context |
CREATE TABLE table_23084 (
"District" text,
"Vacator" text,
"Reason for change" text,
"Successor" text,
"Date successor seated" text
) | Name the vacator for wisconsin 1st | SELECT "Vacator" FROM table_23084 WHERE "District" = 'Wisconsin 1st' | wikisql |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)... | BOSTON to PITTSBURGH wednesday | 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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND date_day.day_number = 23 AND date_day.month_number = 4 AN... | atis |
CREATE TABLE table_name_27 (
res VARCHAR,
time VARCHAR
) | Which Res has a Time of 11:58? | SELECT res FROM table_name_27 WHERE time = "11:58" | sql_create_context |
CREATE TABLE table_name_13 (
byes INTEGER,
against INTEGER
) | How many byes were then when there were less than 737 against? | SELECT SUM(byes) FROM table_name_13 WHERE against < 737 | sql_create_context |
CREATE TABLE table_name_98 (
date VARCHAR,
score_in_the_final VARCHAR,
opponents_in_the_final VARCHAR
) | What is the date of the final that has a score of 3 6, 6 3, 6 4 and penny barg paula smith was the opponent? | SELECT date FROM table_name_98 WHERE score_in_the_final = "3–6, 6–3, 6–4" AND opponents_in_the_final = "penny barg paula smith" | sql_create_context |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | 在编号为4179709的医院中的病患李莹华的出院时科室的名称里有眼外伤这三个字的住院就诊记录有多些? | SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '李莹华' AND hz_info.YLJGDM = '4179709' AND zyjzjlb.CYKSMC LIKE '%眼外伤%' | css |
CREATE TABLE table_12918 (
"Club" text,
"Games" real,
"Wins" real,
"Losses" real,
"Draws" real
) | What is the total number of Games, when Losses is greater than 6, when Club is 'Club Sportif Sfaxien', and when Wins is less than 3? | SELECT COUNT("Games") FROM table_12918 WHERE "Losses" > '6' AND "Club" = 'club sportif sfaxien' AND "Wins" < '3' | wikisql |
CREATE TABLE table_name_3 (
player VARCHAR,
to_par VARCHAR,
year_s__won VARCHAR
) | Which player was +4 to par and won the Open in 1995? | SELECT player FROM table_name_3 WHERE to_par = "+4" AND year_s__won = "1995" | sql_create_context |
CREATE TABLE table_21100348_10 (
rank INTEGER,
player VARCHAR
) | What was the smallest numbered rank for Michael Bevan? | SELECT MIN(rank) FROM table_21100348_10 WHERE player = "Michael Bevan" | sql_create_context |
CREATE TABLE table_24562 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 10" real,
"Poles" real,
"Avg. Start" text,
"Avg. Finish" text,
"Winnings" text,
"Position" text,
"Team(s)" text
) | How many wins does he get when he starts at 10? | SELECT "Wins" FROM table_24562 WHERE "Starts" = '10' | wikisql |
CREATE TABLE table_36983 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | What is the position of the player with an overall of 45? | SELECT "Position" FROM table_36983 WHERE "Overall" = '45' | wikisql |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
... | Will I need KINESLGY 509 to graduate ? | SELECT COUNT(*) > 0 FROM course, program_course WHERE course.department = 'KINESLGY' AND course.number = 509 AND program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id | advising |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restr... | show me flights from DENVER to WASHINGTON wednesday | 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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND date_day.day_number = 23 AND date_day.month_number = 4 AN... | atis |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Lists users in descending order of number of rollback edits they've done.. Lists users in descending order of number of rollback edits they've done. | SELECT r.UserId AS "user_link", COUNT(*) AS "Count" FROM (SELECT h.UserId FROM PostHistory AS h WHERE h.PostHistoryTypeId IN (7, 8, 9) AND NOT h.UserId IS NULL GROUP BY h.UserId, h.RevisionGUID) AS r GROUP BY r.UserId ORDER BY 'Count' DESC | sede |
CREATE TABLE table_name_90 (
february INTEGER,
opponent VARCHAR
) | What is the earliest day that had a game against the Boston Bruins? | SELECT MIN(february) FROM table_name_90 WHERE opponent = "boston bruins" | sql_create_context |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, give me the comparison about the average of code over the founder , and group by attribute founder by a bar chart, display by the names in asc. | SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T2.Founder | nvbench |
CREATE TABLE table_5691 (
"Week 6 Oct 5" text,
"Week 7 Oct 12" text,
"Week 9 Oct 26" text,
"Week 10 Nov 2" text,
"Week 11 Nov 9" text,
"Week 13 Nov 23" text,
"Week 14 Nov 30" text,
"Week 15 (Final) Dec 7" text
) | Which Week 7 Oct 12 has a Week 11 Nov 9 of week 11 nov 9? | SELECT "Week 7 Oct 12" FROM table_5691 WHERE "Week 11 Nov 9" = 'week 11 nov 9' | wikisql |
CREATE TABLE table_28523_3 (
gender VARCHAR,
religious_affiliation VARCHAR,
location VARCHAR
) | What is the gender of the Roman Catholic school is AL4? | SELECT gender FROM table_28523_3 WHERE religious_affiliation = "Roman Catholic" AND location = "AL4" | sql_create_context |
CREATE TABLE table_18963843_1 (
_percentage_indian_american VARCHAR,
asian_american_population__2010_ VARCHAR
) | Name the % indian american for asian population 126965 | SELECT _percentage_indian_american FROM table_18963843_1 WHERE asian_american_population__2010_ = 126965 | sql_create_context |
CREATE TABLE table_name_51 (
co_champions INTEGER,
records VARCHAR,
pct VARCHAR,
mrc_championships VARCHAR
) | What is the highest value for co-champions when the PCT is less than 0.786 and MRC championships is 6 with records of 88-45-6? | SELECT MAX(co_champions) FROM table_name_51 WHERE pct < 0.786 AND mrc_championships = 6 AND records = "88-45-6" | sql_create_context |
CREATE TABLE table_name_82 (
rank INTEGER,
years VARCHAR
) | Which Rank has a Years of 1998 present? | SELECT AVG(rank) FROM table_name_82 WHERE years = "1998–present" | sql_create_context |
CREATE TABLE table_9204 (
"Born as" text,
"Consort as" text,
"Born" text,
"Marriage" text,
"Consort from" text,
"Consort to" text,
"Died" text,
"Spouse to" text
) | Who was the spouse of the consort who was born as rania al yassin? | SELECT "Spouse to" FROM table_9204 WHERE "Born as" = 'rania al yassin' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
... | how many hours has it been since patient 14467 last received an intake of d5w on the current intensive care unit visit? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14467) AND icustays.outtime IS NULL)... | mimic_iii |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE VoteTypes (
Id number,
Name text... | Average Comment Score for user. | SELECT COUNT(Id) AS NumComments, AVG(CAST(Score AS DECIMAL)) AS AvgScore, MIN(CreationDate) AS MinDate, MAX(CreationDate) AS MaxDate, DATEDIFF(dd, MIN(CreationDate), MAX(CreationDate)) AS Days FROM Comments WHERE UserId = 8112776 | sede |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.