context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_72441 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
) | What is the original air date of the episode directed by Jeff Melman? | SELECT "Original air date" FROM table_72441 WHERE "Directed by" = 'Jeff Melman' | wikisql |
CREATE TABLE table_204_608 (
id number,
"name" text,
"elected party" text,
"constituency" text,
"elected date" text,
"military service" text
) | count how many of these members were unionists . | SELECT COUNT("name") FROM table_204_608 WHERE "elected party" = 'unionist' | squall |
CREATE TABLE table_name_53 (
date VARCHAR,
event VARCHAR
) | What date was the 200m breaststroke event? | SELECT date FROM table_name_53 WHERE event = "200m breaststroke" | sql_create_context |
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Dorm_amenity (
amenid ... | What are average ages for students living in each city? Return a bar chart, and sort in asc by the total number. | SELECT city_code, AVG(Age) FROM Student GROUP BY city_code ORDER BY AVG(Age) | nvbench |
CREATE TABLE table_name_64 (
pronunciation_b VARCHAR,
meaning_b VARCHAR
) | Name the pronunciation for meaning b of border, frontier | SELECT pronunciation_b FROM table_name_64 WHERE meaning_b = "border, frontier" | sql_create_context |
CREATE TABLE table_26173063_2 (
faisaly VARCHAR,
wehdat VARCHAR
) | what is faisaly when wehdat is xxx? | SELECT faisaly FROM table_26173063_2 WHERE wehdat = "XXX" | sql_create_context |
CREATE TABLE table_16960 (
"Date" text,
"Tournament" text,
"Location" text,
"Purse( $ )" real,
"Winner" text,
"Score" text,
"1st Prize( $ )" real
) | What is the state that hosted a tournament with the score of 208 (-8)? | SELECT "Location" FROM table_16960 WHERE "Score" = '208 (-8)' | wikisql |
CREATE TABLE table_55423 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Series" text
) | What was the attendance of april 17? | SELECT SUM("Attendance") FROM table_55423 WHERE "Date" = 'april 17' | wikisql |
CREATE TABLE table_9877 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Attendance" text
) | In what Week was the Result W 27-24? | SELECT MAX("Week") FROM table_9877 WHERE "Result" = 'w 27-24' | wikisql |
CREATE TABLE table_name_66 (
player VARCHAR,
year VARCHAR
) | What player played in 2000? | SELECT player FROM table_name_66 WHERE year = 2000 | sql_create_context |
CREATE TABLE table_27048 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
) | What was the production code for the episode that debuted October 1, 1993? | SELECT MAX("Production code") FROM table_27048 WHERE "Original air date" = 'October 1, 1993' | wikisql |
CREATE TABLE table_17238 (
"Tournament" text,
"Date" text,
"City" text,
"Country" text,
"Surface" text,
"Singles champions" text,
"Doubles champions" text
) | How many singles tournaments did Ludovic Walter win? | SELECT COUNT("Tournament") FROM table_17238 WHERE "Singles champions" = 'Ludovic Walter' | wikisql |
CREATE TABLE table_name_82 (
artist VARCHAR,
actual_title VARCHAR
) | Game of Thrones was done by which artist? | SELECT artist FROM table_name_82 WHERE actual_title = "game of thrones" | sql_create_context |
CREATE TABLE table_name_37 (
attendance INTEGER,
week VARCHAR,
date VARCHAR
) | What is the lowest attendance for a game before 10 weeks on November 12, 1967 | SELECT MIN(attendance) FROM table_name_37 WHERE week < 10 AND date = "november 12, 1967" | sql_create_context |
CREATE TABLE table_203_14 (
id number,
"#" number,
"date" text,
"venue" text,
"opponent" text,
"score" text,
"result" text,
"competition" text
) | when was his last match ? | SELECT "date" FROM table_203_14 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE table_1949994_8 (
premiere_air_dates VARCHAR,
start_date VARCHAR
) | What were the television air dates for the series that had a production start date of June 16? | SELECT premiere_air_dates FROM table_1949994_8 WHERE start_date = "June 16" | sql_create_context |
CREATE TABLE table_5893 (
"Rank" real,
"Rider" text,
"Team" text,
"Speed" text,
"Time" text
) | Which Speed has a Rank smaller than 9 in kawasaki zx6 600cc Team? | SELECT "Speed" FROM table_5893 WHERE "Rank" < '9' AND "Team" = 'kawasaki zx6 600cc' | wikisql |
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,... | 平均医疗住院时长超过26天在医院3530897有多少个科室? | SELECT COUNT(*) FROM (SELECT MED_ORG_DEPT_CD FROM t_kc21 WHERE MED_SER_ORG_NO = '3530897' GROUP BY MED_ORG_DEPT_CD HAVING AVG(IN_HOSP_DAYS) > 26) AS T | css |
CREATE TABLE table_2241101_1 (
year VARCHAR,
date VARCHAR
) | In how many different years did the race happen on February 27? | SELECT COUNT(year) FROM table_2241101_1 WHERE date = "February 27" | sql_create_context |
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
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 T... | give me the flights from SEATTLE to CHICAGO that have meals on CO saturday morning | SELECT DISTINCT flight_id FROM flight WHERE (((((flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 26 AND DATE_DAYalias0.month_number = 7 AND DATE_DAYalias0.year = 1991)) AND ... | atis |
CREATE TABLE table_name_5 (
college_junior_club_team VARCHAR,
pick VARCHAR
) | Tell me the college/junior club team for pick of 16 | SELECT college_junior_club_team FROM table_name_5 WHERE pick = "16" | sql_create_context |
CREATE TABLE table_72791 (
"Player" text,
"No." real,
"Nationality" text,
"Position" text,
"Years for Grizzlies" text,
"School/Club Team" text
) | Which position did kevin edwards play for | SELECT "Position" FROM table_72791 WHERE "Player" = 'Kevin Edwards' | wikisql |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | 罗列出病患编号16591301在2004年5月15日到2008年3月25日内所有检验报告单的审核日期时间是什么? | (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 = '16591301' AND jybgb.BGRQ BETWEEN '2004-05-15' AND '2008-03-25') UNI... | css |
CREATE TABLE table_name_62 (
away_team VARCHAR,
home_team VARCHAR
) | Who was the opponent when Footscray played as the home team? | SELECT away_team AS score FROM table_name_62 WHERE home_team = "footscray" | 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... | give the number of patients whose primary disease is acute subdural hematoma and year of death is in or before year 2186. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ACUTE SUBDURAL HEMATOMA" AND demographic.dod_year <= "2186.0" | mimicsql_data |
CREATE TABLE table_16570286_4 (
best_bowling VARCHAR,
average VARCHAR
) | What was the best bowling score when the average was 23.33? | SELECT best_bowling FROM table_16570286_4 WHERE average = "23.33" | sql_create_context |
CREATE TABLE table_42101 (
"Ecozone" text,
"Area (km\u00b2) Territorial waters" real,
"Area (km\u00b2) Exclusive Economic Zone" real,
"Percentage of total area (forEEZ)" real,
"Percentage of marine area (forEEZ)" real
) | What is the average percentage of total area when the percentage of marine area is more than 39.3 and territorial waters area is less than 2,788,349? | SELECT AVG("Percentage of total area (forEEZ)") FROM table_42101 WHERE "Percentage of marine area (forEEZ)" > '39.3' AND "Area (km\u00b2) Territorial waters" < '2,788,349' | wikisql |
CREATE TABLE table_name_67 (
score VARCHAR,
team VARCHAR
) | Tell met he score for team of waaia | SELECT score FROM table_name_67 WHERE team = "waaia" | sql_create_context |
CREATE TABLE table_53969 (
"Year" real,
"Date" text,
"Drivers" text,
"Distance/Duration" text,
"Race Title" text
) | What is the distance/duration on sept 5 of le grand prix de trois-rivi res? | SELECT "Distance/Duration" FROM table_53969 WHERE "Date" = 'sept 5' AND "Race Title" = 'le grand prix de trois-rivières' | wikisql |
CREATE TABLE Customers (
customer_first_name VARCHAR,
customer_last_name VARCHAR,
customer_id VARCHAR
)
CREATE TABLE Accounts (
customer_id VARCHAR
) | What is the customer id, first and last name with most number of accounts. | SELECT T1.customer_id, T2.customer_first_name, T2.customer_last_name FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY ... | For those employees who was hired before 2002-06-21, give me the trend about manager_id over hire_date , sort from high to low by the X-axis. | SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY HIRE_DATE DESC | nvbench |
CREATE TABLE table_42267 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Event" text
) | What is the average Year, when Competition is Oceania Youth Championships? | SELECT AVG("Year") FROM table_42267 WHERE "Competition" = 'oceania youth championships' | wikisql |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Visualize a pie chart about the proportion of ACC_Regular_Season and ACC_Percent. | SELECT ACC_Regular_Season, ACC_Percent FROM basketball_match | nvbench |
CREATE TABLE table_29491 (
"Club" text,
"Location" text,
"Ground" text,
"Manager" text,
"Titles" real,
"Last title" text
) | Who is the manager for lootos p lva? | SELECT "Manager" FROM table_29491 WHERE "Club" = 'Lootos Põlva' | wikisql |
CREATE TABLE table_76965 (
"Date" text,
"Opponent" text,
"Score" text,
"Result" text,
"Record" text
) | WHAT IS THE RESULT WITH A SCORE OF 70-73? | SELECT "Result" FROM table_76965 WHERE "Score" = '70-73' | wikisql |
CREATE TABLE table_40924 (
"From" real,
"Goal" text,
"Round 1" text,
"Round 2" text,
"Round 3" text,
"Round 4" text,
"Round 5" text,
"Round 6+" text
) | What is Round 5 when Round 4 is Triple, Round 3 is Double and Round 6+ is Triple? | SELECT "Round 5" FROM table_40924 WHERE "Round 4" = 'triple' AND "Round 3" = 'double' AND "Round 6+" = 'triple' | wikisql |
CREATE TABLE table_24016 (
"Player" text,
"Played" real,
"Legs Won" real,
"Legs Lost" real,
"LWAT" real,
"100+" real,
"140+" real,
"180s" real,
"High Checkout" real,
"3-dart Average" text
) | What is the 3-dart average with a high checkout of 112? | SELECT "3-dart Average" FROM table_24016 WHERE "High Checkout" = '112' | wikisql |
CREATE TABLE table_6831 (
"Time" text,
"00:00 AM" text,
"01:00 AM" text,
"02:00 AM" text,
"05:00 AM" text
) | Which show is on at 02:00 AM on Monday? | SELECT "02:00 AM" FROM table_6831 WHERE "Time" = 'monday' | wikisql |
CREATE TABLE table_name_58 (
team VARCHAR,
conference VARCHAR,
school VARCHAR
) | What team has great plains as the conference, and concordia (ne) as the school? | SELECT team FROM table_name_58 WHERE conference = "great plains" AND school = "concordia (ne)" | sql_create_context |
CREATE TABLE table_name_30 (
pop__2010_ INTEGER,
water__sqmi_ VARCHAR,
longitude VARCHAR,
latitude VARCHAR
) | What is the average 2010 population having longitude over -102.353035, latitude over 46.937841, and 0.034 sqmi of water? | SELECT AVG(pop__2010_) FROM table_name_30 WHERE longitude > -102.353035 AND latitude > 46.937841 AND water__sqmi_ = 0.034 | sql_create_context |
CREATE TABLE table_65490 (
"Year" real,
"Venue" text,
"Men's Open" text,
"Women's Open" text,
"Men's 35s" text
) | What is the Men's Open when the venue is Perth? | SELECT "Men's Open" FROM table_65490 WHERE "Venue" = 'perth' | wikisql |
CREATE TABLE table_62111 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is Player, when Place is '1'? | SELECT "Player" FROM table_62111 WHERE "Place" = '1' | wikisql |
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varch... | For WRITING 420 , is there a section next semester that is not on Monday ? | SELECT DISTINCT course_offering.section_number FROM course, course_offering, semester WHERE course_offering.monday = 'N' AND course.course_id = course_offering.course_id AND course.department = 'WRITING' AND course.number = 420 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semeste... | advising |
CREATE TABLE table_19246_1 (
carrier VARCHAR,
frequency VARCHAR,
launch_date__ddmmyyyy_ VARCHAR
) | When the launch date is 14.09.2005, and the frequency is 900mhz and 1800mhz, how many carriers are there? | SELECT COUNT(carrier) FROM table_19246_1 WHERE frequency = "900MHz and 1800MHz" AND launch_date__ddmmyyyy_ = "14.09.2005" | sql_create_context |
CREATE TABLE table_30018460_1 (
manhunt_international INTEGER
) | What is the minimum manhunt beauty contest? | SELECT MIN(manhunt_international) FROM table_30018460_1 | sql_create_context |
CREATE TABLE table_19916 (
"Series Ep." text,
"Episode" real,
"Netflix" text,
"Segment A" text,
"Segment B" text,
"Segment C" text,
"Segment D" text
) | Name the segment D of the episode where segment A is tequila | SELECT "Segment D" FROM table_19916 WHERE "Segment A" = 'Tequila' | wikisql |
CREATE TABLE table_22329326_1 (
owned_since INTEGER
) | What was the earliest year a station was owned since? | SELECT MIN(owned_since) FROM table_22329326_1 | sql_create_context |
CREATE TABLE table_31244 (
"Episode" real,
"Title" text,
"Directed by" text,
"Written by" text,
"UK viewers (million)" text,
"Share (%)" text,
"Original air date" text
) | How many episodes hve 4.50 million viewers? | SELECT "Episode" FROM table_31244 WHERE "UK viewers (million)" = '4.50' | wikisql |
CREATE TABLE table_name_38 (
laps INTEGER,
grid VARCHAR,
points VARCHAR
) | What is the top lap that had 6 grids and more than 19 points? | SELECT MAX(laps) FROM table_name_38 WHERE grid = "6" AND points > 19 | sql_create_context |
CREATE TABLE table_49744 (
"Model number" text,
"Frequency" text,
"L1 Cache" text,
"Mult." real,
"Voltage" text
) | What is the Frequency, when the Voltage is 3.3 V? | SELECT "Frequency" FROM table_49744 WHERE "Voltage" = '3.3 v' | wikisql |
CREATE TABLE table_13319 (
"Rank" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
) | What is Zimbabwe's rank? | SELECT "Rank" FROM table_13319 WHERE "Nationality" = 'zimbabwe' | wikisql |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | A bar chart shows the distribution of All_Neutral and ACC_Percent , display from high to low by the ACC_Percent. | SELECT All_Neutral, ACC_Percent FROM basketball_match ORDER BY ACC_Percent DESC | nvbench |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
... | what were the top three most frequent diagnoses that were given to patients during the same hospital encounter after receiving the exc/dest hrt lesion open since 2104? | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.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, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_i... | mimic_iii |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetake... | calculate the total amount of patient 002-41152's inputs on last month/17. | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-41152')) AND intakeoutput.cellpath LIKE '%in... | eicu |
CREATE TABLE table_name_34 (
year VARCHAR,
third VARCHAR
) | What year did Kyle Newman place third? | SELECT year FROM table_name_34 WHERE third = "kyle newman" | 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,
... | 在00年1月17日直到11年5月4日这一段时间,病患云天干内所有检验结果指标记录中的仪器编号以及名称分别叫什么? | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZ... | css |
CREATE TABLE reviewer (
rid number,
name text
)
CREATE TABLE rating (
rid number,
mid number,
stars number,
ratingdate time
)
CREATE TABLE movie (
mid number,
title text,
year number,
director text
) | What is the name of the movie produced after 2000 and directed by James Cameron? | SELECT title FROM movie WHERE director = 'James Cameron' AND year > 2000 | spider |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
... | Best Posts by len and score. | SELECT Id AS "post_link", Score AS PostRating, AnswerCount AS Answers, CommentCount AS Comments FROM Posts WHERE Score > 5 ORDER BY PostRating DESC LIMIT 10 | sede |
CREATE TABLE table_name_66 (
score VARCHAR,
home_team VARCHAR
) | what is the score when the home team is king's lynn? | SELECT score FROM table_name_66 WHERE home_team = "king's lynn" | sql_create_context |
CREATE TABLE table_50460 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | How many Total medals did the Nation the got 0 Bronze medals receive? | SELECT AVG("Total") FROM table_50460 WHERE "Bronze" < '0' | wikisql |
CREATE TABLE table_15295 (
"First game" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Percentage" text
) | what is the most lost games when the percentage is 50.00% and games played is less than 2? | SELECT MAX("Lost") FROM table_15295 WHERE "Percentage" = '50.00%' AND "Played" < '2' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... | what is the first time patient 025-10988 had enteral formula volume/bolus amt (ml) taken on the first icu visit? | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-10988') AND NOT patient.unitdischargetime IS NULL... | eicu |
CREATE TABLE table_name_51 (
planet VARCHAR,
semimajor_axis___au__ VARCHAR
) | What type of planet has a semimajor axis of 0.07 AU? | SELECT planet AS Type FROM table_name_51 WHERE semimajor_axis___au__ = 0.07 | sql_create_context |
CREATE TABLE table_8007 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What was the location and attendance for the game after game 36 against Atlanta? | SELECT "Location Attendance" FROM table_8007 WHERE "Game" > '36' AND "Team" = 'atlanta' | wikisql |
CREATE TABLE table_28582091_2 (
title VARCHAR,
production_code VARCHAR
) | What was the title of the episode with production code 2J5515? | SELECT title FROM table_28582091_2 WHERE production_code = "2J5515" | sql_create_context |
CREATE TABLE gwyjzb (
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,
... | 医院5859683中就诊的患者沈清昶去看病的科室名字里不含有矫形的所有医疗就诊记录共有哪些? | SELECT * FROM gwyjzb WHERE gwyjzb.PERSON_NM = '沈清昶' AND gwyjzb.MED_SER_ORG_NO = '5859683' AND NOT gwyjzb.MED_ORG_DEPT_NM LIKE '%矫形%' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '沈清昶' AND fgwyjzb.MED_SER_ORG_NO = '5859683' AND NOT fgwyjzb.MED_ORG_DEPT_NM LIKE '%矫形%' | css |
CREATE TABLE table_200_30 (
id number,
"year" number,
"award" text,
"work/artist" text,
"result" text
) | in what year did they win them ? | SELECT "year" FROM table_200_30 WHERE "result" = 'won' | squall |
CREATE TABLE table_name_36 (
place VARCHAR,
country VARCHAR
) | What is the Place of the Player from Scotland? | SELECT place FROM table_name_36 WHERE country = "scotland" | 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... | count the number of patients whose death status is 1 and diagnoses long title is subarachnoid hemorrhage? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.long_title = "Subarachnoid hemorrhage" | mimicsql_data |
CREATE TABLE table_62527 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What Country had a Player with a Score of 72-66-72=210? | SELECT "Country" FROM table_62527 WHERE "Score" = '72-66-72=210' | wikisql |
CREATE TABLE table_73990 (
"Edition" text,
"Year" real,
"Host city" text,
"Host country" text,
"Date" text,
"No. of athletes" text,
"Nations" real
) | In what year was Montenegro the host country? | SELECT "Year" FROM table_73990 WHERE "Host country" = 'Montenegro' | wikisql |
CREATE TABLE table_name_4 (
goals INTEGER,
club VARCHAR,
points VARCHAR,
assists VARCHAR
) | What is the highest number of goals Eisb ren Berlin had along with 13 points and 10 assists? | SELECT MAX(goals) FROM table_name_4 WHERE points = 13 AND assists = 10 AND club = "eisbären berlin" | sql_create_context |
CREATE TABLE table_19333 (
"Rank" real,
"Name" text,
"Nationality" text,
"1st (m)" text,
"2nd (m)" text,
"Points" text,
"Overall WC points (Rank)" text
) | What are the overall wc points for 2nd (m) of 214.5? | SELECT "Overall WC points (Rank)" FROM table_19333 WHERE "2nd (m)" = '214.5' | wikisql |
CREATE TABLE table_13456202_1 (
affiliation VARCHAR,
mascot VARCHAR
) | How many teams have an eagles mascot? | SELECT COUNT(affiliation) FROM table_13456202_1 WHERE mascot = "Eagles" | sql_create_context |
CREATE TABLE table_57637 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the low gold total for nations with under 23 silvers, ranked beloe 5, and 6 bronzes? | SELECT MIN("Gold") FROM table_57637 WHERE "Silver" < '23' AND "Rank" > '5' AND "Bronze" = '6' | wikisql |
CREATE TABLE mzjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
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,
... | 患者14484033在被门诊诊断为患有帕金森病性痴呆(震颤麻痹性痴呆)的时候其检测指标353555的结果定量及其单位都是什么? | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb... | css |
CREATE TABLE table_name_75 (
points INTEGER,
difference VARCHAR,
lost VARCHAR
) | What was the total number of Points when the value Difference was 13, and when the value Lost was greater than 3? | SELECT SUM(points) FROM table_name_75 WHERE difference = "13" AND lost > 3 | sql_create_context |
CREATE TABLE table_203_576 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | which nation earned the most bronze medals , thailand or south korea ? | SELECT "nation" FROM table_203_576 WHERE "nation" IN ('thailand', 'south korea') ORDER BY "bronze" DESC LIMIT 1 | squall |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE allergy_type (
allergy text,
allergytype text
)
CREATE TABLE has_allergy (
stuid number,
allergy text
) | What is the minimum, mean, and maximum age across all students? | SELECT MIN(age), AVG(age), MAX(age) FROM student | spider |
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 flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_... | how much does it cost to fly from BOSTON to ATLANTA | 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_... | atis |
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... | PreMajor classes are being offered by which teachers next Winter ? | SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr... | advising |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
fi... | tell me the minimum total cost of a hospital that contains acute pain due to trauma until 2 years ago? | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'acute pain due to trauma')) AND DATETIME(cost.chargetime) <= DA... | mimic_iii |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25... | Show each employee's salary using a bar chart, note that use the last name of each employee, list in desc by the y-axis. | SELECT LAST_NAME, SALARY FROM employees ORDER BY SALARY DESC | nvbench |
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,
... | 医院1771451在2003年9月14日到2010年1月28日期间,有多少科室在门诊就诊中开出20张以下的检验报告单 | SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM zzmzjzjlb JOIN jybgb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE zzmzjzjlb.YLJGDM = '1771451' AND jybgb.BGRQ BETWEEN '2003-09-14' AND '2010-01-28' GROUP BY jybgb.KSBM HAVING COUNT(*) <= 20 UNION SELECT jybgb.KSBM FROM fzzmzjzjlb... | css |
CREATE TABLE table_4171 (
"Series #" real,
"Production Code" real,
"Title" text,
"Directed by" text,
"Written by" text,
"United States Original Airdate" text,
"Canada Original Airdate" text
) | Who wrote the episode directed by Jos Humphrey that had an original Canadian air date that was unknown and a United States original air date of August 27, 2011? | SELECT "Written by" FROM table_4171 WHERE "Directed by" = 'Jos Humphrey' AND "Canada Original Airdate" = 'Unknown' AND "United States Original Airdate" = 'August 27, 2011' | wikisql |
CREATE TABLE table_56467 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Record" text
) | Who was the leading scorer on February 9? | SELECT "Leading scorer" FROM table_56467 WHERE "Date" = 'february 9' | wikisql |
CREATE TABLE table_56250 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which home team has an Away team score of 18.21 (129)? | SELECT "Home team" FROM table_56250 WHERE "Away team score" = '18.21 (129)' | wikisql |
CREATE TABLE Residents_Services (
resident_id INTEGER,
service_id INTEGER,
date_moved_in DATETIME,
property_id INTEGER,
date_requested DATETIME,
date_provided DATETIME,
other_details VARCHAR(255)
)
CREATE TABLE Things (
thing_id INTEGER,
organization_id INTEGER,
Type_of_Thing_Co... | Give me a bar chart that the X-axis is the date_moved_in and the Y-axis is Count them, please bin X-axis into Day of Week interval. | SELECT date_moved_in, COUNT(date_moved_in) FROM Customer_Events | nvbench |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
... | java tagged questions without answers and comments. | SELECT Id, Title, AcceptedAnswerId FROM Posts WHERE CommentCount = 0 AND AnswerCount > 0 AND Tags LIKE '%error%' AND ClosedDate IS NULL ORDER BY FavoriteCount DESC | sede |
CREATE TABLE table_name_51 (
result VARCHAR,
week VARCHAR,
date VARCHAR
) | What happened on November 20, 1983 before week 15? | SELECT result FROM table_name_51 WHERE week < 15 AND date = "november 20, 1983" | 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... | 在医疗机构5394717的记录里,这位55722979的患者在01年9月1日到15年6月25日期间接受了多少次检查 | SELECT COUNT(*) 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.PERSON_ID = '55722979' AND t_kc22.STA_DATE BETWEEN '2001-09-01' AND '2015-06-25' AND t_kc21.MED_SER_ORG_NO = '5394717' AND t_kc22.MED_INV... | css |
CREATE TABLE table_54791 (
"Player" text,
"Total Win-Loss" text,
"Singles Win-Loss" text,
"Doubles Win-Loss" text,
"No. of ties" real,
"First year played" real,
"Years Played" real
) | How many years did the team that has a Singles win-Loss of 4-9 and first played before 1999? | SELECT SUM("Years Played") FROM table_54791 WHERE "Singles Win-Loss" = '4-9' AND "First year played" < '1999' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,... | 患者俞安安为疾病V29.354,门诊诊断的神经元特异性烯醇化酶的结果定量是什么?单位是什么? | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZ... | css |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId num... | Number of questions/answers vs comments. | SELECT t1.Count_1 AS "Number of questions and answers", t2.Count_2 AS "Number of comments" FROM (SELECT COUNT(1) AS Count_1 FROM Posts WHERE CreationDate <= '2017-09-30') AS t1, (SELECT COUNT(1) AS Count_2 FROM Comments WHERE CreationDate <= '2017-09-30') AS t2 | sede |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE... | what are the three most frequent microbiological tests patients had in the same hospital visit after undergoing a inject into thorax cavit? | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_pro... | mimic_iii |
CREATE TABLE table_32688 (
"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 bids does Atlantic 10 have? | SELECT "# of Bids" FROM table_32688 WHERE "Conference" = 'atlantic 10' | wikisql |
CREATE TABLE program (
program_id number,
name text,
origin text,
launch number,
owner text
)
CREATE TABLE channel (
channel_id number,
name text,
owner text,
share_in_percent number,
rating_in_percent number
)
CREATE TABLE broadcast (
channel_id number,
program_id numb... | What is the list of program origins ordered alphabetically? | SELECT origin FROM program ORDER BY origin | spider |
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,
... | 从03年9月17到06年10月6日这段时间,医疗机构5908391记录的病人平均住院时长是多少 | SELECT AVG(gwyjzb.IN_HOSP_DAYS) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '5908391' AND gwyjzb.IN_HOSP_DATE BETWEEN '2003-09-17' AND '2006-10-06' UNION SELECT AVG(fgwyjzb.IN_HOSP_DAYS) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '5908391' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2003-09-17' AND '2006-10-06' | css |
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 (
... | give me the number of patients with copd exacerbation primary disease who have been discharged to skilled nursing facility. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SNF" AND demographic.diagnosis = "COPD EXACERBATION" | mimicsql_data |
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Description VARCHAR(255)
)
CREATE TABLE Ref_Locations (
Location_Code CHAR(15),
Location_Name VARCHAR(255),
Location_Description VARCHAR(255)
)
CREATE TABLE Document_Locations (
Do... | How many documents in different starting date? Return a line chart binning starting date by year interval, order in descending by the Date_in_Location_From please. | SELECT Date_in_Location_From, COUNT(Date_in_Location_From) FROM Document_Locations ORDER BY Date_in_Location_From DESC | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.