context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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... | provide the number of patients born before 2170 for whom blood lab test order was placed. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2170" AND lab.fluid = "Blood" | mimicsql_data |
CREATE TABLE table_203_270 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
) | what is the total amount of times the frankfurt marathon occurred ? | SELECT COUNT(*) FROM table_203_270 WHERE "competition" = 'frankfurt marathon' | squall |
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE time_interval (
period text... | show me the earliest flight from DENVER to LAS VEGAS | 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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LAS VE... | atis |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNot... | Most Favorited StackOverflow tags. | SELECT * FROM Tags ORDER BY ExcerptPostId DESC | sede |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | Do you know of any other human computer interaction courses that are easier than PHARMSCI 569 ? | 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 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... | 螺内酯片在医疗就诊21173614248里的社保三目录统一编码是啥 | SELECT SOC_SRT_DIRE_CD FROM t_kc22 WHERE MED_CLINIC_ID = '21173614248' AND SOC_SRT_DIRE_NM = '螺内酯片' | css |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE FlagTypes (
Id ... | TOP 200 HAMMER JUGGLERS: Users with many gold tag badges. | SELECT UserId AS "user_link", COUNT(*) AS Hammers FROM Badges AS b WHERE b.TagBased = 1 AND b.Class = 1 GROUP BY UserId ORDER BY COUNT(*) DESC LIMIT 200 | sede |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_... | list all flights from NASHVILLE to SEATTLE | 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 = 'NASHVILLE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SEAT... | atis |
CREATE TABLE table_40815 (
"1935" text,
"1936" text,
"1937" text,
"1938" text,
"1939" text,
"1940" text,
"1941" text,
"1943" text,
"1945" text,
"1946" text,
"1947" text,
"1948" text,
"1949" text,
"1950" text,
"1951" text,
"1952" text,
"1953" text
) | What is the 1938 that has N/A for 1948? | SELECT "1938" FROM table_40815 WHERE "1948" = 'n/a' | wikisql |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday va... | Which professor taught RESTORA 880 most recently ? | SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course_offeri... | advising |
CREATE TABLE table_18554 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What party does the incumbent from the Ohio 20 district belong to? | SELECT "Party" FROM table_18554 WHERE "District" = 'Ohio 20' | wikisql |
CREATE TABLE table_28092844_16 (
intermediate_sprints_classification_klasyfikacja_najaktywniejszych VARCHAR,
winner VARCHAR
) | What was the intermediate sprint classification for the race whose winner was Daniel Martin? | SELECT intermediate_sprints_classification_klasyfikacja_najaktywniejszych FROM table_28092844_16 WHERE winner = "Daniel Martin" | sql_create_context |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod 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 outputevents (
... | what's the first hospital discharge time for patient 29666 in a year before? | SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 29666 AND DATETIME(admissions.dischtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY admissions.dischtime LIMIT 1 | mimic_iii |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
... | Question Closures by Vote Counts. | SELECT ph.PostId AS "post_link", u.DisplayName AS CloseUser, COUNT(v.value) AS VoterCount FROM PostHistory AS ph JOIN Posts AS p ON p.Id = ph.PostId JOIN Users AS u ON u.Id = ph.UserId JOIN LATERAL OPENJSON(ph.Text, '$.Voters') AS v WHERE PostHistoryTypeId = 10 AND p.PostTypeId = 1 GROUP BY ph.PostId, ph.Text, ph.Comme... | sede |
CREATE TABLE table_35698 (
"Track" text,
"City" text,
"State" text,
"Opened (closing date if defunct)" text,
"Surface" text,
"Length" text
) | What is the track in Washington state? | SELECT "Track" FROM table_35698 WHERE "State" = 'washington' | wikisql |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswer... | Linux Engineers (AboutMe contains Linux Engineer related keywords). | SELECT DISTINCT CONCAT('https://stackoverflow.com/users/', u.Id) AS "profile_link", u.DisplayName, u.Reputation, u.Location, u.WebsiteUrl, REPLACE(REPLACE(u.AboutMe, CHAR(13), ''), CHAR(10), '') AS AboutMe FROM Users AS u WHERE (u.AboutMe LIKE '%linux%' OR u.AboutMe LIKE '%ubuntu%' OR u.AboutMe LIKE '%unix%' OR u.About... | sede |
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 wdmzjzjlb.SG, wdmzjzjlb.TZ FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '姜君昊' UNION SELECT bdmzjzjlb.SG, bdmzjzjlb.TZ FROM person_info JOIN hz_info JOIN bd... | css |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
H... | 通过患者06397639的医疗记录显示其医疗费总数目比6289.51元打的次数有多少,入院诊断疾病编码和名称都是啥啊? | SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '06397639' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 6289.51) | css |
CREATE TABLE table_204_885 (
id number,
"season" text,
"competition" text,
"round" text,
"opponent" text,
"home" text,
"away" text,
"agg." text,
"bye" text
) | who was their last opponent in the uefa cup in the 2007-2008 season ? | SELECT "opponent" FROM table_204_885 WHERE "competition" = 'uefa cup' AND "season" = '2007-08' ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE table_11803648_22 (
position VARCHAR,
player VARCHAR
) | What is the position of player Tobias Lindberg? | SELECT position FROM table_11803648_22 WHERE player = "Tobias Lindberg" | sql_create_context |
CREATE TABLE table_29254 (
"District" text,
"Incumbent" text,
"Party" text,
"Elected" real,
"Status" text,
"Result" text
) | What is the district with the result mac collins (r) unopposed? | SELECT "District" FROM table_29254 WHERE "Result" = 'Mac Collins (R) unopposed' | 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_DIRE_CD text,
MED_DIRE_NM text,... | 查查编号为59839403的病患被开出过药品金额超过2930.76元的医疗记录,看看这些医疗就诊的编码 | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '59839403' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 2930.76) | css |
CREATE TABLE nomination (
Artwork_ID int,
Festival_ID int,
Result text
)
CREATE TABLE festival_detail (
Festival_ID int,
Festival_Name text,
Chair_Name text,
Location text,
Year int,
Num_of_Audience int
)
CREATE TABLE artwork (
Artwork_ID int,
Type text,
Name text
) | Show the ids and names of festivals that have at least two nominations for artworks Plot them as bar chart, and could you list by the total number in asc please? | SELECT T3.Festival_Name, T1.Festival_ID FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID ORDER BY T1.Festival_ID | nvbench |
CREATE TABLE table_1342370_10 (
party VARCHAR,
incumbent VARCHAR
) | How many parties were represented for Charles R. Crisp? | SELECT COUNT(party) FROM table_1342370_10 WHERE incumbent = "Charles R. Crisp" | sql_create_context |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResults (
Id number,
... | Metrics - User - Accumulated PU ratio. | SELECT COUNT(1) AS Users, SUM(s) AS Writers, ROUND(SUM(s) * 100.0 / COUNT(1), 2) AS "writers_%" FROM (SELECT u.Id, (CASE WHEN SUM(CASE WHEN p.PostTypeId = 2 AND (p.Score >= @minVote) THEN 1 ELSE 0 END) >= @minPost THEN 1 ELSE 0 END) AS s, (TIME_TO_STR(u.CreationDate, '%Y') * 100 + TIME_TO_STR(u.CreationDate, '%q')) AS ... | sede |
CREATE TABLE table_74424 (
"Week #" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" text,
"Result" text
) | Which artists have order number 6? | SELECT "Original artist" FROM table_74424 WHERE "Order #" = '6' | wikisql |
CREATE TABLE table_31720 (
"Frequency" text,
"Call sign" text,
"Branding" text,
"Format" text,
"Owner" text
) | Who is the owner with the branding fox fm? | SELECT "Owner" FROM table_31720 WHERE "Branding" = 'fox fm' | wikisql |
CREATE TABLE table_11677691_1 (
hometown VARCHAR,
player VARCHAR
) | What is Jeremy Hill's hometown? | SELECT hometown FROM table_11677691_1 WHERE player = "Jeremy Hill" | sql_create_context |
CREATE TABLE table_77439 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game site" text
) | What team was the opponent in a week earlier than 17 on June 17, 2006? | SELECT "Opponent" FROM table_77439 WHERE "Week" < '17' AND "Date" = 'june 17, 2006' | wikisql |
CREATE TABLE table_72671 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Won" real,
"Drawn" real,
"Lost" real,
"For" real,
"Against" real,
"Difference" text
) | Name the most for when difference is 7 | SELECT MAX("For") FROM table_72671 WHERE "Difference" = '7' | wikisql |
CREATE TABLE table_name_37 (
result VARCHAR,
work VARCHAR
) | What was the result of t.u.f.f. puppy? | SELECT result FROM table_name_37 WHERE work = "t.u.f.f. puppy" | sql_create_context |
CREATE TABLE table_name_71 (
engine VARCHAR,
points VARCHAR,
year VARCHAR
) | Which engine has more than 1 point after 1981? | SELECT engine FROM table_name_71 WHERE points > 1 AND year > 1981 | sql_create_context |
CREATE TABLE table_23284271_6 (
score VARCHAR,
date VARCHAR
) | Name the score for december 27 | SELECT COUNT(score) FROM table_23284271_6 WHERE date = "December 27" | sql_create_context |
CREATE TABLE table_train_214 (
"id" int,
"gender" string,
"lead_ecg" bool,
"systolic_blood_pressure_sbp" int,
"qt_interval" bool,
"urine_dipstick_protein" int,
"stroke" bool,
"transient_ischemic_attack" bool,
"qtc" int,
"long_qt_syndrome" bool,
"cardiovascular_disease" bool,
... | egfr as calculated by mdrd of < 60 ml / min | SELECT * FROM table_train_214 WHERE estimated_glomerular_filtration_rate_egfr < 60 | criteria2sql |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
U... | top egypt users in tags. | WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id =... | sede |
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 inputevents_cv (
row_id number,
subject_id number,
... | when was patient 8244's arterial bp [diastolic] measured for the first time on this month/16? | 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 = 8244)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial ... | mimic_iii |
CREATE TABLE table_27003223_4 (
registered_voters VARCHAR,
d_r_spread VARCHAR
) | What is the percentage of registered voters in which the d-r spread is +14.3%? | SELECT registered_voters FROM table_27003223_4 WHERE d_r_spread = "+14.3%" | 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,
... | find the number of patients whose hospital stay is more than 6 days. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.days_stay > "6" | mimicsql_data |
CREATE TABLE students (
student_id number,
date_of_registration time,
date_of_latest_logon time,
login_name text,
password text,
personal_name text,
middle_name text,
family_name text
)
CREATE TABLE student_tests_taken (
registration_id number,
date_test_taken time,
test_res... | Find the personal name, family name, and author ID of the course author that teaches the most courses. | SELECT T1.personal_name, T1.family_name, T2.author_id FROM course_authors_and_tutors AS T1 JOIN courses AS T2 ON T1.author_id = T2.author_id GROUP BY T2.author_id ORDER BY COUNT(*) DESC LIMIT 1 | 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
)
... | what is the number of patients whose age is less than 56 and admission year is less than 2176? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "56" AND demographic.admityear < "2176" | mimicsql_data |
CREATE TABLE table_19948664_2 (
ranking_la__2_ VARCHAR,
world_ranking__1_ VARCHAR
) | How many items were under ranking l.a.(2) when the world ranking was 21st? | SELECT COUNT(ranking_la__2_) FROM table_19948664_2 WHERE world_ranking__1_ = "21st" | sql_create_context |
CREATE TABLE table_name_53 (
laps INTEGER,
time_retired VARCHAR
) | How many laps were there when time/retired was gearbox? | SELECT SUM(laps) FROM table_name_53 WHERE time_retired = "gearbox" | sql_create_context |
CREATE TABLE table_42223 (
"Former kingdom" text,
"Province" text,
"Hangul" text,
"Hanja" text,
"Capital" text,
"Modern equivalent" text
) | What is the capital of the province with in Hanja? | SELECT "Capital" FROM table_42223 WHERE "Hanja" = '漢州' | wikisql |
CREATE TABLE table_25185 (
"Romanised name" text,
"Chinese name" text,
"age at appointment" real,
"Portfolio" text,
"Prior occupation" text
) | What's the romanised name of the official who was Secretary for health, welfare and food? | SELECT "Romanised name" FROM table_25185 WHERE "Portfolio" = 'Secretary for Health, Welfare and Food' | wikisql |
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)... | co-authors of lorenzo bruzzone | SELECT DISTINCT AUTHOR_1.authorid FROM author AS AUTHOR_0, author AS AUTHOR_1, writes AS WRITES_0, writes AS WRITES_1 WHERE AUTHOR_0.authorname = 'lorenzo bruzzone' AND WRITES_0.authorid = AUTHOR_0.authorid AND WRITES_1.authorid = AUTHOR_1.authorid AND WRITES_1.paperid = WRITES_0.paperid | scholar |
CREATE TABLE table_9255 (
"Season" real,
"Conference" text,
"Champion" text,
"Format" text,
"Series" text,
"Runner-Up" text
) | What series has a season after 2008, super leg final as the format, and conference v as the conference? | SELECT "Series" FROM table_9255 WHERE "Season" > '2008' AND "Format" = 'super leg final' AND "Conference" = 'conference v' | wikisql |
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE city (
city_code varchar,
city_na... | i'd like to fly nonstop from ATLANTA to BALTIMORE and get there at 1900 | 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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND flight.arrival_time = 1900 AND flight.to_airport = AIRPORT_SERVICE_1.airp... | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | For how many patients aged 76 or below, was the death status left unspecified? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.age >= "76" | mimicsql_data |
CREATE TABLE table_name_59 (
long INTEGER,
loss VARCHAR,
gain VARCHAR
) | When the player gained below 1,405 yards and lost over 390 yards, what's the sum of the long yards? | SELECT SUM(long) FROM table_name_59 WHERE loss > 390 AND gain < 1 OFFSET 405 | sql_create_context |
CREATE TABLE table_61505 (
"Year" real,
"Binibining Pilipinas-Universe" text,
"Binibining Pilipinas-World" text,
"Binibining Pilipinas International" text,
"Miss Maja Pilipinas" text,
"First runner-up" text,
"Second runner-up" text
) | Which Year has a Binibining Pilipinas International of alma concepcion? | SELECT "Year" FROM table_61505 WHERE "Binibining Pilipinas International" = 'alma concepcion' | 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 is the average age of patients who are admitted under emergency and diagnosed with primary disease communicating aneurysm/sda? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "POSTERIOR COMMUNICATING ANEURYSM/SDA" | mimicsql_data |
CREATE TABLE table_name_19 (
venue VARCHAR,
result VARCHAR
) | In what venues was the match with a final result of Eng by 4 wkts? | SELECT venue FROM table_name_19 WHERE result = "eng by 4 wkts" | sql_create_context |
CREATE TABLE table_58848 (
"Year" real,
"Manufacturer" text,
"Start" real,
"Finish" real,
"Team" text
) | WHAT MANUFACTURER AFTER 1966 HAD A START SMALLER THAN 5, A WOOD TEAM AND FINISHED 35? | SELECT "Manufacturer" FROM table_58848 WHERE "Year" > '1966' AND "Start" < '5' AND "Team" = 'wood' AND "Finish" = '35' | wikisql |
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 employees (
EMPLOYEE_ID decimal(6,0),... | For all employees who have the letters D or S in their first name, draw a bar chart about the distribution of hire_date and the sum of manager_id bin hire_date by time, sort Y-axis from high to low order. | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(MANAGER_ID) DESC | nvbench |
CREATE TABLE table_48456 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"Location Attendance" text,
"Record" text
) | What is the location and attendance of the game when the score is 125-100? | SELECT "Location Attendance" FROM table_48456 WHERE "Score" = '125-100' | wikisql |
CREATE TABLE table_name_31 (
tries_for VARCHAR,
tries_against VARCHAR
) | tries against correct as of 2007-10-15 has what tries for? | SELECT tries_for FROM table_name_31 WHERE tries_against = "correct as of 2007-10-15" | sql_create_context |
CREATE TABLE employees (
employee_id VARCHAR,
first_name VARCHAR,
last_name VARCHAR,
job_id VARCHAR,
salary INTEGER
) | display the employee number, name( first name and last name ) and job title for all employees whose salary is more than any salary of those employees whose job title is PU_MAN. | SELECT employee_id, first_name, last_name, job_id FROM employees WHERE salary > (SELECT MAX(salary) FROM employees WHERE job_id = 'PU_MAN') | sql_create_context |
CREATE TABLE table_2160008_4 (
reason_for_change VARCHAR,
date_successor_seated VARCHAR
) | Name the number of reason for change on may 11, 1939 | SELECT COUNT(reason_for_change) FROM table_2160008_4 WHERE date_successor_seated = "May 11, 1939" | sql_create_context |
CREATE TABLE table_2861364_1 (
place_of_execution VARCHAR,
executed_person VARCHAR
) | where was mazouz ghaouti executed? | SELECT place_of_execution FROM table_2861364_1 WHERE executed_person = "Mazouz Ghaouti" | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
... | until 2104, how many patients were prescribed with 1000 ml flex cont : sodium chloride 0.9 % iv soln within the same hospital visit after the diagnosis with pancreatitis - acute? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pancreatitis - acute' AND STRFTIME('%y', diagnosis.diagnosistime) <= '210... | eicu |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | what are the four most commonly prescribed drugs for patients who were also prescribed vincristine sulfate at the same time during this year? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'vincristine sulfate' AND DATETIME(prescriptions.startdate, 'start... | mimic_iii |
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 is the number of patients whose ethnicity is black/haitian and primary disease is aortic insufficiency\re-do sternotomy; aortic valve replacement ? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/HAITIAN" AND demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT " | mimicsql_data |
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... | 患者90065090为帕金森病性痴呆(震颤麻痹性痴呆),门诊诊断的免疫球蛋白M(敏感)的结果定量及其单位分别是什么? | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jyb... | css |
CREATE TABLE table_13741576_6 (
club VARCHAR,
points_for VARCHAR
) | What club has 536 points for? | SELECT club FROM table_13741576_6 WHERE points_for = "536" | sql_create_context |
CREATE TABLE table_16418 (
"Condition" text,
"Prothrombin time" text,
"Partial thromboplastin time" text,
"Bleeding time" text,
"Platelet count" text
) | What was the bleeding time for the factor x deficiency as seen in amyloid purpura | SELECT "Bleeding time" FROM table_16418 WHERE "Condition" = 'Factor X deficiency as seen in amyloid purpura' | wikisql |
CREATE TABLE table_6309 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | what team scored 65-87 | SELECT "Date" FROM table_6309 WHERE "Record" = '65-87' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | Find the average age of patients that survived and had a pimary disease of ventricular tachycardia. | SELECT AVG(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.diagnosis = "VENTRICULAR TACHYCARDIA" | mimicsql_data |
CREATE TABLE table_26893 (
"Team" text,
"Truck(s)" text,
"#" real,
"Driver(s)" text,
"Primary Sponsor(s)" text,
"Listed Owner(s)" text,
"Crew Chief" text
) | Name the team for susan bates | SELECT "Team" FROM table_26893 WHERE "Listed Owner(s)" = 'Susan Bates' | wikisql |
CREATE TABLE lessons (
lesson_id number,
customer_id number,
lesson_status_code text,
staff_id number,
vehicle_id number,
lesson_date time,
lesson_time text,
price number
)
CREATE TABLE customer_payments (
customer_id number,
datetime_payment time,
payment_method_code text,
... | List all payment methods and number of payments using each payment methods. | SELECT payment_method_code, COUNT(*) FROM customer_payments GROUP BY payment_method_code | spider |
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 microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,... | what was the three most frequently performed lab tests in 2105? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE STRFTIME('%y', labevents.charttime) = '2105' GROUP BY labevents.itemid) AS t1 WHERE t1.c1 <= 3) | mimic_iii |
CREATE TABLE table_name_28 (
school VARCHAR,
mascot VARCHAR
) | Which School's Mascot is Raiders? | SELECT school FROM table_name_28 WHERE mascot = "raiders" | sql_create_context |
CREATE TABLE table_51195 (
"Year" real,
"Theme" text,
"Artist" text,
"Composition" text,
"Mintage" real,
"Issue Price" text
) | What's the mintage when the theme was year of the rabbit? | SELECT "Mintage" FROM table_51195 WHERE "Theme" = 'year of the rabbit' | wikisql |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
vitalpe... | among patients that were prescribed with 2 ml vial: midazolam hcl 2 mg/2ml ij soln, what are the five most frequently prescribed drugs at the same time, since 2103. | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = '2 ml vial: midazolam hcl 2 mg/2ml ij soln' AND STRF... | eicu |
CREATE TABLE table_name_9 (
name VARCHAR,
caps VARCHAR
) | Who has a 59 cap? | SELECT name FROM table_name_9 WHERE caps = 59 | sql_create_context |
CREATE TABLE table_59082 (
"Season" text,
"GP/MP" text,
"Kills" real,
"K/Game" real,
"Errors" real,
"Total Attempts" real,
"Percentage" real,
"Assists" real,
"Service Aces" real,
"Digs" real,
"Solo Blocks" real,
"Block Assists" real,
"Total Blocks" real,
"Points" ... | What is the highest percentage when there are more than 361 blocks? | SELECT MAX("Percentage") FROM table_59082 WHERE "Total Blocks" > '361' | wikisql |
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Student (
S... | Find the average age of students living in each dorm and the name of dorm. Plot them as bar chart. | SELECT dorm_name, AVG(T1.Age) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid GROUP BY T3.dorm_name | nvbench |
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,
... | 从12年9月21日至17年9月17日之间因骨伤的住院量是多少? | SELECT COUNT(*) FROM zyjzjlb WHERE JZKSMC = '创伤骨科' AND RYDJSJ BETWEEN '2012-09-21' AND '2017-09-17' | css |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | tell me the price of verapamil sr. | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'verapamil sr') | mimic_iii |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
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... | For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of first_name and commission_pct , display by the y axis in asc. | SELECT FIRST_NAME, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COMMISSION_PCT | nvbench |
CREATE TABLE table_23285761_11 (
high_assists VARCHAR,
date VARCHAR
) | Who has the high assists when April 26 is the date? | SELECT high_assists FROM table_23285761_11 WHERE date = "April 26" | sql_create_context |
CREATE TABLE table_68212 (
"Year" real,
"Manufacturer" text,
"Start" real,
"Finish" real,
"Team" text
) | Name the total number of start when finish is less than 4 | SELECT COUNT("Start") FROM table_68212 WHERE "Finish" < '4' | wikisql |
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 jybgb (
BBCJBW text,
BBDM tex... | 病患36963389检测丙戊酸在2012年2月7日起到2019年5月3日结束的医务人员工号及姓名分别是什么? | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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 = jybgb_jyjgzbb.YLJGDM ... | css |
CREATE TABLE Organisation_Types (
organisation_type VARCHAR(10),
organisation_type_description VARCHAR(255)
)
CREATE TABLE Grants (
grant_id INTEGER,
organisation_id INTEGER,
grant_amount DECIMAL(19,4),
grant_start_date DATETIME,
grant_end_date DATETIME,
other_details VARCHAR(255)
)
CR... | What are the ids and details for all organizations that have grants of more than 6000 dollars, rank X from low to high order. | SELECT T2.organisation_details, T1.organisation_id FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_details ORDER BY T2.organisation_details | nvbench |
CREATE TABLE table_68602 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | Which opponent has a record of 17-11? | SELECT "Opponent" FROM table_68602 WHERE "Record" = '17-11' | wikisql |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
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 locations (
LOCATION_ID decimal(4,0... | For all employees who have the letters D or S in their first name, draw a bar chart about the distribution of hire_date and the average of manager_id bin hire_date by weekday, and show by the y axis in ascending. | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(MANAGER_ID) | nvbench |
CREATE TABLE table_name_44 (
address VARCHAR,
mascot VARCHAR
) | What is the address for the school that has the coyotes mascot? | SELECT address FROM table_name_44 WHERE mascot = "coyotes" | sql_create_context |
CREATE TABLE table_name_12 (
Block INTEGER,
assists VARCHAR,
total_blocks VARCHAR
) | When assists is more than 32 and total blocks is more than 88, what is the total of block assists? | SELECT SUM(Block) AS assists FROM table_name_12 WHERE assists > 32 AND total_blocks > 88 | sql_create_context |
CREATE TABLE table_3342 (
"Settlement" text,
"Cyrillic Name" text,
"Type" text,
"Population (2011)" real,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
) | What is the largest ethnic group (2002) when cyrillic name is ? | SELECT "Largest ethnic group (2002)" FROM table_3342 WHERE "Cyrillic Name" = 'Брестач' | wikisql |
CREATE TABLE table_18143210_2 (
number_of_seasons_in_liga_mx VARCHAR,
first_season_of_current_spell_in_top_division VARCHAR
) | How many 'number of season in Liga MX' were played if the 'first season of current spell in top division' is in 1962-63? | SELECT number_of_seasons_in_liga_mx FROM table_18143210_2 WHERE first_season_of_current_spell_in_top_division = "1962-63" | sql_create_context |
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Faculty_Participates_in (
FacID INTEGER,
actid INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
... | What is the first name of the faculty members who participated in at least one activity? For each of them, also show the number of activities they participated in with a bar chart, list in ascending by the X. | SELECT Fname, COUNT(*) FROM Faculty AS T1 JOIN Faculty_Participates_in AS T2 ON T1.FacID = T2.FacID GROUP BY T1.FacID ORDER BY Fname | nvbench |
CREATE TABLE table_name_36 (
date VARCHAR,
crowd INTEGER
) | When was the attendance at a venue bigger than 35,151? | SELECT date FROM table_name_36 WHERE crowd > 35 OFFSET 151 | sql_create_context |
CREATE TABLE match_result (
Rank int,
Club_ID int,
Gold int,
Big_Silver int,
Small_Silver int,
Bronze int,
Points int
)
CREATE TABLE coach (
Coach_ID int,
Coach_name text,
Gender text,
Club_ID int,
Rank int
)
CREATE TABLE club (
Club_ID int,
Club_name text,
... | Draw a bar chart of gender versus the number of gender, order in descending by the names. | SELECT Gender, COUNT(Gender) FROM player GROUP BY Gender ORDER BY Gender DESC | nvbench |
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... | 在医院6828719中列出患者14284593就诊科室名称不包含心血管病的全部门诊就诊记录的流水号都是什么? | SELECT wdmzjzjlb.JZLSH FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '14284593' AND hz_info.YLJGDM = '6828719' AND NOT wdmzjzjlb.JZKSMC LIKE '%心血管病%' UNION SELECT bdmzjzjlb.JZLSH FROM hz_info JOIN bdmzjzjlb ON hz_info.... | css |
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 number,
label text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
... | when was patient 83182 being prescribed with a medication for the last time in this hospital visit? | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83182 AND admissions.dischtime IS NULL) ORDER BY prescriptions.startdate DESC LIMIT 1 | 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... | provide the number of patients diagnosed with mv collision nos-driver. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Mv collision NOS-driver" | mimicsql_data |
CREATE TABLE table_14560 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | Which opponent has a Date of april 14? | SELECT "Opponent" FROM table_14560 WHERE "Date" = 'april 14' | wikisql |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimme... | Visualize a bar chart about the distribution of meter_600 and ID , and order by the bars in asc. | SELECT meter_600, ID FROM swimmer ORDER BY meter_600 | nvbench |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | indicate the monthly minimum amount of arterial bp [systolic] for patient 25814 since 61 days ago. | SELECT MIN(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25814)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arte... | mimic_iii |
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
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 Lives_in (
stuid INTEGER,
... | Find the number of students living in each city with a bar chart, and display by the Y-axis from high to low please. | SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE Ref_Transaction_Types (
transaction_type_description VARCHAR,
transaction_type_code VARCHAR
)
CREATE TABLE TRANSACTIONS (
date_of_transaction VARCHAR,
transaction_type_code VARCHAR,
share_count INTEGER
) | Show the transaction type descriptions and dates if the share count is smaller than 10. | SELECT T1.transaction_type_description, T2.date_of_transaction FROM Ref_Transaction_Types AS T1 JOIN TRANSACTIONS AS T2 ON T1.transaction_type_code = T2.transaction_type_code WHERE T2.share_count < 10 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.