context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE cost (
row_id number,
subject_... | when did patient 16368 last got the maximum of arterial bp [diastolic]? | SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 16368)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial... | mimic_iii |
CREATE TABLE table_name_23 (
record VARCHAR,
high_rebounds VARCHAR
) | what is the record when marc gasol (8) had the high rebounds? | SELECT record FROM table_name_23 WHERE high_rebounds = "marc gasol (8)" | sql_create_context |
CREATE TABLE table_55945 (
"Year" real,
"Title" text,
"Role" text,
"Studio" text,
"Director" text
) | Who was the director for To Have and Have Not, earlier than 1945 with WB studio? | SELECT "Director" FROM table_55945 WHERE "Studio" = 'wb' AND "Year" < '1945' AND "Title" = 'to have and have not' | wikisql |
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
) | A bar chart about what are the average prices of products, grouped by manufacturer name? | 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_77 (
result VARCHAR,
date VARCHAR
) | Which Result has a Date of 9 october 2009? | SELECT result FROM table_name_77 WHERE date = "9 october 2009" | sql_create_context |
CREATE TABLE table_name_79 (
top_10 INTEGER,
events VARCHAR,
cuts_made VARCHAR
) | For events with values of exactly 1, and 0 cuts made, what is the fewest number of top-10s? | SELECT MIN(top_10) FROM table_name_79 WHERE events = 1 AND cuts_made > 0 | sql_create_context |
CREATE TABLE table_1342292_2 (
party VARCHAR,
incumbent VARCHAR
) | what's the party with incumbent being william b. bankhead | SELECT party FROM table_1342292_2 WHERE incumbent = "William B. Bankhead" | sql_create_context |
CREATE TABLE table_name_2 (
seasons INTEGER,
name VARCHAR
) | What is the number of seasons coached by Kathy Graham? | SELECT MIN(seasons) FROM table_name_2 WHERE name = "kathy graham" | sql_create_context |
CREATE TABLE table_204_700 (
id number,
"name" text,
"developer" text,
"release" text,
"type" text,
"game flow" text,
"setting" text
) | what is the number of multiplayer browser games released in 2003 ? | SELECT COUNT(*) FROM table_204_700 WHERE "release" = 2003 | squall |
CREATE TABLE table_74916 (
"Pick #" real,
"Round" text,
"Player" text,
"Position" text,
"College" text
) | What is the Position of Pick #321? | SELECT "Position" FROM table_74916 WHERE "Pick #" = '321' | wikisql |
CREATE TABLE table_name_30 (
season VARCHAR,
premier VARCHAR,
score VARCHAR
) | How many seasons feature essendon, and a Score of 15.12 (102) 9.14 (68)? | SELECT COUNT(season) FROM table_name_30 WHERE premier = "essendon" AND score = "15.12 (102) – 9.14 (68)" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | count the number of patients whose marital status is single and drug route is inhalation. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "SINGLE" AND prescriptions.route = "INHALATION" | mimicsql_data |
CREATE TABLE captain (
captain_id number,
name text,
ship_id number,
age text,
class text,
rank text
)
CREATE TABLE ship (
ship_id number,
name text,
type text,
built_year number,
class text,
flag text
) | Return the names and classes of ships that do not have a captain? | SELECT name, class FROM ship WHERE NOT ship_id IN (SELECT ship_id FROM captain) | spider |
CREATE TABLE table_16793 (
"Ward" text,
"Bello" text,
"Ben-Tahir" text,
"Doucet" text,
"Furtenbacher" text,
"Gauthier" text,
"Haydon" text,
"Larter" text,
"Lawrance" text,
"Libweshya" text,
"Liscumb" text
) | What is Ben-Tahir when Bello is 51? | SELECT "Ben-Tahir" FROM table_16793 WHERE "Bello" = '51' | wikisql |
CREATE TABLE table_24390 (
"City & Nation" text,
"First Place" real,
"Second Place" real,
"Third Place" real,
"Total Top 3 Placements" real,
"First Place Winning Year(s) (if applicable)" text
) | What is the total number of second place finishes when the city & nation was Chicago, USA? | SELECT COUNT("Second Place") FROM table_24390 WHERE "City & Nation" = 'Chicago, USA' | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | how many newborn who were born before 2107 were admitted? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.dob_year < "2065" | mimicsql_data |
CREATE TABLE investors (
investor_id number,
investor_details text
)
CREATE TABLE transactions (
transaction_id number,
investor_id number,
transaction_type_code text,
date_of_transaction time,
amount_of_transaction number,
share_count text,
other_details text
)
CREATE TABLE transa... | Show all investor details. | SELECT investor_details FROM investors | spider |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
... | i would like to book a flight from DENVER to PITTSBURGH on 7 15 i'd like it to be the cheapest flight | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, da... | atis |
CREATE TABLE table_23248869_10 (
record VARCHAR,
team VARCHAR
) | What is every record for the team Boston? | SELECT record FROM table_23248869_10 WHERE team = "Boston" | sql_create_context |
CREATE TABLE qtb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | 在2016年5月1日到2016年12月18日内医院0660177门诊医疗记录的数量是多少? | SELECT COUNT(*) FROM mzb WHERE mzb.MED_TYPE = '0660177' AND mzb.IN_HOSP_DAYS BETWEEN '2016-05-01' AND '2016-12-18' | css |
CREATE TABLE people (
people_id number,
sex text,
name text,
date_of_birth text,
height number,
weight number
)
CREATE TABLE candidate (
candidate_id number,
people_id number,
poll_source text,
date text,
support_rate number,
consider_rate number,
oppose_rate number,... | What are the names of all people, ordered by their date of birth? | SELECT name FROM people ORDER BY date_of_birth | spider |
CREATE TABLE table_14984 (
"Ensemble" text,
"Gold Medals" real,
"Silver Medals" real,
"Bronze Medals" real,
"Total Medals" real
) | When the Mandarins won more than 1 bronze medals, how many gold medals did they win? | SELECT COUNT("Gold Medals") FROM table_14984 WHERE "Ensemble" = 'mandarins' AND "Bronze Medals" > '1' | wikisql |
CREATE TABLE table_63285 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"TV Time" text,
"Attendance" text
) | What is the week with attendance of 73,572? | SELECT MAX("Week") FROM table_63285 WHERE "Attendance" = '73,572' | wikisql |
CREATE TABLE Documents (
Document_ID INTEGER,
Document_Type_Code CHAR(15),
Project_ID INTEGER,
Document_Date DATETIME,
Document_Name VARCHAR(255),
Document_Description VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Ref_Budget_Codes (
Budget_Type_Code CHAR(15),
Budget_Type_D... | Show the number of documents created in each day and bin document date by year interval with a line chart. | SELECT Document_Date, COUNT(Document_Date) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code | nvbench |
CREATE TABLE table_44661 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text
) | What was the record in the game where the opponent was the cincinnati royals? | SELECT "Record" FROM table_44661 WHERE "Opponent" = 'cincinnati royals' | wikisql |
CREATE TABLE table_18185 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | what being the minimum first elected with district being washington 7 | SELECT MIN("First elected") FROM table_18185 WHERE "District" = 'Washington 7' | wikisql |
CREATE TABLE table_name_83 (
crowd INTEGER,
away_team VARCHAR
) | What is the least amount of people that attended a game when Essendon was the away team? | SELECT MIN(crowd) FROM table_name_83 WHERE away_team = "essendon" | sql_create_context |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),... | 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, show me the trend about manager_id over hire_date with a line chart. | SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
CREATE TABLE table_3558 (
"Pick #" real,
"Brand (to)" text,
"Employee (Real name)" text,
"Role(s)" text,
"Brand (from)" text
) | Name the employee real name for raw and superstar | SELECT "Employee (Real name)" FROM table_3558 WHERE "Brand (from)" = 'Raw' AND "Role(s)" = 'Superstar' | wikisql |
CREATE TABLE table_name_50 (
event VARCHAR,
round VARCHAR,
opponent VARCHAR
) | Which event only lasted for 3 rounds against Fernando Terere? | SELECT event FROM table_name_50 WHERE round = 3 AND opponent = "fernando terere" | sql_create_context |
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 diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime ti... | did patient 65309 have hypertension nos. | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hypertension nos') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65309) | mimic_iii |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
s... | count the number of patients who were admitted during this year to the hospital. | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | mimic_iii |
CREATE TABLE table_54057 (
"Week" real,
"Date" text,
"TV Time" text,
"Opponent" text,
"Result" text
) | Tell me the average week for result of l 34 24 | SELECT AVG("Week") FROM table_54057 WHERE "Result" = 'l 34–24' | wikisql |
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 comment_instructor (
instructor_id int,
student_id int,
score int,
... | Are there many sections of AUTO 590 after 10 A.M. ? | SELECT COUNT(*) FROM course, course_offering, semester WHERE course_offering.start_time > '10:00:00' AND course.course_id = course_offering.course_id AND course.department = 'AUTO' AND course.number = 590 AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016 | advising |
CREATE TABLE table_58387 (
"Ship" text,
"Pennant number" text,
"Laid down" text,
"Launched" text,
"Completed" text
) | What is the launched date of the destroyer completed 1 July 1936? | SELECT "Launched" FROM table_58387 WHERE "Completed" = '1 july 1936' | wikisql |
CREATE TABLE table_75391 (
"Game" real,
"March" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | Which Points have a Record of 45 21 4, and a Game larger than 70? | SELECT AVG("Points") FROM table_75391 WHERE "Record" = '45–21–4' AND "Game" > '70' | wikisql |
CREATE TABLE station (
Station_ID int,
Name text,
Annual_entry_exit real,
Annual_interchanges real,
Total_Passengers real,
Location text,
Main_Services text,
Number_of_Platforms int
)
CREATE TABLE train (
Train_ID int,
Name text,
Time text,
Service text
)
CREATE TABLE t... | Visualize a bar chart, group by name and compute each group's total number, could you show by the the number of name in ascending? | SELECT Name, COUNT(Name) FROM train GROUP BY Name ORDER BY COUNT(Name) | nvbench |
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 hz_info_mzjzjlb (
JZLSH number,
... | 患者卡号以及卡类型在门诊就诊14556788521中是什么? | SELECT mzjzjlb.KH, mzjzjlb.KLX FROM mzjzjlb WHERE mzjzjlb.JZLSH = '14556788521' | css |
CREATE TABLE table_name_81 (
date VARCHAR,
label VARCHAR
) | What is the date of the Chrysalis, Island Records label? | SELECT date FROM table_name_81 WHERE label = "chrysalis, island records" | sql_create_context |
CREATE TABLE table_52408 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What is the high grid number for a Time/Retired of + 3 laps, and a Laps smaller than 57? | SELECT MAX("Grid") FROM table_52408 WHERE "Time/Retired" = '+ 3 laps' AND "Laps" < '57' | wikisql |
CREATE TABLE table_66722 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Which is the highest bronze with gold less than 0? | SELECT MAX("Bronze") FROM table_66722 WHERE "Gold" < '0' | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | provide the number of patients whose age is less than 71 and drug code is clin300l? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "71" AND prescriptions.formulary_drug_cd = "CLIN300L" | mimicsql_data |
CREATE TABLE player (
Player_ID int,
Player text,
Years_Played text,
Total_WL text,
Singles_WL text,
Doubles_WL text,
Team int
)
CREATE TABLE team (
Team_id int,
Name text
)
CREATE TABLE match_season (
Season real,
Player text,
Position text,
Country int,
Team i... | Show the draft pick numbers and draft classes of players whose positions are defenders Show bar chart, I want to list by the x-axis from low to high. | SELECT Draft_Class, Draft_Pick_Number FROM match_season WHERE Position = "Defender" ORDER BY Draft_Class | nvbench |
CREATE TABLE Acceptance (
Submission_ID int,
Workshop_ID int,
Result text
)
CREATE TABLE submission (
Submission_ID int,
Scores real,
Author text,
College text
)
CREATE TABLE workshop (
Workshop_ID int,
Date text,
Venue text,
Name text
) | Show the authors of their total submissions with a bar chart, and display x axis from high to low order. | SELECT Author, COUNT(Author) FROM submission GROUP BY Author ORDER BY Author DESC | nvbench |
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 admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dis... | how much did it cost for the hospital stay of patient 462 during this year? | SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 462) AND DATETIME(cost.chargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | mimic_iii |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | what is procedure short title of procedure icd9 code 3613? | SELECT procedures.short_title FROM procedures WHERE procedures.icd9_code = "3613" | mimicsql_data |
CREATE TABLE table_name_31 (
elector VARCHAR,
elevator VARCHAR,
cardinalatial_title VARCHAR
) | What Elector has an Elevator of Alexander III and a Cardinalatial title of Bishop of Palestrina? | SELECT elector FROM table_name_31 WHERE elevator = "alexander iii" AND cardinalatial_title = "bishop of palestrina" | sql_create_context |
CREATE TABLE table_2847477_2 (
area VARCHAR,
simplified VARCHAR
) | What is the area of ? | SELECT area FROM table_2847477_2 WHERE simplified = "罗山县" | sql_create_context |
CREATE TABLE table_24703 (
"Series #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Prod. code" text
) | Who wore the episode with the production code of 1apx11? | SELECT "Written by" FROM table_24703 WHERE "Prod. code" = '1APX11' | wikisql |
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
)
... | what is the number of patients whose gender is f and primary disease is sdh? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "SDH" | mimicsql_data |
CREATE TABLE table_name_41 (
draws VARCHAR,
wins VARCHAR,
against VARCHAR
) | What is the total number of draws when there is 1 Win, and less than 1728 against matches? | SELECT COUNT(draws) FROM table_name_41 WHERE wins = 1 AND against < 1728 | sql_create_context |
CREATE TABLE table_name_70 (
score VARCHAR,
loss VARCHAR
) | What is the score when there was a Loss of birkbeck (0 3)? | SELECT score FROM table_name_70 WHERE loss = "birkbeck (0–3)" | sql_create_context |
CREATE TABLE table_13258806_2 (
attendance VARCHAR,
result VARCHAR
) | What was the attendance at the game that resulted in w 24-20? | SELECT attendance FROM table_13258806_2 WHERE result = "W 24-20" | sql_create_context |
CREATE TABLE table_name_74 (
date_of_birth VARCHAR,
bowling_style VARCHAR
) | When is the birth date of player with right arm fast style? | SELECT date_of_birth FROM table_name_74 WHERE bowling_style = "right arm fast" | sql_create_context |
CREATE TABLE table_31659 (
"Date" text,
"Result" text,
"Opponent" text,
"Method" text,
"Round" real
) | When did the technical knockout against Fatu Tuimanono happen? | SELECT "Date" FROM table_31659 WHERE "Method" = 'technical knockout' AND "Opponent" = 'fatu tuimanono' | wikisql |
CREATE TABLE table_25454 (
"Date" text,
"Location" text,
"Opponent" text,
"Terps Points" real,
"Opp. Points" real,
"Record" text
) | What is the highest number of terps points in games where the opponent made 53 points? | SELECT MAX("Terps Points") FROM table_25454 WHERE "Opp. Points" = '53' | wikisql |
CREATE TABLE table_70714 (
"Dance" text,
"Best dancer(s)" text,
"Best score" real,
"Worst dancer(s)" text,
"Worst score" real
) | What's the best score, with the worst dancer(s) gethin jones/kenny logan? | SELECT "Best score" FROM table_70714 WHERE "Worst dancer(s)" = 'gethin jones/kenny logan' | wikisql |
CREATE TABLE Visitors (
Tourist_ID INTEGER,
Tourist_Details VARCHAR(255)
)
CREATE TABLE Ref_Attraction_Types (
Attraction_Type_Code CHAR(15),
Attraction_Type_Description VARCHAR(255)
)
CREATE TABLE Hotels (
hotel_id INTEGER,
star_rating_code CHAR(15),
pets_allowed_yn CHAR(1),
price_ran... | What are the distinct visit dates, and count them by a bar chart, sort in asc by the Y-axis. | SELECT Visit_Date, COUNT(Visit_Date) FROM Visits ORDER BY COUNT(Visit_Date) | nvbench |
CREATE TABLE table_204_125 (
id number,
"state" text,
"type" text,
"name" text,
"title" text,
"royal house" text,
"from" text,
"to" text
) | who ruled longer , zhao or zhaoxiang ? | SELECT "name" FROM table_204_125 WHERE "name" IN ('zhao', 'zhaoxiang') ORDER BY "from" - "to" DESC LIMIT 1 | squall |
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... | 把医院8257985全部诊疗记录中个人需要自费的部分与总的医疗花费的比值最小值依科室的不同和出院诊断编码的差别列出来,把结果按从小到大来显示 | SELECT qtb.MED_ORG_DEPT_NM, qtb.OUT_DIAG_DIS_CD, MIN(t_kc24.PER_EXP) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '8257985' GROUP BY qtb.MED_ORG_DEPT_NM, qtb.OUT_DIAG_DIS_CD ORDER BY MIN(t_kc24.PER_EXP / t_kc24.MED_AMOUT) UNION SELECT gyb.MED_ORG_DEPT_NM, gyb.OUT_DIAG_DIS_... | css |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
... | Edits to specific user's posts by a specific user. | SELECT P.Id AS "post_link" FROM Posts AS P JOIN PostHistory AS H ON H.PostId = P.Id WHERE H.PostHistoryTypeId = 5 AND H.UserId = '##EditUserId##' AND P.OwnerUserId = '##PostOwnerId##' ORDER BY H.CreationDate | sede |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | What is the minimum age of patients whose primary disease is pneumonia;human immunodeficiency virus but not tuberculosis and were admitted in or after the year 2176? | SELECT MIN(demographic.age) FROM demographic WHERE demographic.diagnosis = "PNEUMONIA;HUMAN IMMUNODEFIENCY VIRUS;RULE OUT TUBERCULOSIS" AND demographic.admityear >= "2176" | mimicsql_data |
CREATE TABLE table_74355 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Prod. code" real,
"U.S. viewers (millions)" text
) | What is the title of the episode directed by Rich Correll and written by Dennis Rinsler? | SELECT "Title" FROM table_74355 WHERE "Directed by" = 'Rich Correll' AND "Written by" = 'Dennis Rinsler' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | Tell me the number of white russian ethnic background patients who are less than 77 years of age. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND demographic.age < "77" | mimicsql_data |
CREATE TABLE table_14406743_5 (
date_of_vacancy VARCHAR,
manner_of_departure VARCHAR,
outgoing_manager VARCHAR
) | Name the total number of date of vacancy for manner of departure being resigned and outgoing manager is geninho | SELECT COUNT(date_of_vacancy) FROM table_14406743_5 WHERE manner_of_departure = "Resigned" AND outgoing_manager = "Geninho" | sql_create_context |
CREATE TABLE table_16006 (
"Nomination" text,
"Actors Name" text,
"Film Name" text,
"Director" text,
"Country" text
) | Which nominations are connected to the film Totalitarian Romance? | SELECT "Nomination" FROM table_16006 WHERE "Film Name" = 'Totalitarian Romance' | wikisql |
CREATE TABLE table_name_88 (
attendance INTEGER,
opponent VARCHAR,
week VARCHAR
) | Which Attendance has an Opponent of new york giants, and a Week smaller than 5? | SELECT AVG(attendance) FROM table_name_88 WHERE opponent = "new york giants" AND week < 5 | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid ... | list the top four most frequent lab tests that patients have been given during the same hospital encounter after receiving administration of electrolytes - potassium since 2 years ago. | SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'administration of... | eicu |
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 d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE diagnoses_icd (
row_id numbe... | retrieve patient ids that have been diagnosed with esophagitis, unspecified. | SELECT admissions.subject_id FROM admissions WHERE admissions.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 = 'esophagitis, unspecified')) | mimic_iii |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | count the number of patients whose year of birth is less than 2104 and drug name is vancomycin? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2104" AND prescriptions.drug = "Vancomycin" | mimicsql_data |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
... | in 2105, patient 005-87465 underwent a medicine consultation procedure in other hospitals? | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '005-87465' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '005-87465' AND patient.hospitaldischargetime IS NULL)) AND tr... | eicu |
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,... | 患者的转铁蛋白下限和上限均为多少,在门诊诊断为疾病Y37.102的参考值范围? | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDBM = 'Y37.102' AND jyjgzbb.JCZBMC = '转铁蛋白' UNION SELECT jyjgzbb.CKZFWX... | css |
CREATE TABLE table_18569389_1 (
production_code VARCHAR,
us_viewers__million_ VARCHAR
) | Name the number of production code for 5.08 | SELECT COUNT(production_code) FROM table_18569389_1 WHERE us_viewers__million_ = "5.08" | sql_create_context |
CREATE TABLE table_4366 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | Tell the opponent of eastbourne with score of 6 0, 5 7, 3 6 | SELECT "Opponent" FROM table_4366 WHERE "Tournament" = 'eastbourne' AND "Score" = '6–0, 5–7, 3–6' | wikisql |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwner... | All answers by a specific user (including body). | SELECT a.Id AS "post_link", a.CreationDate, q.Title, q.Tags, a.Body FROM Posts AS a INNER JOIN Posts AS q ON q.Id = a.ParentId WHERE (a.OwnerUserId = '##userid##') ORDER BY a.Id | sede |
CREATE TABLE table_204_385 (
id number,
"round" number,
"pick" number,
"player" text,
"nationality" text,
"college/junior/club team" text
) | who was the first pick by the golden seals ? | SELECT "player" FROM table_204_385 ORDER BY "pick" LIMIT 1 | squall |
CREATE TABLE table_name_23 (
location VARCHAR,
date VARCHAR
) | Where was the September 22 game played? | SELECT location FROM table_name_23 WHERE date = "september 22" | sql_create_context |
CREATE TABLE table_19860 (
"Year" real,
"Player" text,
"Country" text,
"Score" text,
"Margin of victory" text,
"Winners share ( $ )" real,
"Honoree(s)" text
) | How many countries does honoree Roberto de Vicenzo represent? | SELECT COUNT("Country") FROM table_19860 WHERE "Honoree(s)" = 'Roberto De Vicenzo' | wikisql |
CREATE TABLE table_name_92 (
points_classification VARCHAR,
stage VARCHAR
) | What is the point classification of stage 15? | SELECT points_classification FROM table_name_92 WHERE stage = "15" | sql_create_context |
CREATE TABLE table_34922 (
"Team" text,
"Driver" text,
"Laps" real,
"Time" text,
"Grid" real
) | What is the average Laps for the Mexico team with a grid number of more than 1? | SELECT AVG("Laps") FROM table_34922 WHERE "Grid" > '1' AND "Team" = 'mexico' | wikisql |
CREATE TABLE table_name_9 (
round INTEGER,
overall VARCHAR
) | What was the lowest round number that had an overall pick up 92? | SELECT MIN(round) FROM table_name_9 WHERE overall = 92 | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | what is death status and admission location of subject name kurt buczek? | SELECT demographic.expire_flag, demographic.admission_location FROM demographic WHERE demographic.name = "Kurt Buczek" | mimicsql_data |
CREATE TABLE table_39373 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | How much Overall has a Pick # larger than 9, and a Round larger than 5? | SELECT COUNT("Overall") FROM table_39373 WHERE "Pick #" > '9' AND "Round" > '5' | wikisql |
CREATE TABLE table_name_72 (
total INTEGER,
data_processing_and_exploitation VARCHAR,
management_and_support VARCHAR
) | What is the lowest total data processing and exploitation of 00 0,228, and a management and support larger than 1,7? | SELECT MIN(total) FROM table_name_72 WHERE data_processing_and_exploitation = "00 0,228" AND management_and_support > 1 OFFSET 7 | 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... | 查查负责医疗就诊05374679474出院诊断的医生的编码,以及该医生的姓名 | SELECT gwyjzb.OUT_DIAG_DOC_CD, gwyjzb.OUT_DIAG_DOC_NM FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '05374679474' UNION SELECT fgwyjzb.OUT_DIAG_DOC_CD, fgwyjzb.OUT_DIAG_DOC_NM FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '05374679474' | css |
CREATE TABLE table_203_502 (
id number,
"team" text,
"titles" number,
"runner-up" number,
"third place" number,
"fourth place" number,
"years participated" number
) | how many titles does the last team on this chart have ? | SELECT "titles" FROM table_203_502 ORDER BY id DESC LIMIT 1 | squall |
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 text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | what is drug type and drug dose of drug name sulfameth/trimethoprim ss? | SELECT prescriptions.drug_type, prescriptions.drug_dose FROM prescriptions WHERE prescriptions.drug = "Sulfameth/Trimethoprim SS" | mimicsql_data |
CREATE TABLE table_34294 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Record" text
) | What is the Game held on february 9? | SELECT "Game" FROM table_34294 WHERE "Date" = 'february 9' | wikisql |
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREA... | show me all the flights from NEW YORK to MILWAUKEE | 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 CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'NEW YORK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MILWA... | atis |
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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | Calculate the total number of patients who had a heart valve replaced by transplant and got treated with base drug | 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.long_title = "Heart valve replaced by transplant" AND prescriptions.drug_type = "BASE" | mimicsql_data |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_labitems... | what was the last laboratory test given to patient 1372 until 06/2100? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1372) AND STRFTIME('%y-%m', labevents.charttime) <= '2100-06' ORDER BY labevents.charttime DESC LIMIT 1) | mimic_iii |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For those employees who did not have any job in the past, give me the comparison about the sum of salary over the hire_date bin hire_date by weekday. | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | nvbench |
CREATE TABLE repair (
repair_id number,
name text,
launch_date text,
notes text
)
CREATE TABLE machine (
machine_id number,
making_year number,
class text,
team text,
machine_series text,
value_points number,
quality_rank number
)
CREATE TABLE repair_assignment (
techni... | Show names of technicians and the number of machines they are assigned to repair. | SELECT T2.name, COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_id = T2.technician_id GROUP BY T2.name | spider |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TAB... | how many patients have had cpap/peep therapy - 5-10 cm h2o two or more times? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'cpap/peep therapy - 5-10 cm h2o') GROUP BY patient.uniquepid) AS t1 WHERE t1.c1 >= 2 | eicu |
CREATE TABLE table_name_73 (
attendance INTEGER,
h___a VARCHAR,
round VARCHAR
) | What is the lowest attendance when the h/A is H in the Semi-Finals Second Leg? | SELECT MIN(attendance) FROM table_name_73 WHERE h___a = "h" AND round = "semi-finals second leg" | sql_create_context |
CREATE TABLE table_54175 (
"Date" text,
"Result" text,
"Opponent" text,
"Location" text,
"Method" text
) | What is the method against Bj rn Bregy? | SELECT "Method" FROM table_54175 WHERE "Opponent" = 'björn bregy' | wikisql |
CREATE TABLE table_203_59 (
id number,
"country" text,
"2000" number,
"2001" number,
"2002" number,
"2003" number,
"2004" number,
"2005" number,
"2006" number,
"2007" number,
"2008" number,
"2009" number,
"2010" number,
"2011" number
) | in 2000 , did world mine production according to usgs estimates produce more tons or less tons of output of niobium minerals than in 2002 , when a total of 29,900 tons was estimated to have been mined ? | SELECT (SELECT "2000" FROM table_203_59 WHERE "country" = 'world') > 29900 | squall |
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases INTEGER,
Drink TEXT
)
CREATE TABLE appellations (
No... | What is the number of counties for all appellations?, and I want to order bars from high to low order please. | SELECT County, COUNT(County) FROM appellations GROUP BY County ORDER BY County DESC | nvbench |
CREATE TABLE table_1547951_3 (
partner VARCHAR,
opponents VARCHAR
) | Name the partner for mark woodforde martina navratilova | SELECT partner FROM table_1547951_3 WHERE opponents = "Mark Woodforde Martina Navratilova" | sql_create_context |
CREATE TABLE table_5360 (
"Player" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
) | What Player has less than 10 Touchdowns and 0 Extra points and more than 5 Points? | SELECT "Player" FROM table_5360 WHERE "Touchdowns" < '10' AND "Extra points" = '0' AND "Points" > '5' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.