context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_29160596_1 (
top_mc VARCHAR,
year_inducted VARCHAR,
peak_ranking VARCHAR
) | List all the MCs with peak ranking of 6 who were inducted in 2007. | SELECT top_mc FROM table_29160596_1 WHERE year_inducted = 2007 AND peak_ranking = 6 | sql_create_context |
CREATE TABLE table_name_84 (
away VARCHAR,
home VARCHAR
) | Which Away has a Home of 2 2? | SELECT away FROM table_name_84 WHERE home = "2–2" | sql_create_context |
CREATE TABLE table_name_4 (
gp_gs VARCHAR,
assists VARCHAR
) | What was the gp/gs when the assists was 1? | SELECT gp_gs FROM table_name_4 WHERE assists = "1" | sql_create_context |
CREATE TABLE table_14930 (
"Tournament" text,
"Wins" real,
"Top-10" real,
"Events" real,
"Cuts made" real
) | How many wins did he have when he made over 2 cuts and had under 2 top 10s? | SELECT AVG("Wins") FROM table_14930 WHERE "Cuts made" > '2' AND "Top-10" < '2' | wikisql |
CREATE TABLE table_name_39 (
away_team VARCHAR,
venue VARCHAR
) | What was the away team for the match at Punt Road Oval? | SELECT away_team FROM table_name_39 WHERE venue = "punt road oval" | sql_create_context |
CREATE TABLE table_45158 (
"Date" text,
"Race" text,
"Track" text,
"Winner" text,
"Reports" text
) | Who won the Food World 250? | SELECT "Winner" FROM table_45158 WHERE "Race" = 'food world 250' | wikisql |
CREATE TABLE table_28864 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
) | how many 'Party' are in district south carolina 2? | SELECT COUNT("Party") FROM table_28864 WHERE "District" = 'South Carolina 2' | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | what is gender and procedure long title of subject id 2560? | SELECT demographic.gender, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE table_name_70 (
agg VARCHAR,
team_1 VARCHAR
) | What is the agg when team 1 is Milan? | SELECT agg FROM table_name_70 WHERE team_1 = "milan" | sql_create_context |
CREATE TABLE table_49415 (
"Game" real,
"November" real,
"Opponent" text,
"Score" text,
"Record" text
) | What day in November has the game less than 12? | SELECT "November" FROM table_49415 WHERE "Game" < '12' | wikisql |
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)... | i want to fly DALLAS to SAN FRANCISCO on monday 7 8 | 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 = 'SAN FRANCISCO' AND date_day.day_number = 8 AND date_day.month_number = 7 ... | atis |
CREATE TABLE table_28379 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
) | Who is the directed by when the production code is 67425? | SELECT "Directed by" FROM table_28379 WHERE "Production code" = '67425' | wikisql |
CREATE TABLE table_6653 (
"Year" text,
"Men's singles" text,
"Women's singles" text,
"Men's doubles" text,
"Women's doubles" text,
"Mixed doubles" text
) | Who won women's double in 2002, the year that Kenneth Vella won men's singles? | SELECT "Women's doubles" FROM table_6653 WHERE "Men's singles" = 'kenneth vella' AND "Year" = '2002' | wikisql |
CREATE TABLE table_39808 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | What is the highest Pick # when the CFL Team is the Toronto Argonauts? | SELECT MAX("Pick #") FROM table_39808 WHERE "CFL Team" = 'toronto argonauts' | wikisql |
CREATE TABLE table_name_50 (
constructor VARCHAR,
driver VARCHAR
) | What company was the constructor when Nick Heidfeld was the driver/ | SELECT constructor FROM table_name_50 WHERE driver = "nick heidfeld" | sql_create_context |
CREATE TABLE table_name_92 (
byes INTEGER,
losses VARCHAR,
wins VARCHAR
) | How many byes for the team with more than 14 losses and more than 0 wins? | SELECT AVG(byes) FROM table_name_92 WHERE losses > 14 AND wins > 0 | sql_create_context |
CREATE TABLE table_27683516_3 (
outgoing_manager VARCHAR,
incoming_manager VARCHAR
) | What is the outgoing manager when the incoming manager is tefan tarkovi ? | SELECT outgoing_manager FROM table_27683516_3 WHERE incoming_manager = "Štefan Tarkovič" | sql_create_context |
CREATE TABLE table_name_39 (
laps VARCHAR,
manufacturer VARCHAR,
time VARCHAR
) | What laps did Honda do with a time of +1:38.407? | SELECT laps FROM table_name_39 WHERE manufacturer = "honda" AND time = "+1:38.407" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | among patients tested for creatine kinase, mb isoenzyme, how many of them were english speaking? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.language = "ENGL" AND lab.label = "Creatine Kinase, MB Isoenzyme" | mimicsql_data |
CREATE TABLE table_name_78 (
location VARCHAR,
result VARCHAR,
opponent VARCHAR
) | What is the location for the win against Johan Mparmpagiannis? | SELECT location FROM table_name_78 WHERE result = "win" AND opponent = "johan mparmpagiannis" | sql_create_context |
CREATE TABLE table_36081 (
"Name" text,
"Species Specific" text,
"Intra-molecular structure" text,
"Comparative" text,
"Link" text
) | Which Comparative has a Name of pictar? | SELECT "Comparative" FROM table_36081 WHERE "Name" = 'pictar' | wikisql |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | Compare the prices of each manufacturer's most expensive product with a bar chart, and could you display by the Y in ascending? | SELECT T2.Name, MAX(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY MAX(T1.Price) | nvbench |
CREATE TABLE table_name_47 (
best VARCHAR,
name VARCHAR
) | What was Robert Doornbos' Best? | SELECT best FROM table_name_47 WHERE name = "robert doornbos" | sql_create_context |
CREATE TABLE table_48197 (
"Player" text,
"Nationality" text,
"Jersey Number(s)" real,
"Position" text,
"Years" text,
"From" text
) | What is Years, when Nationality is United States, and when Position is PG / SG? | SELECT "Years" FROM table_48197 WHERE "Nationality" = 'united states' AND "Position" = 'pg / sg' | wikisql |
CREATE TABLE table_name_54 (
silver INTEGER,
gold VARCHAR,
total VARCHAR
) | What is the silver number when gold is more than 4, and the total is less than 24? | SELECT AVG(silver) FROM table_name_54 WHERE gold > 4 AND total < 24 | sql_create_context |
CREATE TABLE table_37710 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real
) | What was the score of the game on May 26? | SELECT "Score" FROM table_37710 WHERE "Date" = 'may 26' | wikisql |
CREATE TABLE table_79585 (
"Year" real,
"Game" text,
"Genre" text,
"Platform" text,
"Publisher" text
) | Which Genre has a Game of tony hawk's pro skater 2? | SELECT "Genre" FROM table_79585 WHERE "Game" = 'tony hawk''s pro skater 2' | wikisql |
CREATE TABLE table_20007413_6 (
torque VARCHAR,
year VARCHAR
) | What are the torque characteristics of the model made in 1996? | SELECT torque FROM table_20007413_6 WHERE year = "1996" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | count the number of patients whose admission year is less than 2200 and item id is 51222? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2200" AND lab.itemid = "51222" | mimicsql_data |
CREATE TABLE table_50055 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | When curtis strange had a to par +1, what was his score? | SELECT "Score" FROM table_50055 WHERE "To par" = '+1' AND "Player" = 'curtis strange' | wikisql |
CREATE TABLE gyb (
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... | 姓名是曹云飞的患者分别在哪几次医疗记录中被开出的药品金额都少于了6638.96元?就诊时的编号是什么? | SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '曹云飞' AND NOT qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 6638.96) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '曹云飞' AND NOT gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUN... | css |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 患者21324611在01年4月21日到2011年6月2日内的所有检验结果指标记录的检测人为姜欣合的检测指标流水号是多少? | SELECT jyjgzbb.JYZBLSH 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 = '21324611' AND jyjgzbb.JYRQ BETWEEN '2001-04-2... | css |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
... | how much does the arterial bp [diastolic] change of patient 8908 last measured on the last icu visit compared to the first value measured on the last icu visit? | SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8908) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents.... | mimic_iii |
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 int,
capacity int,
pay_load int,
cruising_speed int,
range_... | give me the flights from KANSAS CITY to CHICAGO leaving next wednesday arriving at CHICAGO at about 7pm | 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 (((flight.arrival_time <= 1930 AND flight.arrival_time >= 1830) AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 19... | atis |
CREATE TABLE table_2979789_1 (
fa_cup_apps INTEGER,
league_apps VARCHAR
) | Name the most fa cup apps for league apps being 27 | SELECT MAX(fa_cup_apps) FROM table_2979789_1 WHERE league_apps = 27 | sql_create_context |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
... | Which courses are SI 6 -credit courses ? | SELECT DISTINCT name, number FROM course WHERE department = 'SI' AND credits = 6 | advising |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about commission_pct over the last_name , display in asc by the X-axis. | SELECT LAST_NAME, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY LAST_NAME | nvbench |
CREATE TABLE table_24463470_1 (
unlock_order VARCHAR,
unlocks VARCHAR
) | How many instances is paris the unlock? | SELECT COUNT(unlock_order) FROM table_24463470_1 WHERE unlocks = "Paris" | sql_create_context |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NA... | For all employees who have the letters D or S in their first name, give me the comparison about the average of department_id over the hire_date bin hire_date by weekday, and display Y-axis in desc order. | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(DEPARTMENT_ID) DESC | nvbench |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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,
H... | 从零二年一月二十五日到一九年七月八日,医疗机构7879862的检查费用有多少 | SELECT SUM(t_kc22.AMOUNT) 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 = '7879862' AND t_kc22.STA_DATE BETWEEN '2002-01-25' AND '2019-07-08' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE table_204_621 (
id number,
"no." number,
"date" text,
"tournament" text,
"winning score" text,
"margin\nof victory" text,
"runner(s)-up" text
) | how many tournaments were in 1967 ? | SELECT COUNT("tournament") FROM table_204_621 WHERE "date" = 1967 | squall |
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,... | 手术量排名第一与手术量排名倒数第一的科室在2001年9月16日到2008年6月13日间能相差多少? | SELECT (SELECT COUNT(*) FROM t_kc22 WHERE STA_DATE BETWEEN '2001-09-16' AND '2008-06-13' AND MED_INV_ITEM_TYPE = '手术费' GROUP BY MED_ORG_DEPT_CD ORDER BY COUNT(*) DESC LIMIT 1) - (SELECT COUNT(*) FROM t_kc22 WHERE STA_DATE BETWEEN '2001-09-16' AND '2008-06-13' AND MED_INV_ITEM_TYPE = '手术费' GROUP BY MED_ORG_DEPT_CD ORDER... | css |
CREATE TABLE table_name_37 (
team VARCHAR,
qual_1 VARCHAR
) | What team has 59.372 for qual 1? | SELECT team FROM table_name_37 WHERE qual_1 = "59.372" | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (... | count the number of patients whose admission type is emergency and diagnoses long title is other specified disorders of esophagus? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Other specified disorders of esophagus" | mimicsql_data |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | how many patients were diagnosed with a congenital heart anomaly nos and an abnormal lab test? | 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 = "Cong heart anomaly NOS" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ tim... | 沈元纬这个病人做的脸部检验的各项指标结果如何 | SELECT * 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 jybgb.YLJGDM = jyjgzbb.YLJGDM... | css |
CREATE TABLE Faculty_Participates_in (
FacID INTEGER,
actid INTEGER
)
CREATE TABLE Participates_in (
stuid INTEGER,
actid INTEGER
)
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Ra... | Stacked bar chart of the total number for with each Sex in each rank, could you rank in asc by the Y-axis? | SELECT Rank, COUNT(*) FROM Faculty GROUP BY Sex, Rank ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_name_81 (
description VARCHAR,
livery VARCHAR
) | What is the description for the livery Br Grey? | SELECT description FROM table_name_81 WHERE livery = "br grey" | sql_create_context |
CREATE TABLE table_name_15 (
time VARCHAR,
speed VARCHAR
) | What is Time, when Speed is 87.49mph? | SELECT time FROM table_name_15 WHERE speed = "87.49mph" | sql_create_context |
CREATE TABLE table_2205 (
"Year" real,
"Division" real,
"League" text,
"Regular Season" text,
"Playoffs" text,
"Open Canada Cup" text
) | What is the total number of playoffs held in exactly 2006? | SELECT COUNT("Playoffs") FROM table_2205 WHERE "Year" = '2006' | wikisql |
CREATE TABLE table_22242 (
"Year to April" real,
"Revenue (\u00a3million)" text,
"EBIT (\u00a3m)" text,
"Net profit (\u00a3m)" text,
"Earnings per share (p)" text
) | Name the ebit for eps being 10.6 | SELECT "EBIT (\u00a3m)" FROM table_22242 WHERE "Earnings per share (p)" = '10.6' | wikisql |
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE student_record (
studen... | When will Intensive Latin be offered ? | SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM semester INNER JOIN course_offering ON semester.semester_id = course_o... | advising |
CREATE TABLE table_name_27 (
opponent VARCHAR,
record VARCHAR
) | What opponent has a record of 6-9? | SELECT opponent FROM table_name_27 WHERE record = "6-9" | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | how many patients whose gender is m and drug code is mido5? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "M" AND prescriptions.formulary_drug_cd = "MIDO5" | mimicsql_data |
CREATE TABLE table_78491 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which home team has a home team 14.12 (96)? | SELECT "Home team" FROM table_78491 WHERE "Home team score" = '14.12 (96)' | wikisql |
CREATE TABLE table_name_96 (
year VARCHAR
) | What year is the 2007 big red? | SELECT year FROM table_name_96 WHERE 2007 = "big red" | sql_create_context |
CREATE TABLE table_36195 (
"Round" real,
"Pick" text,
"Name" text,
"Position" text,
"College" text
) | What was the lowest round for a tight end position? | SELECT MIN("Round") FROM table_36195 WHERE "Position" = 'tight end' | wikisql |
CREATE TABLE table_62396 (
"Harmonic" real,
"Ratio" text,
"Cents" real,
"12ET Cents" text,
"53ET Commas" real,
"53ET Cents" real
) | What is the sum of cents that has 53ET cents less than 113.21, and a harmonic more than 1? | SELECT SUM("Cents") FROM table_62396 WHERE "53ET Cents" < '113.21' AND "Harmonic" > '1' | wikisql |
CREATE TABLE table_8874 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text
) | what is the score on february 18? | SELECT "Score" FROM table_8874 WHERE "Date" = 'february 18' | wikisql |
CREATE TABLE table_name_22 (
round INTEGER,
pole_position VARCHAR
) | what is the lowest round pole position of satoshi motoyama | SELECT MIN(round) FROM table_name_22 WHERE pole_position = "satoshi motoyama" | sql_create_context |
CREATE TABLE table_21378339_5 (
artist VARCHAR,
televotes VARCHAR
) | Name the artist for 1595 televotes | SELECT artist FROM table_21378339_5 WHERE televotes = 1595 | sql_create_context |
CREATE TABLE table_name_83 (
score VARCHAR,
opponent_team VARCHAR,
opponent VARCHAR
) | What is Score, when Opponent Team is Belgium, and when Opponent is Kirsten Flipkens? | SELECT score FROM table_name_83 WHERE opponent_team = "belgium" AND opponent = "kirsten flipkens" | sql_create_context |
CREATE TABLE table_63810 (
"Title" text,
"Author" text,
"First Issue" text,
"Last Issue" text,
"Completed?" text
) | What is the First Issue date of Soul Eater? | SELECT "First Issue" FROM table_63810 WHERE "Title" = 'soul eater' | wikisql |
CREATE TABLE table_47867 (
"Date" text,
"Opponent" text,
"Score" text,
"Result" text,
"Record" text
) | WHAT SCORE WAS ON SEPTEMBER 21? | SELECT "Score" FROM table_47867 WHERE "Date" = 'september 21' | wikisql |
CREATE TABLE table_64381 (
"Round" real,
"Dates" text,
"Rally Name" text,
"Rally HQ" text,
"Support Category" text,
"Surface" text
) | What Surface had a Rally HQ of salou? | SELECT "Surface" FROM table_64381 WHERE "Rally HQ" = 'salou' | wikisql |
CREATE TABLE employee (
emp_num number,
emp_lname text,
emp_fname text,
emp_initial text,
emp_jobcode text,
emp_hiredate time,
emp_dob time
)
CREATE TABLE enroll (
class_code text,
stu_num number,
enroll_grade text
)
CREATE TABLE course (
crs_code text,
dept_code text,
... | What is the name, address, and number of students in the departments that have the 3 most students? | SELECT T2.dept_name, T2.dept_address, COUNT(*) FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY COUNT(*) DESC LIMIT 3 | spider |
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 SuggestedEditVotes (
Id number,
SuggestedEditId number,
... | Number of comments by user. | SELECT UserId AS "user_link", COUNT(*) FROM Comments WHERE CreationDate BETWEEN '##fromDate:string##' AND '##tillDate:string##' GROUP BY UserId ORDER BY COUNT(*) DESC | sede |
CREATE TABLE technician (
technician_id number,
name text,
team text,
starting_year number,
age number
)
CREATE TABLE repair (
repair_id number,
name text,
launch_date text,
notes text
)
CREATE TABLE repair_assignment (
technician_id number,
repair_id number,
machine_id... | List the name of technicians whose team is not 'NYY'. | SELECT name FROM technician WHERE team <> "NYY" | spider |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense... | Progression of comments referring to CodeReview. See how many posts per day with comments referring to CodeReview. | SELECT DATE(CreationDate) AS CreationDate, COUNT(pp.CAmount) AS Amount FROM (SELECT PostId, COUNT(*) AS CAmount FROM Comments WHERE UPPER(Text) LIKE '%CODEREVIEW%' GROUP BY PostId) AS pp RIGHT OUTER JOIN Posts ON pp.PostId = Posts.Id GROUP BY DATE(CreationDate) ORDER BY CreationDate | sede |
CREATE TABLE table_name_62 (
episode VARCHAR,
viewers__m_ VARCHAR,
households__rating_share_ VARCHAR
) | Name the episode for viewers bigger than 5.63 and the households rating is 4.5/7 | SELECT episode FROM table_name_62 WHERE viewers__m_ > 5.63 AND households__rating_share_ = "4.5/7" | sql_create_context |
CREATE TABLE table_name_97 (
years VARCHAR,
jersey_number_s_ VARCHAR,
position VARCHAR
) | What is Years, when Jersey Number(s) is 21, and when Position is SG? | SELECT years FROM table_name_97 WHERE jersey_number_s_ = "21" AND position = "sg" | sql_create_context |
CREATE TABLE table_name_43 (
losses VARCHAR,
byes INTEGER
) | What is the total number of losses for teams with more than 0 byes? | SELECT COUNT(losses) FROM table_name_43 WHERE byes > 0 | sql_create_context |
CREATE TABLE table_name_57 (
poles VARCHAR,
racing_team VARCHAR
) | How many poles does status grand prix have? | SELECT poles FROM table_name_57 WHERE racing_team = "status grand prix" | sql_create_context |
CREATE TABLE table_43448 (
"Frequency" text,
"Call sign" text,
"Branding" text,
"Format" text,
"Owner" text
) | Which Call sign has a Branding of cbc radio one? | SELECT "Call sign" FROM table_43448 WHERE "Branding" = 'cbc radio one' | wikisql |
CREATE TABLE table_49959 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Attendance" real,
"Record" text,
"Points" real
) | What were the Points on December 13? | SELECT MAX("Points") FROM table_49959 WHERE "Date" = 'december 13' | wikisql |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,... | count the number of patients who received a thoracentesis procedure during the same month after they were diagnosed with asymp hiv infectn status until 2 years ago. | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'asymp hiv infectn ... | mimic_iii |
CREATE TABLE table_20468 (
"Cartridge" text,
"Bullet weight" text,
"Muzzle velocity" text,
"Muzzle energy" text,
"Source" text
) | What type of cartridge is used by a Winchester? | SELECT "Cartridge" FROM table_20468 WHERE "Source" = 'Winchester' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
... | what were the top three most common procedures that followed in the same hospital visit for patients that received a oxygen therapy (40% to 60%) since 2105? | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'oxyge... | eicu |
CREATE TABLE table_10548224_1 (
winning_team VARCHAR,
date_contested VARCHAR
) | Who was the winning team of the game that was contested on February 1, 2009? | SELECT winning_team FROM table_10548224_1 WHERE date_contested = "February 1, 2009" | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
... | indicate the daily maximum amount of arterial bp [systolic] for patient 6725 until 12/07/2105. | SELECT MAX(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 6725)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arter... | mimic_iii |
CREATE TABLE table_46508 (
"Opposing Team" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
) | Where was the 05/09/1973 venue? | SELECT "Venue" FROM table_46508 WHERE "Date" = '05/09/1973' | wikisql |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 患者魏冠宇在二00九年九月二日到二0一八年十二月二十八日期间,总共到医院就诊过多少次 | SELECT (SELECT COUNT(*) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.person_info_XM = '魏冠宇' AND mzjzjlb.JZKSRQ BETWEEN '2009-09-02' AND '2018-12-28') + (SELECT COUNT(*) FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AN... | css |
CREATE TABLE table_name_38 (
opponent VARCHAR,
attendance VARCHAR
) | Who was the opponent for the game played with 54,136 people in attendance? | SELECT opponent FROM table_name_38 WHERE attendance = "54,136" | 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,... | 在编号为3775508的医院中根据入院诊断疾病名称算出不同疾病的平均患者年龄在多少岁呢? | SELECT IN_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '3775508' GROUP BY IN_DIAG_DIS_NM | css |
CREATE TABLE table_4605 (
"Conference" text,
"# of Bids" real,
"Record" text,
"Win %" text,
"Round of 32" text,
"Sweet Sixteen" text,
"Elite Eight" text,
"Final Four" text,
"Championship Game" text
) | How many Big 12 teams made it to the Final Four? | SELECT "Final Four" FROM table_4605 WHERE "Conference" = 'big 12' | wikisql |
CREATE TABLE table_23180638_1 (
oricon_albums_chart VARCHAR,
debut_sales__copies_ INTEGER
) | Which charts had debut sales of of more than 339333.011497678? | SELECT oricon_albums_chart FROM table_23180638_1 WHERE debut_sales__copies_ > 339333.011497678 | sql_create_context |
CREATE TABLE table_name_25 (
round INTEGER,
college VARCHAR,
overall VARCHAR
) | Which Round is the highest one that has a College of arizona, and an Overall larger than 120? | SELECT MAX(round) FROM table_name_25 WHERE college = "arizona" AND overall > 120 | sql_create_context |
CREATE TABLE table_68378 (
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text
) | Who attended the school in 2006, that Whitney Powell attended in 2007? | SELECT "2006" FROM table_68378 WHERE "2007" = 'whitney powell' | wikisql |
CREATE TABLE field (
fieldid int
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE... | keyphrases used by Akihito Kotera and Masatsugu Kidode | SELECT DISTINCT paperkeyphrase.keyphraseid FROM author, paperkeyphrase, writes WHERE author.authorname IN ('Akihito Kotera', 'Masatsugu Kidode') AND writes.authorid = author.authorid AND writes.paperid = paperkeyphrase.paperid GROUP BY paperkeyphrase.keyphraseid HAVING COUNT(DISTINCT writes.authorid) = 2 | scholar |
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 (... | give me the number of patients whose insurance is private and procedure short title is int inser lead atri-vent? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.short_title = "Int inser lead atri-vent" | mimicsql_data |
CREATE TABLE table_name_89 (
tie_no VARCHAR,
score VARCHAR
) | What is Tie No, when Score is 'Marlow United won 4 2 on penalties'? | SELECT tie_no FROM table_name_89 WHERE score = "marlow united won 4–2 on penalties" | sql_create_context |
CREATE TABLE table_1771753_3 (
chassis VARCHAR,
average_speed__mph_ VARCHAR
) | When 169.182 is the average speed miles per hour what is the chassis? | SELECT chassis FROM table_1771753_3 WHERE average_speed__mph_ = "169.182" | sql_create_context |
CREATE TABLE table_name_25 (
driver VARCHAR,
laps VARCHAR,
grid VARCHAR
) | Who drive 74 laps in a grid larger than 9? | SELECT driver FROM table_name_25 WHERE laps = 74 AND grid > 9 | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime t... | when was the first time until 1070 days ago patient 010-6010 reached the maximum sao2? | 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 = '010-6010')) AND NOT vitalperiodic.sao2 IS NULL AND ... | eicu |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
... | how many times did patient 017-16041 have enteral tube intake: nasoduodenal nostril, r in his system on 12/25/2105? | SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-16041')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.ce... | eicu |
CREATE TABLE table_name_8 (
round VARCHAR,
kick_off VARCHAR
) | Which round has a Kick Off of 1993-02-17 20:30? | SELECT round FROM table_name_8 WHERE kick_off = "1993-02-17 20:30" | sql_create_context |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
... | 594 has a lab , does it ? | SELECT COUNT(*) > 0 FROM course WHERE department = 'EECS' AND has_lab = 'Y' AND number = 594 | advising |
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... | Draw a bar chart about the distribution of ACC_Road and the sum of School_ID , and group by attribute ACC_Road, and display from high to low by the X-axis. | SELECT ACC_Road, SUM(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road DESC | nvbench |
CREATE TABLE table_name_69 (
election INTEGER,
_number_of_seats_won VARCHAR,
_number_of_candidates_nominated VARCHAR,
_percentage_of_popular_vote VARCHAR
) | What is the earliest election with more than 7 candidates nominated, a percentage of the popular vote of 2.75%, and 0 seats won? | SELECT MIN(election) FROM table_name_69 WHERE _number_of_candidates_nominated > 7 AND _percentage_of_popular_vote = "2.75%" AND _number_of_seats_won < 0 | sql_create_context |
CREATE TABLE table_6514 (
"Year" real,
"Class" text,
"Team" text,
"Points" real,
"Rank" text,
"Wins" real
) | What is year that has points larger than 46, and a rank of 6th? | SELECT SUM("Year") FROM table_6514 WHERE "Points" > '46' AND "Rank" = '6th' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.