instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_items (
row_id number,
... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'creon 12' AND STRFTIME('%y', prescriptions.startdate) = '2104') A... | mimic_iii |
CREATE TABLE table_name_33 (
date_of_release INTEGER,
title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE AVERAGE DATE OF RELEASE FOR THICKSKIN?
| SELECT AVG(date_of_release) FROM table_name_33 WHERE title = "thickskin" | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
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,
... | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'advair diskus' AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-1 year') | mimic_iii |
CREATE TABLE mountain (
id number,
name text,
height number,
prominence number,
range text,
country text
)
CREATE TABLE camera_lens (
id number,
brand text,
name text,
focal_length_mm number,
max_aperture number
)
CREATE TABLE photos (
id number,
camera_lens_id numb... | SELECT name, height, prominence FROM mountain WHERE range <> 'Aberdare Range' | spider |
CREATE TABLE table_5710 (
"Games" real,
"Drawn" real,
"Lost" real,
"Points difference" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Points difference of 18 - 33, and a Points smaller than 4 is the total of what sum of games?
| SELECT SUM("Games") FROM table_5710 WHERE "Points difference" = '18 - 33' AND "Points" < '4' | wikisql |
CREATE TABLE table_31508 (
"Townland" text,
"Area( acres )" real,
"Barony" text,
"Civil parish" text,
"Poor law union" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Ballymurphy North's civil parish?
| SELECT "Civil parish" FROM table_31508 WHERE "Townland" = 'Ballymurphy North' | wikisql |
CREATE TABLE table_name_5 (
tournament VARCHAR,
host VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the tournament on July 29 hosted by SK Brann?
| SELECT tournament FROM table_name_5 WHERE host = "sk brann" AND date = "july 29" | sql_create_context |
CREATE TABLE Part_Faults (
part_fault_id INTEGER,
part_id INTEGER,
fault_short_name VARCHAR(20),
fault_description VARCHAR(255),
other_fault_details VARCHAR(255)
)
CREATE TABLE Maintenance_Engineers (
engineer_id INTEGER,
company_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR... | SELECT part_name, COUNT(*) FROM Parts AS T1 JOIN Asset_Parts AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_name ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_name_30 (
caps INTEGER,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many caps for mike macdonald?
| SELECT SUM(caps) FROM table_name_30 WHERE player = "mike macdonald" | sql_create_context |
CREATE TABLE table_name_51 (
date VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date of the game with a score of 4-2?
| SELECT date FROM table_name_51 WHERE score = "4-2" | sql_create_context |
CREATE TABLE table_3500 (
"No." real,
"#" real,
"Title" text,
"Directed by" text,
"Written by" text,
"U.S. viewers (million)" text,
"Rank (week)" text,
"Original air date" text,
"Production code" text
)
-- Using valid SQLite, answer the following questions for the tables provided a... | SELECT "Written by" FROM table_3500 WHERE "No." = '38' | 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.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 7492.17) UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, fgwyjzb.IN_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '沈鸿信' AND fgwyjzb.MED_C... | css |
CREATE TABLE table_20823568_2 (
second_place_s_ VARCHAR,
sporting_profession VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many second place showings does snooker have?
| SELECT second_place_s_ FROM table_20823568_2 WHERE sporting_profession = "Snooker" | sql_create_context |
CREATE TABLE party (
party_name VARCHAR,
party_id VARCHAR
)
CREATE TABLE Member (
member_name VARCHAR,
party_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List member names and their party names.
| SELECT T1.member_name, T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id | sql_create_context |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT * FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '69043988325' AND NOT t_kc22.MED_ORG_DEPT_NM LIKE '%烧伤科%' | css |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Myelodysplastic syndrome, unspecified" AND prescriptions.drug_type = "BASE" | mimicsql_data |
CREATE TABLE table_name_17 (
points INTEGER,
opponent VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Points have an Opponent of @ florida panthers, and a Game larger than 58?
| SELECT MIN(points) FROM table_name_17 WHERE opponent = "@ florida panthers" AND game > 58 | 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 WHERE demographic.diagnosis = "CEREBRAL ANEURYSM/SDA" AND demographic.admityear < "2173" | mimicsql_data |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose... | SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 20166 AND DATETIME(admissions.dischtime) >= DATETIME(CURRENT_TIME(), '-3 year') ORDER BY admissions.dischtime LIMIT 1 | mimic_iii |
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 prescriptions... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND diagnoses.short_title = "Polymyalgia rheumatica" | mimicsql_data |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime t... | SELECT STRFTIME('%j', admissions.dischtime) - STRFTIME('%j', admissions.admittime) FROM admissions WHERE admissions.subject_id = 78076 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_name_63 (
competition VARCHAR,
goal VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What competition has 41 goals?
| SELECT competition FROM table_name_63 WHERE goal = 41 | sql_create_context |
CREATE TABLE table_name_65 (
poles INTEGER,
season VARCHAR,
wins VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average Poles, when Wins is 0, when Position is 'nc', and when Season is before 2004?
| SELECT AVG(poles) FROM table_name_65 WHERE wins = 0 AND position = "nc" AND season < 2004 | sql_create_context |
CREATE TABLE laptimes (
raceid number,
driverid number,
lap number,
position number,
time text,
milliseconds number
)
CREATE TABLE constructorstandings (
constructorstandingsid number,
raceid number,
constructorid number,
points number,
position number,
positiontext text... | SELECT T1.driverid, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds DESC LIMIT 1 | spider |
CREATE TABLE table_77493 (
"Masculine a-stems" text,
"Masculine u-stems" text,
"Feminine \u014d-stems" text,
"Neuter a-stems" text,
"Masculine an-stems" text,
"Feminine \u014dn-stems" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the u ... | SELECT "Masculine u-stems" FROM table_77493 WHERE "Neuter a-stems" = 'skip' AND "Masculine a-stems" = 'fisker' | wikisql |
CREATE TABLE table_10992_3 (
city_district__stadtteil_ VARCHAR,
foreign_nationals VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of the city district of stadtteil where foreigners are 5.162?
| SELECT COUNT(city_district__stadtteil_) FROM table_10992_3 WHERE foreign_nationals = "5.162" | sql_create_context |
CREATE TABLE table_35407 (
"Year" real,
"Jewish" real,
"Muslim" real,
"Christian" real,
"Druze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest year that has a druze greater than 2,534, with a total less than 121,... | SELECT MIN("Year") FROM table_35407 WHERE "Druze" > '2,534' AND "Total" < '121,333' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid numb... | SELECT (SELECT 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 = '030-42006' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'magne... | eicu |
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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "UNKNOWN/NOT SPECIFIED" AND diagnoses.long_title = "Mitral valve insufficiency and aortic valve insufficiency" | mimicsql_data |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Na... | SELECT * FROM Posts AS p INNER JOIN PostTags AS pt1 ON p.Id = pt1.PostId INNER JOIN PostTags AS pt2 ON p.Id = pt2.PostId WHERE pt1.TagId = 17 AND pt2.TagId = 942 | sede |
CREATE TABLE Rooms (
roomName VARCHAR,
RoomId VARCHAR
)
CREATE TABLE Reservations (
Room VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the most popular room in the hotel. The most popular room is the room that had seen the largest number of reserv... | SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
Acce... | SELECT COUNT(*) FROM Posts WHERE PostTypeId = 2 AND CreationDate BETWEEN '##start?2019-01-01##' AND '##end?2019-07-01##' | sede |
CREATE TABLE table_41317 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the attendance at the West Ham United home game?
| SELECT "Attendance" FROM table_41317 WHERE "Home team" = 'west ham united' | wikisql |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE wdmzjzjlb (
HXPLC number,
HZX... | SELECT wdmzjzjlb.JZJSSJ FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '43308617358' UNION SELECT bdmzjzjlb.JZJSSJ FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '43308617358' | css |
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_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, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_i... | mimic_iii |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T1.Code | nvbench |
CREATE TABLE table_name_90 (
finishes INTEGER,
points VARCHAR,
starts VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the finishes when points is more than 337 and starts is more than 26?
| SELECT SUM(finishes) FROM table_name_90 WHERE points > 337 AND starts > 26 | sql_create_context |
CREATE TABLE discipline_enrollments (
campus number,
discipline number,
year number,
undergraduate number,
graduate number
)
CREATE TABLE faculty (
campus number,
year number,
faculty number
)
CREATE TABLE enrollments (
campus number,
year number,
totalenrollment_ay number,... | SELECT AVG(campusfee) FROM csu_fees WHERE year = 1996 | spider |
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 hz_info.person_info_XM FROM hz_info JOIN zyjzjlb JOIN jybgb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND zyjzjlb.YLJGDM = jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZJLB WHERE jybgb.BGDH = '08550534166' | css |
CREATE TABLE table_48911 (
"Country" text,
"First store" text,
"Hypermarkets" text,
"Supermarkets" text,
"Hard Discounters" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country has 370 supermarkets?
| SELECT "Country" FROM table_48911 WHERE "Supermarkets" = '370' | wikisql |
CREATE TABLE table_26807 (
"Episode no." real,
"Airdate" text,
"Viewers" text,
"BBC Three weekly ranking" text,
"Cable rank" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the number of bbc rankings with cable rankings of 6.
| SELECT "BBC Three weekly ranking" FROM table_26807 WHERE "Cable rank" = '6' | wikisql |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
row_id number,
itemid ... | SELECT COUNT(*) > 0 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 = 27964)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [dias... | mimic_iii |
CREATE TABLE table_name_12 (
total INTEGER,
country VARCHAR,
year_s__won VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest total for Scotland with a year won of 1985?
| SELECT MAX(total) FROM table_name_12 WHERE country = "scotland" AND year_s__won = 1985 | sql_create_context |
CREATE TABLE table_42747 (
"Inf. Stem" text,
"Sing. Pres." text,
"Plur. Pres." text,
"Sing. Pret." text,
"Plur. Pret." text,
"Subj. Pres." text,
"Subj. Pret." text,
"Past Part." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the ... | SELECT "Subj. Pres." FROM table_42747 WHERE "Plur. Pret." = 'u' AND "Sing. Pret." = 'ou' AND "Sing. Pres." = 'û' | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic ... | SELECT demographic.admission_type, diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "3343" | mimicsql_data |
CREATE TABLE event (
Event_ID int,
Date text,
Venue text,
Name text,
Event_Attendance int
)
CREATE TABLE journalist (
journalist_ID int,
Name text,
Nationality text,
Age text,
Years_working int
)
CREATE TABLE news_report (
journalist_ID int,
Event_ID int,
Work_Type ... | SELECT Nationality, COUNT(*) FROM journalist GROUP BY Nationality | nvbench |
CREATE TABLE table_33664 (
"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 was the date of the match played at MCG?
| SELECT "Date" FROM table_33664 WHERE "Venue" = 'mcg' | wikisql |
CREATE TABLE table_75042 (
"Outcome" text,
"Event" text,
"Year" text,
"Venue" text,
"Opponent in the final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Outcome of the Singles Event in London, England?
| SELECT "Outcome" FROM table_75042 WHERE "Event" = 'singles' AND "Venue" = 'london, england' | wikisql |
CREATE TABLE table_35452 (
"Season" real,
"Game" text,
"Record" text,
"Opponent" text,
"Score" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Season has a Score of 39-27?
| SELECT MAX("Season") FROM table_35452 WHERE "Score" = '39-27' | wikisql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
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
)
... | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26817) AND DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TIME(), '-2 year') ORDER BY procedures_icd.charttime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_204_723 (
id number,
"year" number,
"film" text,
"role" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- the number of films govinda appeared in during his debut year .
| SELECT COUNT("film") FROM table_204_723 WHERE "year" = (SELECT MIN("year") FROM table_204_723) | squall |
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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "8968" AND prescriptions.drug_type = "BASE" | mimicsql_data |
CREATE TABLE bdmzjzjlb (
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 jybgb.SHSJ FROM hz_info JOIN wdmzjzjlb JOIN jybgb ON 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 WHERE hz_info.RYBH = '17320230' AND jybgb.BGRQ BETWEEN '2013-09-23' AND '2019-... | css |
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
CREATE TABLE Student (
StuID INTEGE... | SELECT Sex, COUNT(*) FROM Student WHERE Age > (SELECT AVG(Age) FROM Student) GROUP BY Sex ORDER BY COUNT(*) | nvbench |
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 * FROM qtb WHERE qtb.PERSON_ID = '69380544' AND qtb.MED_SER_ORG_NO = '2426455' AND NOT qtb.MED_ORG_DEPT_NM LIKE '%眼外伤%' UNION SELECT * FROM gyb WHERE gyb.PERSON_ID = '69380544' AND gyb.MED_SER_ORG_NO = '2426455' AND NOT gyb.MED_ORG_DEPT_NM LIKE '%眼外伤%' UNION SELECT * FROM zyb WHERE zyb.PERSON_ID = '69380544' AND... | css |
CREATE TABLE table_64027 (
"Class to 1928" text,
"Class from 1928" text,
"Seats" text,
"Quantity" real,
"Year(s) of Manufacture" text,
"Remarks" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which class to 1928 value had years of manufacture of... | SELECT "Class to 1928" FROM table_64027 WHERE "Year(s) of Manufacture" = '1921/23' AND "Class from 1928" = 'bci-21' | wikisql |
CREATE TABLE table_name_75 (
score VARCHAR,
surface VARCHAR,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score of the hard court Ramat Hasharon tournament?
| SELECT score FROM table_name_75 WHERE surface = "hard" AND tournament = "ramat hasharon" | sql_create_context |
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 COUNT(hz_info.RYBH) FROM hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_in... | 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 chartevents.charttime 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 = 22782)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart ra... | mimic_iii |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "7" AND lab.label = "Prostate Specific Antigen" | mimicsql_data |
CREATE TABLE table_name_84 (
attendance INTEGER,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the largest attendance that has December 16, 1962 as the date?
| SELECT MAX(attendance) FROM table_name_84 WHERE date = "december 16, 1962" | sql_create_context |
CREATE TABLE table_name_67 (
round INTEGER,
school_club_team VARCHAR,
pick VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Round has a School/Club Team of cal-poly slo, and a Pick smaller than 238?
| SELECT MAX(round) FROM table_name_67 WHERE school_club_team = "cal-poly slo" AND pick < 238 | sql_create_context |
CREATE TABLE table_24160890_3 (
conference VARCHAR,
tournament_venue__city_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When madison square garden ( new york city, new york ) is the tournament venue (city) what is the conference tournament?
| SELECT conference AS Tournament FROM table_24160890_3 WHERE tournament_venue__city_ = "Madison Square Garden ( New York City, New York )" | sql_create_context |
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 SUM(t_kc24.MED_AMOUT), SUM(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '3061264' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-05-05' AND '2012-09-12' | css |
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 GROUP BY Creation ORDER BY Creation DESC | nvbench |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "E8786" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
... | SELECT COUNT(DISTINCT icustays.icustay_id) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65309) AND DATETIME(icustays.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') | mimic_iii |
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight (
aircraft_code_sequence... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, da... | atis |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost numbe... | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-18575') AND patient.unitdischargetime IS NULL) AN... | eicu |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLic... | SELECT Posts.Id AS "post_link" FROM Posts JOIN PostHistory ON Posts.Id = PostHistory.PostId WHERE Posts.PostTypeId = 1 AND PostHistoryTypeId = 36 | sede |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND procedures.icd9_code = "41" | mimicsql_data |
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 (SELECT COUNT(*) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '80429036' AND mzjzjlb.JZKSRQ BETWEEN '2001-09-04' AND '2005-11-28') + (SELECT COUNT(*) FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_... | css |
CREATE TABLE table_203_393 (
id number,
"year" number,
"film" text,
"director" text,
"cast" text,
"details" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the number of awards won by prema katha ?
| SELECT "details" FROM table_203_393 WHERE "film" = 'prema katha' | squall |
CREATE TABLE table_name_61 (
chassis VARCHAR,
entrant VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the Chassis that has the Entrant of trivellato racing team?
| SELECT chassis FROM table_name_61 WHERE entrant = "trivellato racing team" | sql_create_context |
CREATE TABLE table_50348 (
"World Record" text,
"Press" text,
"103.5" text,
"Roger Fran\u00e7ois" text,
"Paris ( FRA )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the press like in Paris for Roger Francois, and Carlo Galimberti?
| SELECT "Paris ( FRA )" FROM table_50348 WHERE "Press" = 'press' AND "Roger Fran\u00e7ois" = 'carlo galimberti' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | SELECT demographic.dob, demographic.language FROM demographic WHERE demographic.name = "Kurt Buczek" | mimicsql_data |
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 WHERE demographic.expire_flag = "1" AND demographic.diagnosis = "AORTIC VALVE INSUFFIENCY\AORTIC VALVE REPLACEMENT /SDA" | mimicsql_data |
CREATE TABLE table_60439 (
"Year" real,
"Dates" text,
"Champion" text,
"Country" text,
"Score" text,
"Tournament Location" text,
"Purse" text,
"Winner's Share" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score of champion ... | SELECT "Score" FROM table_60439 WHERE "Champion" = 'masahiro kawamura' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND prescriptions.drug = "Rosiglitazone Maleate" | mimicsql_data |
CREATE TABLE table_name_76 (
tie_no INTEGER,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the sum of tie no for home team burgess hill town?
| SELECT SUM(tie_no) FROM table_name_76 WHERE home_team = "burgess hill town" | sql_create_context |
CREATE TABLE table_61082 (
"Constituency number" text,
"Name" text,
"Reserved for ( SC / ST /None)" text,
"District" text,
"Number of electorates (2009)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of constituency 5?
| SELECT "Name" FROM table_61082 WHERE "Constituency number" = '5' | wikisql |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimme... | SELECT Time, ID FROM swimmer ORDER BY ID | nvbench |
CREATE TABLE Customers (
customer_id INTEGER,
payment_method_code VARCHAR(10),
customer_code VARCHAR(20),
customer_name VARCHAR(80),
customer_address VARCHAR(255),
customer_phone VARCHAR(80),
customer_email VARCHAR(80)
)
CREATE TABLE Suppliers (
supplier_id INTEGER,
supplier_name VA... | SELECT product_type_code, AVG(product_price) FROM Products GROUP BY product_type_code ORDER BY AVG(product_price) DESC | nvbench |
CREATE TABLE table_name_27 (
top_5 INTEGER,
wins INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Top-5 is the lowest one that has Wins smaller than 0?
| SELECT MIN(top_5) FROM table_name_27 WHERE wins < 0 | sql_create_context |
CREATE TABLE table_11197 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What number of years did the red bull sauber petronas have greater than 6 points?
| SELECT COUNT("Year") FROM table_11197 WHERE "Entrant" = 'red bull sauber petronas' AND "Points" > '6' | wikisql |
CREATE TABLE table_23863 (
"Party" text,
"Seats Contested" real,
"Seats Won" real,
"No. of Votes" real,
"% of Votes" text,
"% in Seats contested" text,
"Seats Forfeited" real,
"2003 Seats" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- H... | SELECT "Seats Contested" FROM table_23863 WHERE "Party" = 'Independents' | wikisql |
CREATE TABLE txmzjzjlb (
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 jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGD... | css |
CREATE TABLE table_name_57 (
venue VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the venue on 3 September 1972?
| SELECT venue FROM table_name_57 WHERE date = "3 september 1972" | sql_create_context |
CREATE TABLE table_69855 (
"Tournament" text,
"2008" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the 2008 with 2010 of 2r and wimbledon tournament
| SELECT "2008" FROM table_69855 WHERE "2010" = '2r' AND "Tournament" = 'wimbledon' | wikisql |
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 COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
... | SELECT DEPT_CODE, AVG(STU_GPA) FROM STUDENT GROUP BY DEPT_CODE | nvbench |
CREATE TABLE table_204_912 (
id number,
"rank" number,
"athlete" text,
"country" text,
"time" number,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many athletes represented sweden ?
| SELECT COUNT("athlete") FROM table_204_912 WHERE "country" = 'sweden' | squall |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Rupture of chordae tendineae" | mimicsql_data |
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
... | SELECT name, ID FROM swimmer ORDER BY name DESC | nvbench |
CREATE TABLE table_63168 (
"Japanese Title" text,
"Romaji Title" text,
"TV Station" text,
"Episodes" real,
"Average Ratings" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Romaji Title has a Japanese Title of 2 ?
| SELECT "Romaji Title" FROM table_63168 WHERE "Japanese Title" = '花より男子2(リターンズ)' | wikisql |
CREATE TABLE Customer_Orders (
order_id INTEGER,
customer_id INTEGER,
order_status_code VARCHAR(10),
order_date DATETIME
)
CREATE TABLE Staff_Department_Assignments (
staff_id INTEGER,
department_id INTEGER,
date_assigned_from DATETIME,
job_title_code VARCHAR(10),
date_assigned_to D... | SELECT customer_name, customer_id FROM Customers WHERE customer_address LIKE "%TN%" ORDER BY customer_id | nvbench |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT All_Neutral, School_ID FROM basketball_match ORDER BY School_ID | nvbench |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime t... | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '013-28507' AND patient.hospitaladmitsource = 'emergency department' AND STRFTIME('%y', patient.hospitaladmittime) >= '2105' ORDER BY patient.hospitaladmittime DESC LIMIT 1 | eicu |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT t_kc22.USE_FRE, t_kc22.EACH_DOSAGE FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '31414220389' AND t_kc22.SOC_SRT_DIRE_CD = '047472-s' | css |
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Paralytic ileus" AND prescriptions.route = "IM" | mimicsql_data |
CREATE TABLE table_204_334 (
id number,
"opposition" text,
"matches" number,
"won" number,
"drawn" number,
"lost" number,
"for" number,
"against" number,
"win%" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the number of opp... | SELECT COUNT("opposition") FROM table_204_334 WHERE "win%" = 100 | squall |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.