instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_55565 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the crowd population of the home team loc... | SELECT SUM("Crowd") FROM table_55565 WHERE "Home team" = 'richmond' | wikisql |
CREATE TABLE people (
Hometown VARCHAR,
People_ID VARCHAR
)
CREATE TABLE gymnast (
Gymnast_ID VARCHAR,
Total_Points INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the distinct hometowns of gymnasts with total points more than 57.5?
| SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID WHERE T1.Total_Points > 57.5 | sql_create_context |
CREATE TABLE table_train_70 (
"id" int,
"pregnancy_or_lactation" bool,
"white_blood_cell_count_wbc" int,
"systolic_blood_pressure_sbp" int,
"mean_arterial_pressure_map" int,
"temperature" float,
"oliguria" bool,
"surgery" bool,
"heart_rate" int,
"systemic_inflammatory_response" b... | SELECT * FROM table_train_70 WHERE pregnancy_or_lactation = 1 | criteria2sql |
CREATE TABLE table_17723 (
"Year" real,
"Population (Region total)" real,
"Population (Stanthorpe)" real,
"Population (Warwick)" real,
"Population (Allora)" real,
"Population (Glengallan)" real,
"Population (Rosenthal)" real
)
-- Using valid SQLite, answer the following questions for the t... | SELECT MAX("Population (Glengallan)") FROM table_17723 | wikisql |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.person_i... | css |
CREATE TABLE table_9511 (
"Position" real,
"Team" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Difference" text,
"Points 1" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the h... | SELECT MAX("Goals For") FROM table_9511 WHERE "Lost" = '25' | wikisql |
CREATE TABLE table_36338 (
"Volume" text,
"Discs" real,
"Episodes" real,
"Region 1 release" text,
"Region 2 release" text,
"Region 4 release" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the region 4 release that has july 20, 2009 as t... | SELECT "Region 4 release" FROM table_36338 WHERE "Region 2 release" = 'july 20, 2009' | wikisql |
CREATE TABLE table_38396 (
"Name" text,
"Years of Operation" text,
"Location" text,
"Historical Photos" text,
"Year Clubhouse Constructed" text,
"Sign-in/Bicker" text,
"Year co-ed" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the ... | SELECT "Year Clubhouse Constructed" FROM table_38396 WHERE "Sign-in/Bicker" = 'bicker' AND "Name" = 'cannon club' | wikisql |
CREATE TABLE table_26418 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the score for san diego
| SELECT "Score" FROM table_26418 WHERE "Championship" = 'San Diego' | wikisql |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program (
program_id int,
name v... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour... | advising |
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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT MIN(demographic.days_stay) FROM demographic WHERE demographic.admityear >= "2179" | mimicsql_data |
CREATE TABLE table_204_667 (
id number,
"year" number,
"film title" text,
"genre" text,
"cast" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the title listed after parva ?
| SELECT "film title" FROM table_204_667 WHERE id = (SELECT id FROM table_204_667 WHERE "film title" = 'parva') + 1 | squall |
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "V5416" AND lab.fluid = "Pleural" | mimicsql_data |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT microlab.patientunitstayid FROM microlab WHERE microlab.culturesite = 'sputum, expectorated' AND DATETIME(microlab.culturetakentime) <= DATETIME(CURRENT_TIME(), '-1 year')) | eicu |
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB text,
BGDH number,
YLJGDM 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 te... | SELECT COUNT(*) FROM zyjzjlb WHERE zyjzjlb.YLJGDM = '1438612' AND zyjzjlb.RYDJSJ BETWEEN '2001-07-24' AND '2018-05-18' AND zyjzjlb.WDBZ > 0 | css |
CREATE TABLE table_62264 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Visitor, when Date is 'May 9'?
| SELECT "Visitor" FROM table_62264 WHERE "Date" = 'may 9' | wikisql |
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 MAX(demographic.age) FROM demographic WHERE demographic.insurance = "Self Pay" AND demographic.diagnosis = "HYPOXIA" | mimicsql_data |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
v... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.i... | mimic_iii |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decima... | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(MANAGER_ID) DESC | nvbench |
CREATE TABLE table_13606 (
"General election" real,
"Name" text,
"Share of votes" text,
"Seats" real,
"Share of seats" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Share of seats has Seats smaller than 52, and a Name of sdp liberal alliance,... | SELECT "Share of seats" FROM table_13606 WHERE "Seats" < '52' AND "Name" = 'sdp–liberal alliance' AND "General election" = '1983' | wikisql |
CREATE TABLE table_43858 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Attendance" real,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What attendance is dated february 27?
| SELECT AVG("Attendance") FROM table_43858 WHERE "Date" = 'february 27' | wikisql |
CREATE TABLE table_name_25 (
born_died VARCHAR,
term_start VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Born-Died, when Term Start is 4 December 1941?
| SELECT born_died FROM table_name_25 WHERE term_start = "4 december 1941" | 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 zyjybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN zyjybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '61732704' AND NOT zyjybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM ... | css |
CREATE TABLE table_name_61 (
translation VARCHAR,
composer VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WhatTranslation has a Composer of jacques brel, rod mckuen?
| SELECT translation FROM table_name_61 WHERE composer = "jacques brel, rod mckuen" | sql_create_context |
CREATE TABLE table_10305 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the venue where the away tea... | SELECT "Venue" FROM table_10305 WHERE "Away team score" = '17.12 (114)' | wikisql |
CREATE TABLE table_54569 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average round for players from california?
| SELECT AVG("Round") FROM table_54569 WHERE "College" = 'california' | wikisql |
CREATE TABLE table_65044 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent in week 6?
| SELECT "Opponent" FROM table_65044 WHERE "Week" = '6' | wikisql |
CREATE TABLE table_203_519 (
id number,
"pos" number,
"no" number,
"driver" text,
"team" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- charles zwolsman acquired the... | SELECT "driver" FROM table_203_519 WHERE "driver" <> 'charles zwolsman' AND "points" = (SELECT "points" FROM table_203_519 WHERE "driver" = 'charles zwolsman') | squall |
CREATE TABLE table_8376 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Score has a Visitor of toronto st. pats, and a Home of montreal canadiens, and a Record of 3 2 0?
| SELECT "Score" FROM table_8376 WHERE "Visitor" = 'toronto st. pats' AND "Home" = 'montreal canadiens' AND "Record" = '3–2–0' | wikisql |
CREATE TABLE table_21565 (
"1391 Carelia" text,
"1398 Donnera" text,
"1405 Sibelius" text,
"1406 Komppa" text,
"1407 Lindel\u00f6f" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the 1405 sibelius of asteroid which 1407 lindel f is 2020 ukko... | SELECT "1405 Sibelius" FROM table_21565 WHERE "1407 Lindel\u00f6f" = '2020 Ukko' | wikisql |
CREATE TABLE hz_info_zyjzjlb (
JZLSH number,
YLJGDM number,
zyjzjlb_id number
)
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,
... | SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz... | css |
CREATE TABLE table_11132 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent on December 10, 2000?
| SELECT "Opponent" FROM table_11132 WHERE "Date" = 'december 10, 2000' | wikisql |
CREATE TABLE table_name_45 (
played INTEGER,
points VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the mean number of played when there are less than 18 points and the position is less than 8?
| SELECT AVG(played) FROM table_name_45 WHERE points < 18 AND position < 8 | sql_create_context |
CREATE TABLE table_dev_14 (
"id" int,
"anemia" bool,
"pulmonary_disease" bool,
"c_peptide_level" float,
"hemoglobin_a1c_hba1c" float,
"renal_disease" bool,
"cardiovascular_disease" bool,
"estimated_glomerular_filtration_rate_egfr" int,
"fasting_c_peptide" float,
"organ_failure" b... | SELECT * FROM table_dev_14 WHERE fasting_c_peptide >= 0.8 | criteria2sql |
CREATE TABLE table_name_47 (
start_source VARCHAR,
started VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the start source when started on 2 february?
| SELECT start_source FROM table_name_47 WHERE started = "2 february" | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREAT... | SELECT (SELECT vitalperiodic.systemicsystolic FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-66713') AND NOT patient.unitdischarget... | eicu |
CREATE TABLE table_41819 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score of the competition on November 10?
| SELECT "Score" FROM table_41819 WHERE "Date" = 'november 10' | wikisql |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '23868941' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2002-01-22' AND '2003-03-01' AND t_kc22.MED_INV_ITEM_TYPE = '手术费' | css |
CREATE TABLE Ref_Locations (
Location_Code CHAR(15),
Location_Name VARCHAR(255),
Location_Description VARCHAR(255)
)
CREATE TABLE Employees (
Employee_ID INTEGER,
Role_Code CHAR(15),
Employee_Name VARCHAR(255),
Gender_MFU CHAR(1),
Date_of_Birth DATETIME,
Other_Details VARCHAR(255)
)... | SELECT Destroyed_by_Employee_ID, COUNT(*) FROM Documents_to_be_Destroyed GROUP BY Destroyed_by_Employee_ID | nvbench |
CREATE TABLE table_55145 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the region for an item on November 10, 2007 that's a cd?
| SELECT "Region" FROM table_55145 WHERE "Date" = 'november 10, 2007' AND "Format" = 'cd' | wikisql |
CREATE TABLE person_info_hz_info (
RYBH text,
KH number,
KLX number,
YLJGDM number
)
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 t... | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = ... | css |
CREATE TABLE Plays_games (
gameid VARCHAR
)
CREATE TABLE Video_games (
gameid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show all game names played by at least 1000 hours.
| SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid HAVING SUM(hours_played) >= 1000 | sql_create_context |
CREATE TABLE table_17093 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who are all the players for armwood high school
| SELECT "Player" FROM table_17093 WHERE "School" = 'Armwood High School' | wikisql |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | SELECT jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDW, AVG(jyjgzbb.JCZBJGDL) FROM jyjgzbb JOIN jybgb_jyjgzbb JOIN jybgb ON jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JYZBLSH AND jybgb_jyjgzbb.jyjgzbb_id = jyjgzbb.jyjgzbb_id AND jybgb_jyjgzbb.YLJGDM = jybgb.YLJGDM WHERE jybgb.YLJGDM = '2298937' AND jyjgzbb.BGRQ BETWEEN '2000-02-17' AND '2009-07... | css |
CREATE TABLE table_name_13 (
points VARCHAR,
draws VARCHAR,
wins VARCHAR,
goal_difference VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points have more than 14 wins, a goal difference of 14, and more than 6 draws?
| SELECT COUNT(points) FROM table_name_13 WHERE wins > 14 AND goal_difference = 14 AND draws > 6 | sql_create_context |
CREATE TABLE Affiliated_With (
Physician INTEGER,
Department INTEGER,
PrimaryAffiliation BOOLEAN
)
CREATE TABLE Procedures (
Code INTEGER,
Name VARCHAR(30),
Cost REAL
)
CREATE TABLE Department (
DepartmentID INTEGER,
Name VARCHAR(30),
Head INTEGER
)
CREATE TABLE On_Call (
Nurs... | SELECT T1.Name, COUNT(T1.Name) FROM Physician AS T1 JOIN Trained_In AS T2 ON T1.EmployeeID = T2.Physician JOIN Procedures AS T3 ON T3.Code = T2.Treatment WHERE T3.Cost > 5000 GROUP BY T1.Name ORDER BY COUNT(T1.Name) DESC | nvbench |
CREATE TABLE table_name_24 (
record VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Record, when Game is '24'?
| SELECT record FROM table_name_24 WHERE game = 24 | 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 jybgb.KSBM, jybgb.KSMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZ... | css |
CREATE TABLE month (
month_number int,
month_name text
)
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,... | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'SAN FRANCISCO' AND ground_service.city_code = city.city_code | atis |
CREATE TABLE table_41383 (
"Year" real,
"Award" text,
"Category" text,
"Nominee" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was best costume design the award category?
| SELECT "Year" FROM table_41383 WHERE "Category" = 'best costume design' | wikisql |
CREATE TABLE table_48522 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"Record" text,
"Streak" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Score when Team is @ Kansas City-Omaha Kings?
| SELECT "Score" FROM table_48522 WHERE "Team" = '@ kansas city-omaha kings' | wikisql |
CREATE TABLE table_18600760_20 (
ansi_code VARCHAR,
latitude VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many ansi codes are there for latitude 48.142938?
| SELECT COUNT(ansi_code) FROM table_18600760_20 WHERE latitude = "48.142938" | sql_create_context |
CREATE TABLE table_67337 (
"Call sign" text,
"Frequency MHz" text,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of call sign that uses a Frequency MHz of 91.1 fm?
| SELECT "Call sign" FROM table_67337 WHERE "Frequency MHz" = '91.1 fm' | wikisql |
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 gwyjzb.IN_DIAG_DIS_CD, gwyjzb.IN_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_NM = '喻思聪' AND gwyjzb.IN_HOSP_DATE BETWEEN '2002-10-16' AND '2006-01-26' GROUP BY gwyjzb.IN_DIAG_DIS_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, fgwyjzb.IN_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '喻... | css |
CREATE TABLE table_name_96 (
date VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which date featured the Boston Patriots as the opponent?
| SELECT date FROM table_name_96 WHERE opponent = "boston patriots" | sql_create_context |
CREATE TABLE table_40834 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In the Phoenix Open, what was the winning score?
| SELECT "Winning score" FROM table_40834 WHERE "Tournament" = 'phoenix open' | wikisql |
CREATE TABLE table_name_52 (
rec INTEGER,
yards VARCHAR,
s_touchdown VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which rec has Yards of 192, and a Touchdown smaller than 1?
| SELECT AVG(rec) FROM table_name_52 WHERE yards = 192 AND s_touchdown < 1 | sql_create_context |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost numb... | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 77980) AND prescriptions.drug = 'phenytoin (suspension)' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-4 year') | mimic_iii |
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varch... | 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_204_357 (
id number,
"year" number,
"div." text,
"pos." text,
"cup" text,
"top scorer (league)" text,
"score" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many years was shodiev the top scorer ?
| SELECT COUNT("year") FROM table_204_357 WHERE "top scorer (league)" = 'vokhid shodiev' | squall |
CREATE TABLE actor (
aid int,
gender text,
name text,
nationality text,
birth_city text,
birth_year int
)
CREATE TABLE writer (
wid int,
gender text,
name text,
nationality text,
birth_city text,
birth_year int
)
CREATE TABLE director (
did int,
gender text,
... | SELECT movie.title FROM made_by, movie, producer, writer, written_by WHERE movie.mid = made_by.msid AND producer.name = 'Woody Allen' AND producer.pid = made_by.pid AND writer.name = 'Woody Allen' AND written_by.msid = movie.mid AND written_by.wid = writer.wid | imdb |
CREATE TABLE table_1341568_14 (
district VARCHAR,
elected VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What district had elections in 1964?
| SELECT district FROM table_1341568_14 WHERE elected = 1964 | sql_create_context |
CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptroller text,
Attorney_General text,
US_Senate text
)
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
Party int,
... | SELECT T2.Party, COUNT(T2.Party) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party | nvbench |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Medicare" AND diagnoses.long_title = "Body Mass Index less than 19, adult" | mimicsql_data |
CREATE TABLE table_train_130 (
"id" int,
"gender" string,
"systolic_blood_pressure_sbp" int,
"right_bundle_branch_block" bool,
"space_occupying_cerebral_lesion" bool,
"huntington_disease" bool,
"psychiatric_disease" bool,
"mental_illness" bool,
"treatment_regimen" bool,
"psychoti... | SELECT * FROM table_train_130 WHERE bilirubin > 2 OR ((gender = 'male' AND serum_creatinine > 1.5) OR (gender = 'female' AND serum_creatinine > 1.4)) | criteria2sql |
CREATE TABLE table_168274_1 (
index_weighting___percentage__at_17_january_2013 VARCHAR,
company VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of index weighting % at 17 january 2013 for bouygues
| SELECT COUNT(index_weighting___percentage__at_17_january_2013) FROM table_168274_1 WHERE company = "Bouygues" | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" AND procedures.short_title = "Parent infus nutrit sub" | mimicsql_data |
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Faculty_Participates_in (
FacID INTEGER,
actid INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
... | SELECT Sex, COUNT(*) FROM Faculty WHERE Rank = "AsstProf" GROUP BY Sex | nvbench |
CREATE TABLE table_64088 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score in the final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who are the opponents in the Februa... | SELECT "Opponents in the final" FROM table_64088 WHERE "Date" = 'february 19, 1996' | wikisql |
CREATE TABLE table_63202 (
"Position" real,
"Gymnast" text,
"A score" real,
"B score" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total when the A score was less than 6.6, and the B score was 8.925?
| SELECT "Total" FROM table_63202 WHERE "A score" < '6.6' AND "B score" = '8.925' | wikisql |
CREATE TABLE table_23066 (
"Draw" real,
"Artist" text,
"Original" text,
"English Meaning" text,
"Language" text,
"Authors" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the artist for the origin Shake it, Europe?
| SELECT "Artist" FROM table_23066 WHERE "Original" = 'Shake It, Europe' | wikisql |
CREATE TABLE table_46991 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the Player that has the Country of united states, and the Score of 77-72-72=221?
| SELECT "Player" FROM table_46991 WHERE "Country" = 'united states' AND "Score" = '77-72-72=221' | wikisql |
CREATE TABLE table_23274514_9 (
record VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record when they played golden state?
| SELECT record FROM table_23274514_9 WHERE team = "Golden State" | sql_create_context |
CREATE TABLE table_17058178_8 (
team VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who did the Trail Blazers play on January 2?
| SELECT team FROM table_17058178_8 WHERE date = "January 2" | sql_create_context |
CREATE TABLE table_15187735_5 (
netflix VARCHAR,
segment_b VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When marshmallow cookies is segment b what episode is it on netflix?
| SELECT netflix FROM table_15187735_5 WHERE segment_b = "Marshmallow Cookies" | sql_create_context |
CREATE TABLE table_22165661_3 (
head_coach VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the head coach for the score of 4-3?
| SELECT head_coach FROM table_22165661_3 WHERE score = "4-3" | sql_create_context |
CREATE TABLE table_name_37 (
to_par INTEGER,
place VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest to par with a place of t8 and West Germany as the country?
| SELECT MAX(to_par) FROM table_name_37 WHERE place = "t8" AND country = "west germany" | sql_create_context |
CREATE TABLE College (
cName varchar(20),
state varchar(2),
enr numeric(5,0)
)
CREATE TABLE Tryout (
pID numeric(5,0),
cName varchar(20),
pPos varchar(8),
decision varchar(3)
)
CREATE TABLE Player (
pID numeric(5,0),
pName varchar(20),
yCard varchar(3),
HS numeric(5,0)
)
... | SELECT pName, HS FROM Player WHERE HS < 1500 ORDER BY HS DESC | nvbench |
CREATE TABLE enzyme (
id int,
name text,
Location text,
Product text,
Chromosome text,
OMIM int,
Porphyria text
)
CREATE TABLE medicine_enzyme_interaction (
enzyme_id int,
medicine_id int,
interaction_type text
)
CREATE TABLE medicine (
id int,
name text,
Trade_Name... | SELECT Trade_Name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id ORDER BY id DESC | nvbench |
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 ReviewRejectionReasons (
Id number,
N... | WITH DownVoterCount AS (SELECT DownVoterCount = CAST(COUNT(*) AS FLOAT) FROM Users WHERE Users.DownVotes > 0), UserCount AS (SELECT UserCount = CAST(COUNT(*) AS FLOAT) FROM Users), DownVoterPercentage AS (SELECT ROUND(((SELECT DownVoterCount FROM DownVoterCount) / (SELECT UserCount FROM UserCount)) * 100, 2) AS DownVot... | sede |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime... | SELECT MAX(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-83812')) AND lab.labname = 'o2 sat (%)' AND STRFTIME('%y', lab.labresulttime) ... | eicu |
CREATE TABLE table_name_90 (
points INTEGER,
opponent VARCHAR,
january VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Points have an Opponent of calgary flames, and a January larger than 22?
| SELECT AVG(points) FROM table_name_90 WHERE opponent = "calgary flames" AND january > 22 | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Other chronic pain" AND lab.flag = "abnormal" | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "DIVORCED" AND lab.label = "pH" | mimicsql_data |
CREATE TABLE table_name_86 (
hits VARCHAR,
year INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the hits for years before 1883
| SELECT hits FROM table_name_86 WHERE year < 1883 | sql_create_context |
CREATE TABLE table_51486 (
"Year" real,
"Organisation" text,
"Award" text,
"Nominated Work Title" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the organisation when the nominated work title is n/a in the year 2005?
| SELECT "Organisation" FROM table_51486 WHERE "Nominated Work Title" = 'n/a' AND "Year" = '2005' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartr... | SELECT AVG(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'platelet dysfunction' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104' GROUP BY STRFTIME('%y-%m-%d', diagnosis.diagnosistime)) AS t1 | eicu |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
... | 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 = 23 AND date_day.month_number = 11 AND d... | atis |
CREATE TABLE table_train_138 (
"id" int,
"mini_mental_state_examination_mmse" int,
"stroke" bool,
"body_weight" float,
"cranial_neurosurgery" bool,
"first_degree_relative" bool,
"seizure_disorder" bool,
"alcohol_abuse" bool,
"body_mass_index_bmi" float,
"aneurysm" bool,
"NOUS... | SELECT * FROM table_train_138 WHERE stroke = 1 OR aneurysm = 1 OR cranial_neurosurgery = 1 | criteria2sql |
CREATE TABLE table_50135 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What method was used in the match that went to roun... | SELECT "Method" FROM table_50135 WHERE "Round" = '1' AND "Record" = '6-3-1' | wikisql |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE patient (
uniquep... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', medication.drugstarttime)) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-195... | eicu |
CREATE TABLE table_204_398 (
id number,
"title" text,
"year" number,
"publisher" text,
"developer" text,
"platforms" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total number of lord of the rings games released since 1982 ?
| SELECT COUNT("title") FROM table_204_398 WHERE "year" > 1982 | squall |
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Number_Deaths int
)
CREATE TABLE region (
Region_id int,
Region_code text,
Region_name text
)
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_cit... | SELECT Name, COUNT(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.Storm_ID = T2.Storm_ID GROUP BY T1.Storm_ID | nvbench |
CREATE TABLE trained_in (
physician number,
treatment number,
certificationdate time,
certificationexpires time
)
CREATE TABLE patient (
ssn number,
name text,
address text,
phone text,
insuranceid number,
pcp number
)
CREATE TABLE nurse (
employeeid number,
name text,
... | SELECT COUNT(patient) FROM stay WHERE room = 112 | spider |
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases IN... | SELECT Name, COUNT(Name) FROM appellations AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Monterey" AND T2.Price < 50 GROUP BY Name ORDER BY COUNT(Name) | nvbench |
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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "DIVORCED" AND lab.label = "Alkaline Phosphatase" | mimicsql_data |
CREATE TABLE table_name_42 (
high_rebounds VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had the highest number of rebounds on February 14?
| SELECT high_rebounds FROM table_name_42 WHERE date = "february 14" | 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... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "NEWBORN" AND diagnoses.long_title = "Loss of weight" | mimicsql_data |
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 COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73075) AND STRFTIME('%y', procedures_icd.charttime) >= '2103' | mimic_iii |
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,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | SELECT COUNT(sel.Id) FROM (SELECT c.Id FROM Comments AS c WHERE YEAR(c.CreationDate) >= 2019) AS sel | sede |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.