context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE patient (
uniquep... | what is 'diagnosis cost' of svt - without hemodynamic compromise? | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'diagnosis' AND cost.eventid IN (SELECT diagnosis.diagnosisid FROM diagnosis WHERE diagnosis.diagnosisname = 'svt - without hemodynamic compromise') | eicu |
CREATE TABLE table_55711 (
"Region" text,
"Date" real,
"Label" text,
"Format" text,
"Catalog" text
) | what is the earliest date for the album that had a catalog number of 3645, was formatted as a cd and was under the luaka bop label? | SELECT MIN("Date") FROM table_55711 WHERE "Catalog" = '3645' AND "Format" = 'cd' AND "Label" = 'luaka bop' | wikisql |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | 请提供检验报告单19869602899的检验技师工号以及姓名的详细信息 | SELECT zyjybgb.JYJSGH, zyjybgb.JYJSQM FROM zyjybgb WHERE zyjybgb.BGDH = '19869602899' UNION SELECT mzjybgb.JYJSGH, mzjybgb.JYJSQM FROM mzjybgb WHERE mzjybgb.BGDH = '19869602899' | css |
CREATE TABLE table_6623 (
"Cardinal direction" text,
"Burmese" text,
"Sanskrit" text,
"English" text,
"Planet" text,
"Sign" text
) | What is the cardinal direction of Wednesday p.m. in English? | SELECT "Cardinal direction" FROM table_6623 WHERE "English" = 'wednesday p.m.' | wikisql |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
... | ORDER BY - most recent Posts by CreationDate. | SELECT YEAR(CreationDate) AS CreationDateYear, COUNT(*) AS PostsThisYear FROM dbo.Posts WHERE OwnerUserId = 22656 GROUP BY YEAR(CreationDate) ORDER BY YEAR(CreationDate) | sede |
CREATE TABLE table_name_27 (
wins INTEGER,
losses VARCHAR,
draws VARCHAR
) | What is the lowest number of wins where the losses are more than 12 and the draws are less than 0? | SELECT MIN(wins) FROM table_name_27 WHERE losses > 12 AND draws < 0 | sql_create_context |
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 ... | compared to last measured on the current intensive care unit visit is the arterial bp mean of patient 18866 less than the value second to last measured on the current intensive care unit visit? | SELECT (SELECT 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 = 18866) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_i... | mimic_iii |
CREATE TABLE table_name_56 (
year INTEGER,
start VARCHAR,
stage VARCHAR
) | What was the earliest year that had a start of Saint-Gaudens and a stage smaller than 15? | SELECT MIN(year) FROM table_name_56 WHERE start = "saint-gaudens" AND stage < 15 | sql_create_context |
CREATE TABLE table_name_81 (
launched VARCHAR,
territory VARCHAR,
channel VARCHAR
) | When did channel 83 in singapore launch? | SELECT launched FROM table_name_81 WHERE territory = "singapore" AND channel = 83 | sql_create_context |
CREATE TABLE table_name_97 (
result VARCHAR,
location VARCHAR
) | What was the result for the match held in Boston? | SELECT result FROM table_name_97 WHERE location = "boston" | sql_create_context |
CREATE TABLE table_74950 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Which Bronze is the lowest one that has a Rank of 3, and a Silver smaller than 2? | SELECT MIN("Bronze") FROM table_74950 WHERE "Rank" = '3' AND "Silver" < '2' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid ... | how many patients were diagnosed with hyperlipidemia within 2 months after being diagnosed with diabetes mellitus? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hyperlipidemia') AS t1 JOIN (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient O... | eicu |
CREATE TABLE table_204_888 (
id number,
"location" text,
"mile" number,
"destinations" text,
"notes" text
) | what is the exit beofre virginia avenue ? | SELECT "destinations" FROM table_204_888 WHERE id = (SELECT id FROM table_204_888 WHERE "destinations" = 'virginia avenue to us 522 north') - 1 | squall |
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 prescriptions (
subject_id text,
hadm_id... | count the number of patients whose primary disease is guillain barre syndrome and age is less than 31? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "GUILLAIN BARRE SYNDROME" AND demographic.age < "31" | mimicsql_data |
CREATE TABLE table_name_8 (
pitcher VARCHAR,
date VARCHAR
) | Tell me the pitcher on september 6, 2006 | SELECT pitcher FROM table_name_8 WHERE date = "september 6, 2006" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | how many patients whose gender is m and primary disease is upper gi bleed? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.diagnosis = "UPPER GI BLEED" | mimicsql_data |
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
)
CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
) | What is the total number of each fate? Give me the result in a bar graph, display x-axis in descending order. | SELECT Fate, COUNT(Fate) FROM mission GROUP BY Fate ORDER BY Fate DESC | nvbench |
CREATE TABLE table_70579 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" text
) | Who was the away team when the attendance was 7,891? | SELECT "Away team" FROM table_70579 WHERE "Attendance" = '7,891' | wikisql |
CREATE TABLE table_name_41 (
competition VARCHAR,
venue VARCHAR,
result VARCHAR
) | What Away Competition had a Result of lost 2-4? | SELECT competition FROM table_name_41 WHERE venue = "away" AND result = "lost 2-4" | sql_create_context |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TA... | list the flights from DALLAS to SAN FRANCISCO on AA | 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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ... | atis |
CREATE TABLE table_37655 (
"Surname" text,
"First" text,
"D.O.B." text,
"Bats" text,
"Throws" text,
"Position" text
) | Which DOB has a Surname of cresswell? | SELECT "D.O.B." FROM table_37655 WHERE "Surname" = 'cresswell' | wikisql |
CREATE TABLE table_name_31 (
title VARCHAR,
year VARCHAR,
genre VARCHAR,
network VARCHAR
) | What's the title when the genre is drama with a network of KBS2 happening in 2011? | SELECT title FROM table_name_31 WHERE genre = "drama" AND network = "kbs2" AND year = 2011 | sql_create_context |
CREATE TABLE table_4564 (
"Year" real,
"Network" text,
"Play-by-play" text,
"Color commentator(s)" text,
"Sideline reporter(s)" text
) | Who were the collor commentator(s) for ESPN before 2012? | SELECT "Color commentator(s)" FROM table_4564 WHERE "Year" < '2012' AND "Network" = 'espn' | wikisql |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE days (
days_code varchar,
da... | AA flights from SAN FRANCISCO please | 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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND flight.from_airport... | atis |
CREATE TABLE table_32699 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | How many golds for teams ranking below 7 with 3 bronze and less than 5 total medals? | SELECT COUNT("Gold") FROM table_32699 WHERE "Bronze" = '3' AND "Rank" > '7' AND "Total" < '5' | wikisql |
CREATE TABLE table_name_92 (
award VARCHAR,
result VARCHAR,
category VARCHAR
) | Which Award has a nominated, and outstanding choreography? | SELECT award FROM table_name_92 WHERE result = "nominated" AND category = "outstanding choreography" | sql_create_context |
CREATE TABLE table_204_866 (
id number,
"name" text,
"lifetime" text,
"nationality" text,
"notable as" text,
"notes" text
) | which name is before sam falson | SELECT "name" FROM table_204_866 WHERE id = (SELECT id FROM table_204_866 WHERE "name" = 'sam falson') - 1 | squall |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTa... | Most 20 active users (total actions - posting, commenting and voting). Users who spend A LOT of time posting, editing, commenting and voting. | SELECT UserId AS "user_link", SUM(c) AS s FROM (SELECT UserId, COUNT(*) AS c FROM PostHistory WHERE UserId > 0 GROUP BY UserId UNION ALL SELECT UserId, COUNT(*) AS c FROM Comments WHERE UserId > 0 GROUP BY UserId UNION ALL SELECT UserId, COUNT(*) AS c FROM Votes WHERE UserId > 0 GROUP BY UserId) AS Actions GROUP BY Use... | sede |
CREATE TABLE table_204_823 (
id number,
"dates" text,
"location" text,
"attendance" text,
"official guests" text,
"notes" text
) | where was the first location used in august , 1976 ? | SELECT "location" FROM table_204_823 WHERE "dates" = 1976 AND "dates" = 8 | squall |
CREATE TABLE table_name_23 (
headquarters VARCHAR,
employees__world_ VARCHAR
) | Which HQ is associated with a number of employees of 100? | SELECT headquarters FROM table_name_23 WHERE employees__world_ = 100 | sql_create_context |
CREATE TABLE web_client_accelerator (
id number,
name text,
operating_system text,
client text,
connection text
)
CREATE TABLE browser (
id number,
name text,
market_share number
)
CREATE TABLE accelerator_compatible_browser (
accelerator_id number,
browser_id number,
compa... | Find the number of web accelerators used for each Operating system. | SELECT operating_system, COUNT(*) FROM web_client_accelerator GROUP BY operating_system | spider |
CREATE TABLE table_38023 (
"Driver" text,
"Constructor" text,
"Laps" text,
"Time/Retired" text,
"Grid" text
) | What is the Time/Retired for the BMW Sauber, and Nick Heidfeld? | SELECT "Time/Retired" FROM table_38023 WHERE "Constructor" = 'bmw sauber' AND "Driver" = 'nick heidfeld' | wikisql |
CREATE TABLE table_name_91 (
nfl_team VARCHAR,
position VARCHAR,
round VARCHAR,
overall VARCHAR,
pick VARCHAR
) | Which NFL team chose a position of DE when the pick was larger than 9, after round 5, and the overal was larger than 118? | SELECT nfl_team FROM table_name_91 WHERE overall > 118 AND pick > 9 AND round > 5 AND position = "de" | sql_create_context |
CREATE TABLE table_51009 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" text
) | Who was the away team when the Tie no was 34? | SELECT "Away team" FROM table_51009 WHERE "Tie no" = '34' | wikisql |
CREATE TABLE table_75032 (
"Call sign" text,
"Analog channel" text,
"Digital channel" text,
"Virtual channel" text,
"Network" text,
"Station Ownership" text
) | Network of nbc is what digital channel? | SELECT "Digital channel" FROM table_75032 WHERE "Network" = 'nbc' | 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
) | For those records from the products and each product's manufacturer, show me about the correlation between price and code , and group by attribute founder in a scatter chart. | SELECT T1.Price, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder | nvbench |
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 procedures_icd (
row_id number,
subject_id number,
... | when was the first time that since 164 months ago patient 95909 was prescribed a medication via pr? | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 95909) AND prescriptions.route = 'pr' AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-164 month') ORDER BY prescriptions.startdate LIMIT 1 | mimic_iii |
CREATE TABLE table_71584 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money (US$)" real
) | What was Arnold Palmer's score in the tournamnet? | SELECT "Score" FROM table_71584 WHERE "Player" = 'arnold palmer' | wikisql |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE ReviewTaskStates (
Id number,
... | Posts Since The Mess Started. | SELECT COUNT(*) FROM Posts AS p WHERE p.CreationDate >= '2019-09-05' | sede |
CREATE TABLE table_21708 (
"Class" text,
"Part 1" text,
"Part 2" text,
"Part 3" text,
"Part 4" text,
"Verb meaning" text
) | How many different part 3 verbs are there that mean to freeze? | SELECT COUNT("Part 3") FROM table_21708 WHERE "Verb meaning" = 'to freeze' | wikisql |
CREATE TABLE table_300283_1 (
official_name VARCHAR,
name_in_spanish VARCHAR
) | What is the official name of the municipality whose name in Spanish is Crip n? | SELECT official_name FROM table_300283_1 WHERE name_in_spanish = "Cripán" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text... | 09590061301的这次住院就诊门诊的主要诊断如何?需要编码的类型和列表,还有名称列表 | SELECT MZBMLX, MZZDBM, MZZDMC FROM zyjzjlb WHERE JZLSH = '09590061301' | css |
CREATE TABLE table_59595 (
"Rank" text,
"County" text,
"State" text,
"Land area (km\u00b2)" text,
"Land area (mi\u00b2)" text,
"April 1, 2010 census" text,
"April 1, 2010 density (/km\u00b2)" text,
"April 1, 2010 density (/mi\u00b2)" text,
"July 1, 2010 official estimate" text,
"... | What is the July 1, 2011 density if the July 1, 2010 official estimate is 800,482? | SELECT "July 1, 2011 density (/mi\u00b2)" FROM table_59595 WHERE "July 1, 2010 official estimate" = '800,482' | wikisql |
CREATE TABLE tryout (
pid number,
cname text,
ppos text,
decision text
)
CREATE TABLE college (
cname text,
state text,
enr number
)
CREATE TABLE player (
pid number,
pname text,
ycard text,
hs number
) | How many different colleges were represented at tryouts? | SELECT COUNT(DISTINCT cname) FROM tryout | spider |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE course (
c... | If I want to declare a major in GREEKMOD , what classes do I need to take ? | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%GREEKMOD%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id | advising |
CREATE TABLE table_name_69 (
date_of_appointment VARCHAR,
outgoing_manager VARCHAR
) | What is Date of Appointment, when Outgoing Manager is 'Giray Bulak'? | SELECT date_of_appointment FROM table_name_69 WHERE outgoing_manager = "giray bulak" | sql_create_context |
CREATE TABLE table_25800134_1 (
series__number INTEGER,
airdate VARCHAR
) | What is largest series number for the episode that aired February 16, 1957? | SELECT MAX(series__number) FROM table_25800134_1 WHERE airdate = "February 16, 1957" | sql_create_context |
CREATE TABLE table_15724 (
"Name" text,
"League" real,
"FA Cup" real,
"League Cup" real,
"Other" real,
"Total" real
) | Name the least other for league cup less than 0, FA cup more than 0 and league of 2 with total less than 14 | SELECT MIN("Other") FROM table_15724 WHERE "Total" < '14' AND "League" = '2' AND "FA Cup" > '0' AND "League Cup" < '0' | wikisql |
CREATE TABLE table_name_26 (
to_par VARCHAR,
place VARCHAR,
score VARCHAR
) | what is the to par when the place is t10 and the score is 72-74-71-69=286? | SELECT to_par FROM table_name_26 WHERE place = "t10" AND score = 72 - 74 - 71 - 69 = 286 | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | how many married patients were admitted to hospital before 2195? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admityear < "2195" | mimicsql_data |
CREATE TABLE table_name_59 (
record VARCHAR,
opponent VARCHAR,
method VARCHAR
) | What record has magomedkhan gamzatkhanov as the opponent, and submission as the method? | SELECT record FROM table_name_59 WHERE opponent = "magomedkhan gamzatkhanov" AND method = "submission" | sql_create_context |
CREATE TABLE table_train_144 (
"id" int,
"retinal_dystrophy" bool,
"mini_mental_state_examination_mmse" int,
"memory_box" float,
"body_weight" float,
"neutrophil_count" int,
"moca_score" int,
"severe_dementia" bool,
"dementia" bool,
"macular_degeneration" bool,
"diabetic_reti... | subjects with dementia must have moderate / severe dementia as preferentially defined by a documented moca score of less than 17 , or by mmse score of less than 17, within the last 12 months | SELECT * FROM table_train_144 WHERE dementia = 1 AND (moderate_dementia = 1 OR severe_dementia = 1) OR (moca_score < 17 OR mini_mental_state_examination_mmse < 17) | criteria2sql |
CREATE TABLE table_name_26 (
flight VARCHAR,
aircraft VARCHAR
) | Which flight had an aircraft of vickers viscount type 794? | SELECT flight FROM table_name_26 WHERE aircraft = "vickers viscount type 794" | sql_create_context |
CREATE TABLE table_name_12 (
goals_per_match VARCHAR,
name VARCHAR
) | What is Cha Bum-Kun's average number of goals per match? | SELECT COUNT(goals_per_match) FROM table_name_12 WHERE name = "cha bum-kun" | sql_create_context |
CREATE TABLE table_32376 (
"Season" text,
"Team" text,
"League Apps" real,
"League Goals" real,
"Cup Apps" real,
"Cup Goals" real
) | How many league apps in the season with more than 2 cup goals and more than 6 cup apps? | SELECT SUM("League Apps") FROM table_32376 WHERE "Cup Goals" > '2' AND "Cup Apps" > '6' | wikisql |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course_prerequisite (
pre_course_id ... | Which of the classes do n't have lab sessions ? | SELECT DISTINCT name, number FROM course WHERE department = 'EECS' AND has_lab = 'N' | advising |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_labitems (
row_id number,
itemid... | count how many medications patient 31260 has been prescribed in 08/last year. | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31260) AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', prescriptions.startdate) = '08' | mimic_iii |
CREATE TABLE table_19130829_4 (
team__number2 VARCHAR,
team__number1 VARCHAR
) | What's team #2 in the round where team $1 is Ilisiakos? | SELECT team__number2 FROM table_19130829_4 WHERE team__number1 = "Ilisiakos" | sql_create_context |
CREATE TABLE table_17062 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"MLB Draft" text
) | How many schools did Mike Jones attend? | SELECT COUNT("School") FROM table_17062 WHERE "Player" = 'Mike Jones' | wikisql |
CREATE TABLE Bookings (
booking_id INTEGER,
customer_id INTEGER,
booking_status_code VARCHAR(10),
returned_damaged_yn VARCHAR(40),
booking_start_date DATETIME,
booking_end_date DATETIME,
count_hired VARCHAR(40),
amount_payable DECIMAL(19,4),
amount_of_discount DECIMAL(19,4),
amou... | Take the first name of all the good customers as the X-axis and gender of all the good customers as Y-axis in a bar chart, list by the Y in asc. | SELECT first_name, gender_mf FROM Customers WHERE good_or_bad_customer = 'good' ORDER BY gender_mf | nvbench |
CREATE TABLE table_39123 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | What is the highest position of the team with an against of 12, less than 11 points, more than 2 drawn, and more than 9 played? | SELECT MAX("Position") FROM table_39123 WHERE "Against" = '12' AND "Points" < '11' AND "Drawn" > '2' AND "Played" > '9' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate n... | what was the first time that patient 016-9636 had a minimum sao2 today? | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-9636')) AND NOT vitalperiodic.sao2 IS NULL AND ... | eicu |
CREATE TABLE table_2589 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
) | What's the season number of the episode with series number 84? | SELECT MIN("No. in season") FROM table_2589 WHERE "No. in series" = '84' | wikisql |
CREATE TABLE table_name_14 (
category VARCHAR,
year VARCHAR
) | What category was in 1964? | SELECT category FROM table_name_14 WHERE year = 1964 | sql_create_context |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 把2000年2月4日到2011年8月12日期间患者方芳芳一共在医院看过多少次病查看一下 | SELECT (SELECT COUNT(*) 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 = '方芳芳' AND wdmzjzjlb.JZKSRQ BETWEEN '2000-02-04' AND '2011-08-12' UNION SELECT COUNT(*) FROM p... | css |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
... | when did patient 51858 receive his/her last prescription for felodipine since 12/2105? | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 51858) AND prescriptions.drug = 'felodipine' AND STRFTIME('%y-%m', prescriptions.startdate) >= '2105-12' ORDER BY prescriptions.startdate DESC LIMIT 1 | mimic_iii |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE restriction (
restriction_code text,
advance_purc... | please show me all the flights from DENVER to OAKLAND that are nonstop | 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 = 'OAKLAN... | atis |
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... | 在2004年9月3日到2009年3月8日这段时间里,参保人魏初雪门诊手术费用了多少钱? | SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '魏初雪' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2004-09-03' AND '2009-03-08' AND t_kc22.MED_INV_ITEM_TYPE = '手术费' | css |
CREATE TABLE table_25580292_13 (
aggressive_rider VARCHAR,
winner VARCHAR
) | Who was the aggressive rider when the winner was luis le n s nchez? | SELECT aggressive_rider FROM table_25580292_13 WHERE winner = "Luis León Sánchez" | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellv... | what was patient 004-87703 last diagnosis time of respiratory acidosis during this year. | SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-87703')) AND diagnosis.diagnosisname = 'respiratory acidosis'... | eicu |
CREATE TABLE table_58049 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Where was the game held when the home team scored 12.21 (93)? | SELECT "Venue" FROM table_58049 WHERE "Home team score" = '12.21 (93)' | wikisql |
CREATE TABLE table_40680 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the total of rank when gold is 2 and total is more than 4? | SELECT SUM("Rank") FROM table_40680 WHERE "Gold" = '2' AND "Total" > '4' | wikisql |
CREATE TABLE table_name_7 (
position VARCHAR,
height VARCHAR
) | What is the Position of the player with a Height off 188cm? | SELECT position FROM table_name_7 WHERE height = "188cm" | sql_create_context |
CREATE TABLE table_name_56 (
language VARCHAR,
year VARCHAR,
role VARCHAR
) | What language is spoken after 2007 for the role of urvashi mathur? | SELECT language FROM table_name_56 WHERE year > 2007 AND role = "urvashi mathur" | sql_create_context |
CREATE TABLE table_227 (
"Week" text,
"Date" text,
"Opponent" text,
"Result" text,
"Kickoff [a ]" text,
"Game site" text,
"TV" text,
"Attendance" text,
"Record" text
) | what's the week where attendance is 77,098 | SELECT "Week" FROM table_227 WHERE "Attendance" = '77,098' | wikisql |
CREATE TABLE table_name_46 (
team_chassis VARCHAR,
year INTEGER
) | Which Team/Chassis has a Year larger than 1987? | SELECT team_chassis FROM table_name_46 WHERE year > 1987 | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutpu... | what was the name of the organism found on the last urine, voided specimen microbiology test of patient 031-24513 in 03/2104? | SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-24513')) AND microlab.culturesite = 'urine, voided specimen' AND STRF... | eicu |
CREATE TABLE table_1416 (
"Country" text,
"Freedom in the World 2013" text,
"2013 Index of Economic Freedom" text,
"2013 Press Freedom Index" text,
"2012 Democracy Index" text
) | How many freedom indices does the country of Austria have? | SELECT COUNT("2013 Press Freedom Index") FROM table_1416 WHERE "Country" = 'Austria' | 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... | 从03年5月3日开始到09年5月24日结束患者45065975被开出的所有检验报告单的检验报告单号能否列出来? | SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info... | css |
CREATE TABLE table_47057 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | What was the score for the golfer from the country of fiji? | SELECT COUNT("Score") FROM table_47057 WHERE "Country" = 'fiji' | 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
)
... | provide the number of patients whose drug code is rosi8. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "ROSI8" | mimicsql_data |
CREATE TABLE table_12327 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | Where is Eduardo Romero from? | SELECT "Country" FROM table_12327 WHERE "Player" = 'eduardo romero' | wikisql |
CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE weather (
date TEXT,
... | A line chart for what are the number of the dates with a maximum temperature higher than 85?, rank by the X from low to high. | SELECT date, COUNT(date) FROM weather WHERE max_temperature_f > 85 GROUP BY date ORDER BY date | nvbench |
CREATE TABLE table_name_93 (
school_club_team VARCHAR,
player VARCHAR
) | What is Michael Stewart's school or club team? | SELECT school_club_team FROM table_name_93 WHERE player = "michael stewart" | sql_create_context |
CREATE TABLE table_29273182_1 (
title VARCHAR,
no_in_series VARCHAR
) | What is the name of episode number 29 in the series? | SELECT title FROM table_29273182_1 WHERE no_in_series = 29 | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | give me the number of patients whose admission location is phys referral/normal deli and lab test fluid is pleural? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND lab.fluid = "Pleural" | mimicsql_data |
CREATE TABLE table_name_26 (
attendance INTEGER,
home_team VARCHAR
) | What is the lowest Attendance, when Home Team is 'Welling United'? | SELECT MIN(attendance) FROM table_name_26 WHERE home_team = "welling united" | sql_create_context |
CREATE TABLE table_15652027_1 (
extortion_theft_3 VARCHAR,
united_nations_mission VARCHAR
) | What is the extortion and theft rates where the United Nations Observer Mission Uganda-Rwanda is active? | SELECT extortion_theft_3 FROM table_15652027_1 WHERE united_nations_mission = "United Nations Observer Mission Uganda-Rwanda" | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
... | when did patient 012-39576 get discharged from the hospital in 2102 for the first time? | SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '012-39576' AND STRFTIME('%y', patient.hospitaldischargetime) = '2102' ORDER BY patient.hospitaldischargetime LIMIT 1 | eicu |
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 demographic ... | to how many patients was the drug maalox/diphenhydramine/lidocaine administered via po route? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Maalox/Diphenhydramine/Lidocaine" AND prescriptions.route = "PO" | mimicsql_data |
CREATE TABLE table_55106 (
"Team" text,
"City/Area" text,
"Arena" text,
"Capacity" text,
"Last season" text
) | Which arena has a capactiy of 1,100? | SELECT "Arena" FROM table_55106 WHERE "Capacity" = '1,100' | wikisql |
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... | 就诊结算日期在15年3月3日到15年9月1日期间的患者苗飞章的所有医疗就诊记录编号是哪些? | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '苗飞章' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2015-03-03' AND '2015-09-01' | css |
CREATE TABLE Stores (
Store_ID VARCHAR(100),
Address_ID INTEGER,
Marketing_Region_Code CHAR(15),
Store_Name VARCHAR(255),
Store_Phone VARCHAR(255),
Store_Email_Address VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Products (
Product_ID VARCHAR(100),
Product_Name VARCHAR(25... | Give me the number of the descriptions of the service types that cost more than 100, I want to sort in desc by the Y-axis. | SELECT Service_Type_Description, COUNT(Service_Type_Description) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100 GROUP BY Service_Type_Description ORDER BY COUNT(Service_Type_Description) DESC | nvbench |
CREATE TABLE table_22297198_3 (
replaced_by VARCHAR,
date_of_vacancy VARCHAR
) | Who was the replacement manager for the vacancy of 12 Dec 2009? | SELECT replaced_by FROM table_22297198_3 WHERE date_of_vacancy = "12 Dec 2009" | sql_create_context |
CREATE TABLE table_name_89 (
home_team VARCHAR,
away_team VARCHAR
) | Who did Collingwood play at home? | SELECT home_team FROM table_name_89 WHERE away_team = "collingwood" | sql_create_context |
CREATE TABLE table_13643320_2 (
rnd VARCHAR,
gtp_winning_team VARCHAR,
gto_winning_team VARCHAR
) | What us the number of the round during which #56 Blue Thunder Racing become the GTP winning team and #38 Mandeville Auto Tech became the GTO winning team? | SELECT rnd FROM table_13643320_2 WHERE gtp_winning_team = "#56 Blue Thunder Racing" AND gto_winning_team = "#38 Mandeville Auto Tech" | 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... | 对于患者22354212的医疗记录中医疗费总额不少于4694.23元的入院诊断疾病的编码和名称都是什么呀? | SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '22354212' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 4694.23) | css |
CREATE TABLE table_name_13 (
agg VARCHAR
) | What is the 1st leg of the team with a 2-1 agg.? | SELECT 1 AS st_leg FROM table_name_13 WHERE agg = "2-1" | sql_create_context |
CREATE TABLE table_3202 (
"Team" text,
"#" real,
"Car Sponsor(s)" text,
"Driver(s)" text,
"Listed Owner(s)" text,
"Engine" text,
"Chassis" text
) | Who is the driver of the Chevrolet engine that is sponsored by godaddy.com? | SELECT "Driver(s)" FROM table_3202 WHERE "Engine" = 'Chevrolet' AND "Car Sponsor(s)" = 'GoDaddy.com' | wikisql |
CREATE TABLE table_58776 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | Which Time/Retired has Laps smaller than 14, and a Rider of darren barton? | SELECT "Time/Retired" FROM table_58776 WHERE "Laps" < '14' AND "Rider" = 'darren barton' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.