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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | provide the number of patients whose admission location is transfer from hosp/extram and item id is 50907? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND lab.itemid = "50907" | mimicsql_data |
CREATE TABLE table_26200568_16 (
points_against INTEGER,
club VARCHAR
) | How many points were scored against the Toronto Rebels? | SELECT MAX(points_against) FROM table_26200568_16 WHERE club = "Toronto Rebels" | sql_create_context |
CREATE TABLE table_7044 (
"Year" real,
"Band" text,
"Song" text,
"Album" text,
"Contribution" text
) | What band has a year above 2011? | SELECT "Band" FROM table_7044 WHERE "Year" > '2011' | wikisql |
CREATE TABLE table_name_97 (
athlete VARCHAR,
nationality VARCHAR,
rank VARCHAR,
lane VARCHAR
) | Which Athlete has a Rank larger than 1, and a Lane larger than 7, and a Nationality of china? | SELECT athlete FROM table_name_97 WHERE rank > 1 AND lane > 7 AND nationality = "china" | sql_create_context |
CREATE TABLE table_name_34 (
county VARCHAR,
irish_name VARCHAR
) | Irish name of an d n (contae an d in) has what county town? | SELECT county AS town FROM table_name_34 WHERE irish_name = "an dún (contae an dúin)" | sql_create_context |
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,... | 编号为6281887的这个医院的医疗记录中,入院诊断为J30.696的最少医疗费总额是多少?最多医疗费总额是多少 | SELECT MIN(MED_AMOUT), MAX(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE MED_SER_ORG_NO = '6281887' AND IN_DIAG_DIS_CD = 'J30.696') | css |
CREATE TABLE table_name_44 (
volts VARCHAR,
energy_to_weight_ratio VARCHAR
) | How many volts has an energy-to-weight ratio of 54 kj/kg to 2.0v? | SELECT volts FROM table_name_44 WHERE energy_to_weight_ratio = "54 kj/kg to 2.0v" | 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
) | what is the total number of games that started at 7:00 ? | SELECT COUNT(*) FROM table_204_459 WHERE "time" = '7:00 pm' | squall |
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,... | 医疗机构4264494在平时的诊疗过程中使用次数top30的项目是哪些 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.MED_SER_ORG_NO = '4264494' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.AMOUNT) DESC LIMIT 3... | css |
CREATE TABLE table_76 (
"Stadium" text,
"Capacity" real,
"City" text,
"Country" text,
"Tenant" text,
"Opening" real
) | What is the maximum capacity of the Otkrytie Arena stadium? | SELECT MAX("Capacity") FROM table_76 WHERE "Stadium" = 'Otkrytie Arena' | wikisql |
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... | 在08年10月25日到15年12月6日这段日子病人吕莹玉使用的药品有多些是自付比例低于0.73的呢? | SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '吕莹玉' AND t_kc22.STA_DATE BETWEEN '2008-10-25' AND '2015-12-06' AND t_kc22.SELF_PAY_PRO < 0.73 UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb.PERS... | css |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_dista... | what is restriction AP/57 | SELECT DISTINCT advance_purchase, application, maximum_stay, minimum_stay, no_discounts, restriction_code, saturday_stay_required, stopovers FROM restriction WHERE restriction_code = 'AP/57' | atis |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
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,
r... | what is the fare going from BALTIMORE to ATLANTA one way on 11 7 | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND C... | atis |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
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 n... | since 2104, what were the four most frequently performed procedures that the patients received after the diagnosis of subtrochanteric fx-close within 2 months? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissi... | mimic_iii |
CREATE TABLE table_35090 (
"Year" text,
"Best Film" text,
"Best Director" text,
"Best Actor" text,
"Best Actress" text,
"Best Supporting Actress" text
) | Which Best Actress has a Year of 2012 6th? | SELECT "Best Actress" FROM table_35090 WHERE "Year" = '2012 6th' | 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 prescriptions (
subject_id text,
hadm_id... | how many patients whose diagnoses short title is hyp ht dis nos w ht fail and lab test abnormal status is delta? | 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 = "Hyp ht dis NOS w ht fail" AND lab.flag = "delta" | mimicsql_data |
CREATE TABLE table_204_450 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
) | what was the name of the competition listed before the boston marathon in 1984 ? | SELECT "competition" FROM table_204_450 WHERE id = (SELECT id FROM table_204_450 WHERE "competition" = 'boston marathon') - 1 | squall |
CREATE TABLE table_name_53 (
attendance VARCHAR,
home_team VARCHAR
) | What was the attendance for the game that had the king's lynn as the home team? | SELECT attendance FROM table_name_53 WHERE home_team = "king's lynn" | sql_create_context |
CREATE TABLE table_50517 (
"Nominative" text,
"Ergative" text,
"Dative" text,
"Genitive" text,
"Instrumental" text,
"Adverbial" text
) | With a nominative of chven-i what is the ergative? | SELECT "Ergative" FROM table_50517 WHERE "Nominative" = 'chven-i' | wikisql |
CREATE TABLE table_name_96 (
total INTEGER,
ward INTEGER
) | WHAT IS THE TOTAL WITH WARD LARGER THAN 60? | SELECT MIN(total) FROM table_name_96 WHERE ward > 60 | sql_create_context |
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,... | 在2010年6月16日至2015年4月16日之中奚秀英病患常去的哪家医院治疗? | SELECT MED_SER_ORG_NO FROM t_kc21 WHERE PERSON_NM = '奚秀英' AND IN_HOSP_DATE BETWEEN '2010-06-16' AND '2015-04-16' GROUP BY MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE table_name_67 (
known_for VARCHAR,
entered VARCHAR,
celebrity VARCHAR
) | What was Freddie Starr, who entered on Day 1, known for? | SELECT known_for FROM table_name_67 WHERE entered = "day 1" AND celebrity = "freddie starr" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH te... | 患者08045413检验的脸部的各项指标结果怎么样? | SELECT * FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE hz_info.RYBH = '08045413' AND jyjgzbb.jybgb_BBCJBW = '脸部' UNION SELECT * FR... | css |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Bar chart of school_id from each all games | SELECT All_Games, School_ID FROM basketball_match | nvbench |
CREATE TABLE player_award (
player_id TEXT,
award_id TEXT,
year INTEGER,
league_id TEXT,
tie TEXT,
notes TEXT
)
CREATE TABLE fielding_postseason (
player_id TEXT,
year INTEGER,
team_id TEXT,
league_id TEXT,
round TEXT,
pos TEXT,
g INTEGER,
gs NUMERIC,
inn_out... | Return me a line chart to show the frequency of the year attribute by binning into a weekday interval, I want to display X-axis from low to high order. | SELECT year, COUNT(year) FROM home_game ORDER BY year | nvbench |
CREATE TABLE table_35308 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
) | Which Tournament has a Margin of victory of 2 strokes, and a Winning score of 14 (68-66-68=202)? | SELECT "Tournament" FROM table_35308 WHERE "Margin of victory" = '2 strokes' AND "Winning score" = '−14 (68-66-68=202)' | wikisql |
CREATE TABLE table_16595 (
"No." real,
"Episode" text,
"Air Date" text,
"Timeslot" text,
"Rating" text,
"Share" real,
"18\u201349 (Rating/Share)" text,
"Viewers (m)" text,
"Rank (#)" text
) | How did the episode rank that had 2.65 million viewers? | SELECT "Rank (#)" FROM table_16595 WHERE "Viewers (m)" = '2.65' | 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,
... | since 176 months ago, what was the monthly minimum weight of patient 027-135082? | SELECT MIN(patient.admissionweight) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-135082') AND NOT patient.admissionweight IS NULL AND DATETIME(patient.unitadmittime) >= DATETIME(CURRENT_TIME(), '-176 month') GROUP BY STRFTI... | eicu |
CREATE TABLE table_name_88 (
driver VARCHAR,
laps VARCHAR,
grid VARCHAR
) | Which driver had a grid of 18 with 68 laps? | SELECT driver FROM table_name_88 WHERE laps = "68" AND grid = "18" | sql_create_context |
CREATE TABLE table_75430 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | Which visitor has a Los Angeles home? | SELECT "Visitor" FROM table_75430 WHERE "Home" = 'los angeles' | wikisql |
CREATE TABLE table_name_47 (
score VARCHAR,
tournament VARCHAR
) | What is the final score of the tournament played in Clearwater, Florida? | SELECT score FROM table_name_47 WHERE tournament = "clearwater, florida" | sql_create_context |
CREATE TABLE table_202_72 (
id number,
"year" number,
"single" text,
"chart" text,
"position" number
) | which is the most popular single on the album ? | SELECT "single" FROM table_202_72 ORDER BY "position" LIMIT 1 | squall |
CREATE TABLE table_name_29 (
away_team VARCHAR
) | What did the away team Carlton score? | SELECT away_team AS score FROM table_name_29 WHERE away_team = "carlton" | sql_create_context |
CREATE TABLE table_name_52 (
opponent VARCHAR,
december VARCHAR
) | Can you tell me the Opponent that has the December of 2? | SELECT opponent FROM table_name_52 WHERE december = 2 | sql_create_context |
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... | 病号21701297在2000年5月29日到2009年5月18日内期间所有检验结果指标记录中使用的仪器编号还有名称都叫什么 | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BG... | css |
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE time_zone (
time_zone_code t... | what is the cheapest fare from DALLAS to DENVER round trip | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_... | atis |
CREATE TABLE student (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
tot_cred numeric(3,0)
)
CREATE TABLE prereq (
course_id varchar(8),
prereq_id varchar(8)
)
CREATE TABLE department (
dept_name varchar(20),
building varchar(15),
budget numeric(12,2)
)
CREATE TABLE advi... | Find the number of courses offered by Psychology department in each year with a line chart, and sort by the x axis in desc. | SELECT year, COUNT(year) FROM course AS T1 JOIN section AS T2 ON T1.course_id = T2.course_id WHERE T1.dept_name = 'Psychology' GROUP BY year ORDER BY year DESC | nvbench |
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,
... | how many patients whose age is less than 27 and diagnoses short title is malig neo ascend colon? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "27" AND diagnoses.short_title = "Malig neo ascend colon" | mimicsql_data |
CREATE TABLE table_17323 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
) | Who had the high rebounds for the game on april 23? | SELECT "High rebounds" FROM table_17323 WHERE "Date" = 'April 23' | wikisql |
CREATE TABLE table_36018 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the lowest total for bronzes over 1, golds over 8, and fewer than 10 silvers? | SELECT MIN("Total") FROM table_36018 WHERE "Bronze" > '1' AND "Gold" > '8' AND "Silver" < '10' | wikisql |
CREATE TABLE table_name_90 (
secretary VARCHAR,
internal_co VARCHAR
) | What Secretary has an Internal CO of isabel voets? | SELECT secretary FROM table_name_90 WHERE internal_co = "isabel voets" | sql_create_context |
CREATE TABLE table_59091 (
"Player" text,
"Country" text,
"Year(s) Won" text,
"Total" real,
"To par" real
) | Can you tell me the average Total that has the To par smaller than 10, and the Country of south korea? | SELECT AVG("Total") FROM table_59091 WHERE "To par" < '10' AND "Country" = 'south korea' | wikisql |
CREATE TABLE aircraft (
Aircraft_ID int,
Order_Year int,
Manufacturer text,
Model text,
Fleet_Series text,
Powertrain text,
Fuel_Propulsion text
)
CREATE TABLE pilot_record (
Record_ID int,
Pilot_ID int,
Aircraft_ID int,
Date text
)
CREATE TABLE pilot (
Pilot_ID int,
... | What are the different nationalities of pilots? Show each nationality and the number of pilots of each nationality. Show bar chart. | SELECT Nationality, COUNT(*) FROM pilot GROUP BY Nationality | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | how many hispanic or latino patients were prescribed alprazolam? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND prescriptions.drug = "Alprazolam" | mimicsql_data |
CREATE TABLE table_2634 (
"Best Male MC" text,
"Best Female MC" text,
"Best Male Artist" text,
"Best Female Artist" text,
"Best Male Lyricist" text,
"Best Female Lyricist" text,
"Best Male Record" text
) | Who was the Best Male Artist where Bankie Travolta won the Best Male MC? | SELECT "Best Male Artist" FROM table_2634 WHERE "Best Male MC" = 'Bankie Travolta' | wikisql |
CREATE TABLE album (
albumid number,
title text,
artistid number
)
CREATE TABLE playlist (
playlistid number,
name text
)
CREATE TABLE track (
trackid number,
name text,
albumid number,
mediatypeid number,
genreid number,
composer text,
milliseconds number,
bytes nu... | Count the number of customers that have an email containing 'gmail.com'. | SELECT COUNT(*) FROM customer WHERE email LIKE "%gmail.com%" | spider |
CREATE TABLE table_69464 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | What day did the record reach 15-4? | SELECT "Date" FROM table_69464 WHERE "Record" = '15-4' | wikisql |
CREATE TABLE table_67249 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | Who was the Opponent when the Attendance was 38,150? | SELECT "Opponent" FROM table_67249 WHERE "Attendance" = '38,150' | wikisql |
CREATE TABLE table_77588 (
"Year" real,
"Utah Mr. Basketball" text,
"High school" text,
"Class" text,
"College" text
) | Where did Tyler Haws, 2009 Utah Mr. Basketball, go to high school? | SELECT "High school" FROM table_77588 WHERE "Utah Mr. Basketball" = 'tyler haws' AND "Year" = '2009' | wikisql |
CREATE TABLE college (
cname text,
state text,
enr number
)
CREATE TABLE tryout (
pid number,
cname text,
ppos text,
decision text
)
CREATE TABLE player (
pid number,
pname text,
ycard text,
hs number
) | Find the states of the colleges that have students in the tryout who played in striker position. | SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cname = T2.cname WHERE T2.ppos = 'striker' | spider |
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 demographic ... | What is the number of patients who had osmolality and measured lab test and were discharged to skilled nursing facility? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.discharge_location = "REHAB/DISTINCT PART HOSP" AND lab.label = "Osmolality, Measured" | mimicsql_data |
CREATE TABLE table_name_85 (
chinese_name VARCHAR,
station_name VARCHAR
) | What's the Chinese name of the wudaokou station? | SELECT chinese_name FROM table_name_85 WHERE station_name = "wudaokou" | sql_create_context |
CREATE TABLE table_62272 (
"Draw" real,
"Language" text,
"Artist" text,
"Song" text,
"English translation" text,
"National final" text,
"Place" real,
"Points" real
) | what is the highest place when the national final is 4th and the points is less than 139? | SELECT MAX("Place") FROM table_62272 WHERE "National final" = '4th' AND "Points" < '139' | wikisql |
CREATE TABLE table_name_75 (
gold VARCHAR,
bronze VARCHAR,
total VARCHAR,
sport VARCHAR
) | How many gold values have totals over 30, bronzes over 35, and are in Swimming? | SELECT COUNT(gold) FROM table_name_75 WHERE total > 30 AND sport = "swimming" AND bronze > 35 | sql_create_context |
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... | 编号为63517576的患者自付比例低于0.39的药品量在2000年1月29日至2018年1月5日期间都有什么? | SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '63517576' AND t_kc22.STA_DATE BETWEEN '2000-01-29' AND '2018-01-05' AND t_kc22.SELF_PAY_PRO < 0.39 UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb... | css |
CREATE TABLE table_33455 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the away team's score at western oval? | SELECT "Away team score" FROM table_33455 WHERE "Venue" = 'western oval' | wikisql |
CREATE TABLE table_8222 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
) | What is the 2nd Leg, when Team 2 is Marbella? | SELECT "2nd leg" FROM table_8222 WHERE "Team 2" = 'marbella' | wikisql |
CREATE TABLE table_229 (
"Week" text,
"Date" text,
"Opponent" text,
"Result" text,
"Kickoff [a ]" text,
"Game site" text,
"TV" text,
"Attendance" text,
"Record" text
) | what's the record where result is l 24-10 | SELECT "Record" FROM table_229 WHERE "Result" = 'L 24-10' | wikisql |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additio... | This semester , who is the teacher of Sound Patterns ? | SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN course ON course.course_id = course_offering.course_id INNER JOIN semester... | advising |
CREATE TABLE table_1123802_1 (
compression_ratio VARCHAR,
engine VARCHAR
) | What was the compression ration when the engine was Wasp Jr. T1B2? | SELECT compression_ratio FROM table_1123802_1 WHERE engine = "Wasp Jr. T1B2" | sql_create_context |
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 diagnoses (
... | what is drug route of drug name sodium phosphate? | SELECT prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Sodium Phosphate" | mimicsql_data |
CREATE TABLE race (
race_id number,
name text,
class text,
date text,
track_id text
)
CREATE TABLE track (
track_id number,
name text,
location text,
seating number,
year_opened number
) | Show all track names that have had no races. | SELECT name FROM track WHERE NOT track_id IN (SELECT track_id FROM race) | spider |
CREATE TABLE table_1346118_2 (
incumbent VARCHAR,
candidates VARCHAR
) | Who was the incumbent when ran william b. oliver (d) unopposed? | SELECT incumbent FROM table_1346118_2 WHERE candidates = "William B. Oliver (D) Unopposed" | sql_create_context |
CREATE TABLE table_name_60 (
lost VARCHAR,
club VARCHAR
) | What is the lost when the club was Barry RFC? | SELECT lost FROM table_name_60 WHERE club = "barry rfc" | sql_create_context |
CREATE TABLE table_1865 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
) | How many series did John Banas direct? | SELECT "No. in series" FROM table_1865 WHERE "Directed by" = 'John Banas' | wikisql |
CREATE TABLE table_train_263 (
"id" int,
"breast_cancer" bool,
"fasting_blood_glucose_fbg" float,
"prostate_cancer" bool,
"hba1c" float,
"body_mass_index_bmi" float,
"age" float,
"NOUSE" float
) | history of prostate or breast cancer | SELECT * FROM table_train_263 WHERE prostate_cancer = 1 OR breast_cancer = 1 | criteria2sql |
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 whose ethnicity is asian and procedure long title is small-to-small intestinal anastomosis? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "ASIAN" AND procedures.long_title = "Small-to-small intestinal anastomosis" | mimicsql_data |
CREATE TABLE table_9632 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" text
) | Who is the opponent in the fight of 1 round when the record is 18-7? | SELECT "Opponent" FROM table_9632 WHERE "Round" = '1' AND "Record" = '18-7' | 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,
... | 在患者韩文丽的医疗就诊记录中其在医院7659093入院是诊断疾病名称不包含炭末这俩字的编号是多少? | SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '韩文丽' AND gwyjzb.MED_SER_ORG_NO = '7659093' AND NOT gwyjzb.IN_DIAG_DIS_NM LIKE '%炭末%' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '韩文丽' AND fgwyjzb.MED_SER_ORG_NO = '7659093' AND NOT fgwyjzb.IN_DIAG_DIS_NM LIKE '%炭末%' | css |
CREATE TABLE financial_transactions (
transaction_id number,
account_id number,
invoice_number number,
transaction_type text,
transaction_date time,
transaction_amount number,
transaction_comment text,
other_transaction_details text
)
CREATE TABLE products (
product_id number,
p... | What are the different product colors? | SELECT DISTINCT product_color FROM products | spider |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Users (
Id num... | Average number of answers depending on day when bounty was started. | WITH tmp AS (SELECT p.AnswerCount AS ACount, Period = TIME_TO_STR(bs.CreationDate, '%W') FROM Posts AS p INNER JOIN Votes AS bs ON p.Id = bs.PostId AND bs.VoteTypeId = 8) SELECT Period, AVG(CAST(ACount AS FLOAT)) FROM tmp GROUP BY Period ORDER BY Period | sede |
CREATE TABLE table_name_38 (
points_against VARCHAR,
matches VARCHAR
) | How many against points for 16 matches? | SELECT points_against FROM table_name_38 WHERE matches = "16" | sql_create_context |
CREATE TABLE table_name_19 (
home__2nd_leg_ VARCHAR,
aggregate VARCHAR
) | Which team played at home for the second leg and has aggregate score of 2-0? | SELECT home__2nd_leg_ FROM table_name_19 WHERE aggregate = "2-0" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | count the number of patients whose diagnoses short title is subarachnoid hemorrhage and drug route is im? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Subarachnoid hemorrhage" AND prescriptions.route = "IM" | mimicsql_data |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TAB... | what's the minimum total cost of a hospital that involves ventricular tachycardia since 2102? | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'ventricular tachycardia')) AND STRFTIME('%y'... | eicu |
CREATE TABLE table_name_41 (
record VARCHAR,
date VARCHAR
) | What was the record for December 5, 1948? | SELECT record FROM table_name_41 WHERE date = "december 5, 1948" | sql_create_context |
CREATE TABLE table_41812 (
"Year" real,
"Income" real,
"Expenditure" real,
"Surplus(Deficit)" text,
"% GDP" text
) | Which Year has an Expenditure of 55, and an Income smaller than 36.2? | SELECT MIN("Year") FROM table_41812 WHERE "Expenditure" = '55' AND "Income" < '36.2' | wikisql |
CREATE TABLE table_39948 (
"Position" real,
"Club" text,
"Games played" real,
"Wins" real,
"Draws" real,
"Loses" real,
"Goals scored" real,
"Goals conceded" real,
"Points" real
) | What is the highest number of wins of the team with a position less than 1? | SELECT MAX("Wins") FROM table_39948 WHERE "Position" < '1' | wikisql |
CREATE TABLE table_20897 (
"Player" text,
"Team" text,
"Matches" real,
"Wickets" real,
"Average" text,
"Best Bowling" text
) | How many matches had 11 wickets? | SELECT MAX("Matches") FROM table_20897 WHERE "Wickets" = '11' | wikisql |
CREATE TABLE table_name_83 (
lane INTEGER,
country VARCHAR
) | What is the most lanes used that had a winner from Ireland? | SELECT MAX(lane) FROM table_name_83 WHERE country = "ireland" | sql_create_context |
CREATE TABLE table_18719 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | Who was the incumbent in the election of henry garland dupr (d) unopposed? | SELECT "Incumbent" FROM table_18719 WHERE "Candidates" = 'Henry Garland Dupré (D) Unopposed' | wikisql |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostFeedback (
Id number,
PostId numb... | Answers that have been unaccepted. | SELECT a.Id AS "post_link", a.CreationDate, q.LastActivityDate FROM Posts AS a INNER JOIN Posts AS q ON q.Id = a.ParentId WHERE q.AcceptedAnswerId != a.Id AND (SELECT COUNT(*) FROM Votes WHERE PostId = a.Id AND VoteTypeId = 1) > 0 | sede |
CREATE TABLE table_2140071_8 (
season INTEGER,
coach VARCHAR
) | What was Cici Kelley's minimum season? | SELECT MIN(season) FROM table_2140071_8 WHERE coach = "Cici Kelley" | sql_create_context |
CREATE TABLE table_name_86 (
location VARCHAR,
nationality VARCHAR,
date VARCHAR
) | Tell me the location of lithuania 12 october 2013 | SELECT location FROM table_name_86 WHERE nationality = "lithuania" AND date = "12 october 2013" | sql_create_context |
CREATE TABLE table_35226 (
"Date" text,
"Label" text,
"Region" text,
"Format" text,
"Catalog" text
) | Which Date has a Region of france? | SELECT "Date" FROM table_35226 WHERE "Region" = 'france' | wikisql |
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 ... | 患者19618355在二零一一年六月三十日以前的检验报告单是在哪些住院就诊的?列出住院就诊流水号 | SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '19618355' AND NOT zyjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ >= '2011-06-30') | css |
CREATE TABLE debate_people (
Debate_ID int,
Affirmative int,
Negative int,
If_Affirmative_Win bool
)
CREATE TABLE people (
People_ID int,
District text,
Name text,
Party text,
Age int
)
CREATE TABLE debate (
Debate_ID int,
Date text,
Venue text,
Num_of_Audience int
... | Show the names of people and the number of times they have been on the affirmative side of debates by a bar chart, sort in descending by the x-axis. | SELECT Name, COUNT(*) FROM debate_people AS T1 JOIN people AS T2 ON T1.Affirmative = T2.People_ID GROUP BY T2.Name ORDER BY Name DESC | nvbench |
CREATE TABLE table_1965650_10 (
pick__number INTEGER,
nhl_team VARCHAR
) | What is Boston Bruins minimum pick? | SELECT MIN(pick__number) FROM table_1965650_10 WHERE nhl_team = "Boston Bruins" | sql_create_context |
CREATE TABLE table_name_62 (
award VARCHAR,
year INTEGER
) | What award did they win before 2005? | SELECT award FROM table_name_62 WHERE year < 2005 | 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... | how many patients with brain mass; intracranial hemorrhage primary disease have ou route of drug administration? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" AND prescriptions.route = "OU" | mimicsql_data |
CREATE TABLE Asset_Parts (
asset_id INTEGER,
part_id INTEGER
)
CREATE TABLE Skills_Required_To_Fix (
part_fault_id INTEGER,
skill_id INTEGER
)
CREATE TABLE Assets (
asset_id INTEGER,
maintenance_contract_id INTEGER,
supplier_company_id INTEGER,
asset_details VARCHAR(255),
asset_mak... | A stacked bar chart showing the number of faults for different fault short name and skills required to fix them The x-axis is falut short name and group by skill description, and I want to show from low to high by the y axis please. | SELECT fault_short_name, COUNT(fault_short_name) FROM Part_Faults AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.part_fault_id = T2.part_fault_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY skill_description, fault_short_name ORDER BY COUNT(fault_short_name) | nvbench |
CREATE TABLE table_72489 (
"Position" real,
"Artist" text,
"Song title" text,
"Highest position" real,
"Points" real
) | What is highest place reached by artist Ray Adams? | SELECT MAX("Position") FROM table_72489 WHERE "Artist" = 'Ray Adams' | wikisql |
CREATE TABLE table_72364 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text,
"Candidates" text
) | What was the result in Illinois 7? | SELECT "Results" FROM table_72364 WHERE "District" = 'Illinois 7' | wikisql |
CREATE TABLE checkin (
cid int,
business_id varchar,
count int,
day varchar
)
CREATE TABLE business (
bid int,
business_id varchar,
name varchar,
full_address varchar,
city varchar,
latitude varchar,
longitude varchar,
review_count bigint,
is_open tinyint,
rating... | Which neighborhood in Madison has the Italian restaurant with the highest stars | SELECT neighborhood.neighborhood_name FROM business, category AS CATEGORY_0, category AS CATEGORY_1, neighborhood WHERE business.city = 'Madison' AND CATEGORY_0.business_id = business.business_id AND CATEGORY_0.category_name = 'restaurant' AND CATEGORY_1.business_id = business.business_id AND CATEGORY_1.category_name =... | yelp |
CREATE TABLE table_56824 (
"Chemical class" text,
"Group" text,
"Formula" text,
"Prefix" text,
"Suffix" text
) | Which formula has a thial as a chemical class? | SELECT "Formula" FROM table_56824 WHERE "Chemical class" = 'thial' | wikisql |
CREATE TABLE Product_Categories (
production_type_code VARCHAR(15),
product_type_description VARCHAR(80),
vat_rating DECIMAL(19,4)
)
CREATE TABLE Invoices (
invoice_number INTEGER,
order_id INTEGER,
invoice_date DATETIME
)
CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER... | How many accounts are opened in each day for all accounts by the customer with first name 'Meaghan' ? Bin the account open day by year interval in a bar chart, could you rank x-axis in ascending order? | SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = 'Meaghan' ORDER BY date_account_opened | nvbench |
CREATE TABLE table_name_19 (
college VARCHAR,
pick__number VARCHAR
) | Which college has a pick number of 155? | SELECT college FROM table_name_19 WHERE pick__number = 155 | sql_create_context |
CREATE TABLE table_12179 (
"Country" text,
"Date" text,
"Label" text,
"Format" text,
"Catalogue #" text
) | What is the country for Sony / Sony Bmg? | SELECT "Country" FROM table_12179 WHERE "Label" = 'sony / sony bmg' | wikisql |
CREATE TABLE table_1740431_3 (
gregorian_months VARCHAR,
season_in_tamil VARCHAR
) | What is every Gregorian month when the season in Tamil is ? | SELECT gregorian_months FROM table_1740431_3 WHERE season_in_tamil = "இளவேனில்" | sql_create_context |
CREATE TABLE table_63122 (
"Rank" real,
"Heat" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
) | What was the time of the 5th ranked swimmer who swam after heat 3 and was in a lane under 5? | SELECT "Time" FROM table_63122 WHERE "Heat" > '3' AND "Lane" < '5' AND "Rank" = '5' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.