instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_82 (
winner VARCHAR,
prize VARCHAR,
runner_up VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Winner, when Prize is ' 50,000', and when Runner-Up is 'Korosh Nejad'?
| SELECT winner FROM table_name_82 WHERE prize = "£50,000" AND runner_up = "korosh nejad" | sql_create_context |
CREATE TABLE table_204_163 (
id number,
"airline" text,
"icao" text,
"iata" text,
"callsign" text,
"commenced\noperations" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what other airline commenced operations the same year as eagle air ?
| SELECT "airline" FROM table_204_163 WHERE "airline" <> 'eagle air' AND "commenced\noperations" = (SELECT "commenced\noperations" FROM table_204_163 WHERE "airline" = 'eagle air') | squall |
CREATE TABLE table_name_91 (
nation VARCHAR,
bronze VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which nation had 3 bronze?
| SELECT nation FROM table_name_91 WHERE bronze = 3 | sql_create_context |
CREATE TABLE table_name_27 (
team_2 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 1st leg for team 2 Portol Drac Palma Mallorca?
| SELECT 1 AS st_leg FROM table_name_27 WHERE team_2 = "portol drac palma mallorca" | sql_create_context |
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 Users (
Id number,
Reputation number,... | SELECT Posts.Id AS "post_link", Posts.Id, Posts.Score, Tags.TagName AS "tagname" FROM Posts INNER JOIN PostTags ON PostTags.PostId = Posts.Id INNER JOIN Tags ON Tags.Id = PostTags.TagId WHERE Posts.PostTypeId = 1 AND Tags.TagName = @MyTag ORDER BY Posts.Score DESC | sede |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime t... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ... | eicu |
CREATE TABLE table_61847 (
"Tournament" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2012 with A in 2009 and 2r in 2010?
| SELECT "2012" FROM table_61847 WHERE "2009" = 'a' AND "2010" = '2r' | wikisql |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT SUM(t_kc24.PER_ACC_PAY) 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 '2013-09-04' AND '2019-06-28' | 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 ... | 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 = 4269)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit... | mimic_iii |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE labevents ... | SELECT microbiologyevents.spec_type_desc FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 76327 AND admissions.dischtime IS NULL) ORDER BY microbiologyevents.charttime LIMIT 1 | mimic_iii |
CREATE TABLE table_name_21 (
area_km_2 INTEGER,
population INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Area km 2, when Population is greater than 1,395?
| SELECT MIN(area_km_2) FROM table_name_21 WHERE population > 1 OFFSET 395 | sql_create_context |
CREATE TABLE Customers (
customer_id INTEGER,
payment_method_code VARCHAR(10),
customer_code VARCHAR(20),
customer_name VARCHAR(80),
customer_address VARCHAR(255),
customer_phone VARCHAR(80),
customer_email VARCHAR(80)
)
CREATE TABLE Addresses (
address_id INTEGER,
address_details V... | SELECT payment_method_code, COUNT(*) FROM Customers GROUP BY payment_method_code ORDER BY payment_method_code | nvbench |
CREATE TABLE table_59716 (
"Initial-syllable open/semi-open unstressed vowels" text,
"17th c." text,
"American" text,
"British" text,
"Australian" text,
"Examples" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is American, when Initial-Syl... | SELECT "American" FROM table_59716 WHERE "Initial-syllable open/semi-open unstressed vowels" = 'y /aɪ, ɨ/' | wikisql |
CREATE TABLE table_27922491_8 (
matches INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the least amount of matches?
| SELECT MIN(matches) FROM table_27922491_8 | sql_create_context |
CREATE TABLE table_27257896_2 (
indians VARCHAR,
salary_range VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the salary range is 4,000-9,000, what is the Indians %?
| SELECT indians FROM table_27257896_2 WHERE salary_range = "4,000-9,000" | sql_create_context |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE T... | SELECT c.PostId AS "post_link", c.CreationDate FROM Comments AS c JOIN Posts AS a ON a.Id = c.PostId AND a.PostTypeId = 2 JOIN Posts AS q ON q.Id = a.ParentId AND q.PostTypeId = 1 WHERE (c.Text LIKE '%accept% rate%' OR c.Text LIKE '%/5234/%') ORDER BY c.CreationDate | sede |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... | SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-132801')) AND vitalperiodic.systemicsystolic BETWEEN systolic_bp... | eicu |
CREATE TABLE table_31895 (
"Heat Rank" real,
"Lane" real,
"Swimmer" text,
"Country" text,
"Time" real,
"Overall Rank" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the total number of time for luke hall overall rank being larger than 10... | SELECT COUNT("Time") FROM table_31895 WHERE "Swimmer" = 'luke hall' AND "Overall Rank" > '105' | wikisql |
CREATE TABLE table_201_29 (
id number,
"#" text,
"picture" text,
"name" text,
"took office" text,
"left office" text,
"party" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which president had the shortest term without being deposed ?
| SELECT "name" FROM table_201_29 ORDER BY JULIANDAY("left office") - JULIANDAY("took office") LIMIT 1 | squall |
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 (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2126.0" AND prescriptions.formulary_drug_cd = "D5W100" | mimicsql_data |
CREATE TABLE table_29280 (
"Position" real,
"Building" text,
"City" text,
"Height" text,
"Number of floors" real,
"Completion" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the number of floors is 70, what is the height?
| SELECT "Height" FROM table_29280 WHERE "Number of floors" = '70' | wikisql |
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
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 swimme... | SELECT meter_200, AVG(ID) FROM swimmer GROUP BY meter_200 | nvbench |
CREATE TABLE table_28887 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people won the election in the district of Virginia 4?
| SELECT COUNT("Result") FROM table_28887 WHERE "District" = 'Virginia 4' | wikisql |
CREATE TABLE member (
Member_ID int,
Name text,
Membership_card text,
Age int,
Time_of_purchase int,
Level_of_membership int,
Address text
)
CREATE TABLE happy_hour_member (
HH_ID int,
Member_ID int,
Total_amount real
)
CREATE TABLE happy_hour (
HH_ID int,
Shop_ID int,
... | SELECT Address, COUNT(*) FROM member GROUP BY Address ORDER BY Address | nvbench |
CREATE TABLE table_204_607 (
id number,
"season" number,
"date" text,
"location" text,
"discipline" text,
"place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many races were in 2010 ?
| SELECT COUNT(*) FROM table_204_607 WHERE "date" = 2010 | squall |
CREATE TABLE table_79925 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record for the date of June 14?
| SELECT "Record" FROM table_79925 WHERE "Date" = 'june 14' | wikisql |
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
... | SELECT DISTINCT department, name, number FROM course WHERE credits = 10 AND department = 'RCIDIV' AND number < 400 + 100 AND number >= 400 | advising |
CREATE TABLE table_73433 (
"P" real,
"Player" text,
"League" real,
"Scottish Cup" real,
"League Cup" real,
"Challenge Cup" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Kris doolan's league number?
| SELECT COUNT("League") FROM table_73433 WHERE "Player" = 'Kris Doolan' | wikisql |
CREATE TABLE table_32238 (
"Cyclist" text,
"Country" text,
"Team" text,
"Time" text,
"UCI ProTour Points" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Davide Rebellin' UCI ProTour Points?
| SELECT "UCI ProTour Points" FROM table_32238 WHERE "Cyclist" = 'davide rebellin' | wikisql |
CREATE TABLE table_16912 (
"Date" text,
"Tournament" text,
"Location" text,
"Purse( $ )" real,
"Winner" text,
"Score" text,
"1st Prize( $ )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score for the tournament in Michigan whe... | SELECT "Score" FROM table_16912 WHERE "Location" = 'Michigan' AND "Purse( $ )" < '1813335.221493934' | wikisql |
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... | SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Road, All_Home | nvbench |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dis... | SELECT COUNT(*) 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 = 3229)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'urine out foley' AN... | mimic_iii |
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 (SELECT COUNT(*) FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE hz_info.RYBH = '24804917' AND txmzjzjlb.JZKSRQ BETWEEN '2006-06-09' AND '2010-08-30' UNION SELECT COUNT(*) FROM hz_info JOIN ftxmzjzjlb ON hz_info.YLJGDM = ftxmzjz... | css |
CREATE TABLE table_name_88 (
label VARCHAR,
catalog VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the label with catalog of mhcl-20005
| SELECT label FROM table_name_88 WHERE catalog = "mhcl-20005" | sql_create_context |
CREATE TABLE table_19738 (
"Position" text,
"Number" text,
"Name" text,
"Height" text,
"Weight" text,
"Class" text,
"Hometown" text,
"Games\u2191" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How tall is Braxton Kelley?
| SELECT "Height" FROM table_19738 WHERE "Name" = 'Braxton Kelley' | wikisql |
CREATE TABLE table_9315 (
"Round" real,
"Pick #" real,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- A Round larger than 1, a College of Oklahoma state, and a average Pick # that has a Position of tight end... | SELECT AVG("Pick #") FROM table_9315 WHERE "Position" = 'tight end' AND "College" = 'oklahoma state' AND "Round" > '1' | 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 zyjzjlb (
CYBQDM text,
CYBQMC... | SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_inf... | css |
CREATE TABLE table_name_89 (
teams VARCHAR,
season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the teams for season 1950-51?
| SELECT teams FROM table_name_89 WHERE season = "1950-51" | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
... | 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 = 'copd - moderate' AND DATETIME(diagnosis.diagnosistime, 'start of year') =... | eicu |
CREATE TABLE table_name_86 (
to_par VARCHAR,
place VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the to par of the player with a t9 place and a score of 72-67=139?
| SELECT to_par FROM table_name_86 WHERE place = "t9" AND score = 72 - 67 = 139 | sql_create_context |
CREATE TABLE has_amenity (
dorm_name VARCHAR,
dormid VARCHAR
)
CREATE TABLE dorm (
dorm_name VARCHAR,
dormid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the name of dorms that do not have any amenity
| SELECT dorm_name FROM dorm WHERE NOT dormid IN (SELECT dormid FROM has_amenity) | sql_create_context |
CREATE TABLE gas_station (
Station_ID int,
Open_Year int,
Location text,
Manager_Name text,
Vice_Manager_Name text,
Representative_Name text
)
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_of_the_Year int
)
CREATE TABLE company (
Company_ID int,
Rank i... | SELECT Main_Industry, COUNT(Main_Industry) FROM company WHERE Headquarters <> 'USA' GROUP BY Main_Industry ORDER BY Main_Industry DESC | nvbench |
CREATE TABLE table_59841 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( \u00a3 )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Score has a Place of t8, and a Country of scotland?
| SELECT "Score" FROM table_59841 WHERE "Place" = 't8' AND "Country" = 'scotland' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2112" AND diagnoses.long_title = "Retained plastic fragments" | mimicsql_data |
CREATE TABLE table_13893 (
"Time" text,
"Show Name" text,
"DJ's" text,
"Local/Networked" text,
"Ad Freq" text,
"News Freq" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What time that is networked has an ad freq of 20 minutes until 7pm?
| SELECT "Time" FROM table_13893 WHERE "Local/Networked" = 'networked' AND "Ad Freq" = '20 minutes until 7pm' | wikisql |
CREATE TABLE table_50740 (
"Date" text,
"Result" text,
"Opponent" text,
"Venue" text,
"Location" text,
"Method" text,
"Round" real,
"Time" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The match that was held at Club ... | SELECT "Method" FROM table_50740 WHERE "Venue" = 'club med sandpiper' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "47" AND prescriptions.route = "BOTH EYES" | mimicsql_data |
CREATE TABLE table_14342210_12 (
points VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points where scored by the right end?
| SELECT COUNT(points) FROM table_14342210_12 WHERE position = "Right end" | sql_create_context |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId ... | SELECT Id AS "post_link" FROM Posts WHERE PostTypeId = 1 AND DATEPART(m, CreationDate) = DATEPART(m, DATEADD(m, -1, GETDATE())) AND DATEPART(yyyy, CreationDate) = DATEPART(yyyy, DATEADD(m, -1, GETDATE())) AND Tags = CONCAT('<', '##Tag:string##', '>') ORDER BY CreationDate DESC | sede |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE gsi (
c... | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT... | advising |
CREATE TABLE table_203_591 (
id number,
"high school" text,
"join\nyear" text,
"from" text,
"left" text,
"league left to" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the last school to join the genesee county b league ?
| SELECT "high school" FROM table_203_591 ORDER BY "join\nyear" DESC LIMIT 1 | squall |
CREATE TABLE person_info_hz_info (
RYBH text,
KH number,
KLX number,
YLJGDM number
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSB... | SELECT jyjgzbb.JCFF FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND 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... | css |
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... | SELECT demographic.age, demographic.gender FROM demographic WHERE demographic.subject_id = "84129" | mimicsql_data |
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREAT... | 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 = 'SEATTLE' AND date_day.day_number = 20 AND date_day.month_number = 1 AND ... | atis |
CREATE TABLE table_13596 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the to par of canada?
| SELECT "To par" FROM table_13596 WHERE "Country" = 'canada' | wikisql |
CREATE TABLE table_name_46 (
away_team VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score for the away team when they played Hawthorn?
| SELECT away_team AS score FROM table_name_46 WHERE home_team = "hawthorn" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,... | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE zzmzjzjlb.JZZDSM = '慢性咽炎' AND jyjgzbb.JCZBDM = '487632' UNION SELECT jyjgzbb.CKZFWXX, ... | css |
CREATE TABLE jybgb_jyjgzbb (
JYZBLSH number,
YLJGDM text,
jyjgzbb_id number
)
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 tex... | SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '9223333' AND jybgb.BGRQ BETWEEN '2010-12-18' AND '2020-10-25' GROUP BY jybgb.KSBM HAVING COUNT(*) >= 13) AS T | css |
CREATE TABLE table_name_94 (
title VARCHAR,
termination_of_mission VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Title has a Termination of Mission of current?
| SELECT title FROM table_name_94 WHERE termination_of_mission = "current" | sql_create_context |
CREATE TABLE table_36618 (
"Date" text,
"Tournament" text,
"Location" text,
"Winner" text,
"Score" text,
"1st prize ( $ )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of the tournament in Scotland with a score of 270 ( 18)?
| SELECT "Date" FROM table_36618 WHERE "Score" = '270 (–18)' AND "Location" = 'scotland' | wikisql |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | SELECT COUNT(DISTINCT hz_info.RYBH) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE mzjzjlb.ZZYSGH = '59997347' AND mzjzjlb.JZKSRQ BETWEEN '2014-05-11' AND '2016-10-25' | css |
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Compa... | SELECT title, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY title | nvbench |
CREATE TABLE table_70992 (
"Year" text,
"Venue" text,
"Winners" text,
"2nd place" text,
"3rd place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who came in 3rd at Venue?
| SELECT "3rd place" FROM table_70992 WHERE "Venue" = 'venue' | wikisql |
CREATE TABLE table_204_700 (
id number,
"name" text,
"developer" text,
"release" text,
"type" text,
"game flow" text,
"setting" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the only game to be released by fubra ?
| SELECT "name" FROM table_204_700 WHERE "developer" = 'fubra' | squall |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
Accepted... | SELECT Users.age AS user_age, COUNT(DISTINCT Users.Id) FROM Users, Posts WHERE NOT Users.age IS NULL AND Users.age BETWEEN 10 AND 70 AND Users.Reputation BETWEEN 2 AND 100000 AND Posts.OwnerUserId = Users.Id AND Users.Id IN (SELECT OwnerUserId FROM Posts GROUP BY OwnerUserId HAVING COUNT(*) >= 10) GROUP BY Users.age OR... | sede |
CREATE TABLE jybgb_jyjgzbb (
JYZBLSH number,
YLJGDM text,
jyjgzbb_id number
)
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 tex... | SELECT jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.BGDH = '65909880212' | css |
CREATE TABLE qtb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '52511910' AND qtb.MED_SER_ORG_NO = '4903807' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '52511910' AND gyb.MED_SER_ORG_NO = '4903... | css |
CREATE TABLE table_name_71 (
year INTEGER,
points VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the average Year that has Points that's smaller than 9 with a Rank of 24th?
| SELECT AVG(year) FROM table_name_71 WHERE points < 9 AND rank = "24th" | sql_create_context |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid nu... | SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 <= 4 | mimic_iii |
CREATE TABLE table_12284476_8 (
alloy VARCHAR,
series VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the alloy with series being ii series
| SELECT alloy FROM table_12284476_8 WHERE series = "II series" | sql_create_context |
CREATE TABLE table_name_8 (
country VARCHAR,
iata VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country has an IATA of EVN?
| SELECT country FROM table_name_8 WHERE iata = "evn" | sql_create_context |
CREATE TABLE table_65957 (
"Township" text,
"County" text,
"Pop. (2010)" real,
"Land ( sqmi )" real,
"Water (sqmi)" real,
"Latitude" real,
"Longitude" real,
"GEO ID" real,
"ANSI code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Wh... | SELECT MAX("Water (sqmi)") FROM table_65957 WHERE "Pop. (2010)" = '359' AND "Longitude" < '-97.176811' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
... | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 50 AND 59) AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT... | eicu |
CREATE TABLE table_41406 (
"Rank" real,
"Name" text,
"Team" text,
"Games" real,
"Rebounds" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Games for the Player from Lietuvos Rytas Vilnius with less the 43 Rebounds?
| SELECT SUM("Games") FROM table_41406 WHERE "Team" = 'lietuvos rytas vilnius' AND "Rebounds" < '43' | wikisql |
CREATE TABLE table_name_81 (
time VARCHAR,
notes VARCHAR,
athlete VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the time of frida svensson's race that had sa/b under the notes?
| SELECT time FROM table_name_81 WHERE notes = "sa/b" AND athlete = "frida svensson" | sql_create_context |
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 diagnosis (
diagn... | SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'bacteremia - vasc... | eicu |
CREATE TABLE table_name_8 (
rank VARCHAR,
nation VARCHAR,
silver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total rank for the Netherlands when more than 2 silver medals were won?
| SELECT COUNT(rank) FROM table_name_8 WHERE nation = "netherlands" AND silver > 2 | sql_create_context |
CREATE TABLE table_16316 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player went to college at Laval?
| SELECT "Player" FROM table_16316 WHERE "College" = 'Laval' | wikisql |
CREATE TABLE table_40 (
"Calls" text,
"Frequency" text,
"Branding" text,
"Format" text,
"Market/Rank" text,
"Timeslot" text,
"Group owner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Frequency is used for WEGP calls?
| SELECT "Frequency" FROM table_40 WHERE "Calls" = 'WEGP' | 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,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "HOME HEALTH CARE" AND procedures.short_title = "Partial glossectomy" | mimicsql_data |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodi... | 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 = '016-9636')) AND intakeoutput.celllabel = 'ileost... | eicu |
CREATE TABLE table_64002 (
"Wimmera FL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the total draws when the losses are less than 10, less than 2 byes, and 13 wins?... | SELECT COUNT("Draws") FROM table_64002 WHERE "Losses" < '10' AND "Wins" = '13' AND "Byes" < '2' | wikisql |
CREATE TABLE buildings (
id number,
name text,
city text,
height number,
stories number,
status text
)
CREATE TABLE companies (
id number,
name text,
headquarters text,
industry text,
sales_billion number,
profits_billion number,
assets_billion number,
market_val... | SELECT AVG(profits_billion) FROM companies | spider |
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_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '97780121' AND NOT t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 196.98) | css |
CREATE TABLE table_203_353 (
id number,
"#" number,
"title" text,
"producer(s)" text,
"featured guest(s)" text,
"time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which songs does not have a producer listed .
| SELECT "title" FROM table_203_353 WHERE "producer(s)" IS NULL | squall |
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,
... | SELECT COUNT(zzmzjzjlb.ZZYSGH) FROM hz_info JOIN zzmzjzjlb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE hz_info.RYBH = '41398120' AND zzmzjzjlb.JZKSRQ BETWEEN '2001-07-25' AND '2011-05-08' UNION SELECT COUNT(fzzmzjzjlb.ZZYSGH) FROM hz_info JOIN fzzmzjzjlb ON h... | css |
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREAT... | 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 ORDER BY AVG(T1.Age) DESC | nvbench |
CREATE TABLE table_name_72 (
state_champions INTEGER,
co_champions VARCHAR,
mrc_championships VARCHAR,
records VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of state champions with more tan 9 MRC Championships, more than 4 co-champio... | SELECT SUM(state_champions) FROM table_name_72 WHERE mrc_championships > 9 AND records = "192-189-3" AND co_champions > 4 | sql_create_context |
CREATE TABLE table_name_62 (
first VARCHAR,
position VARCHAR,
bats VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which First has a Position of c, and Bats of l?
| SELECT first FROM table_name_62 WHERE position = "c" AND bats = "l" | sql_create_context |
CREATE TABLE table_77246 (
"Position" real,
"Team" text,
"Rd 6" real,
"Rd 7" real,
"Rd 8" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average value for Rd 8 in a position less than 2 for Audi Sport Australia?
| SELECT AVG("Rd 8") FROM table_77246 WHERE "Team" = 'audi sport australia' AND "Position" < '2' | wikisql |
CREATE TABLE table_1245148_1 (
location VARCHAR,
year_opened VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where is the track that opened in 1995?
| SELECT location FROM table_1245148_1 WHERE year_opened = 1995 | 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
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "NEWBORN" AND lab.itemid = "51300" | mimicsql_data |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,... | 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, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND days.day_name = 'WEDNESDAY' AND flight.flight_days = days.days_code AN... | atis |
CREATE TABLE table_name_68 (
attendance INTEGER,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the lowest attendance was the opponent was chelsea?
| SELECT MIN(attendance) FROM table_name_68 WHERE opponent = "chelsea" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT demographic.gender, demographic.language FROM demographic WHERE demographic.name = "Travis Hofman" | mimicsql_data |
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... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.route = "IV" | mimicsql_data |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE treatment (
... | SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'alkaline phos.')) AND STRFTIME('%y', cost.chargetime) >= '2105' GROU... | eicu |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_NM = '苗伟懋' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT >= 6998.54) | css |
CREATE TABLE table_name_41 (
home_team VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the home team when kwong wah was the away team?
| SELECT home_team FROM table_name_41 WHERE away_team = "kwong wah" | 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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab."CATEGORY" = "Blood Gas" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.