context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_23184448_4 (
field_goals INTEGER,
player VARCHAR
) | Name the field goals for alexis yackley | SELECT MAX(field_goals) FROM table_23184448_4 WHERE player = "Alexis Yackley" | sql_create_context |
CREATE TABLE table_name_52 (
opponent VARCHAR,
score VARCHAR
) | Which Opponent has a Score of 92 93? | SELECT opponent FROM table_name_52 WHERE score = "92–93" | 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_... | is there an airline that has a flight from PHILADELPHIA to SAN FRANCISCO with a stop in DALLAS | SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANC... | atis |
CREATE TABLE CLASS (
CLASS_CODE varchar(5),
CRS_CODE varchar(10),
CLASS_SECTION varchar(2),
CLASS_TIME varchar(20),
CLASS_ROOM varchar(8),
PROF_NUM int
)
CREATE TABLE EMPLOYEE (
EMP_NUM int,
EMP_LNAME varchar(15),
EMP_FNAME varchar(12),
EMP_INITIAL varchar(1),
EMP_JOBCODE va... | Show the number of courses each instructor taught with a bar chart grouping by course code, could you display by the bars from high to low please? | SELECT CRS_CODE, COUNT(CRS_CODE) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM GROUP BY CRS_CODE ORDER BY CRS_CODE DESC | nvbench |
CREATE TABLE table_57253 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" real,
"Record" text
) | Name the leading scorer for 12 january 2008 | SELECT "Leading scorer" FROM table_57253 WHERE "Date" = '12 january 2008' | wikisql |
CREATE TABLE table_204_655 (
id number,
"year" number,
"winner" text,
"album" text,
"other finalists" text
) | david dallas won in 2010 . what was the name of the album that won the next year ? | SELECT "album" FROM table_204_655 WHERE "year" > 2010 ORDER BY "year" LIMIT 1 | squall |
CREATE TABLE table_name_49 (
finish VARCHAR,
start VARCHAR,
team VARCHAR
) | Which Finish has a Start of 15, and a Team of bahari? | SELECT finish FROM table_name_49 WHERE start = "15" AND team = "bahari" | sql_create_context |
CREATE TABLE table_54506 (
"Tournament" text,
"Date" text,
"City" text,
"Country" text,
"Surface" text,
"Singles champions" text
) | On what Date will the Argentina F17 Futures Tournament be played in Argentina? | SELECT "Date" FROM table_54506 WHERE "Country" = 'argentina' AND "Tournament" = 'argentina f17 futures' | wikisql |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course (
course_id int,
name varchar,
dep... | What are all the upper-level electives being offered in the Fall and Winter ? | SELECT DISTINCT course.department, course.name, course.number 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.course_id WHERE (semester.semester = ... | advising |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
row_id number,
itemid ... | what is the daily minimum bicarbonate value for patient 10624 on this hospital encounter? | SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10624 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bicarbonate') GROUP BY STRFTIME('%y-%m-%d'... | mimic_iii |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
i... | when did on the current hospital encounter patient 027-120575 receive a first procedure? | SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-120575' AND patient.hospitaldischargetime IS NULL)) ORDER BY ... | eicu |
CREATE TABLE table_name_96 (
industry INTEGER,
year VARCHAR,
agriculture VARCHAR
) | What is the lowest Industry, when Year is greater than 2005, and when Agriculture is greater than 11? | SELECT MIN(industry) FROM table_name_96 WHERE year > 2005 AND agriculture > 11 | sql_create_context |
CREATE TABLE table_17478 (
"Series #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (millions)" text
) | What's the total number of directors who've directed episodes seen by 11.34 million US viewers? | SELECT COUNT("Directed by") FROM table_17478 WHERE "U.S. viewers (millions)" = '11.34' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE microbiologyevents (
row_i... | what is the specimen test that patient 49654 was given for the last time in 06/this year? | SELECT microbiologyevents.spec_type_desc FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 49654) AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m', micro... | mimic_iii |
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,
... | 编号为57271172的病患的医疗记录中有多少回被开出的药品金额不多于2998.53元?看看这些医疗就诊的编号 | SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '57271172' AND NOT gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 2998.53) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '57271172' AND NOT fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLI... | css |
CREATE TABLE table_name_10 (
fin_time VARCHAR,
finish VARCHAR,
track VARCHAR
) | What is the finishing time with a 2/1q finish on the Meadowlands track? | SELECT fin_time FROM table_name_10 WHERE finish = "2/1q" AND track = "the meadowlands" | sql_create_context |
CREATE TABLE table_26457 (
"Special" text,
"Original airdate" text,
"Iron Chef" text,
"Challenger" text,
"Challenger Specialty" text,
"Theme Ingredient" text,
"Winner" text
) | Who was the winner when the iron chef is hiroyuki sakai? | SELECT "Winner" FROM table_26457 WHERE "Iron Chef" = 'Hiroyuki Sakai' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | what number of patients having procedure titled coronar arteriogr-1 cath were born before 2182? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2182" AND procedures.short_title = "Coronar arteriogr-1 cath" | mimicsql_data |
CREATE TABLE video_games (
gameid number,
gname text,
gtype text
)
CREATE TABLE plays_games (
stuid number,
gameid number,
hours_played number
)
CREATE TABLE sportsinfo (
stuid number,
sportname text,
hoursperweek number,
gamesplayed number,
onscholarship text
)
CREATE TAB... | What is the total number of games played? | SELECT SUM(gamesplayed) FROM sportsinfo | spider |
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
)
... | give the number of patients whose marital status is widowed and procedure short title is nasal sinus dx proc nec. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "WIDOWED" AND procedures.short_title = "Nasal sinus dx proc NEC" | mimicsql_data |
CREATE TABLE table_8826 (
"City" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
) | What is City, when IATA is 'amm'? | SELECT "City" FROM table_8826 WHERE "IATA" = 'amm' | wikisql |
CREATE TABLE table_name_17 (
try_bonus VARCHAR,
tries_against VARCHAR
) | What try bonus has 19 as the tries against? | SELECT try_bonus FROM table_name_17 WHERE tries_against = "19" | sql_create_context |
CREATE TABLE ship (
TYPE VARCHAR,
flag VARCHAR
) | Find the ship type that are used by both ships with Panama and Malta flags. | SELECT TYPE FROM ship WHERE flag = 'Panama' INTERSECT SELECT TYPE FROM ship WHERE flag = 'Malta' | sql_create_context |
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE ta (
campus_job_id int,... | I need 12 -credit courses , which courses should I take ? | SELECT DISTINCT name, number FROM course WHERE credits = 12 AND department = 'EECS' | advising |
CREATE TABLE table_36948 (
"Season" text,
"Tropical Lows" real,
"Tropical Cyclones" real,
"Severe Tropical Cyclones" real,
"Strongest storm" text
) | What is the least amount of tropical lows for the 1993 94 season with less than 11 tropical cyclones | SELECT MIN("Tropical Lows") FROM table_36948 WHERE "Season" = '1993–94' AND "Tropical Cyclones" < '11' | wikisql |
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... | 28470325313住院就诊中,住院中医诊断的名称和编号分别是啥 | SELECT zyjzjlb.ZYZYZDZZBM, zyjzjlb.ZYZYZDZZMC FROM zyjzjlb WHERE zyjzjlb.JZLSH = '28470325313' | css |
CREATE TABLE table_78590 (
"Year" text,
"Award" text,
"Category" text,
"Nominated" text,
"Result" text
) | Name the performance nominated for a Capif Award. | SELECT "Nominated" FROM table_78590 WHERE "Award" = 'capif award' | wikisql |
CREATE TABLE table_name_85 (
loss VARCHAR,
record VARCHAR
) | Which Loss has a Record of 30-32? | SELECT loss FROM table_name_85 WHERE record = "30-32" | sql_create_context |
CREATE TABLE table_24011 (
"Stations" text,
"Connections" text,
"City/ Neighborhood" text,
"Parking" text,
"Date Opened" text
) | How much parking is in Van Nuys at the Sepulveda station? | SELECT "Parking" FROM table_24011 WHERE "City/ Neighborhood" = 'Van Nuys' AND "Stations" = 'Sepulveda' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number... | count the number of patients who stayed until 1 year ago in ward 48. | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.wardid = 48 AND DATETIME(transfers.intime) <= DATETIME(CURRENT_TIME(), '-1 year')) | mimic_iii |
CREATE TABLE table_203_426 (
id number,
"year" number,
"title" text,
"peak chart positions\naus" number,
"peak chart positions\nnz" number,
"peak chart positions\nuk" number,
"album" text
) | what 's the next single after wide open road ? | SELECT "title" FROM table_203_426 WHERE "year" > (SELECT "year" FROM table_203_426 WHERE "title" = '"wide open road"') ORDER BY "year" LIMIT 1 | squall |
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
) | For those records from the products and each product's manufacturer, draw a bar chart about the distribution of founder and the average of manufacturer , and group by attribute founder. | SELECT Founder, AVG(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder | nvbench |
CREATE TABLE table_204_115 (
id number,
"year" number,
"track" text,
"number" number,
"team" text,
"car" text,
"round result" text
) | how many 1st place round results were there ? | SELECT COUNT(*) FROM table_204_115 WHERE "round result" = 1 | squall |
CREATE TABLE table_22815259_1 (
game INTEGER,
record VARCHAR
) | Name the most game for record 4-0 | SELECT MAX(game) FROM table_22815259_1 WHERE record = "4-0" | sql_create_context |
CREATE TABLE table_name_13 (
points INTEGER,
goals_against VARCHAR,
coach VARCHAR,
tied VARCHAR,
games VARCHAR
) | What is the points average when the tied is greater than 8, less than 82 games and the coach of Bryan Mclay Morris Lallo Gerry Moore , and greater than 322 goals? | SELECT AVG(points) FROM table_name_13 WHERE tied > 8 AND games < 82 AND coach = "bryan mclay † morris lallo ‡ gerry moore ‡" AND goals_against > 322 | sql_create_context |
CREATE TABLE table_77063 (
"Team" text,
"Location" text,
"Venue" text,
"Capacity" real,
"Position in 2005" text
) | Can you tell me the Venue that has the Position in 2005 of 8? | SELECT "Venue" FROM table_77063 WHERE "Position in 2005" = '8' | wikisql |
CREATE TABLE table_42885 (
"Table 2: Depression Data" text,
"1929" real,
"1931" real,
"1933" real,
"1937" real,
"1938" real,
"1940" real
) | What is the highest 1937 value that has a 1940 value over 126? | SELECT MAX("1937") FROM table_42885 WHERE "1940" > '126' | wikisql |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE... | Visualize a bar chart for simply displaying the email address of the employee and the corresponding employee id, and show from high to low by the X-axis. | SELECT EMAIL, EMPLOYEE_ID FROM employees ORDER BY EMAIL DESC | nvbench |
CREATE TABLE table_42675 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
) | What was the aggregate for the match with a team 2 of Kenya? | SELECT "Agg." FROM table_42675 WHERE "Team 2" = 'kenya' | wikisql |
CREATE TABLE table_name_34 (
moving_to VARCHAR,
name VARCHAR
) | Where did Konchesky move to? | SELECT moving_to FROM table_name_34 WHERE name = "konchesky" | sql_create_context |
CREATE TABLE table_28884858_1 (
capacity_percentage VARCHAR,
total_attendance VARCHAR
) | What is the capacity percentage when the total attendance is 509940? | SELECT capacity_percentage FROM table_28884858_1 WHERE total_attendance = 509940 | sql_create_context |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,... | Number of Caucus and Constituent badges. | SELECT COUNT(*) AS "count" FROM Badges AS b WHERE (b.Name IN ('Caucus', 'Constituent')) GROUP BY b.Name LIMIT 100 | sede |
CREATE TABLE table_name_93 (
division VARCHAR,
year VARCHAR
) | What divisions was in the year 1993? | SELECT division FROM table_name_93 WHERE year = 1993 | sql_create_context |
CREATE TABLE Staff (
staff_id INTEGER,
gender VARCHAR(1),
first_name VARCHAR(80),
last_name VARCHAR(80),
email_address VARCHAR(255),
phone_number VARCHAR(80)
)
CREATE TABLE Complaints (
complaint_id INTEGER,
product_id INTEGER,
customer_id INTEGER,
complaint_outcome_code VARCHAR... | Return the average price of products that have each category code, and could you sort mean product price from high to low order please? | SELECT product_category_code, AVG(product_price) FROM Products GROUP BY product_category_code ORDER BY AVG(product_price) DESC | nvbench |
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
) | For those records from the products and each product's manufacturer, show me about the distribution of founder and the sum of code , and group by attribute founder in a bar chart. | SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder | nvbench |
CREATE TABLE table_10975 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | At the match which took place in arden street oval, how much did the away team score? | SELECT "Away team score" FROM table_10975 WHERE "Venue" = 'arden street oval' | wikisql |
CREATE TABLE table_20726262_4 (
no_in_series INTEGER,
production_code VARCHAR
) | what i the maximum number in the series where the production code is 3wab07? | SELECT MAX(no_in_series) FROM table_20726262_4 WHERE production_code = "3WAB07" | sql_create_context |
CREATE TABLE table_11700 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What place had a home team score 22.19 (151)? | SELECT "Venue" FROM table_11700 WHERE "Home team score" = '22.19 (151)' | wikisql |
CREATE TABLE table_49423 (
"Club" text,
"City" text,
"Stadium" text,
"Capacity" real,
"2007\u201308 season" text
) | What was the result of the 2007-08 season for the city of Ferrara? | SELECT "2007\u201308 season" FROM table_49423 WHERE "City" = 'ferrara' | wikisql |
CREATE TABLE procedures (
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 diagnoses (
... | find the number of patients who died on or before 2174 and had other body fluid lab test. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2174.0" AND lab.fluid = "Other Body Fluid" | mimicsql_data |
CREATE TABLE table_61079 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What is the Score in Tie 2? | SELECT "Score" FROM table_61079 WHERE "Tie no" = '2' | wikisql |
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 text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 编号48451516947的检验报告单属于什么检验类型 | SELECT jybgb.JYLX FROM jybgb WHERE jybgb.BGDH = '48451516947' | css |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, a bar chart shows the distribution of hire_date and the average of department_id bin hire_date by time. | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | count the number of patients whose diagnoses short title is hx-rectal & anal malign and lab test category is blood gas? | 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 = "Hx-rectal & anal malign" AND lab."CATEGORY" = "Blood Gas" | mimicsql_data |
CREATE TABLE table_204_297 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | how many countries earned at lest one bronze medal ? | SELECT COUNT("nation") FROM table_204_297 WHERE "bronze" >= 1 | squall |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE inputevents_cv (
row_i... | count the number of patients who had a resp tract intubat nec procedure performed two times. | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'resp tract intubat ne... | mimic_iii |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicationid ... | what is the name of the treatment which has been given to patient 010-19726 two or more times until 64 months ago? | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, COUNT(treatment.treatmenttime) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ... | eicu |
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 gsi (
course_offering_id int,
student_id int
)
CREATE TABLE instructor (
... | Do any 400 -level classes occur in the Fall or Winter term ? | SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number BETWEEN 400 AND 400 + 100 AND semester.semester IN ('FA', 'WN') AND semester.semester_id = course_of... | advising |
CREATE TABLE table_80007 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
) | Which years have a Name of ladbrooks school? | SELECT "Years" FROM table_80007 WHERE "Name" = 'ladbrooks school' | wikisql |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
Dup... | Most Viewed Bangladeshi Stackoverflow Users. | SELECT ROW_NUMBER() OVER (ORDER BY Views DESC) AS "#", Id AS "user_link", Views, Reputation, LastAccessDate, AboutMe FROM Users WHERE LOWER(Location) LIKE '%bangladesh%' OR LOWER(Location) LIKE '%bd%' OR LOWER(Location) LIKE '%dhaka%' ORDER BY Views DESC LIMIT 100 | sede |
CREATE TABLE table_15817998_5 (
position VARCHAR,
college VARCHAR
) | What are the positions in the college of Alberta? | SELECT position FROM table_15817998_5 WHERE college = "Alberta" | sql_create_context |
CREATE TABLE table_11218 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points classification" text,
"Trofeo Fast Team" text
) | Which team had a final stage when Claudio Chiappucci had the points? | SELECT "Trofeo Fast Team" FROM table_11218 WHERE "Points classification" = 'claudio chiappucci' AND "Stage" = 'final' | wikisql |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
... | What are the average ages for male and female students Plot them as bar chart, and list by the bars from low to high. | SELECT Sex, AVG(Age) FROM Student GROUP BY Sex ORDER BY Sex | nvbench |
CREATE TABLE table_1669 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What is the score when the game took place on January 18? | SELECT "Score" FROM table_1669 WHERE "Date" = 'January 18' | wikisql |
CREATE TABLE table_name_1 (
televote_points VARCHAR,
televotes VARCHAR
) | Who received 6,131 televotes? | SELECT televote_points FROM table_name_1 WHERE televotes = "6,131" | sql_create_context |
CREATE TABLE table_52237 (
"Year" real,
"Theme" text,
"Artist" text,
"Mintage" text,
"Issue Price" text
) | Which year did the Royal Canadian Mint Staff create a silver dollar? | SELECT "Year" FROM table_52237 WHERE "Artist" = 'royal canadian mint staff' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE... | count the number of patients who have been dead after having been diagnosed with compression of vein within the same hospital visit during the last year. | SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime, t1.hadm_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 FRO... | mimic_iii |
CREATE TABLE table_name_86 (
final_score VARCHAR,
visiting_team VARCHAR
) | What was the final score when the New York Jets were the Visiting Team? | SELECT final_score FROM table_name_86 WHERE visiting_team = "new york jets" | sql_create_context |
CREATE TABLE table_name_25 (
branding VARCHAR,
location VARCHAR
) | What is the Branding for the station located in Zamboanga? | SELECT branding FROM table_name_25 WHERE location = "zamboanga" | sql_create_context |
CREATE TABLE table_name_26 (
placing VARCHAR,
team VARCHAR
) | What place did russia finish in? | SELECT COUNT(placing) FROM table_name_26 WHERE team = "russia" | sql_create_context |
CREATE TABLE table_65284 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | How much Silver has a Total larger than 9, and a Gold of 14? | SELECT COUNT("Silver") FROM table_65284 WHERE "Total" > '9' AND "Gold" = '14' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,... | for the last time since 3 years ago, when did patient 022-3713 come to the hospital? | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '022-3713' AND DATETIME(patient.hospitaladmittime) >= DATETIME(CURRENT_TIME(), '-3 year') ORDER BY patient.hospitaladmittime DESC LIMIT 1 | eicu |
CREATE TABLE table_name_83 (
number_of_electorates__2009_ VARCHAR,
constituency_number VARCHAR
) | What is the total number of electorates in 2009 with a constituency of 193? | SELECT COUNT(number_of_electorates__2009_) FROM table_name_83 WHERE constituency_number = "193" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
... | 查询在2001年7月30日到2020年3月8日期间医院1741866有多少科室在门诊就诊中开出低于5张检验报告单 | SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_inf... | css |
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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | count the number of patients whose year of death is less than or equal to 2112 and drug code is hesp500i? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2112.0" AND prescriptions.formulary_drug_cd = "HESP500I" | mimicsql_data |
CREATE TABLE table_204_521 (
id number,
"rank" number,
"name" text,
"nationality" text,
"time (hand)" text,
"notes" text
) | how many athletes finished the race in less than 5:00:00 ? | SELECT COUNT("name") FROM table_204_521 WHERE "time (hand)" < 5 | squall |
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE paperfield (
fieldid... | List all academic papers on impact of cellphone towers on birds | SELECT DISTINCT paperid FROM paper WHERE title = 'impact of cellphone towers on birds' | scholar |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | Display a pie chart for what are the names and average prices of products for manufacturers whose products cost on average 150 or more? | SELECT T2.Name, AVG(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name | nvbench |
CREATE TABLE table_name_67 (
loss VARCHAR,
score VARCHAR
) | What game did they lose by 6 - 5? | SELECT loss FROM table_name_67 WHERE score = "6 - 5" | sql_create_context |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname ... | HONORS will be offered how many courses next semester ? | SELECT COUNT(DISTINCT course_offering.course_id) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'HONORS' AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016 | advising |
CREATE TABLE table_40492 (
"Rank" real,
"City" text,
"Airport" text,
"Passengers" real,
"Carriers" text
) | What was the airport with primary carrier of US Airways with a 2 ranking and more than 51,000 passengers? | SELECT "Airport" FROM table_40492 WHERE "Passengers" > '51,000' AND "Carriers" = 'us airways' AND "Rank" = '2' | wikisql |
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 average age of patients whose ethnicity is white and days of hospital stay is 3? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.ethnicity = "WHITE" AND demographic.days_stay = "3" | mimicsql_data |
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
)
... | how many patients whose diagnoses short title is compl kidney transplant and drug route is replace? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Compl kidney transplant" AND prescriptions.route = "REPLACE" | mimicsql_data |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Badges (
Id... | Javascript questions with bounty and 0 answers. | SELECT Posts.Id AS "post_link", Votes.BountyAmount, Votes.CreationDate AS BountyStart FROM Posts INNER JOIN Votes ON Posts.Id = Votes.PostId INNER JOIN PostTags ON Posts.Id = PostTags.PostId INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE Votes.VoteTypeId = 8 AND Tags.TagName = '##tag##' AND Posts.AnswerCount = 0 AND... | sede |
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_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE microbiologyevents (
ro... | on the last hospital visit, how many times did patient 22973 visit the icu? | SELECT COUNT(DISTINCT icustays.icustay_id) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22973 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) | mimic_iii |
CREATE TABLE repair (
repair_ID int,
name text,
Launch_Date text,
Notes text
)
CREATE TABLE machine (
Machine_ID int,
Making_Year int,
Class text,
Team text,
Machine_series text,
value_points real,
quality_rank int
)
CREATE TABLE technician (
technician_id real,
Nam... | What are the names of the technicians that are assigned to repair machines with more point values than 70, and count them by a pie chart | SELECT Name, COUNT(Name) FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.Machine_ID = T2.Machine_ID JOIN technician AS T3 ON T1.technician_id = T3.technician_id WHERE T2.value_points > 70 GROUP BY Name | nvbench |
CREATE TABLE table_name_40 (
crowd INTEGER,
away_team VARCHAR
) | What is the smallest crowd size for away team Fitzroy? | SELECT MIN(crowd) FROM table_name_40 WHERE away_team = "fitzroy" | sql_create_context |
CREATE TABLE table_name_90 (
episode VARCHAR
) | What is the 3rd Edition for Episode 4? | SELECT 3 AS rd_edition FROM table_name_90 WHERE episode = "4" | sql_create_context |
CREATE TABLE procedures (
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 diagnoses (
... | Specify the drug code of Ferrous Sulfate along with the dose | SELECT prescriptions.formulary_drug_cd, prescriptions.drug_dose FROM prescriptions WHERE prescriptions.drug = "Ferrous Sulfate" | mimicsql_data |
CREATE TABLE table_19045 (
"Grand Cru" text,
"Region" text,
"Village" text,
"Wine style" text,
"Vineyard surface (2010)" text
) | what's the village with wine style being red wine and vineyard surface (2010) being hectares (acres) | SELECT "Village" FROM table_19045 WHERE "Wine style" = 'Red wine' AND "Vineyard surface (2010)" = 'hectares (acres)' | wikisql |
CREATE TABLE table_10054296_1 (
headquarters VARCHAR,
member VARCHAR
) | Where is the headquarters of Alpha Nu Omega | SELECT headquarters FROM table_10054296_1 WHERE member = "Alpha Nu Omega" | sql_create_context |
CREATE TABLE table_name_8 (
year INTEGER,
work VARCHAR,
award VARCHAR
) | Which Year is the highest one that has a Work of the clone, and an Award of contigo award? | SELECT MAX(year) FROM table_name_8 WHERE work = "the clone" AND award = "contigo award" | sql_create_context |
CREATE TABLE procedures (
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 prescription... | how many spanish speaking patients are of jewish religious background? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "SPAN" AND demographic.religion = "JEWISH" | mimicsql_data |
CREATE TABLE table_21197135_1 (
date VARCHAR,
record VARCHAR
) | How many opponents were there when the record was 6-0? | SELECT date FROM table_21197135_1 WHERE record = "6-0" | sql_create_context |
CREATE TABLE table_8672 (
"Date" text,
"Home" text,
"Score" text,
"Away" text,
"Attendance" real
) | Who was the away team that had attendance under 2614 and a home team of Victoria? | SELECT "Away" FROM table_8672 WHERE "Attendance" < '2614' AND "Home" = 'victoria' | wikisql |
CREATE TABLE table_29285076_2 (
location VARCHAR,
date VARCHAR
) | At what location was the March 17 race held? | SELECT location FROM table_29285076_2 WHERE date = "March 17" | sql_create_context |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | 编码为2768334的医院科室的最长医疗住院时长少于16天有几个? | SELECT COUNT(*) FROM (SELECT MED_ORG_DEPT_CD FROM t_kc21 WHERE MED_SER_ORG_NO = '2768334' GROUP BY MED_ORG_DEPT_CD HAVING MAX(IN_HOSP_DAYS) < 16) AS T | css |
CREATE TABLE table_name_59 (
away_team VARCHAR
) | What was St Kilda's score as the Away team? | SELECT away_team AS score FROM table_name_59 WHERE away_team = "st kilda" | sql_create_context |
CREATE TABLE table_17355408_9 (
high_assists VARCHAR,
game VARCHAR
) | Who had the high assists in game 80? | SELECT high_assists FROM table_17355408_9 WHERE game = 80 | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | provide the number of patients whose days of hospital stay is greater than 13 and procedure icd9 code is 4105? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "13" AND procedures.icd9_code = "4105" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.