instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_27 (
name VARCHAR,
place_of_birth VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was born in Porsgrunn?
| SELECT name FROM table_name_27 WHERE place_of_birth = "porsgrunn" | sql_create_context |
CREATE TABLE artist (
gender VARCHAR,
artist_name VARCHAR
)
CREATE TABLE song (
artist_name VARCHAR,
resolution VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Return the gender and name of artist who produced the song with the lowest resolution.
| SELECT T1.gender, T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name ORDER BY T2.resolution LIMIT 1 | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.discharge_location = "LONG TERM CARE HOSPITAL" | mimicsql_data |
CREATE TABLE postseason (
year INTEGER,
round TEXT,
team_id_winner TEXT,
league_id_winner TEXT,
team_id_loser TEXT,
league_id_loser TEXT,
wins INTEGER,
losses INTEGER,
ties INTEGER
)
CREATE TABLE fielding (
player_id TEXT,
year INTEGER,
stint INTEGER,
team_id TEXT,
... | SELECT year, COUNT(year) FROM home_game ORDER BY year | nvbench |
CREATE TABLE table_22883210_9 (
game INTEGER,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest game number where the team was Cleveland?
| SELECT MAX(game) FROM table_22883210_9 WHERE team = "Cleveland" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREA... | SELECT MAX(vitalperiodic.heartrate) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-15837')) AND NOT vitalperiodic.heartrate IS NULL... | eicu |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE diagnoses_icd (
row_id number,
... | 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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,... | SELECT JOB_ID, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY SUM(SALARY) | nvbench |
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_NM = '郎永逸' AND qtb.MED_SER_ORG_NO = '7422800' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '郎永逸' AND gyb.MED_SER_ORG_NO = '7422800' UNION... | css |
CREATE TABLE table_67857 (
"Year" real,
"Team" text,
"Co-Drivers" text,
"Class" text,
"Laps" real,
"Pos." text,
"Class Pos." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position did the 5th place team after 1992 with over 346 laps fi... | SELECT "Pos." FROM table_67857 WHERE "Class Pos." = '5th' AND "Year" > '1992' AND "Laps" > '346' | wikisql |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Business Forecasting and Equity Valuation%' OR name LIKE '%Business Forecasting and Equity Valuation%') AND credits = 13 | advising |
CREATE TABLE table_64101 (
"Rank" real,
"Team" text,
"Apps" real,
"Record" text,
"Win %" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest apps for rank 3 and 0% wins?
| SELECT MIN("Apps") FROM table_64101 WHERE "Rank" = '3' AND "Win %" < '0' | wikisql |
CREATE TABLE table_31807 (
"Class" text,
"Type" text,
"No. built (Converted*)" text,
"Year built (Converted*)" text,
"No. range" text,
"Withdrawn" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the year built for number built of 10
| SELECT "Year built (Converted*)" FROM table_31807 WHERE "No. built (Converted*)" = '10' | 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 prescriptions (
subject_id text,
hadm_id... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Medicare" AND demographic.days_stay > "13" | mimicsql_data |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepi... | SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-24054')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutpu... | eicu |
CREATE TABLE table_name_61 (
career VARCHAR,
super_g VARCHAR,
combined VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Career has a Super G of 5, and a Combined of 6?
| SELECT career FROM table_name_61 WHERE super_g = "5" AND combined = "6" | sql_create_context |
CREATE TABLE table_10128185_2 (
northern_ireland VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many votes did Northern Ireland cast if the total was 35?
| SELECT northern_ireland FROM table_10128185_2 WHERE total = 35 | sql_create_context |
CREATE TABLE table_12828723_5 (
lost VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the lost with tries for?
| SELECT lost FROM table_12828723_5 WHERE "tries_for" = "tries_for" | sql_create_context |
CREATE TABLE table_name_86 (
score VARCHAR,
team_1 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2nd round with a score of 3 - 3, and a team 1 fc gueugnon (d2)?
| SELECT 2 AS nd_round FROM table_name_86 WHERE score = "3 - 3" AND team_1 = "fc gueugnon (d2)" | sql_create_context |
CREATE TABLE table_43612 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record for the opponent the Cleveland Cavaliers?
| SELECT "Record" FROM table_43612 WHERE "Opponent" = 'cleveland cavaliers' | wikisql |
CREATE TABLE table_name_73 (
team_2 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the 1st round when team 2 is usl dunkerque (d2)?
| SELECT 1 AS st_round FROM table_name_73 WHERE team_2 = "usl dunkerque (d2)" | sql_create_context |
CREATE TABLE table_14920 (
"Station" text,
"Frequency" real,
"Network Affiliation" text,
"Format" text,
"City of License" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the largest frequency owned by multicultural broadcas... | SELECT MAX("Frequency") FROM table_14920 WHERE "Status" = 'owned by multicultural broadcasting' AND "Format" = 'vietnamese' | wikisql |
CREATE TABLE table_79493 (
"Year" real,
"Game" text,
"Genre" text,
"Platform(s)" text,
"Developer(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year is the Grim Fandango with a windows platform?
| SELECT "Year" FROM table_79493 WHERE "Platform(s)" = 'windows' AND "Game" = 'grim fandango' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND procedures.short_title = "Pericardiocentesis" | mimicsql_data |
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
CREATE TABLE EMPLOYEE (
EMP_NUM int,
EMP_LNAME varchar(15),
EMP_FNAME varchar(12),
EMP_INITIAL varchar(1),
EMP_JOBCODE varchar(5),
EMP_HIREDATE datetime,
EMP... | SELECT CRS_CODE, COUNT(*) FROM CLASS GROUP BY CRS_CODE ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
Date_of_Birth text
)
CREATE TABLE entrepreneur (
Entrepreneur_ID int,
People_ID int,
Company text,
Money_Requested real,
Investor text
)
-- Using valid SQLite, answer the following questions for the tabl... | SELECT Investor, COUNT(Investor) FROM entrepreneur GROUP BY Investor | nvbench |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE cost (
r... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE NOT admissions.dischtime IS NULL AND DATETIME(admissions.dischtime) <= DATETIME(CURRENT_TIME(), '-2 year') | mimic_iii |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
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,... | SELECT COUNT(*) FROM zyjzjlb WHERE YLJGDM = '3398509' AND RYDJSJ > '2012-05-04' | css |
CREATE TABLE station (
id int,
network_name text,
services text,
local_authority text
)
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
wind_speed_mph int
)
CREATE TABLE train (
id int,
train... | SELECT services, COUNT(services) FROM station GROUP BY services ORDER BY services | nvbench |
CREATE TABLE table_40938 (
"Pilot" text,
"Original Airdate" text,
"Musical Guest/Song performed" text,
"YouTube Hero" text,
"MySpace Band" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Musical Guest/Song with an original airdate of janu... | SELECT "Musical Guest/Song performed" FROM table_40938 WHERE "Original Airdate" = 'january 2008' | wikisql |
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... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.dob_year < "2137" | mimicsql_data |
CREATE TABLE table_76361 (
"Date" text,
"Name of ship" text,
"Flag" text,
"Tonnage" real,
"Fate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average tonnage of the ship named proletarij?
| SELECT AVG("Tonnage") FROM table_76361 WHERE "Name of ship" = 'proletarij' | 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 WHERE demographic.insurance = "Private" AND demographic.dob_year < "2023" | mimicsql_data |
CREATE TABLE table_name_35 (
rank VARCHAR,
wins VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What rank is Miller Barber with more than 11 wins?
| SELECT rank FROM table_name_35 WHERE wins > 11 AND player = "miller barber" | sql_create_context |
CREATE TABLE table_name_6 (
country VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country did the player who scored 73-73-65=211 come from?
| SELECT country FROM table_name_6 WHERE score = 73 - 73 - 65 = 211 | sql_create_context |
CREATE TABLE table_53113 (
"Name" text,
"Actual version" text,
"System" text,
"Platform" text,
"License" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which System's Name is Gemulator?
| SELECT "System" FROM table_53113 WHERE "Name" = 'gemulator' | wikisql |
CREATE TABLE table_name_63 (
draw INTEGER,
place VARCHAR,
points VARCHAR,
artist VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Draw number of the song by Artist of 'Loudest Whisper' with 68 or less Points with a place of 9 or larger?
| SELECT AVG(draw) FROM table_name_63 WHERE points < 68 AND artist = "loudest whisper" AND place > 9 | sql_create_context |
CREATE TABLE table_name_45 (
player VARCHAR,
position VARCHAR,
team_from VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the player from Hotchkiss School with a position of d?
| SELECT player FROM table_name_45 WHERE position = "d" AND team_from = "hotchkiss school" | sql_create_context |
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,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments ... | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%LATINOAM%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id | advising |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABL... | 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 = 13897) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.item... | mimic_iii |
CREATE TABLE table_name_6 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average 2007 value for a 2006 of 2.8 and 2009 under 20?
| SELECT AVG(2007) FROM table_name_6 WHERE 2009 < 20 AND 2006 = 2.8 | sql_create_context |
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 transfers (
row_id number,
subject_id number,
hadm_... | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'glucose, pleural')) | mimic_iii |
CREATE TABLE table_72719 (
"City/town" text,
"Municipality" text,
"County" text,
"City/town status" real,
"Population" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the cities/towns located in the municipality of Moss?
| SELECT "City/town" FROM table_72719 WHERE "Municipality" = 'Moss' | 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,
... | SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE wdmzjzjlb.YLJGDM = '7874064' AND DATEDIFF(wdmzjzjlb.CYSJ, wdmzjzjlb.RYSJ) > 26 UNION SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = ... | css |
CREATE TABLE table_name_31 (
opponent VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which opponent has a Record of 4-5?
| SELECT opponent FROM table_name_31 WHERE record = "4-5" | sql_create_context |
CREATE TABLE table_75582 (
"Name" text,
"Street address" text,
"Years as tallest" text,
"Height ft / m" text,
"Floors" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the height of the building named 555 17th street?
| SELECT "Height ft / m" FROM table_75582 WHERE "Name" = '555 17th street' | wikisql |
CREATE TABLE table_name_80 (
date VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Date has a Time of 12:00?
| SELECT date FROM table_name_80 WHERE time = "12:00" | sql_create_context |
CREATE TABLE table_name_7 (
player VARCHAR,
school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what player went to ul-monroe
| SELECT player FROM table_name_7 WHERE school = "ul-monroe" | sql_create_context |
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 d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE chart... | 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 = 25300) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.item... | mimic_iii |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE ... | SELECT COUNT(*) = 0 FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_exams = 'N' AND program_course.category LIKE '%ULCS%' | advising |
CREATE TABLE table_name_38 (
giro_di_lombardia VARCHAR,
paris_roubaix VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Giro di Lombardia has a Paris Roubaix of servais knaven ( ned )?
| SELECT giro_di_lombardia FROM table_name_38 WHERE paris_roubaix = "servais knaven ( ned )" | sql_create_context |
CREATE TABLE table_name_75 (
name_of_the_song VARCHAR,
kind_of_the_song VARCHAR,
singer VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which song has a ending theme, and is sung by miriam yeung?
| SELECT name_of_the_song FROM table_name_75 WHERE kind_of_the_song = "ending theme" AND singer = "miriam yeung" | sql_create_context |
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.department, course.name, course.number FROM course, program, program_course WHERE course.department <> 'CLIMATE' AND program_course.course_id = course.course_id AND program.program_id = program_course.program_id | advising |
CREATE TABLE ENROLL (
CLASS_CODE varchar(5),
STU_NUM int,
ENROLL_GRADE varchar(50)
)
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS varchar(20),
DEPT_EXTENSION varchar(4)
)
CREATE TABLE PROFESSOR (
EMP_N... | SELECT SCHOOL_CODE, COUNT(*) FROM DEPARTMENT AS T1 JOIN PROFESSOR AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.SCHOOL_CODE ORDER BY SCHOOL_CODE | nvbench |
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 jybgb.KSBM, jybgb.KSMC FROM hz_info JOIN zzmzjzjlb JOIN jybgb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '79373971' AND jybgb.BGRQ BETWEEN '2004-04-25... | css |
CREATE TABLE table_name_47 (
kaz_hayashi VARCHAR,
block_a VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the kaz hayashi with block A of Shuji Kondo
| SELECT kaz_hayashi FROM table_name_47 WHERE block_a = "shuji kondo" | sql_create_context |
CREATE TABLE table_name_74 (
auckland VARCHAR,
gold_coast VARCHAR,
melbourne VARCHAR,
sydney VARCHAR,
perth VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- yes or no for the auckland with a yes for sydney, no for perth, yes for melbourne and yes f... | SELECT auckland FROM table_name_74 WHERE sydney = "yes" AND perth = "no" AND melbourne = "yes" AND gold_coast = "yes" | 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... | SELECT * FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jy... | css |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare 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_... | atis |
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 COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '马兴生' AND t_kc22.STA_DATE BETWEEN '2004-04-23' AND '2010-10-25' AND t_kc22.SELF_PAY_AMO > 2352.85 UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_NM = '马兴生' AND ... | css |
CREATE TABLE table_22355_20 (
athlete VARCHAR,
nation VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the athlete from the nation of Ethiopia (eth) who had a rank bigger than 7.0?
| SELECT athlete FROM table_22355_20 WHERE nation = "Ethiopia (ETH)" AND rank > 7.0 | sql_create_context |
CREATE TABLE employees (
employee_id number,
first_name text,
last_name text,
email text,
phone_number text,
hire_date time,
job_id text,
salary number,
commission_pct number,
manager_id number,
department_id number
)
CREATE TABLE regions (
region_id number,
region_n... | SELECT department_id, SUM(salary) FROM employees GROUP BY department_id HAVING COUNT(*) >= 2 | spider |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(MANAGER_ID) DESC | nvbench |
CREATE TABLE table_76857 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What i... | SELECT "High points" FROM table_76857 WHERE "High rebounds" = 'dwight howard (16)' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = 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.JZLSH_MZJZJLB WHERE person_info.XM = '鲁嘉歆' AND jybg... | css |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test... | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id | advising |
CREATE TABLE table_22883210_7 (
location_attendance VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where was game 41 held, and how many people attended?
| SELECT location_attendance FROM table_22883210_7 WHERE game = 41 | sql_create_context |
CREATE TABLE table_53832 (
"Year" text,
"Winner" text,
"Jockey" text,
"Trainer" text,
"Owner" text,
"Distance" text,
"Time" text,
"Purse" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the owner in 1996 of trainer Nick Zito?
| SELECT "Owner" FROM table_53832 WHERE "Trainer" = 'nick zito' AND "Year" = '1996' | wikisql |
CREATE TABLE table_train_259 (
"id" int,
"systolic_blood_pressure_sbp" int,
"hiv_infection" bool,
"hemoglobin_a1c_hba1c" float,
"hearing_problem" bool,
"heart_disease" bool,
"high_blood_pressure" bool,
"diabetic" string,
"immune_deficiency_disorder" bool,
"visual_impairment" bool... | SELECT * FROM table_train_259 WHERE high_blood_pressure = 1 OR systolic_blood_pressure_sbp > 140 OR diastolic_blood_pressure_dbp > 90 | criteria2sql |
CREATE TABLE table_58247 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the Loss listed with a Score of 5-1?
| SELECT "Loss" FROM table_58247 WHERE "Score" = '5-1' | 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
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "77" AND prescriptions.formulary_drug_cd = "NABC50I" | mimicsql_data |
CREATE TABLE table_68043 (
"School" text,
"Team" text,
"Division Record" text,
"Overall Record" text,
"Season Outcome" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Panthers' Division Record?
| SELECT "Division Record" FROM table_68043 WHERE "Team" = 'panthers' | wikisql |
CREATE TABLE table_11877 (
"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 loss for the game on July 1 with an attendance more than 35,621?
| SELECT "Loss" FROM table_11877 WHERE "Attendance" > '35,621' AND "Date" = 'july 1' | wikisql |
CREATE TABLE Apartment_Bookings (
booking_start_date VARCHAR,
apt_id VARCHAR
)
CREATE TABLE Apartments (
apt_number VARCHAR,
apt_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the apartment numbers, start dates, and end dates of all the apar... | SELECT T2.apt_number, T1.booking_start_date, T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id | sql_create_context |
CREATE TABLE table_18979 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who ha... | SELECT "High rebounds" FROM table_18979 WHERE "Location Attendance" = 'Delta Center' | wikisql |
CREATE TABLE table_72423 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who ran in the election where Claude Fuller was the incumbent?
| SELECT "Candidates" FROM table_72423 WHERE "Incumbent" = 'Claude Fuller' | wikisql |
CREATE TABLE wdmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | SELECT COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.YLJGDM = '2301260' AND wdmzjzjlb.JZKSRQ BETWEEN '2007-01-04' AND '2020-10-03' AND wdmzjzjlb.ZSEBZ > 0 UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.YLJGDM = '2301260' AND bdmzjzjlb.JZKSRQ BETWEEN '2007-01-04' AND '2020-10-03' AND bdmzjzjlb.ZSEBZ > 0 | css |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREA... | SELECT Id AS "post_link" FROM Posts WHERE Posts.Id > '##StartID:int?1##' AND Posts.Id < '##EndID:int?1000000##' AND (Body LIKE '%<code>PHP</code>%' OR Body LIKE '%<code>javascript</code>%' OR Body LIKE '%<code>C#</code>%' OR Body LIKE '%<code>python</code>%' OR Body LIKE '%<code>java</code>%' OR Body LIKE '%<code>C</co... | sede |
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... | SELECT (SELECT t_kc24.OVE_PAY FROM t_kc24 JOIN t_kc21_t_kc24 JOIN t_kc21 ON t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID AND t_kc21_t_kc24.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '30482936497') / (SELECT t_kc24.MED_AMOUT FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID = '30482936497') | css |
CREATE TABLE table_14981555_3 (
result VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In Ascot (UK), what was the result?
| SELECT result FROM table_14981555_3 WHERE venue = "Ascot (UK)" | sql_create_context |
CREATE TABLE table_name_80 (
constructor VARCHAR,
grid VARCHAR,
time_retired VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who built the 21 grid car that retired due to suspension?
| SELECT constructor FROM table_name_80 WHERE grid > 21 AND time_retired = "suspension" | sql_create_context |
CREATE TABLE store (
store_id number,
store_name text,
type text,
area_size number,
number_of_product_category number,
ranking number
)
CREATE TABLE district (
district_id number,
district_name text,
headquartered_city text,
city_population number,
city_area number
)
CREATE... | SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.store_name = "Blackville" | spider |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number... | SELECT CASE WHEN Votes.Id IS NULL THEN 1 ELSE 0 END AS Unvoted, VoteTypes.Name, Posts.Score, Posts.Title FROM Posts LEFT JOIN Votes ON Posts.Id = Votes.PostId JOIN PostTags ON Posts.Id = PostTags.PostId JOIN Tags ON PostTags.TagId = Tags.Id JOIN VoteTypes ON VoteTypes.Id = Votes.VoteTypeId WHERE Posts.PostTypeId = 1 AN... | sede |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImage... | SELECT CONCAT(YEAR(P.CreationDate), '-', MONTH(P.CreationDate)) AS YearMonth, 'DB2' AS TagName, COUNT(*) AS PostCount FROM Posts AS P INNER JOIN PostTags AS PT ON (P.Id = PT.PostId) INNER JOIN Tags AS T ON (PT.TagId = T.Id) WHERE T.TagName LIKE 'db2%' GROUP BY YEAR(P.CreationDate), MONTH(P.CreationDate) ORDER BY YEAR(P... | sede |
CREATE TABLE table_name_74 (
sensor_res VARCHAR,
_size VARCHAR,
model VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the sensor res for model of s9200
| SELECT sensor_res, _size FROM table_name_74 WHERE model = "s9200" | sql_create_context |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduct... | SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN area ON course_offering.course_id = area.course_id WHERE area.area LIKE '%... | advising |
CREATE TABLE editor (
Editor_ID int,
Name text,
Age real
)
CREATE TABLE journal_committee (
Editor_ID int,
Journal_ID int,
Work_Type text
)
CREATE TABLE journal (
Journal_ID int,
Date text,
Theme text,
Sales int
)
-- Using valid SQLite, answer the following questions for the ... | SELECT Name, Age FROM editor ORDER BY Age | nvbench |
CREATE TABLE table_16569 (
"Character" text,
"Portrayed by" text,
"First appearance" text,
"Last appearance" text,
"Duration" text,
"Episodes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On which episode did actress Sela Ward make her last ap... | SELECT "Last appearance" FROM table_16569 WHERE "Portrayed by" = 'Sela Ward' | wikisql |
CREATE TABLE table_name_90 (
cardinal_direction VARCHAR,
english VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the cardinal direction of Wednesday p.m. in English?
| SELECT cardinal_direction FROM table_name_90 WHERE english = "wednesday p.m." | sql_create_context |
CREATE TABLE table_71543 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the loss of the game attended by 14,691?
| SELECT "Loss" FROM table_71543 WHERE "Attendance" = '14,691' | wikisql |
CREATE TABLE table_1035 (
"Player" text,
"Position" text,
"Starter" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many field goals were made by someone playing p... | SELECT COUNT("Field goals") FROM table_1035 WHERE "Position" = 'Right end' | wikisql |
CREATE TABLE table_name_55 (
week INTEGER,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What week was September 24, 2000 on?
| SELECT SUM(week) FROM table_name_55 WHERE date = "september 24, 2000" | sql_create_context |
CREATE TABLE customer (
customer_id number,
store_id number,
first_name text,
last_name text,
email text,
address_id number,
active boolean,
create_date time,
last_update time
)
CREATE TABLE store (
store_id number,
manager_staff_id number,
address_id number,
last_up... | SELECT T2.name FROM film AS T1 JOIN language AS T2 ON T1.language_id = T2.language_id WHERE T1.title = 'AIRPORT POLLOCK' | spider |
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
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND lab.itemid = "51132" | mimicsql_data |
CREATE TABLE table_203_723 (
id number,
"year" number,
"song" text,
"us hot 100" number,
"us msr" number,
"us a.c." number,
"can" number,
"uk singles" number,
"album" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what song was a hit... | SELECT "song" FROM table_203_723 WHERE "year" = 1995 AND id > (SELECT id FROM table_203_723 WHERE "song" = '"i live my life for you"') | squall |
CREATE TABLE rooms (
roomid text,
roomname text,
beds number,
bedtype text,
maxoccupancy number,
baseprice number,
decor text
)
CREATE TABLE reservations (
code number,
room text,
checkin text,
checkout text,
rate number,
lastname text,
firstname text,
adults... | SELECT decor, COUNT(*) FROM rooms WHERE bedtype = "King" GROUP BY decor | spider |
CREATE TABLE table_22669044_9 (
team VARCHAR,
high_assists VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the team for kirk hinrich , derrick rose , john salmons (6)
| SELECT team FROM table_22669044_9 WHERE high_assists = "Kirk Hinrich , Derrick Rose , John Salmons (6)" | sql_create_context |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE TagSynonyms (
Id number... | SELECT Users.Id FROM Users, Badges WHERE Badges.UserId = Users.Id AND (Badges.Name = 'android') | sede |
CREATE TABLE course (
title VARCHAR,
credits VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the names of all courses ordered by their titles and credits.
| SELECT title FROM course ORDER BY title, credits | sql_create_context |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,... | SELECT (SELECT COUNT(DISTINCT t1.subject_id) 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_diagnoses.short_title = 'fracture o... | mimic_iii |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.