context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_9173 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | Which Tie no that has an Away team of altrincham? | SELECT "Tie no" FROM table_9173 WHERE "Away team" = 'altrincham' | wikisql |
CREATE TABLE table_name_35 (
to_par VARCHAR,
score VARCHAR
) | What is the To Par that has a 69-69-73=211 score? | SELECT to_par FROM table_name_35 WHERE score = 69 - 69 - 73 = 211 | sql_create_context |
CREATE TABLE table_24319661_5 (
production_code VARCHAR,
directed_by VARCHAR
) | What as the production code for the episode directed by Robert Duncan McNeill? | SELECT production_code FROM table_24319661_5 WHERE directed_by = "Robert Duncan McNeill" | sql_create_context |
CREATE TABLE table_31466 (
"Rank" real,
"Rider" text,
"Sat 20 Aug" text,
"Mon 22 Aug" text,
"Tues 23 Aug" text,
"Wed 24 Aug" text,
"Thurs 25 Aug" text,
"Fri 26 Aug" text
) | What shows for mon 22 aug whenwed 24 aug is 19' 56.16 113.553mph? | SELECT "Mon 22 Aug" FROM table_31466 WHERE "Wed 24 Aug" = '19'' 56.16 113.553mph' | wikisql |
CREATE TABLE table_204_787 (
id number,
"year" number,
"category" text,
"nominee(s)" text,
"episode" text,
"result" text
) | which year was he nominated for cheers : the motion picture . | SELECT "year" FROM table_204_787 WHERE "episode" = '"cheers: the motion picture"' | squall |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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,
... | give the number of patients whose diagnosis icd9 code is v4987. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "V4987" | mimicsql_data |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
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 num... | how many days have elapsed since patient 6170 first received an intake of po intake on the current intensive care unit visit? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 6170) AND icustays.outtime IS NULL) A... | mimic_iii |
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... | Get me the drug code and route of administration for Isosorbide Dinitrate. | SELECT prescriptions.formulary_drug_cd, prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Isosorbide Dinitrate" | mimicsql_data |
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... | 患者的门诊诊断为疾病C26.768的检测指标680382的参考值范围下限和上限是什么? | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JYZBLSH AND jybgb_jyjgzbb.jyjgzbb_id ... | css |
CREATE TABLE table_27539535_7 (
record VARCHAR,
february VARCHAR
) | What was the team's rcord on february 1? | SELECT record FROM table_27539535_7 WHERE february = 1 | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE lab (
la... | until 2104, when did patient 016-14220 go to the hospital for the first time? | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '016-14220' AND STRFTIME('%y', patient.hospitaladmittime) <= '2104' ORDER BY patient.hospitaladmittime LIMIT 1 | eicu |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Give me the comparison about Team_ID over the All_Neutral by a bar chart, and show from low to high by the bar. | SELECT All_Neutral, Team_ID FROM basketball_match ORDER BY All_Neutral | nvbench |
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,
... | TOP Stackoverflow users from Kerala with reputation higher than 200. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%kerala%' AND Reputation >= 200 ORDER BY Reputation DESC | sede |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
... | when did patient 9801 first had the drain out #2 jp lateral output? | SELECT outputevents.charttime FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9801)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'drain... | mimic_iii |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
Pos... | All questions tagged CSS and HTML (in this order; and nothing else). | SELECT Id AS "post_link", Tags, CreationDate FROM Posts WHERE PostTypeId = 1 AND Tags = '<css><html>' ORDER BY CreationDate DESC LIMIT 100 | sede |
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE... | Give me the comparison about meter_100 over the meter_300 , and display in desc by the Y. | SELECT meter_300, meter_100 FROM swimmer ORDER BY meter_100 DESC | nvbench |
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),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... | For all employees who have the letters D or S in their first name, give me the comparison about the sum of department_id over the job_id , and group by attribute job_id, and show in descending by the X-axis. | SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID DESC | nvbench |
CREATE TABLE table_train_33 (
"id" int,
"active_infection" bool,
"allergy_to_thiamine" bool,
"receiving_vasopressor" bool,
"liver_disease" bool,
"allergy_to_vitamin_c" bool,
"allergy_to_hydrocortisone" bool,
"hypertension" bool,
"age" float,
"serum_aminotransferase_level_alt_ast"... | hypotensive requiring vasopressors | SELECT * FROM table_train_33 WHERE hypertension = 1 AND receiving_vasopressor = 1 | criteria2sql |
CREATE TABLE table_30224 (
"Series #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
) | What is the series number for the episode with production code bdf109? | SELECT "Series #" FROM table_30224 WHERE "Production code" = 'BDF109' | wikisql |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE dual_carrier (
main_airline varchar,... | how long is a trip from PHILADELPHIA airport to downtown PHILADELPHIA | SELECT DISTINCT AIRPORT_SERVICE_0.minutes_distant FROM airport, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1 WHERE airport.airport_code = AIRPORT_SERVICE_0.airport_code AND airport.airport_code = AIRPORT_SERVICE_1.airport_code AND CITY_0.city_code = AIRPORT_... | atis |
CREATE TABLE table_6080 (
"Image" text,
"Father" text,
"Birth" text,
"Ceased to be Duchess" text,
"Death" text,
"Husband" text
) | Which image is of the woman married to william iv? | SELECT "Image" FROM table_6080 WHERE "Husband" = 'william iv' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wa... | what number of patients were diagnosed with copd and did not return to the hospital within 2 months until 2104? | SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'copd' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104') AS t1) - (SELECT COUNT(DISTINCT t2.uniq... | eicu |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id numb... | count the number of people that died after being diagnosed with hyperpotassemia within 2 months until 2104. | SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_di... | mimic_iii |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
... | Strunk & White and Copy Editor Progress. Counts the number of edits a user has made. | SELECT COUNT(*) FROM Posts WHERE PostTypeId = 1 AND LastEditorUserId = @UserId AND OwnerUserId != @UserId | sede |
CREATE TABLE body_builder (
body_builder_id number,
people_id number,
snatch number,
clean_jerk number,
total number
)
CREATE TABLE people (
people_id number,
name text,
height number,
weight number,
birth_date text,
birth_place text
) | List the height and weight of people in descending order of height. | SELECT height, weight FROM people ORDER BY height DESC | spider |
CREATE TABLE buildings (
id number,
name text,
city text,
height number,
stories number,
status text
)
CREATE TABLE office_locations (
building_id number,
company_id number,
move_in_year number
)
CREATE TABLE companies (
id number,
name text,
headquarters text,
indu... | What are the maximum and minimum sales of the companies whose industries are not 'Banking'. | SELECT MAX(sales_billion), MIN(sales_billion) FROM companies WHERE industry <> "Banking" | spider |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE days (
days_code varchar,
day_name varchar... | what are the UA flights between BALTIMORE and DENVER on 8 12 | 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, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND date_day.day_number = 12 AND date_day.month_number = 8 AND d... | atis |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
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),
CO... | For all employees who have the letters D or S in their first name, show me about the correlation between salary and commission_pct in a scatter chart. | SELECT SALARY, COMMISSION_PCT FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | nvbench |
CREATE TABLE table_61375 (
"Name" text,
"Street address" text,
"Years as tallest" text,
"Height ft (m)" text,
"Floors" real
) | What is the Name of the Building at 100 North Tampa Street? | SELECT "Name" FROM table_61375 WHERE "Street address" = '100 north tampa street' | wikisql |
CREATE TABLE table_name_23 (
to_par VARCHAR,
place VARCHAR,
score VARCHAR
) | What is the Top that has a 66-71-66=203 score and a place of t1? | SELECT to_par FROM table_name_23 WHERE place = "t1" AND score = 66 - 71 - 66 = 203 | 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... | provide the number of patients whose age is less than 45 and procedure long title is procedure on two vessels? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "45" AND procedures.long_title = "Procedure on two vessels" | mimicsql_data |
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,
... | Posts with more then 1000 votes on SQA&T. | SELECT * FROM Posts AS p WHERE p.Score > 1000 | sede |
CREATE TABLE table_24124 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Black Knights points" real,
"Opponents" real,
"Record" text
) | Name the opponents for record of 2-1 | SELECT "Opponents" FROM table_24124 WHERE "Record" = '2-1' | wikisql |
CREATE TABLE table_name_55 (
method VARCHAR,
location VARCHAR
) | What is the Method for Brazil? | SELECT method FROM table_name_55 WHERE location = "brazil" | sql_create_context |
CREATE TABLE table_46144 (
"Title" text,
"Author" text,
"ISBN UK" text,
"ISBN US" text,
"TV companions featured" text
) | What is TV Companions Featured, when Author is 'William Emms'? | SELECT "TV companions featured" FROM table_46144 WHERE "Author" = 'william emms' | wikisql |
CREATE TABLE table_name_46 (
not_usable INTEGER,
retired VARCHAR,
launch_failures VARCHAR
) | What is the average number of not usable satellited when there are 0 retired, and the launch failures are less than 1? | SELECT AVG(not_usable) FROM table_name_46 WHERE retired = 0 AND launch_failures < 1 | sql_create_context |
CREATE TABLE table_name_19 (
date VARCHAR,
home_team VARCHAR
) | What is the date for home team Collingwood? | SELECT date FROM table_name_19 WHERE home_team = "collingwood" | sql_create_context |
CREATE TABLE table_27902171_5 (
team VARCHAR,
location_attendance VARCHAR
) | What is every team with location attendance of Arco Arena 17,014? | SELECT team FROM table_27902171_5 WHERE location_attendance = "ARCO Arena 17,014" | sql_create_context |
CREATE TABLE table_26615633_3 (
media_debut VARCHAR,
species VARCHAR
) | what is the media debut for the asian black bear? | SELECT media_debut FROM table_26615633_3 WHERE species = "Asian black bear" | sql_create_context |
CREATE TABLE table_15948 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 5" real,
"Top 10" real,
"Poles" real,
"Avg. Start" text,
"Avg. Finish" text,
"Winnings" text,
"Position" text,
"Team(s)" text
) | How many starts did Hendrick motorsports have? | SELECT MIN("Starts") FROM table_15948 WHERE "Team(s)" = 'Hendrick Motorsports' | wikisql |
CREATE TABLE table_2561 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 5" real,
"Top 10" real,
"Poles" real,
"Avg. Start" text,
"Avg. Finish" text,
"Winnings" text,
"Position" text,
"Team(s)" text
) | How many top 5s when he was on team #28/#49 jay robinson racing? | SELECT MAX("Top 5") FROM table_2561 WHERE "Team(s)" = '#28/#49 Jay Robinson Racing' | wikisql |
CREATE TABLE table_name_8 (
team VARCHAR,
make VARCHAR,
driver VARCHAR
) | What team does bobby hillin jr. (r) drive a buick regal for? | SELECT team FROM table_name_8 WHERE make = "buick regal" AND driver = "bobby hillin jr. (r)" | sql_create_context |
CREATE TABLE table_name_21 (
rank VARCHAR,
premiere VARCHAR
) | What is the rank for the episode that premiered on September 13, 1978? | SELECT rank FROM table_name_21 WHERE premiere = "september 13, 1978" | sql_create_context |
CREATE TABLE player (
Player_ID int,
Player text,
Years_Played text,
Total_WL text,
Singles_WL text,
Doubles_WL text,
Team int
)
CREATE TABLE country (
Country_id int,
Country_name text,
Capital text,
Official_native_language text
)
CREATE TABLE team (
Team_id int,
... | Give me a bar chart for the total number of each position, display bars from low to high order please. | SELECT Position, COUNT(*) FROM match_season GROUP BY Position ORDER BY Position | nvbench |
CREATE TABLE table_name_69 (
col__m_ INTEGER,
peak VARCHAR,
elevation__m_ VARCHAR
) | Whta is the lowest col in m of gerlachovsk t t peak, which has an elevation greater than 2,655 m? | SELECT MIN(col__m_) FROM table_name_69 WHERE peak = "gerlachovský štít" AND elevation__m_ > 2 OFFSET 655 | sql_create_context |
CREATE TABLE grants (
grant_id number,
organisation_id number,
grant_amount number,
grant_start_date time,
grant_end_date time,
other_details text
)
CREATE TABLE projects (
project_id number,
organisation_id number,
project_details text
)
CREATE TABLE project_outcomes (
project... | When did researchers start and stop working? | SELECT date_from, date_to FROM project_staff WHERE role_code = 'researcher' | spider |
CREATE TABLE table_203_675 (
id number,
"match" number,
"date" text,
"round" text,
"home/away" text,
"opponent team" text,
"score" text,
"scorers" text
) | what was the average score between matches 1 and 2 ? | SELECT "score" FROM table_203_675 WHERE "match" = 1 | squall |
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
) | Find the name and training hours of players whose hours are below 1500. | SELECT pname, hs FROM player WHERE hs < 1500 | spider |
CREATE TABLE table_name_48 (
pilot VARCHAR,
weapon VARCHAR,
date VARCHAR
) | What is Pilot, when Weapon is '35mm fire', and when Date is '4 May 1982'? | SELECT pilot FROM table_name_48 WHERE weapon = "35mm fire" AND date = "4 may 1982" | sql_create_context |
CREATE TABLE table_46779 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Record" text
) | Can you tell me the Game that has the Opponent of miami heat? | SELECT "Game" FROM table_46779 WHERE "Opponent" = 'miami heat' | wikisql |
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 lab (
subject_id text,
hadm_id text,
... | what is the number of patients whose gender is f and item id is 51458? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "F" AND lab.itemid = "51458" | mimicsql_data |
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 cost (
costid number,
uniquepid text,... | when was the last time since 06/04/2103 patient 022-76925 heartrate was measured/taken? | 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 = '022-76925')) AND NOT vitalperiodic.heartrate IS NUL... | eicu |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime... | calculate the total of patient 008-46802's input until 11/07/2104. | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '008-46802')) AND intakeoutput.cellpath LIKE '%in... | eicu |
CREATE TABLE table_76556 (
"Sambalpuri Cinema" text,
"Kosal" text,
"Western Odisha" text,
"Sitalsasthi Carnival" text,
"Sambalpuri Language" text,
"Sambalpuri Saree" text
) | What is the Kosal with a balangir town sitalsasthi carnival? | SELECT "Kosal" FROM table_76556 WHERE "Sitalsasthi Carnival" = 'balangir town' | wikisql |
CREATE TABLE table_53911 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | What is Rhett Mclane's highest pick number? | SELECT MAX("Pick #") FROM table_53911 WHERE "Player" = 'rhett mclane' | wikisql |
CREATE TABLE Student_Addresses (
student_id INTEGER,
address_id INTEGER,
date_address_from DATETIME,
date_address_to DATETIME,
monthly_rental DECIMAL(19,4),
other_details VARCHAR(255)
)
CREATE TABLE Assessment_Notes (
notes_id INTEGER,
student_id INTEGER,
teacher_id INTEGER,
dat... | Draw a pie chart about the proportion of other_details and the amount of other_details. | SELECT other_details, COUNT(other_details) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE building (
building_id text,
name text,
street_address text,
years_as_tallest text,
height_feet number,
floors number
)
CREATE TABLE protein (
common_name text,
protein_name text,
divergence_from_human_lineage number,
accession_number text,
sequence_length numbe... | What are the average, maximum, and minimum number of floors for all buildings? | SELECT AVG(floors), MAX(floors), MIN(floors) FROM building | spider |
CREATE TABLE table_60896 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real
) | What is Country, when Total is less than 148, and when Player is 'Gary Player'? | SELECT "Country" FROM table_60896 WHERE "Total" < '148' AND "Player" = 'gary player' | wikisql |
CREATE TABLE table_name_46 (
total VARCHAR,
rank VARCHAR,
gold VARCHAR
) | What is the sum of total with a Rank larger than 12, and a Gold larger than 4? | SELECT COUNT(total) FROM table_name_46 WHERE rank > 12 AND gold > 4 | sql_create_context |
CREATE TABLE table_64391 (
"Position" real,
"Name" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Points" real
) | What is the sum of matches played for teams with more than 10 losses and under 5 points? | SELECT SUM("Played") FROM table_64391 WHERE "Lost" > '10' AND "Points" < '5' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | Among patients with sigmoid diverticulitis, colovestical fistula/sda as primary disease, how many of them were born before 2073? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "SIGMOID DIVERTICULITIS, COLOVESTICAL FISTULA/SDA" AND demographic.dob_year < "2073" | mimicsql_data |
CREATE TABLE table_name_13 (
director VARCHAR,
role VARCHAR
) | Who was the director where the role was Fred Ayres? | SELECT director FROM table_name_13 WHERE role = "fred ayres" | sql_create_context |
CREATE TABLE culture_company (
company_name text,
type text,
incorporated_in text,
group_equity_shareholding number,
book_club_id text,
movie_id text
)
CREATE TABLE movie (
movie_id number,
title text,
year number,
director text,
budget_million number,
gross_worldwide nu... | Which publishers did not publish a book in 1989? | SELECT publisher FROM book_club EXCEPT SELECT publisher FROM book_club WHERE year = 1989 | spider |
CREATE TABLE table_29289372_1 (
population__2010_ VARCHAR,
income_classification VARCHAR,
city_municipality VARCHAR
) | When itogon, benguet is the city/municipality and 1st class is the income classification how many measurements of population in 2010? | SELECT COUNT(population__2010_) FROM table_29289372_1 WHERE income_classification = "1st Class" AND city_municipality = "Itogon, Benguet" | sql_create_context |
CREATE TABLE table_77034 (
"Position" real,
"Driver / Passenger" text,
"Equipment" text,
"Points" real,
"Wins" text,
"Second" text,
"Third" text
) | Who was the driver/passengar when the position was smaller than 8, the third was 1, and there was 1 win? | SELECT "Driver / Passenger" FROM table_77034 WHERE "Third" = '1' AND "Position" < '8' AND "Wins" = '1' | 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,
... | Count the number of patients with brain mass intracranial hemorrhage as their primary disease who were hospitalized for more than 2 days. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" AND demographic.days_stay > "2" | mimicsql_data |
CREATE TABLE table_26786 (
"Rank (2008)" real,
"Federal Subjects" text,
"Russian Name" text,
"2008 (RUB)" real,
"2008 (USD)" real,
"2007 (RUB)" real,
"2007 (USD)" real,
"2005 (RUB)" real,
"2005 (USD)" real
) | What is the 2008 USD figure for the subject with 2849 USD in 2005? | SELECT "2008 (USD)" FROM table_26786 WHERE "2005 (USD)" = '2849' | 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,... | 查一下6673315这个医疗机构在零六年五月二十一到一二年八月四号的统筹金额消耗量 | SELECT SUM(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '6673315' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2006-05-21' AND '2012-08-04' | css |
CREATE TABLE table_204_670 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"record" text,
"attendance" number
) | which is the previous attendance for week 10 | SELECT "attendance" FROM table_204_670 WHERE "week" = 10 - 1 | squall |
CREATE TABLE table_24172157_3 (
date_of_vacancy VARCHAR,
table VARCHAR,
team VARCHAR
) | What is the date of vacancy for the Liverpool team with a table named pre-season? | SELECT date_of_vacancy FROM table_24172157_3 WHERE table = "Pre-season" AND team = "Liverpool" | sql_create_context |
CREATE TABLE table_name_87 (
net_yards INTEGER,
yards_per_attempt VARCHAR,
touchdowns VARCHAR,
attempts VARCHAR
) | What are the average net yards that have 9 as the touchdowns, 145 as the attempts, and yards per attempt greater than 4.8? | SELECT AVG(net_yards) FROM table_name_87 WHERE touchdowns = 9 AND attempts = 145 AND yards_per_attempt > 4.8 | sql_create_context |
CREATE TABLE table_22713796_14 (
stage VARCHAR,
mountains_classification VARCHAR
) | Name the total number of stage for lloyd mondory | SELECT COUNT(stage) FROM table_22713796_14 WHERE mountains_classification = "Lloyd Mondory" | sql_create_context |
CREATE TABLE college (
cname text,
state text,
enr number
)
CREATE TABLE player (
pid number,
pname text,
ycard text,
hs number
)
CREATE TABLE tryout (
pid number,
cname text,
ppos text,
decision text
) | Find the name and hours of the students whose tryout decision is yes. | SELECT T1.pname, T1.hs FROM player AS T1 JOIN tryout AS T2 ON T1.pid = T2.pid WHERE T2.decision = 'yes' | spider |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
... | how much is the average cost for a hospital that contains ciprofloxacin hcl until 2101? | SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'ciprofloxacin hcl') AND STRFTIME('%y', cost.chargetime) <= '2101' GROUP BY cost.hadm_id) AS t1 | mimic_iii |
CREATE TABLE table_44245 (
"Fin. Pos" text,
"Car No." text,
"Driver" text,
"Team" text,
"Laps" text,
"Time/Retired" text,
"Grid" text,
"Laps Led" text,
"Points" text
) | Which Team has Points of 15? | SELECT "Team" FROM table_44245 WHERE "Points" = '15' | wikisql |
CREATE TABLE table_33532 (
"Network" text,
"Origin of Programming" text,
"Language" text,
"Genre" text,
"Service" text
) | Which service does the network of atn urdu offer? | SELECT "Service" FROM table_33532 WHERE "Network" = 'atn urdu' | wikisql |
CREATE TABLE table_name_40 (
owner VARCHAR,
format VARCHAR
) | What is the Owner of the Frequency with a Format of First Nations Community Radio? | SELECT owner FROM table_name_40 WHERE format = "first nations community radio" | sql_create_context |
CREATE TABLE table_name_43 (
event VARCHAR,
notes VARCHAR
) | Which event has notes of women +60kg quarterfinal? | SELECT event FROM table_name_43 WHERE notes = "women +60kg quarterfinal" | sql_create_context |
CREATE TABLE table_1888165_1 (
Otl INTEGER,
PCt VARCHAR
) | If the PCT is 0.514, what was the minimum OTL? | SELECT MIN(Otl) FROM table_1888165_1 WHERE PCt = 0.514 | sql_create_context |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 是否所有的费用明细项目都结算好了,就是72791261819的那次医疗就诊 | SELECT (SELECT SUM(t_kc22.STA_FLG) FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '72791261819') = (SELECT COUNT(*) FROM t_kc22 WHERE t_kc21_t_kc22.MED_CLINIC_ID = '72791261819') | css |
CREATE TABLE table_42721 (
"Outcome" text,
"Date" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
) | What is the Outcome when christophe rochus was partner, on 31 july 2005? | SELECT "Outcome" FROM table_42721 WHERE "Partner" = 'christophe rochus' AND "Date" = '31 july 2005' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TA... | how many patients were diagnosed with breast ca - female in the same hospital visit during the last year following the first diagnosis of pleural effusion? | 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 = 'breast ca - female' AND DATETIME(diagnosis.diagnosistime, 'start of year'... | eicu |
CREATE TABLE table_34609 (
"Date" text,
"Label" text,
"Region" text,
"Format" text,
"Catalog" text
) | what is the format of catalog 865 821-1? | SELECT "Format" FROM table_34609 WHERE "Catalog" = '865 821-1' | wikisql |
CREATE TABLE table_203_22 (
id number,
"draw" number,
"artist" text,
"song" text,
"points" number,
"place" text
) | what is the total amount of points for florencia ? | SELECT "points" FROM table_203_22 WHERE "artist" = 'florencia' | squall |
CREATE TABLE table_68405 (
"Tournament" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"Win %" text
) | What shows for 2009 when 25 shows for 2011? | SELECT "2009" FROM table_68405 WHERE "2011" = '25' | wikisql |
CREATE TABLE table_name_74 (
island VARCHAR,
summit VARCHAR
) | What's the island with a summit of Haleakal ? | SELECT island FROM table_name_74 WHERE summit = "haleakalā" | sql_create_context |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD ... | 按照不同的科室编码和不同的入院诊断疾病名称,整理出医院9146406所有医疗就诊记录中患者的平均年龄是多少岁 | SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '9146406' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM | css |
CREATE TABLE table_name_51 (
heat INTEGER,
time VARCHAR,
name VARCHAR,
nationality VARCHAR,
rank VARCHAR
) | What was the lowest heat for Germany with a rank smaller than 9 for Mike Fenner and a time smaller than 13.52? | SELECT MIN(heat) FROM table_name_51 WHERE nationality = "germany" AND rank < 9 AND name = "mike fenner" AND time < 13.52 | sql_create_context |
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 procedures (
... | provide the number of patients whose diagnoses short title is hx tia/stroke w/o resid and drug name is warfarin? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Hx TIA/stroke w/o resid" AND prescriptions.drug = "Warfarin" | mimicsql_data |
CREATE TABLE table_27756474_6 (
high_assists VARCHAR,
location_attendance VARCHAR
) | Name the total number of high assists for fedexforum 11,283 | SELECT COUNT(high_assists) FROM table_27756474_6 WHERE location_attendance = "FedExForum 11,283" | sql_create_context |
CREATE TABLE table_name_92 (
us VARCHAR,
year VARCHAR
) | What is the U.S. Christian with a Year that is 1989? | SELECT us AS Christian FROM table_name_92 WHERE year = 1989 | sql_create_context |
CREATE TABLE table_20649850_1 (
college VARCHAR,
player VARCHAR
) | Where did aaron wagner go to college | SELECT college FROM table_20649850_1 WHERE player = "Aaron Wagner" | 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... | 编号为28349097的病患的检验报告单的报告日期在15年4月17日之后的是哪些住院就诊的?列出流水号 | SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND pers... | css |
CREATE TABLE table_29714 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Table" text,
"Incoming manager" text,
"Date of appointment" text
) | How many dates of vacancy were on 30 october 2010? | SELECT COUNT("Team") FROM table_29714 WHERE "Date of vacancy" = '30 October 2010' | wikisql |
CREATE TABLE club (
clubid number,
clubname text,
clubdesc text,
clublocation text
)
CREATE TABLE member_of_club (
stuid number,
clubid number,
position text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advis... | What are the first name and last name of each male member in club 'Hopkins Student Enterprises'? | SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Hopkins Student Enterprises" AND t3.sex = "M" | spider |
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,
... | 在医疗机构6451963住过超过15天院的病人有多少? | SELECT COUNT(DISTINCT hz_info.RYBH) FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE zyjzjlb.YLJGDM = '6451963' AND DATEDIFF(zyjzjlb.CYSJ, zyjzjlb.RYSJ) > 15 | css |
CREATE TABLE table_5317 (
"Player" text,
"Position" text,
"Date of Birth (Age)" text,
"Caps" real,
"Club/province" text
) | Which Player has a Position of number 8, and a Club/province of scarlets? | SELECT "Player" FROM table_5317 WHERE "Position" = 'number 8' AND "Club/province" = 'scarlets' | wikisql |
CREATE TABLE table_37949 (
"Tournament" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text
) | Which 2008 had a 1998 and 2006 that were a when 2009 was sf? | SELECT "2008" FROM table_37949 WHERE "1998" = 'a' AND "2009" = 'sf' AND "2006" = 'a' | wikisql |
CREATE TABLE table_name_57 (
opponent VARCHAR,
record VARCHAR
) | Who is the opponent the Seattle Seahawks played when their record was 1-3? | SELECT opponent FROM table_name_57 WHERE record = "1-3" | sql_create_context |
CREATE TABLE table_name_43 (
phoneme VARCHAR,
nuskhuri VARCHAR
) | What is the Phoneme symbol for in Nuskhuri? | SELECT phoneme FROM table_name_43 WHERE nuskhuri = "ⴥ" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.