context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_21 (
class VARCHAR,
identifier VARCHAR
) | What Class has the Identifier of CBFX-FM-6? | SELECT class FROM table_name_21 WHERE identifier = "cbfx-fm-6" | sql_create_context |
CREATE TABLE table_74853 (
"Game" real,
"October" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | Which October has a Record of 5 1 0, and a Game larger than 6? | SELECT AVG("October") FROM table_74853 WHERE "Record" = '5–1–0' AND "Game" > '6' | wikisql |
CREATE TABLE table_204_693 (
id number,
"place" text,
"total" number,
"men" number,
"women" number,
"children" number,
"elderly" number,
"serbs" number,
"jews" number,
"romani" number,
"rusyns" number,
"hungarians" number,
"russians" number
) | which locations had no women casualties ? | SELECT "place" FROM table_204_693 WHERE "women" IS NULL | squall |
CREATE TABLE band (
id number,
firstname text,
lastname text
)
CREATE TABLE vocals (
songid number,
bandmate number,
type text
)
CREATE TABLE albums (
aid number,
title text,
year number,
label text,
type text
)
CREATE TABLE performance (
songid number,
bandmate nu... | What is the last name of the musician who was in the most songs? | SELECT T2.lastname FROM performance AS T1 JOIN band AS T2 ON T1.bandmate = T2.id JOIN songs AS T3 ON T3.songid = T1.songid GROUP BY lastname ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_64362 (
"Club" text,
"Wins" real,
"Losses" real,
"Draws" real,
"Against" real
) | What are the least losses of Mortlake having less than 970 against? | SELECT MIN("Losses") FROM table_64362 WHERE "Club" = 'mortlake' AND "Against" < '970' | wikisql |
CREATE TABLE table_name_27 (
couple VARCHAR,
style VARCHAR
) | Which couple participated in the Contemporary style of dance? | SELECT couple FROM table_name_27 WHERE style = "contemporary" | sql_create_context |
CREATE TABLE table_26202788_7 (
opponent_in_the_final VARCHAR,
championship VARCHAR
) | In the championship Indian Wells, United States (2), who are the opponents in the final? | SELECT opponent_in_the_final FROM table_26202788_7 WHERE championship = "Indian Wells, United States (2)" | sql_create_context |
CREATE TABLE Document_Sections (
section_id INTEGER,
document_code VARCHAR(15),
section_sequence INTEGER,
section_code VARCHAR(20),
section_title VARCHAR(80)
)
CREATE TABLE Document_Sections_Images (
section_id INTEGER,
image_id INTEGER
)
CREATE TABLE Document_Structures (
document_str... | Return a histogram on what are the different role codes for users, and how many users have each? | SELECT role_code, COUNT(*) FROM Users GROUP BY role_code | nvbench |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
... | Do you have any suggestions for human computer interaction courses that are easier than EHS 699 ? | SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE area.area LIKE '%human computer interaction%' AND program_course.workload < (SELECT MIN(P... | advising |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
... | Is there anyone who has n't taught ENS 347 ? | SELECT DISTINCT name FROM instructor WHERE NOT name IN (SELECT INSTRUCTORalias1.name FROM course AS COURSEalias0 INNER JOIN course_offering AS COURSE_OFFERINGalias0 ON COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id INNER JOIN offering_instructor AS OFFERING_INSTRUCTOR ON OFFERING_OFFERING_ID = COURSE_OFFERING... | advising |
CREATE TABLE table_56907 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What venue did the away team footscray play at? | SELECT "Venue" FROM table_56907 WHERE "Away team" = 'footscray' | wikisql |
CREATE TABLE table_16470 (
"Season" real,
"MLS Cup Winner" text,
"MLS Cup Runner-Up" text,
"MLS Supporters Shield Winner" text,
"MLS Supporters Shield Runner-Up" text
) | What is the name of the shield winner in which the mls cup winner and mls cup runner up is colorado rapids? | SELECT "MLS Cup Winner" FROM table_16470 WHERE "MLS Cup Runner-Up" = 'Colorado Rapids' | wikisql |
CREATE TABLE table_38658 (
"NTFA Div 2" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | Old Scotch had less than 9 losses and how much against? | SELECT SUM("Against") FROM table_38658 WHERE "Losses" < '9' AND "NTFA Div 2" = 'old scotch' | wikisql |
CREATE TABLE table_204_524 (
id number,
"season" text,
"tier" number,
"division" text,
"place" text
) | what was the top place the team achieved ? | SELECT "place" FROM table_204_524 ORDER BY "place" LIMIT 1 | 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,... | 从10年11月16日到19年10月24日,医院9744702一共有多少购药医疗记录 | SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '9744702' AND t_kc21.IN_HOSP_DATE BETWEEN '2010-11-16' AND '2019-10-24' AND t_kc21.CLINIC_TYPE = '购药' | css |
CREATE TABLE table_name_35 (
score VARCHAR,
opponents VARCHAR,
date VARCHAR
) | Which Score has Opponents of pkns fc, and a Date of january 8, 2006? | SELECT score FROM table_name_35 WHERE opponents = "pkns fc" AND date = "january 8, 2006" | sql_create_context |
CREATE TABLE table_name_28 (
bonus_points VARCHAR,
drawn VARCHAR
) | What is the number of bonus points when there are 4 drawn? | SELECT bonus_points FROM table_name_28 WHERE drawn = "4" | 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... | what is the number of patients whose admission type is elective and item id is 51466? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.itemid = "51466" | mimicsql_data |
CREATE TABLE election (
election_id number,
representative_id number,
date text,
votes number,
vote_percent number,
seats number,
place number
)
CREATE TABLE representative (
representative_id number,
name text,
state text,
party text,
lifespan text
) | List the votes of elections in descending order. | SELECT votes FROM election ORDER BY votes DESC | spider |
CREATE TABLE table_name_23 (
bangladeshis_admitted INTEGER,
nepalis_admitted VARCHAR,
pakistanis_admitted VARCHAR
) | How many Bangladeshis were admitted when 714 Nepalis and 13,575 Pakistanis were admitted? | SELECT AVG(bangladeshis_admitted) FROM table_name_23 WHERE nepalis_admitted = 714 AND pakistanis_admitted > 13 OFFSET 575 | sql_create_context |
CREATE TABLE procedures (
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
)
... | count the number of patients whose diagnoses icd9 code is 76528 and lab test category is chemistry? | 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.icd9_code = "76528" AND lab."CATEGORY" = "Chemistry" | mimicsql_data |
CREATE TABLE table_10470082_3 (
writer VARCHAR,
us_air_date VARCHAR
) | How many writers had an US air date of september 25, 1993? | SELECT COUNT(writer) FROM table_10470082_3 WHERE us_air_date = "September 25, 1993" | sql_create_context |
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 vitalperiodi... | what is the cost of a medication named dextrose 50 % in water (d50w) iv syringe? | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'dextrose 50 % in water (d50w) iv syringe') | eicu |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversa... | What posts have I edited?. Searches for all edits made | SELECT PostId AS "post_link", * FROM PostHistory WHERE UserId = @UserId ORDER BY PostId DESC, Id DESC | sede |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | Search comments between given dates. | SELECT PostId AS "post_link", Id AS "comment_link", UserId AS "user_link", DATE(CreationDate) FROM Comments WHERE (LOWER(Text) LIKE LOWER('%##SearchString##%')) AND DATE(CreationDate) BETWEEN @StartDate AND @EndDate ORDER BY CreationDate DESC | sede |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABL... | how many patients received cont inv mec ven <96 hrs treatment in the same hospital visit after having been diagnosed with chf nos in this year? | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id 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 =... | mimic_iii |
CREATE TABLE table_6860 (
"Couple" text,
"Style" text,
"Music" text,
"Choreographer(s)" text,
"Chosen by" text
) | What is Choreographer(s), when Chosen is Mary Murphy, and when Style is Contemporary? | SELECT "Choreographer(s)" FROM table_6860 WHERE "Chosen by" = 'mary murphy' AND "Style" = 'contemporary' | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | how many patients have had a lab test name magnesium? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Magnesium" | mimicsql_data |
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... | calculate the total number of patients belonging to black/haitian ethnic origin who had dx ultrasound-heart | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "BLACK/HAITIAN" AND procedures.short_title = "Dx ultrasound-heart" | mimicsql_data |
CREATE TABLE gas_station (
Station_ID int,
Open_Year int,
Location text,
Manager_Name text,
Vice_Manager_Name text,
Representative_Name text
)
CREATE TABLE company (
Company_ID int,
Rank int,
Company text,
Headquarters text,
Main_Industry text,
Sales_billion real,
Pr... | For each headquarter, what are the headquarter and how many companies are centered there Visualize by bar chart, and show from low to high by the total number please. | SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_5352 (
"Nation" text,
"Skip" text,
"Third" text,
"Second" text,
"Lead" text
) | Which Second has a Nation of latvia? | SELECT "Second" FROM table_5352 WHERE "Nation" = 'latvia' | wikisql |
CREATE TABLE table_name_52 (
wins VARCHAR,
year VARCHAR
) | How many wins in 1992? | SELECT wins FROM table_name_52 WHERE year = 1992 | sql_create_context |
CREATE TABLE table_16864968_9 (
location VARCHAR,
attendance VARCHAR
) | Name the location for 15046 attendance | SELECT location FROM table_16864968_9 WHERE attendance = 15046 | sql_create_context |
CREATE TABLE table_61105 (
"Year" real,
"Award" text,
"Category" text,
"Nominated Work" text,
"Result" text
) | What is the most recent year that the Mineola Twins was nominated for outstanding actress in a play and a Drama Desk award? | SELECT MAX("Year") FROM table_61105 WHERE "Nominated Work" = 'the mineola twins' AND "Category" = 'outstanding actress in a play' AND "Award" = 'drama desk award' | wikisql |
CREATE TABLE table_name_41 (
round VARCHAR,
pick__number VARCHAR
) | For Pick #323, which round is it? | SELECT round FROM table_name_41 WHERE pick__number = 323 | sql_create_context |
CREATE TABLE procedures (
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
)
... | provide the number of patients whose admission type is elective and ethnicity is white? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.ethnicity = "WHITE" | mimicsql_data |
CREATE TABLE table_200_12 (
id number,
"year" text,
"award" text,
"category" text,
"nominated work" text,
"result" text
) | what play was wanamaker nominated for best actress in a revival in 1984 ? | SELECT "nominated work" FROM table_200_12 WHERE "category" = 'best actress in a revival' AND "year" = 1984 | squall |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto 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 d_labitems (
row_id number,
itemid num... | have patient 14836 had a hematocrit test in 2105? | SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'hematocrit') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14836) AND STRFTIME('%y', labevents.charttime) = '2105' | mimic_iii |
CREATE TABLE table_20711 (
"Number in series" real,
"Broadcast Order" text,
"Title" text,
"Directed by" text,
"Written by" text,
"Original airdate" text,
"Production Code" real
) | Who directed the episode for s02 e08? | SELECT "Directed by" FROM table_20711 WHERE "Broadcast Order" = 'S02 E08' | wikisql |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE diagnosis (
diagnosisid number... | compared to last measured on the current hospital visit, was the value of the bun from patient 016-38131 less than the value first measured on the current hospital visit? | SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-38131' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'bun' ... | eicu |
CREATE TABLE table_4839 (
"Name" text,
"Bullet" text,
"Case Length" text,
"Base" text,
"Neck" text
) | A .416 barrett has which Case Length? | SELECT "Case Length" FROM table_4839 WHERE "Name" = '.416 barrett' | 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... | Draw a bar chart about the distribution of All_Home and the sum of Team_ID , and group by attribute All_Home, and display from low to high by the x-axis. | SELECT All_Home, SUM(Team_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home | nvbench |
CREATE TABLE SALES (
sales_details VARCHAR,
sales_transaction_id VARCHAR
)
CREATE TABLE TRANSACTIONS (
date_of_transaction VARCHAR,
transaction_id VARCHAR,
amount_of_transaction INTEGER
) | What are the sale details and dates of transactions with amount smaller than 3000? | SELECT T1.sales_details, T2.date_of_transaction FROM SALES AS T1 JOIN TRANSACTIONS AS T2 ON T1.sales_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction < 3000 | sql_create_context |
CREATE TABLE table_21809 (
"N" real,
"P" text,
"Name" text,
"EU" text,
"Country" text,
"Age" real,
"Type" text,
"Moving from" text,
"Transfer window" text,
"Ends" real,
"Transfer fee" text,
"Source" text
) | How many transfer windows coming from Crystal Palace? | SELECT COUNT("Transfer window") FROM table_21809 WHERE "Moving from" = 'Crystal Palace' | 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,
... | 以前患者07290816有过什么异常情况吗? | (SELECT * 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.BGDH WHERE hz_info.RYBH = ... | css |
CREATE TABLE table_name_91 (
team VARCHAR,
high_rebounds VARCHAR,
date VARCHAR
) | Can you tell me the Team that has the High rebounds of antawn jamison (10), and the Date of november 5? | SELECT team FROM table_name_91 WHERE high_rebounds = "antawn jamison (10)" AND date = "november 5" | sql_create_context |
CREATE TABLE table_76917 (
"Title" text,
"Details" text,
"Track Title" text,
"Label" text,
"Year" real
) | Which label has a year older than 2004 and a 2xcd detail as well as the sonic seducer cold hands seduction vol. 69 title? | SELECT "Label" FROM table_76917 WHERE "Year" > '2004' AND "Details" = '2xcd' AND "Title" = 'sonic seducer cold hands seduction vol. 69' | wikisql |
CREATE TABLE table_4082 (
"Player" text,
"Games" real,
"Field goals" real,
"Free throws" real,
"Points" real,
"Points per game" text
) | How many points per game did Benjamin Weiss score? | SELECT "Points per game" FROM table_4082 WHERE "Player" = 'Benjamin Weiss' | wikisql |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
... | What 's the total number of credits I have right now ? | SELECT DISTINCT total_credit FROM student WHERE student_id = 1 | advising |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
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,
admi... | Name all MDE classes for me . | SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id | advising |
CREATE TABLE table_41907 (
"Single" text,
"CCM Chart" text,
"Debut" text,
"Peak Date" text,
"Peak Pos" real,
"Total Wks" real,
"Spins (since 1998) source: Mediabase" real
) | How many Spins sources have a CCM Chart of CHR with a peak position less than 1? | SELECT COUNT("Spins (since 1998) source: Mediabase") FROM table_41907 WHERE "CCM Chart" = 'chr' AND "Peak Pos" < '1' | wikisql |
CREATE TABLE table_61818 (
"Perpetrator" text,
"Date" text,
"Year" real,
"Location" text,
"Country" text,
"Killed" real,
"Additional Notes" text
) | Who went on a rampage in Baghdad? | SELECT "Perpetrator" FROM table_61818 WHERE "Location" = 'baghdad' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartr... | what is the two year survival rate of patients who were prescribed 20.3 ml cup : acetaminophen 160 mg/5ml po soln after being diagnosed with septic shock? | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid... | eicu |
CREATE TABLE table_50438 (
"Date" text,
"Home" text,
"Score" text,
"Away" text,
"Attendance" real
) | What was the away team when the score was 3:1? | SELECT "Away" FROM table_50438 WHERE "Score" = '3:1' | wikisql |
CREATE TABLE table_50586 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Opponent" text,
"Score" text
) | who is the opponent when the year is after 1996 and the outcome is winner? | SELECT "Opponent" FROM table_50586 WHERE "Year" > '1996' AND "Outcome" = 'winner' | wikisql |
CREATE TABLE table_name_70 (
attendance VARCHAR,
week VARCHAR
) | What was the Attendance in Week 17? | SELECT attendance FROM table_name_70 WHERE week = 17 | sql_create_context |
CREATE TABLE table_203_465 (
id number,
"name" text,
"population (2002 census)" number,
"population (2007 estimation)" number,
"population (2011 census)" number,
"area (km2)" number,
"density (pop/km2)" number
) | which city had a higher population in 2007 , ghimbav or prejmer ? | SELECT "name" FROM table_203_465 WHERE "name" IN ('ghimbav', 'prejmer') ORDER BY "population (2007 estimation)" DESC LIMIT 1 | squall |
CREATE TABLE table_name_89 (
position VARCHAR,
school_club_team VARCHAR
) | What position does the player from Winston-Salem State play? | SELECT position FROM table_name_89 WHERE school_club_team = "winston-salem state" | sql_create_context |
CREATE TABLE table_204_675 (
id number,
"year" number,
"game of the year" text,
"abstract strategy" text,
"advanced strategy" text,
"family" text,
"family card" text,
"family strategy" text,
"party" text,
"puzzle" text,
"word" text,
"historical simulation" text,
"othe... | did blox win in 2009 or 2010 ? | SELECT "year" FROM table_204_675 WHERE "year" IN (2009, 2010) AND "abstract strategy" = 'blox' | squall |
CREATE TABLE table_14913 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) | What formated cataloged alca-9196? | SELECT "Format" FROM table_14913 WHERE "Catalog" = 'alca-9196' | wikisql |
CREATE TABLE table_name_34 (
d_46 VARCHAR,
d_43 VARCHAR
) | Name the D 46 which has a D 43 of majority | SELECT d_46 FROM table_name_34 WHERE d_43 = "majority→" | sql_create_context |
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_... | what am flights are available from PITTSBURGH to BOSTON | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((flight.departure_time <= 1159 AND flight.departure_time >= 0) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.to_... | atis |
CREATE TABLE table_name_53 (
score VARCHAR,
game VARCHAR,
record VARCHAR
) | What is the score for a game after 34 with a record of 31-11? | SELECT score FROM table_name_53 WHERE game > 34 AND record = "31-11" | sql_create_context |
CREATE TABLE table_204_396 (
id number,
"country" text,
"masters" number,
"u.s. open" number,
"the open" number,
"pga" number,
"total" number
) | is the united stated or scotland better ? | SELECT "country" FROM table_204_396 WHERE "country" IN ('united states', 'scotland') ORDER BY "total" DESC LIMIT 1 | squall |
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 zyjzjlb (
CYBQDM text,
CYBQMC... | 看看病人朱泰和在10.8.21到16.12.05内所有检验报告单中的标本采集部位,把这些采集部位都列出来 | SELECT jybgb.BBCJBW FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb 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_MZJZJLB WHERE person_info.XM = ... | css |
CREATE TABLE table_name_46 (
result VARCHAR,
week VARCHAR
) | Tell me the result for week of 4 | SELECT result FROM table_name_46 WHERE week = 4 | sql_create_context |
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... | 门诊诊断为嗜眠症的患者的籍贯代码是什么?名称是什么?相应人数是多少? | SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE txmzjzjlb.JZZDSM = '嗜眠症' GROUP BY person_info.JGDM UNION SELECT per... | css |
CREATE TABLE table_38533 (
"Game" text,
"Date" text,
"Referee" text,
"Umpire" text,
"Head Linesman" text,
"Line Judge" text,
"Field Judge" text,
"Back Judge" text
) | Which game was on 14 January 1973? | SELECT "Game" FROM table_38533 WHERE "Date" = '14 january 1973' | wikisql |
CREATE TABLE table_18759 (
"Frequency" text,
"Call sign" text,
"Name" text,
"Format" text,
"Owner" text,
"Target city/ market" text,
"City of license" text
) | What is the target market of the station with call sign KFXS? | SELECT "Target city/ market" FROM table_18759 WHERE "Call sign" = 'KFXS' | wikisql |
CREATE TABLE table_name_9 (
home_team VARCHAR,
away_team VARCHAR
) | Which Home team faced the Away team, Hawthorn? | SELECT home_team FROM table_name_9 WHERE away_team = "hawthorn" | sql_create_context |
CREATE TABLE table_1519 (
"Engine" text,
"Exhaust Ports" text,
"Bypass Ports" real,
"Bypass Boosters" text,
"SPI" text,
"Tapered Grind" text,
"Number on cyl." text
) | Are there SPI on the number 7 cylinder? | SELECT "SPI" FROM table_1519 WHERE "Number on cyl." = '7' | wikisql |
CREATE TABLE table_24847 (
"Series #" real,
"Season #" real,
"Title" text,
"Director" text,
"Writer(s)" text,
"NBC Airdate" text,
"Code" real
) | Who wrote, 'The Last Dance'? | SELECT "Writer(s)" FROM table_24847 WHERE "Title" = 'The Last Dance' | wikisql |
CREATE TABLE table_16799784_8 (
longitude VARCHAR,
name VARCHAR
) | What is the longitude of the feature named Razia Patera? | SELECT longitude FROM table_16799784_8 WHERE name = "Razia Patera" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | what is subject name of subject id 65652? | SELECT demographic.name FROM demographic WHERE demographic.subject_id = "65652" | mimicsql_data |
CREATE TABLE table_4908 (
"Player" text,
"Nationality" text,
"Position" text,
"From" real,
"School/Country" text
) | What year is listed for the player who played at UCLA? | SELECT SUM("From") FROM table_4908 WHERE "School/Country" = 'ucla' | wikisql |
CREATE TABLE airport (
id VARCHAR,
country VARCHAR,
city VARCHAR,
name VARCHAR
) | List the id, country, city and name of the airports ordered alphabetically by the name. | SELECT id, country, city, name FROM airport ORDER BY name | sql_create_context |
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... | 在1934902医院就诊的病人78419637所就诊的科室名字里没有检查的所有门诊就诊记录的流水号分别是啥? | SELECT mzjzjlb.JZLSH 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.RYBH = '78419637' AND hz_info.YLJGDM = '1934902' AND NOT mzjzjlb.JZKSMC LIKE '%检查%' | css |
CREATE TABLE products (
product_id number,
color_code text,
product_category_code text,
product_name text,
typical_buying_price text,
typical_selling_price text,
product_description text,
other_product_details text
)
CREATE TABLE product_characteristics (
product_id number,
char... | What is the description of the color used by least products? | SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code GROUP BY t2.color_description ORDER BY COUNT(*) LIMIT 1 | spider |
CREATE TABLE table_67515 (
"Venue" text,
"City" text,
"State" text,
"Tickets Sold / Available" text,
"Gross Revenue (1982)" text,
"Gross Revenue (2011)" text
) | Which state has the venue Tsukisamu dome? | SELECT "State" FROM table_67515 WHERE "Venue" = 'tsukisamu dome' | wikisql |
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... | 门诊就诊21319926440开检验报告单开了几份? | SELECT COUNT(*) FROM zyjybgb WHERE zyjybgb.JZLSH = '21319926440' UNION SELECT COUNT(*) FROM mzjybgb WHERE mzjybgb.JZLSH = '21319926440' | css |
CREATE TABLE table_name_62 (
nation VARCHAR,
athlete VARCHAR,
medal_count VARCHAR
) | What nation has paavo nurmi as the athlete, with a medal count less than 12? | SELECT nation FROM table_name_62 WHERE athlete = "paavo nurmi" AND medal_count < 12 | 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... | how many patients whose primary disease is guillain barre syndrome and year of death is less than or equal to 2111? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "GUILLAIN BARRE SYNDROME" AND demographic.dod_year <= "2111.0" | mimicsql_data |
CREATE TABLE table_name_93 (
date VARCHAR,
turkey_scorers VARCHAR
) | I want the date for nihat kahveci | SELECT date FROM table_name_93 WHERE turkey_scorers = "nihat kahveci" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodici... | is the bicarbonate level of patient 016-20141 second measured on the last hospital visit less than first measured on the last hospital visit? | SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-20141' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi... | eicu |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wa... | what number of cultures procedures have been performed in 2104? | SELECT COUNT(*) FROM treatment WHERE treatment.treatmentname = 'cultures' AND STRFTIME('%y', treatment.treatmenttime) = '2104' | eicu |
CREATE TABLE table_41956 (
"Tournament" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1997" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text... | What is 2009, when 2004 is 2R, and when 1993 is A? | SELECT "2009" FROM table_41956 WHERE "2004" = '2r' AND "1993" = 'a' | wikisql |
CREATE TABLE table_77814 (
"Name" text,
"Date of birth" text,
"Position(s)" text,
"Seasons" text,
"Matches & (Goals) (League + Finals + KNVB-Cup)" text,
"Previous club" text
) | What is the date of birth of the goalkeeper from the 1st season? | SELECT "Date of birth" FROM table_77814 WHERE "Position(s)" = 'goalkeeper' AND "Seasons" = '1st' | wikisql |
CREATE TABLE table_27253 (
"Rank" real,
"WS Points" real,
"Name" text,
"Country" text,
"09-10 I/O best" real,
"09-10 GP/JGP best" real,
"09-10 GP/JGP 2nd" real,
"09-10 OI best" real,
"09-10 OI 2nd" real,
"08-09 I/O best" real,
"08-09 GP/JGP best" real,
"08-09 GP/JGP 2nd" ... | If 09-10 i/o best is 972, what is the 09-10 gp/jgp 2nd maximum? | SELECT MAX("09-10 GP/JGP 2nd") FROM table_27253 WHERE "09-10 I/O best" = '972' | wikisql |
CREATE TABLE Courses (
course_id INTEGER,
author_id INTEGER,
subject_id INTEGER,
course_name VARCHAR(120),
course_description VARCHAR(255)
)
CREATE TABLE Student_Tests_Taken (
registration_id INTEGER,
date_test_taken DATETIME,
test_result VARCHAR(255)
)
CREATE TABLE Student_Course_Enro... | What are the number of the completion dates of all the tests that have result 'Fail'?, and rank from low to high by the the number of date of completion. | SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Fail" GROUP BY date_of_completion ORDER BY COUNT(date_of_completion) | nvbench |
CREATE TABLE table_24411 (
"Satellite" text,
"Launch date (UTC)" text,
"Decay" text,
"Mass(kg)" text,
"Diameter(m)" text,
"NSSDC ID" text,
"Nation" text,
"Usage" text
) | What was the launch date for the sattelite with ado that was 4 kg and 3 meters in diameter? | SELECT "Launch date (UTC)" FROM table_24411 WHERE "Usage" = 'ado' AND "Mass(kg)" = '4' AND "Diameter(m)" = '3' | 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,
... | 在00年1月17日直到11年5月4日这一段时间,病患云天干内所有检验结果指标记录中的仪器编号以及名称分别叫什么? | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AN... | css |
CREATE TABLE table_name_60 (
date VARCHAR,
venue VARCHAR,
opponent VARCHAR
) | What day was the game held at Firhill against AYR United? | SELECT date FROM table_name_60 WHERE venue = "firhill" AND opponent = "ayr united" | sql_create_context |
CREATE TABLE table_10387 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"NFL Recap" text,
"Attendance" real
) | What is the date of the game in a week earlier than 10 played in Texas stadium agains the Atlanta Falcons? | SELECT "Date" FROM table_10387 WHERE "Week" < '10' AND "Game site" = 'texas stadium' AND "Opponent" = 'atlanta falcons' | 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... | 患者93401280在09年11月18日到2017年1月22日内自费金额高于7898.94块钱的药品量有多少? | SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '93401280' AND t_kc22.STA_DATE BETWEEN '2009-11-18' AND '2017-01-22' AND t_kc22.SELF_PAY_AMO > 7898.94 | css |
CREATE TABLE table_name_42 (
winner VARCHAR,
team VARCHAR,
circuit VARCHAR
) | Who is the Winner of the Nissan Motorsport Australia Team at the Oran Park Raceway? | SELECT winner FROM table_name_42 WHERE team = "nissan motorsport australia" AND circuit = "oran park raceway" | sql_create_context |
CREATE TABLE table_256286_45 (
type VARCHAR,
description VARCHAR
) | What is the type of measure that voted on the Power Development Debt Limit Amendment? | SELECT type FROM table_256286_45 WHERE description = "Power Development Debt Limit Amendment" | sql_create_context |
CREATE TABLE VISITORS (
Tourist_ID VARCHAR,
Tourist_Details VARCHAR
)
CREATE TABLE Tourist_Attractions (
Name VARCHAR,
Tourist_Attraction_ID VARCHAR
)
CREATE TABLE VISITS (
Tourist_Attraction_ID VARCHAR,
Tourist_ID VARCHAR
) | Which tourist attractions does the visitor with detail 'Vincent' visit? | SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID JOIN VISITORS AS T3 ON T2.Tourist_ID = T3.Tourist_ID WHERE T3.Tourist_Details = "Vincent" | sql_create_context |
CREATE TABLE table_name_67 (
segment_c VARCHAR,
episode INTEGER
) | Episode smaller than 210 had what segment c? | SELECT segment_c FROM table_name_67 WHERE episode < 210 | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | what is the average days of hospital stay for patients who are diagnosed with primary disease posterior communicating aneurysm/sda? | SELECT AVG(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "POSTERIOR COMMUNICATING ANEURYSM/SDA" | mimicsql_data |
CREATE TABLE table_1805191_33 (
district VARCHAR,
incumbent VARCHAR
) | How many districts have the incumbent, Charles Rangel? | SELECT COUNT(district) FROM table_1805191_33 WHERE incumbent = "Charles Rangel" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.