instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_17281 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who ha... | SELECT "High assists" FROM table_17281 WHERE "Date" = 'November 4' | wikisql |
CREATE TABLE table_28298589_4 (
broadcast VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Connecticut home games were broadcast?
| SELECT COUNT(broadcast) FROM table_28298589_4 WHERE home_team = "Connecticut" | sql_create_context |
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 demographic.days_stay FROM demographic WHERE demographic.subject_id = "22999" | mimicsql_data |
CREATE TABLE zzmzjzjlb (
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 zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGD... | css |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND procedures.short_title = "Arthrocentesis" | mimicsql_data |
CREATE TABLE table_46330 (
"Round" real,
"Pick #" real,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHo is the Player got a Pick # smaller than 61, and a College of texas?
| SELECT "Player" FROM table_46330 WHERE "Pick #" < '61' AND "College" = 'texas' | wikisql |
CREATE TABLE table_23465864_6 (
thurs_27_aug VARCHAR,
tues_25_aug VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the event on Thurs 27 Aug when Tues 25 Aug was 23' 00.59 98.384mph?
| SELECT thurs_27_aug FROM table_23465864_6 WHERE tues_25_aug = "23' 00.59 98.384mph" | sql_create_context |
CREATE TABLE table_62785 (
"Year" real,
"Chassis" text,
"Engine" text,
"Start" real,
"Finish" real,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where did the team of Rahal Letterman in 2006 start?
| SELECT COUNT("Start") FROM table_62785 WHERE "Team" = 'rahal letterman' AND "Year" = '2006' | wikisql |
CREATE TABLE table_15796072_1 (
original_artist VARCHAR,
week__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the original artist for week number Top 16 (8 women)?
| SELECT original_artist FROM table_15796072_1 WHERE week__number = "Top 16 (8 Women)" | sql_create_context |
CREATE TABLE Locations (
Location_ID INTEGER,
Location_Name VARCHAR(255),
Address VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Ref_Attraction_Types (
Attraction_Type_Code CHAR(15),
Attraction_Type_Description VARCHAR(255)
)
CREATE TABLE Royal_Family (
Royal_Family_ID INTEGER,
... | SELECT Visit_Date, COUNT(Visit_Date) FROM Visits ORDER BY Visit_Date | nvbench |
CREATE TABLE table_178242_1 (
channel VARCHAR,
host_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which channel has the host Art Rooijakkers?
| SELECT channel FROM table_178242_1 WHERE host_s_ = "Art Rooijakkers" | sql_create_context |
CREATE TABLE fault_log_parts (
fault_log_entry_id number,
part_fault_id number,
fault_status text
)
CREATE TABLE maintenance_engineers (
engineer_id number,
company_id number,
first_name text,
last_name text,
other_details text
)
CREATE TABLE maintenance_contracts (
maintenance_con... | SELECT gender FROM staff GROUP BY gender ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT MED_SER_ORG_NO FROM t_kc21 WHERE PERSON_ID = '48799651' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE SOC_SRT_DIRE_NM = '硫酸氢氯吡格雷片') | css |
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 Id, PostTypeId FROM Posts WHERE PostTypeId = 2 | sede |
CREATE TABLE table_name_7 (
result VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the result when the attendance is 54,814?
| SELECT result FROM table_name_7 WHERE attendance = "54,814" | sql_create_context |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
... | SELECT COUNT(Votes.Id) AS "Count", VoteTypeId, PostTypeId FROM Votes INNER JOIN Posts ON Posts.Id = Votes.PostId WHERE Votes.CreationDate > GETUTCDATE() - 3 AND (VoteTypeId = 2 OR VoteTypeId = 3) GROUP BY VoteTypeId, Posts.PostTypeId | sede |
CREATE TABLE table_name_37 (
label VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the label for October 21, 1981?
| SELECT label FROM table_name_37 WHERE date = "october 21, 1981" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2175" AND procedures.long_title = "Other closed [endoscopic] biopsy of biliary duct or sphincter of Oddi" | mimicsql_data |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
... | SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE table_17311759_4 (
score VARCHAR,
high_rebounds VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Give the score when high rebounds was zaza pachulia (8)
| SELECT score FROM table_17311759_4 WHERE high_rebounds = "Zaza Pachulia (8)" | sql_create_context |
CREATE TABLE table_12715053_1 (
compound_name VARCHAR,
chemical_class VARCHAR,
clinical_trials_β VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many compound names list a chemical class of depsipeptide and a clinical trials value of 1/7?
| SELECT COUNT(compound_name) FROM table_12715053_1 WHERE chemical_class = "Depsipeptide" AND clinical_trials_β = "1/7" | sql_create_context |
CREATE TABLE table_name_49 (
location VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which location is in the Belgian Congo Tanganyika?
| SELECT location FROM table_name_49 WHERE country = "belgian congo tanganyika" | 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 COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '葛德元' AND t_kc22.STA_DATE BETWEEN '2017-02-20' AND '2020-04-10' AND t_kc22.SOC_SRT_DIRE_NM = '地西泮片' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb... | css |
CREATE TABLE table_23379776_5 (
nature_of_role VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is every nature of role with year as 2009?
| SELECT nature_of_role FROM table_23379776_5 WHERE year = 2009 | sql_create_context |
CREATE TABLE table_48289 (
"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.
-- What was the score for the game when West Ham United was the away team?
| SELECT "Score" FROM table_48289 WHERE "Away team" = 'west ham united' | wikisql |
CREATE TABLE Affiliated_With (
Physician INTEGER,
Department INTEGER,
PrimaryAffiliation BOOLEAN
)
CREATE TABLE Undergoes (
Patient INTEGER,
Procedures INTEGER,
Stay INTEGER,
DateUndergoes DATETIME,
Physician INTEGER,
AssistingNurse INTEGER
)
CREATE TABLE Prescribes (
Physician... | 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 | nvbench |
CREATE TABLE table_50519 (
"Nominative" text,
"Ergative" text,
"Dative" text,
"Genitive" text,
"Instrumental" text,
"Adverbial" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What nominative has mis as the dative?
| SELECT "Nominative" FROM table_50519 WHERE "Dative" = 'mis' | wikisql |
CREATE TABLE table_22886 (
"Rank" real,
"English title" text,
"Chinese title" text,
"Average" real,
"Peak" real,
"Premiere" real,
"Finale" real,
"HK viewers" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the maximum average of ... | SELECT MAX("Average") FROM table_22886 WHERE "Chinese title" = '古靈精探B' | wikisql |
CREATE TABLE invoiceline (
invoicelineid number,
invoiceid number,
trackid number,
unitprice number,
quantity number
)
CREATE TABLE playlist (
playlistid number,
name text
)
CREATE TABLE invoice (
invoiceid number,
customerid number,
invoicedate time,
billingaddress text,
... | SELECT T1.name FROM mediatype AS T1 JOIN track AS T2 ON T1.mediatypeid = T2.mediatypeid GROUP BY T2.mediatypeid ORDER BY COUNT(*) LIMIT 1 | spider |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
... | 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 = '015-94542' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmit... | eicu |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25... | SELECT FIRST_NAME, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY FIRST_NAME DESC | nvbench |
CREATE TABLE mzjzjlb_jybgb (
YLJGDM_MZJZJLB text,
BGDH number,
YLJGDM number
)
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb.B... | css |
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 t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'hypotonic fluid administration - d5w' AND DATETIME(treatment.treatmenttim... | eicu |
CREATE TABLE table_10583 (
"Name" text,
"City" text,
"Height feet/m" text,
"Year" real,
"Period" text,
"Surpassed by" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I need the surpassed for years before 1925 and period of 6 years
| SELECT "Surpassed by" FROM table_10583 WHERE "Year" < '1925' AND "Period" = '6 years' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutpu... | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'antibacterials - quinolone')) AND STRFTIME('... | eicu |
CREATE TABLE table_56330 (
"Team" text,
"Games Played" real,
"Wins" real,
"Losses" real,
"Ties" real,
"Goals For" real,
"Goals Against" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many goals for occurred when the goals against was les... | SELECT COUNT("Goals For") FROM table_56330 WHERE "Goals Against" < '56' AND "Games Played" > '7' AND "Wins" < '6' | wikisql |
CREATE TABLE table_34552 (
"Year" real,
"Tournament" text,
"Venue" text,
"Result" text,
"Distance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Venue has a Tournament of olympic games with a Result of 4th?
| SELECT "Venue" FROM table_34552 WHERE "Tournament" = 'olympic games' AND "Result" = '4th' | wikisql |
CREATE TABLE table_name_88 (
opponent VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the opponent on November 20, 1966?
| SELECT opponent FROM table_name_88 WHERE date = "november 20, 1966" | sql_create_context |
CREATE TABLE table_142159_1 (
arrival INTEGER,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the arrival time of greenbat
| SELECT MAX(arrival) FROM table_142159_1 WHERE name = "Greenbat" | 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 MIN(demographic.days_stay) FROM demographic WHERE demographic.age >= "72" | mimicsql_data |
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "47" AND lab.fluid = "Other Body Fluid" | mimicsql_data |
CREATE TABLE table_name_58 (
record VARCHAR,
high_points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Record has a High points of hoffman (16)?
| SELECT record FROM table_name_58 WHERE high_points = "hoffman (16)" | sql_create_context |
CREATE TABLE table_21531764_1 (
employment_area VARCHAR,
october_2010 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where is the rate 5.7 in October 2010?
| SELECT employment_area FROM table_21531764_1 WHERE october_2010 = "5.7" | sql_create_context |
CREATE TABLE film_market_estimation (
Estimation_ID int,
Low_Estimate real,
High_Estimate real,
Film_ID int,
Type text,
Market_ID int,
Year int
)
CREATE TABLE film (
Film_ID int,
Title text,
Studio text,
Director text,
Gross_in_dollar int
)
CREATE TABLE market (
Mar... | SELECT Type, COUNT(Type) FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Type ORDER BY Type | nvbench |
CREATE TABLE table_12177 (
"Country" text,
"Date" text,
"Label" text,
"Format" text,
"Catalogue #" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the catalogue number for Brazil?
| SELECT "Catalogue #" FROM table_12177 WHERE "Country" = 'brazil' | wikisql |
CREATE TABLE table_12280396_1 (
rank VARCHAR,
municipality VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the rank where the municipality is sunndal?
| SELECT rank FROM table_12280396_1 WHERE municipality = "Sunndal" | sql_create_context |
CREATE TABLE table_name_39 (
name VARCHAR,
transfer_fee VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had a transfer fee of dkk 6m?
| SELECT name FROM table_name_39 WHERE transfer_fee = "dkk 6m" | sql_create_context |
CREATE TABLE table_name_31 (
laps INTEGER,
driver VARCHAR,
constructor VARCHAR,
grid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the lowest laps of Luigi Musso driving a Ferrari with a Grid larger than 2?
| SELECT MIN(laps) FROM table_name_31 WHERE constructor = "ferrari" AND grid > 2 AND driver = "luigi musso" | sql_create_context |
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_... | SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((flight.airline_code = 'DL') AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.to_airport = AIRP... | atis |
CREATE TABLE table_name_3 (
name VARCHAR,
stage VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Name of the SS11 Stage?
| SELECT name FROM table_name_3 WHERE stage = "ss11" | sql_create_context |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'absolute cd8 count') AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(), '-1 year')) | mimic_iii |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.JZLSH = '00619973238' | css |
CREATE TABLE table_name_78 (
regular_season VARCHAR,
playoffs VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What regular season did the team reach the conference semifinals in the playoffs?
| SELECT regular_season FROM table_name_78 WHERE playoffs = "conference semifinals" | sql_create_context |
CREATE TABLE station (
LOCATION VARCHAR,
number_of_platforms VARCHAR,
total_passengers VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show all locations that have train stations with at least 15 platforms and train stations with more than 25 total passen... | SELECT DISTINCT LOCATION FROM station WHERE number_of_platforms >= 15 AND total_passengers > 25 | sql_create_context |
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
)
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
Party int,
First_Elected real,
Committee text
)
CREATE TABLE party (
Party_ID int,
... | SELECT Committee, COUNT(Committee) FROM election GROUP BY Committee ORDER BY COUNT(Committee) | nvbench |
CREATE TABLE table_26152 (
"Edition" text,
"Round" text,
"Date" text,
"Against" text,
"Surface" text,
"Opponent" text,
"W/L" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score against Loic Didavi?
| SELECT "Result" FROM table_26152 WHERE "Opponent" = 'Loic Didavi' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE 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 WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.discharge_location = "DEAD/EXPIRED" | mimicsql_data |
CREATE TABLE table_28744929_1 (
school_type VARCHAR,
nickname VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what type of school is the institution nicknamed seminoles?
| SELECT school_type FROM table_28744929_1 WHERE nickname = "Seminoles" | sql_create_context |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT MED_SER_ORG_NO FROM t_kc21 WHERE PERSON_ID = '24294276' AND IN_HOSP_DATE BETWEEN '2010-01-31' AND '2015-05-02' GROUP BY MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1 | 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 WHERE demographic.ethnicity = "BLACK/HAITIAN" AND demographic.diagnosis = "UPPER GI BLEED" | mimicsql_data |
CREATE TABLE table_name_54 (
tonnage VARCHAR,
u_boats_destroyed__kuk_ VARCHAR,
ships_sunk__pola_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the listed Tonnage that has U-boats destroyed (KuK) of 2 and Ships sunk (Pola) of (not recorded)?
| SELECT tonnage FROM table_name_54 WHERE u_boats_destroyed__kuk_ = "2" AND ships_sunk__pola_ = "(not recorded)" | sql_create_context |
CREATE TABLE table_30320 (
"Year Location" text,
"Mens Singles" text,
"Womens Singles" text,
"Mens Doubles" text,
"Womens Doubles" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many times was the womens doubles in china?
| SELECT COUNT("Mens Singles") FROM table_30320 WHERE "Womens Doubles" = 'China' | wikisql |
CREATE TABLE table_name_72 (
form VARCHAR,
pages INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many forms have less than 18 pages?
| SELECT COUNT(form) FROM table_name_72 WHERE pages < 18 | sql_create_context |
CREATE TABLE table_69980 (
"Games" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals For" real,
"Goals Against" real,
"Goal Differential" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many draws have 1 win, 1 loss, and a Goal Diffe... | SELECT SUM("Draws") FROM table_69980 WHERE "Wins" = '1' AND "Losses" = '1' AND "Goal Differential" = '+1' | 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.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN 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 = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE person_info... | css |
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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "5770" AND prescriptions.route = "LEFT EYE" | mimicsql_data |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE flight_stop (
flight_id int,
stop_number 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 = 'MEMPHIS' AND date_day.day_number = 29 AND date_day.month_number = 6 AND d... | atis |
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 jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE hz_info.RYBH = '15906206' AND jyjgzbb.JYRQ BETWEEN '2016-02-15' AND '2018-0... | css |
CREATE TABLE table_name_88 (
goals INTEGER,
rank VARCHAR,
matches VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the mean number of goals when the rank's less than 8 and there are 261 matches?
| SELECT AVG(goals) FROM table_name_88 WHERE rank < 8 AND matches = 261 | sql_create_context |
CREATE TABLE table_name_44 (
total INTEGER,
year_s__won VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Total for the Player who won in 1922, 1932?
| SELECT AVG(total) FROM table_name_44 WHERE year_s__won = "1922, 1932" | sql_create_context |
CREATE TABLE table_name_88 (
actor VARCHAR,
number_of_episodes VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Actor, when Number Of Episodes is '117 Episodes'?
| SELECT actor FROM table_name_88 WHERE number_of_episodes = "117 episodes" | 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 jybgb.SQRGH, jybgb.SQRXM FROM jybgb WHERE jybgb.JZLSH = '60552087558' GROUP BY jybgb.SQRGH HAVING COUNT(*) > 19 | css |
CREATE TABLE table_name_34 (
date VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What day did Footscray play as the away team?
| SELECT date FROM table_name_34 WHERE away_team = "footscray" | sql_create_context |
CREATE TABLE table_name_40 (
points INTEGER,
team VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points did she have with team bultaco, ranked 6th?
| SELECT SUM(points) FROM table_name_40 WHERE team = "bultaco" AND rank = "6th" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
sy... | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-127032')) AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_T... | eicu |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistoryTypes (
Id numb... | SELECT ROW_NUMBER() OVER (ORDER BY b.Date), b.UserId, b.Date AS DateReceived, u.DisplayName FROM Users AS u, Badges AS b WHERE b.Name = 'swift' AND b.Class = 3 AND u.Id = b.UserId GROUP BY b.Date, b.UserId, u.DisplayName | sede |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Faculty (
FacID INTEGER,
Lname... | SELECT Rank, COUNT(*) FROM Faculty GROUP BY Rank ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_50072 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"Record" text,
"Streak" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Game has a Streak of loss 1, and a Score of 110 111?
| SELECT "Game" FROM table_50072 WHERE "Streak" = 'loss 1' AND "Score" = '110–111' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wa... | SELECT diagnosis.diagnosisname FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-62367')) AND STRFTIME('%y', diagnosis.diagnosistime) >= '2105... | eicu |
CREATE TABLE table_1213511_5 (
college_junior_club_team VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- where is team player mike mcniven played for?
| SELECT college_junior_club_team FROM table_1213511_5 WHERE player = "Mike McNiven" | sql_create_context |
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 text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM tex... | SELECT JZZTDM, JZZTMC FROM mzjzjlb WHERE JZLSH = '36916045402' | css |
CREATE TABLE table_50535 (
"Season" text,
"Skip" text,
"Third" text,
"Second" text,
"Lead" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the second with a lead of Sarah Macintyre (jr) Anne Laird (w)?
| SELECT "Second" FROM table_50535 WHERE "Lead" = 'sarah macintyre (jr) anne laird (w)' | wikisql |
CREATE TABLE table_28046929_2 (
driver VARCHAR,
entrant VARCHAR,
co_driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the person that is part of the belgian vw club that works with fr d ric miclotte
| SELECT driver FROM table_28046929_2 WHERE entrant = "Belgian VW Club" AND co_driver = "Frédéric Miclotte" | sql_create_context |
CREATE TABLE table_name_22 (
game VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Game has an Opponent of phoenix suns?
| SELECT game FROM table_name_22 WHERE opponent = "phoenix suns" | sql_create_context |
CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
account_name VARCHAR(50),
other_account_details VARCHAR(255)
)
CREATE TABLE Customers_Cards (
card_id INTEGER,
customer_id INTEGER,
card_type_code VARCHAR(15),
card_number VARCHAR(80),
date_valid_from DATETIME,
dat... | SELECT account_id, account_name FROM Accounts | nvbench |
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adults INTEGER,
Kids INTEGER
)
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
baseP... | SELECT roomName, COUNT(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room | nvbench |
CREATE TABLE table_54233 (
"Draw" real,
"Artist" text,
"Song" text,
"Points" real,
"Place" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What place for 'jednom u ivotu' with a draw larger than 18?
| SELECT COUNT("Place") FROM table_54233 WHERE "Song" = 'jednom u životu' AND "Draw" > '18' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREA... | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-27661')) AND NOT vitalperiodic.heartrate IS NUL... | eicu |
CREATE TABLE table_203_577 (
id number,
"tenure" text,
"coach" text,
"years" number,
"record" text,
"pct." number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how long was joseph black a coach ?
| SELECT "years" FROM table_203_577 WHERE "coach" = 'joseph black' | squall |
CREATE TABLE climber (
Climber_ID int,
Name text,
Country text,
Time text,
Points real,
Mountain_ID int
)
CREATE TABLE mountain (
Mountain_ID int,
Name text,
Height real,
Prominence real,
Range text,
Country text
)
-- Using valid SQLite, answer the following questions ... | SELECT T2.Name, COUNT(T2.Name) FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID GROUP BY T2.Name | nvbench |
CREATE TABLE invoice_line_items (
order_item_id number,
invoice_number number,
product_id number,
product_title text,
product_quantity text,
product_price number,
derived_product_cost number,
derived_vat_payable number,
derived_total_cost number
)
CREATE TABLE financial_transactions... | SELECT T2.account_name, T1.account_id, COUNT(*) FROM financial_transactions AS T1 JOIN accounts AS T2 ON T1.account_id = T2.account_id GROUP BY T1.account_id | spider |
CREATE TABLE table_name_49 (
home_team VARCHAR,
tie_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Home Team, when Tie No is 4?
| SELECT home_team FROM table_name_49 WHERE tie_no = "4" | sql_create_context |
CREATE TABLE table_75633 (
"Year" text,
"Name" text,
"Political affiliation" text,
"Deputy" text,
"Deputy's affiliation" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Name for 1997 99?
| SELECT "Name" FROM table_75633 WHERE "Year" = '1997–99' | wikisql |
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 text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '07564193' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE table_66197 (
"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.
-- Churai has what as the fewest number of electora... | SELECT MIN("Number of electorates (2009)") FROM table_66197 WHERE "Name" = 'churai' | wikisql |
CREATE TABLE table_69922 (
"Draw" real,
"Competing dancers" text,
"Dance styles" text,
"Rank" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest draw with rank 4?
| SELECT MIN("Draw") FROM table_69922 WHERE "Rank" = '4' | wikisql |
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 Founder, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder | nvbench |
CREATE TABLE table_203_534 (
id number,
"week" number,
"date" text,
"opponent" text,
"home/away" text,
"result" text,
"bye" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total number of games lost during the month of april ?
| SELECT COUNT(*) FROM table_203_534 WHERE "result" = 'l' AND "date" = 4 | squall |
CREATE TABLE table_68836 (
"City" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which airport has an IATA of AMS?
| SELECT "Airport" FROM table_68836 WHERE "IATA" = 'ams' | wikisql |
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND procedures.icd9_code = "3897" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.