instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
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.insurance = "Medicaid" AND procedures.long_title = "Transplant from live non-related donor" | mimicsql_data |
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb 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 = j... | css |
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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Malig neo bladder NEC" AND lab.fluid = "Joint Fluid" | mimicsql_data |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" | mimicsql_data |
CREATE TABLE table_204_445 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the top position in which he finished ?
| SELECT MIN("position") FROM table_204_445 | squall |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Views, AccountId, Age, UpVotes, DownVotes FROM Users WHERE LOWER(Location) LIKE LOWER('%Germany%') AND Reputation >= 578 ORDER BY Reputation | sede |
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 (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | 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 = "Diaphragmatic hernia without mention of obstruction or gangrene" AND lab.fluid = "Urine" | mimicsql_data |
CREATE TABLE table_17287 (
"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.
-- How ma... | SELECT COUNT("Location Attendance") FROM table_17287 WHERE "Score" = '98–90' | wikisql |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE time_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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND date_day.day_number = 21 AND date_day.month_number = 2... | atis |
CREATE TABLE table_name_51 (
gdp_2012_millions_of_euro VARCHAR,
population_in_millions VARCHAR,
gdp__nominal__per_capita_2012_euro VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is GDP 2012 Millions of Euro, when Population in Millions is less than ... | SELECT gdp_2012_millions_of_euro FROM table_name_51 WHERE population_in_millions < 1.3 AND gdp__nominal__per_capita_2012_euro = "20,700(p)" | sql_create_context |
CREATE TABLE table_6340 (
"Name" text,
"Circuit" text,
"Date" text,
"Winning driver" text,
"Winning constructor" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is Winning driver on 18 may?
| SELECT "Winning driver" FROM table_6340 WHERE "Date" = '18 may' | wikisql |
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airline (
airline_co... | 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_... | atis |
CREATE TABLE table_train_214 (
"id" int,
"gender" string,
"lead_ecg" bool,
"systolic_blood_pressure_sbp" int,
"qt_interval" bool,
"urine_dipstick_protein" int,
"stroke" bool,
"transient_ischemic_attack" bool,
"qtc" int,
"long_qt_syndrome" bool,
"cardiovascular_disease" bool,
... | SELECT * FROM table_train_214 WHERE lead_ecg = 1 OR (qt_interval = 1 OR (gender = 'male' AND qtc > 450) OR (gender = 'female' AND qtc > 470)) | criteria2sql |
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 mzjzjlb (
HXPLC number,
HZXM ... | SELECT jybgb.SQRGH, jybgb.SQRXM FROM jybgb WHERE jybgb.BGDH = '77601421796' | css |
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 * 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.RYBH = '... | css |
CREATE TABLE table_name_67 (
class VARCHAR,
pos VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the class for 4th position with year before 2006
| SELECT class FROM table_name_67 WHERE pos = "4th" AND year < 2006 | sql_create_context |
CREATE TABLE inst (
instid number,
name text,
country text
)
CREATE TABLE papers (
paperid number,
title text
)
CREATE TABLE authorship (
authid number,
instid number,
paperid number,
authorder number
)
CREATE TABLE authors (
authid number,
lname text,
fname text
)
-... | SELECT t1.country FROM inst AS t1 JOIN authorship AS t2 ON t1.instid = t2.instid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.country ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_203_784 (
id number,
"no. in\nseries" number,
"no. in\nseason" number,
"performer" text,
"appearance" text,
"air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many performers appeared on the air date 21 january 2011... | SELECT COUNT("performer") FROM table_203_784 WHERE "air date" = '21 january 2011' | squall |
CREATE TABLE table_30058355_7 (
fri_26_aug VARCHAR,
wed_24_aug VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is every entry for Friday August 26 when the entry for Wednesday August 24 is 23' 52.67 94.807mph?
| SELECT fri_26_aug FROM table_30058355_7 WHERE wed_24_aug = "23' 52.67 94.807mph" | sql_create_context |
CREATE TABLE table_57166 (
"Round" real,
"Grand Prix" text,
"Date" text,
"Location" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning Driver" text,
"Winning Constructor" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above... | SELECT "Winning Constructor" FROM table_57166 WHERE "Winning Driver" = 'riccardo patrese' | wikisql |
CREATE TABLE table_name_66 (
interview INTEGER,
swimsuit VARCHAR,
average VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the highest Interview score from a contestant who had a swimsuit score of 8.857 and an Average score over 9.097?
| SELECT MAX(interview) FROM table_name_66 WHERE swimsuit = 8.857 AND average > 9.097 | sql_create_context |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | SELECT COUNT(DISTINCT OwnerUserId) FROM Posts | sede |
CREATE TABLE table_name_21 (
ties INTEGER,
games_played VARCHAR,
wins VARCHAR,
goals_against VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For teams with fewer than 5 wins, goals against over 37, and fewer than 8 games played, what is the average nu... | SELECT AVG(ties) FROM table_name_21 WHERE wins < 5 AND goals_against > 37 AND games_played < 8 | sql_create_context |
CREATE TABLE table_46722 (
"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.
-- What t... | SELECT "Team" FROM table_46722 WHERE "Record" = '50–28' | wikisql |
CREATE TABLE table_58810 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the away team on 30 January 1988, when the home team was Everton?
| SELECT "Away team" FROM table_58810 WHERE "Home team" = 'everton' AND "Date" = '30 january 1988' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
d... | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'uterine leiomyoma nos')) | mimic_iii |
CREATE TABLE table_12369913_1 (
result VARCHAR,
original_title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many results are there with the original title of ani ohev otach roza ( )?
| SELECT COUNT(result) FROM table_12369913_1 WHERE original_title = "Ani Ohev Otach Roza (אני אוהב אותך רוזה)" | sql_create_context |
CREATE TABLE table_63986 (
"Team #1" text,
"Agg." text,
"Team #2" text,
"1st leg" text,
"2nd leg" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the first leg score of the matchup with a 2nd leg of 80-70?
| SELECT "1st leg" FROM table_63986 WHERE "2nd leg" = '80-70' | wikisql |
CREATE TABLE table_name_35 (
report VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the report about townsville crocodiles as an away team?
| SELECT report FROM table_name_35 WHERE away_team = "townsville crocodiles" | sql_create_context |
CREATE TABLE table_2897457_2 (
pick__number VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many draft picks is player byron dafoe?
| SELECT COUNT(pick__number) FROM table_2897457_2 WHERE player = "Byron Dafoe" | sql_create_context |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE swimme... | SELECT T4.Name, COUNT(T4.Name) FROM swimmer AS t1 JOIN record AS t2 ON t1.ID = t2.Swimmer_ID JOIN event AS t3 ON t2.Event_ID = t3.ID JOIN stadium AS t4 ON t4.ID = t3.Stadium_ID WHERE t1.Nationality = 'Australia' GROUP BY T4.Name | nvbench |
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.JZLSH FROM jybgb WHERE jybgb.BGDH = '60691424102' | css |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t4.icd9_code FROM (SELECT t3.icd9_code, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.icd9_code, 100 - SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.chartt... | mimic_iii |
CREATE TABLE table_name_5 (
tournament VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What tournament was located in Colorado?
| SELECT tournament FROM table_name_5 WHERE location = "colorado" | sql_create_context |
CREATE TABLE table_41898 (
"Ballarat 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 is the smallest losses when the wins are 5 and the against less than 1852?
| SELECT MIN("Losses") FROM table_41898 WHERE "Wins" = '5' AND "Against" < '1852' | wikisql |
CREATE TABLE table_5335 (
"Specification" text,
"Gender" text,
"Junior High School (12\u201315 yrs)" text,
"Senior High School (15\u201318 yrs)" text,
"University students and Adults (18yrs+)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What valu... | SELECT "University students and Adults (18yrs+)" FROM table_5335 WHERE "Gender" = 'male' AND "Specification" = 'minimum weight' | wikisql |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'PEDDENT' AND course.number = 599 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offerin... | advising |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d... | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'dorzolamide 2% ophth. soln.') | mimic_iii |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
war... | SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 80119 AND DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-6 year') | mimic_iii |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | SELECT DISTINCT name, number FROM course WHERE credits = 3 AND department = 'EECS' | advising |
CREATE TABLE appointment (
Physician VARCHAR
)
CREATE TABLE physician (
name VARCHAR,
EmployeeID VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the name of physicians who took some appointment.
| SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician = T2.EmployeeID | sql_create_context |
CREATE TABLE Student (
StuID VARCHAR,
age INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show all student ids who are older than 20.
| SELECT StuID FROM Student WHERE age > 20 | sql_create_context |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE instructor (
instructo... | SELECT COUNT(*) > 0 FROM course, program, program_course WHERE course.department = 'HHCR' AND course.number = 710 AND program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id | advising |
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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE T... | SELECT EMAIL, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMAIL | nvbench |
CREATE TABLE table_name_43 (
body VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What body participated in 1973?
| SELECT body FROM table_name_43 WHERE year = "1973" | sql_create_context |
CREATE TABLE table_name_3 (
country VARCHAR,
iata VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country has an IATA of JFK?
| SELECT country FROM table_name_3 WHERE iata = "jfk" | sql_create_context |
CREATE TABLE Person (
job VARCHAR,
age INTEGER,
gender VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is average age of male for different job title?
| SELECT AVG(age), job FROM Person WHERE gender = 'male' GROUP BY job | sql_create_context |
CREATE TABLE table_204_756 (
id number,
"year" number,
"team" text,
"games" number,
"combined tackles" number,
"tackles" number,
"assisted tackles" number,
"sacks" number,
"forced fumbles" number,
"fumble recoveries" number,
"fumble return yards" number,
"interceptions" n... | SELECT COUNT("year") FROM table_204_756 WHERE "games" < 16 | squall |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varch... | SELECT DISTINCT advisory_requirement, enforced_requirement, name FROM course WHERE department = 'EECS' AND number = 510 | advising |
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 AVG(t_kc21.MED_AMOUT) FROM t_kc21 WHERE t_kc21.MED_ORG_DEPT_NM = '神经内科' AND t_kc21.IN_HOSP_DATE BETWEEN '2008-03-15' AND '2013-06-01' AND t_kc21.IN_DIAG_DIS_CD = 'L40.551' AND t_kc21.CLINIC_TYPE = '住院' | css |
CREATE TABLE table_name_63 (
score VARCHAR,
partnering VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which Score has a Partnering of dmitry tursunov?
| SELECT score FROM table_name_63 WHERE partnering = "dmitry tursunov" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM t... | (SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM 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... | css |
CREATE TABLE table_15835 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year did Elf Team Tyrrell have 34 points?
| SELECT AVG("Year") FROM table_15835 WHERE "Entrant" = 'elf team tyrrell' AND "Points" = '34' | 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 MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.diagnosis = "GANGRENE" | mimicsql_data |
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 cName, COUNT(*) FROM Tryout GROUP BY cName ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_name_54 (
byes INTEGER,
benalla_dfl VARCHAR,
wins VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the average byes of Bonnie Doon having more than 16 wins?
| SELECT AVG(byes) FROM table_name_54 WHERE benalla_dfl = "bonnie doon" AND wins > 16 | sql_create_context |
CREATE TABLE Circulation_History (
document_id INTEGER,
draft_number INTEGER,
copy_number INTEGER,
employee_id INTEGER
)
CREATE TABLE Roles (
role_code CHAR(15),
role_description VARCHAR(255)
)
CREATE TABLE Documents_Mailed (
document_id INTEGER,
mailed_to_address_id INTEGER,
maili... | SELECT receipt_date, COUNT(receipt_date) FROM Documents ORDER BY receipt_date | nvbench |
CREATE TABLE table_42620 (
"Name" text,
"Position" text,
"Number" real,
"School/Club Team" text,
"Season" text,
"Acquisition via" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How did the School/Club Team of Manuel Luis Quezon acquire their For... | SELECT "Acquisition via" FROM table_42620 WHERE "Position" = 'forward' AND "School/Club Team" = 'manuel luis quezon' | wikisql |
CREATE TABLE table_49221 (
"Round" real,
"Pick" text,
"Player" text,
"Position" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the WR player?
| SELECT "Player" FROM table_49221 WHERE "Position" = 'wr' | wikisql |
CREATE TABLE table_name_15 (
attendance VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the attendance on april 17
| SELECT attendance FROM table_name_15 WHERE date = "april 17" | 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 admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
a... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admi... | mimic_iii |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as ... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016 ORDER BY course.department | advising |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE aircraft (... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN... | atis |
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 WHERE demographic.age < "81" AND demographic.days_stay > "29" | mimicsql_data |
CREATE TABLE table_47031 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record of game 26 wi... | SELECT "Record" FROM table_47031 WHERE "High assists" = 'beno udrih (4)' AND "Game" = '26' | wikisql |
CREATE TABLE head (
head_ID int,
name text,
born_state text,
age real
)
CREATE TABLE management (
department_ID int,
head_ID int,
temporary_acting text
)
CREATE TABLE department (
Department_ID int,
Name text,
Creation text,
Ranking int,
Budget_in_Billions real,
Num... | SELECT Creation, AVG(Budget_in_Billions) FROM department | nvbench |
CREATE TABLE table_name_92 (
winner VARCHAR,
finalist VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the winner against finalist Lina Krasnoroutskaya?
| SELECT winner FROM table_name_92 WHERE finalist = "lina krasnoroutskaya" | sql_create_context |
CREATE TABLE fgwyjzb (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '华安然' AND NOT gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 1404.19) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '华安然' AND NOT fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FR... | css |
CREATE TABLE table_48509 (
"Tournament" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1997" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"Career WR"... | SELECT "2000" FROM table_48509 WHERE "1996" = 'a' AND "1997" = 'a' AND "2007" = 'a' | wikisql |
CREATE TABLE table_59095 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the maximum total when the To par is +3?
| SELECT MAX("Total") FROM table_59095 WHERE "To par" = '+3' | wikisql |
CREATE TABLE table_name_62 (
venue VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where did Geelong play as the away team?
| SELECT venue FROM table_name_62 WHERE away_team = "geelong" | sql_create_context |
CREATE TABLE table_34997 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date has ny islanders as the visitor?
| SELECT "Date" FROM table_34997 WHERE "Visitor" = 'ny islanders' | wikisql |
CREATE TABLE table_48512 (
"Year" real,
"Award" text,
"Nominated Work" text,
"Category" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Before the year 2012, what award was given to the artist in the category of revelaci n pop del a o?... | SELECT "Award" FROM table_48512 WHERE "Year" < '2012' AND "Category" = 'revelación pop del año' | wikisql |
CREATE TABLE table_53603 (
"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 is the average attendance on april 24?
| SELECT AVG("Attendance") FROM table_53603 WHERE "Date" = 'april 24' | wikisql |
CREATE TABLE architect (
id text,
name text,
nationality text,
gender text
)
CREATE TABLE bridge (
architect_id int,
id int,
name text,
location text,
length_meters real,
length_feet real
)
CREATE TABLE mill (
architect_id int,
id int,
location text,
name text,
... | SELECT T1.name, T1.id FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id ORDER BY T1.id DESC | nvbench |
CREATE TABLE table_name_2 (
d_46_√ VARCHAR,
d_43_√ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the D 46 with a D 43 with r 3?
| SELECT d_46_√ FROM table_name_2 WHERE d_43_√ = "r 3" | sql_create_context |
CREATE TABLE table_name_93 (
loses INTEGER,
points VARCHAR,
points_against VARCHAR,
club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the highest losses that have points agaisnt less than 956, high park demons as the club, and points less ... | SELECT MAX(loses) FROM table_name_93 WHERE points_against < 956 AND club = "high park demons" AND points < 16 | sql_create_context |
CREATE TABLE table_63443 (
"Rank" real,
"Rowers" text,
"Country" text,
"Time" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What rank was the team from Australia?
| SELECT COUNT("Rank") FROM table_63443 WHERE "Country" = 'australia' | wikisql |
CREATE TABLE table_71700 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the sum of roll for morrinsville school
| SELECT SUM("Roll") FROM table_71700 WHERE "Name" = 'morrinsville school' | wikisql |
CREATE TABLE Customers_Cards (
card_id INTEGER,
customer_id INTEGER,
card_type_code VARCHAR(15),
card_number VARCHAR(80),
date_valid_from DATETIME,
date_valid_to DATETIME,
other_card_details VARCHAR(255)
)
CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
account_... | SELECT transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type ORDER BY transaction_type | nvbench |
CREATE TABLE section (
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
building varchar(15),
room_number varchar(7),
time_slot_id varchar(4)
)
CREATE TABLE takes (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
... | SELECT year, COUNT(*) FROM section GROUP BY semester ORDER BY year DESC | nvbench |
CREATE TABLE All_Documents (
Document_ID INTEGER,
Date_Stored DATETIME,
Document_Type_Code CHAR(15),
Document_Name CHAR(255),
Document_Description CHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Document_Locations (
Document_ID INTEGER,
Location_Code CHAR(15),
Date_in_Location_... | SELECT Role_Code, COUNT(*) FROM Employees GROUP BY Role_Code | nvbench |
CREATE TABLE table_25751 (
"Position" real,
"Driver" text,
"Points" real,
"Starts" real,
"Wins" real,
"Top 5s" real,
"Top 10s" real,
"Winnings ($)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many starts are there?
| SELECT MIN("Starts") FROM table_25751 | 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 COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '1165324' AND IN_HOSP_DATE BETWEEN '2002-04-26' AND '2008-06-23' AND INSU_TYPE = '儿童' | css |
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 demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.short_title = "1 int mam-cor art bypass" | mimicsql_data |
CREATE TABLE mzb (
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 qtb.MED_ORG_DEPT_CD, qtb.MED_ORG_DEPT_NM FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '3153321' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2009-02-17' AND '2015-11-04' GROUP BY qtb.MED_ORG_DEPT_CD ORDER BY SUM(t_kc24.OVE_PAY) DESC LIMIT 29 UNION SELECT gyb.MED_ORG_DEPT_CD,... | css |
CREATE TABLE table_53324 (
"Unit" text,
"Reactor Type" text,
"Net Capacity" text,
"Gross Capacity" text,
"Construction Start" text,
"Grid Connection" text,
"Commercial Operation" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT "Gross Capacity" FROM table_53324 WHERE "Commercial Operation" = 'august 28, 1987' | wikisql |
CREATE TABLE table_72485 (
"N" real,
"P" text,
"Name" text,
"EU" text,
"Country" text,
"Age" real,
"Type" text,
"Moving from" text,
"Transfer window" text,
"Ends" text,
"Transfer fee" text,
"Source" text
)
-- Using valid SQLite, answer the following questions for the ta... | SELECT "Type" FROM table_72485 WHERE "Transfer fee" = '€20M' | wikisql |
CREATE TABLE table_11157122_5 (
yards VARCHAR,
attempts VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many yards did the player with 87 attempts rush?
| SELECT yards FROM table_11157122_5 WHERE attempts = 87 | sql_create_context |
CREATE TABLE table_75986 (
"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.
-- Which Score has smaller than 1994, and a Partner of elizabe... | SELECT "Score" FROM table_75986 WHERE "Year" < '1994' AND "Partner" = 'elizabeth sayers smylie' | wikisql |
CREATE TABLE table_20819 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many players named Jeff Brown were drafted
| SELECT COUNT("Position") FROM table_20819 WHERE "Player" = 'Jeff Brown' | wikisql |
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)
)
CREATE TABLE College (
cName varchar(20),
state varchar(2),
enr numeric(5,0)
)
... | SELECT cName, enr FROM College ORDER BY enr | nvbench |
CREATE TABLE table_train_165 (
"id" int,
"gender" string,
"hemoglobin_a1c_hba1c" float,
"visual_impairment" bool,
"blood_glucose" int,
"body_mass_index_bmi" float,
"a1c" float,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT * FROM table_train_165 WHERE body_mass_index_bmi >= 30 | criteria2sql |
CREATE TABLE table_42631 (
"Rank" real,
"Song title" text,
"Composer(s)" text,
"Performer(s)" text,
"Year" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who sang the song composed by Mariah Carey and Walter Afanasieff?
| SELECT "Performer(s)" FROM table_42631 WHERE "Composer(s)" = 'mariah carey and walter afanasieff' | wikisql |
CREATE TABLE table_dev_26 (
"id" int,
"gender" string,
"hemoglobin_a1c_hba1c" float,
"dyslipidemia" bool,
"body_weight" float,
"hba1c" float,
"body_mass_index_bmi" float,
"hypertension" bool,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provi... | SELECT * FROM table_dev_26 WHERE hba1c > 7 AND hemoglobin_a1c_hba1c < 10.5 | criteria2sql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetake... | SELECT MIN(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 = '011-53628')) AND lab.labname = 'alkaline phos.' AND DATETIME(lab.labresulttime, 's... | eicu |
CREATE TABLE table_37959 (
"Date" text,
"Time" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Total" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Total has a Score of 1 3, and a Set 1 of 29 31?
| SELECT "Total" FROM table_37959 WHERE "Score" = '1–3' AND "Set 1" = '29–31' | 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 demographic.language FROM demographic WHERE demographic.name = "Charles Deshay" | mimicsql_data |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD... | SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_NM = '花淑华' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '603623-l') | css |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
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,
insuranc... | SELECT t3.drug FROM (SELECT t2.drug, 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.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ... | mimic_iii |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.