instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number... | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-64961')) AND treatment.treatmentname = 'active warming' AND DATETIME(tre... | eicu |
CREATE TABLE table_23812628_1 (
points VARCHAR,
team__number1 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the points for zamora
| SELECT points FROM table_23812628_1 WHERE team__number1 = "Zamora" | sql_create_context |
CREATE TABLE table_name_3 (
composer VARCHAR,
director VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was Director John Ramster's Composer?
| SELECT composer FROM table_name_3 WHERE director = "john ramster" | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
i... | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-3407')) AND intakeoutput.cellpath LIKE '%intake%' AND ST... | eicu |
CREATE TABLE teaches (
ID VARCHAR
)
CREATE TABLE instructor (
ID VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the names of all instructors who have taught some course and the course_id.
| SELECT name, course_id FROM instructor AS T1 JOIN teaches AS T2 ON T1.ID = T2.ID | sql_create_context |
CREATE TABLE table_11344 (
"Rank" real,
"Player" text,
"Country" text,
"Earnings ( $ )" real,
"Events" real,
"Wins" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much money did the player ranked above 3 with under 28 events earn?
| SELECT COUNT("Earnings ( $ )") FROM table_11344 WHERE "Events" < '28' AND "Rank" < '3' | wikisql |
CREATE TABLE table_name_36 (
secr_numbers VARCHAR,
class VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which SECR numbers have a class of b1?
| SELECT secr_numbers FROM table_name_36 WHERE class = "b1" | sql_create_context |
CREATE TABLE table_name_37 (
score VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want the score for 28 march 1979
| SELECT score FROM table_name_37 WHERE date = "28 march 1979" | sql_create_context |
CREATE TABLE table_71416 (
"Position" real,
"Club" text,
"Played" real,
"Points" text,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.... | SELECT AVG("Goals against") FROM table_71416 WHERE "Draws" = '8' AND "Losses" < '12' AND "Wins" > '22' | wikisql |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
View... | SELECT * FROM Users WHERE DisplayName LIKE '%Nathan%' | sede |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid n... | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOI... | eicu |
CREATE TABLE table_71885 (
"Date" text,
"Visiting team" text,
"Final score" text,
"Host team" text,
"Stadium" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Stadium has a Visiting team of pittsburgh steelers?
| SELECT "Stadium" FROM table_71885 WHERE "Visiting team" = 'pittsburgh steelers' | wikisql |
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Retur... | SELECT director, COUNT(*) FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID GROUP BY T1.director 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 COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '葛安易' AND t_kc22.STA_DATE BETWEEN '2000-07-27' AND '2006-10-24' AND t_kc22.SELF_PAY_AMO > 1217.85 | css |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program (
progr... | SELECT COUNT(DISTINCT course_offering.course_id) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'ASIAN' AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016 | advising |
CREATE TABLE table_75785 (
"Name" text,
"Appointed" text,
"Prior position" text,
"Province" text,
"Nominated by" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the prior position held by Wyman Webb?
| SELECT "Prior position" FROM table_75785 WHERE "Name" = 'wyman webb' | wikisql |
CREATE TABLE table_11210576_4 (
character VARCHAR,
fate VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the character with fate being deceased: knife wound
| SELECT character FROM table_11210576_4 WHERE fate = "Deceased: Knife Wound" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | SELECT demographic.admission_type FROM demographic WHERE demographic.name = "Kevin Jones" | mimicsql_data |
CREATE TABLE table_11912 (
"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 away team played at VFL Park with more than... | SELECT "Away team" FROM table_11912 WHERE "Crowd" > '10,530' AND "Venue" = 'vfl park' | wikisql |
CREATE TABLE table_50940 (
"Senator" text,
"Party" text,
"District" real,
"Home Town" text,
"Took Office" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Senator has a Party of republican, a Home Town of houston, and a District of 7?
| SELECT "Senator" FROM table_50940 WHERE "Party" = 'republican' AND "Home Town" = 'houston' AND "District" = '7' | wikisql |
CREATE TABLE table_14864 (
"Round" text,
"Track" text,
"Race 1" text,
"Race 2" text,
"Race 3" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Race 1 result of Round 2?
| SELECT "Race 1" FROM table_14864 WHERE "Round" = 'round 2' | wikisql |
CREATE TABLE table_34829 (
"Game" real,
"April" real,
"Opponent" text,
"Score" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the opponent with record of 38-34-10
| SELECT "Opponent" FROM table_34829 WHERE "Record" = '38-34-10' | wikisql |
CREATE TABLE table_203_697 (
id number,
"player" text,
"career" text,
"nickname" text,
"team inducted as" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was the first player to play for the st louis cardinals ?
| SELECT "player" FROM table_203_697 WHERE "team inducted as" = 'st. louis cardinals' ORDER BY "career" LIMIT 1 | squall |
CREATE TABLE table_69977 (
"Name" text,
"Date of Execution" text,
"Crime" text,
"Method" text,
"Race" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the race of the person executed on December 27, 1827?
| SELECT "Race" FROM table_69977 WHERE "Date of Execution" = 'december 27, 1827' | wikisql |
CREATE TABLE table_name_57 (
goals_against INTEGER,
draws VARCHAR,
wins VARCHAR,
goal_difference VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the high goal against associated with 18 wins, a Goal Difference of 43, and under 6 draws?
| SELECT MAX(goals_against) FROM table_name_57 WHERE wins = 18 AND goal_difference = 43 AND draws < 6 | sql_create_context |
CREATE TABLE table_71204 (
"Year" real,
"Team" text,
"Co-Drivers" text,
"Class" text,
"Pos." text,
"Class Pos." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the Co-Driver of the winner of 1992's race?
| SELECT "Co-Drivers" FROM table_71204 WHERE "Year" = '1992' | wikisql |
CREATE TABLE table_name_44 (
byzantine_commander VARCHAR,
result VARCHAR,
battle VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Byzantine Commander with a Bulgarian Victory at the Siege of Lovech?
| SELECT byzantine_commander FROM table_name_44 WHERE result = "bulgarian victory" AND battle = "siege of lovech" | sql_create_context |
CREATE TABLE table_18661 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What party is incumbent Oliver H. Cross?
| SELECT "Party" FROM table_18661 WHERE "Incumbent" = 'Oliver H. Cross' | wikisql |
CREATE TABLE table_name_31 (
capacity_in_use VARCHAR,
annual_change VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Capacity in use with an Annual change that is 21.8%?
| SELECT capacity_in_use FROM table_name_31 WHERE annual_change = "21.8%" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "75732" AND prescriptions.drug_type = "BASE" | mimicsql_data |
CREATE TABLE table_name_19 (
score VARCHAR,
opponent VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which score has an Opponent of @ athletics, and a Record of 76-57?
| SELECT score FROM table_name_19 WHERE opponent = "@ athletics" AND record = "76-57" | 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 * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '5930977' AND gwyjzb.IN_HOSP_DATE BETWEEN '2004-11-28' AND '2012-07-27' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '5930977' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2004-11-28' AND '2012-07-27' EXCEPT SELECT * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '593097... | css |
CREATE TABLE table_name_38 (
circuit VARCHAR,
winning_driver VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which circuit did Jim Clark win in 1962?
| SELECT circuit FROM table_name_38 WHERE winning_driver = "jim clark" AND year = "1962" | sql_create_context |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college 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 varchar,
admit_term int,... | SELECT DISTINCT name, number FROM course WHERE credits = 13 AND department = 'EECS' | advising |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_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_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '53464739' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT School_ID, All_Games_Percent FROM basketball_match | nvbench |
CREATE TABLE table_51488 (
"Year" real,
"Organisation" text,
"Award" text,
"Nominated Work Title" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the year when then organisation is star awards, the result is won and the nominat... | SELECT "Year" FROM table_51488 WHERE "Organisation" = 'star awards' AND "Result" = 'won' AND "Nominated Work Title" = 'n/a' | wikisql |
CREATE TABLE table_name_49 (
time VARCHAR,
laps VARCHAR,
bike VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the time of the honda cbr1000rr bike, which has less than 25 laps?
| SELECT time FROM table_name_49 WHERE laps < 25 AND bike = "honda cbr1000rr" | sql_create_context |
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 * FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.person_info_XM = '鲁修齐' AND hz_info.YLJGDM = '0966893' AND zyjzjlb.JZKSMC LIKE '%换药%' | css |
CREATE TABLE table_name_17 (
play_by_play VARCHAR,
studio_host VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the play by play commentator for the game that has Alan Massengale as Studio Host?
| SELECT play_by_play FROM table_name_17 WHERE studio_host = "alan massengale" | sql_create_context |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,... | 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 = 'tricor') | mimic_iii |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE" AND prescriptions.route = "INHALATION" | mimicsql_data |
CREATE TABLE table_2526 (
"Rank" real,
"School" text,
"Basic Elements" real,
"Tumbling" real,
"Stunts" text,
"Pyramids" text,
"Tosses" text,
"Deductions" text,
"Total" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is every scho... | SELECT "School" FROM table_2526 WHERE "Stunts" = '48' | wikisql |
CREATE TABLE table_name_44 (
co_drivers VARCHAR,
laps VARCHAR,
tyres VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which co-driver has fewer than 282 laps and type P tyres?
| SELECT co_drivers FROM table_name_44 WHERE laps < 282 AND tyres = "p" | 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 '2009-02-01' AND '2021-11-26' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjz... | css |
CREATE TABLE table_train_132 (
"id" int,
"loss_of_consciousness" bool,
"deep_venous_thrombosis" bool,
"unstable_angina" bool,
"thromboembolic_vascular_disease" bool,
"head_injury" bool,
"stroke" bool,
"cerebrovascular_disease" bool,
"mental_retardation" bool,
"psychiatric_disease... | SELECT * FROM table_train_132 WHERE psychiatric_disease = 1 OR neurological_disease = 1 OR (stroke = 1 OR vascular_dementia = 1 OR lewy_body_disease = 1 OR parkinson_disease = 1 OR seizure_disorder = 1 OR head_injury = 1 OR loss_of_consciousness = 1 OR psychotic_disorder = 1 OR bipolar_disorder = 1) | criteria2sql |
CREATE TABLE Apartment_Buildings (
building_address VARCHAR,
building_phone VARCHAR,
building_manager VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the addresses and phones of all the buildings managed by 'Brenden'.
| SELECT building_address, building_phone FROM Apartment_Buildings WHERE building_manager = "Brenden" | sql_create_context |
CREATE TABLE table_26260 (
"Party" text,
"Result, Parliam. election 2005" text,
"Result, County elections 2007" text,
"Aug 2008" text,
"Sep 2008" text,
"Oct 2008" text,
"Nov 2008" text,
"Dec 2008" text,
"Jan 2009" text,
"Feb 2009" text,
"Mar 2009" text,
"Apr 2009" text,
... | SELECT "Jul 2009" FROM table_26260 WHERE "Result, Parliam. election 2005" = '6.5%' | wikisql |
CREATE TABLE table_name_20 (
date VARCHAR,
winning_score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was 16 (62-71-71-68=272) the winning score?
| SELECT date FROM table_name_20 WHERE winning_score = –16(62 - 71 - 71 - 68 = 272) | sql_create_context |
CREATE TABLE table_53213 (
"Year" text,
"2010" real,
"2009" real,
"2008" real,
"2005" real,
"2000" real,
"1995" real,
"1990" real,
"1985" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 1995 value with a 2005 value bigger ... | SELECT SUM("1995") FROM table_53213 WHERE "2005" > '74' AND "2008" = '84' AND "2000" < '80' | wikisql |
CREATE TABLE table_24270 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Derik Fury plays for which college?
| SELECT "College" FROM table_24270 WHERE "Player" = 'Derik Fury' | wikisql |
CREATE TABLE table_name_17 (
score VARCHAR,
opponent VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of Game 2 in the series against the Florida Panthers?
| SELECT score FROM table_name_17 WHERE opponent = "florida panthers" AND game = 2 | sql_create_context |
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 patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'hyperchloremia' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-4 year')) | eicu |
CREATE TABLE table_20874 (
"District" text,
"Vacator" text,
"Reason for change" text,
"Successor" text,
"Date successor seated" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the vacator whre the district is new jersey 2nd?
| SELECT "Vacator" FROM table_20874 WHERE "District" = 'New Jersey 2nd' | wikisql |
CREATE TABLE table_train_40 (
"id" int,
"bone_marrow_transplant" bool,
"organ_transplantation" bool,
"systolic_blood_pressure_sbp" int,
"do_not_resuscitate_dnr" bool,
"autoimmune_disease" bool,
"steroid_therapy" bool,
"intention_to_central_venous_catheter" bool,
"hematologic_disease"... | SELECT * FROM table_train_40 WHERE autoimmune_disease = 1 OR hematologic_disease = 1 OR neoplasma = 1 OR acute_leukemia = 1 OR organ_transplantation = 1 OR bone_marrow_transplant = 1 OR (steroid_therapy = 1 AND receiving_prednisolone > 5) | criteria2sql |
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 microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_ty... | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'arthrocentesis')) GROUP BY cost.hadm_id) AS t1 | 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 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "5" AND prescriptions.route = "TP" | mimicsql_data |
CREATE TABLE table_12340907_1 (
population INTEGER,
police_officers VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the number of police officers is 94, what is the lowest population number?
| SELECT MIN(population) FROM table_12340907_1 WHERE police_officers = 94 | sql_create_context |
CREATE TABLE type_of_restaurant (
resid number,
restypeid number
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE visits_restaurant (
stuid number,
resid number,
time tim... | SELECT fname, lname FROM student WHERE age > 18 AND major = 600 | spider |
CREATE TABLE table_31224 (
"Skip (Club)" text,
"W" real,
"L" real,
"PF" real,
"PA" real,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends" real,
"Stolen Ends" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the blank ends record... | SELECT "Blank Ends" FROM table_31224 WHERE "W" > '6.0' | wikisql |
CREATE TABLE table_1598533_8 (
inflation__percentage_annual__2012_ VARCHAR,
gdp_per_capita_in_ppp_us$__2012_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the annual inflation % when GDP per capita in ppp US$ is 24505 in 2012?
| SELECT inflation__percentage_annual__2012_ FROM table_1598533_8 WHERE gdp_per_capita_in_ppp_us$__2012_ = 24505 | sql_create_context |
CREATE TABLE table_7580 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total having a bronze value over 1, silver under 5, and ranked 9?
| SELECT "Total" FROM table_7580 WHERE "Bronze" > '1' AND "Silver" < '5' AND "Rank" = '9' | wikisql |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Badges (
Id... | WITH my_table AS (SELECT T.TagName, CAST((JULIANDAY(CreationDate) - JULIANDAY(P.CreationDate)) * 1440.0 AS INT) AS ResponseMinutes FROM Posts AS P INNER JOIN Posts AS A ON P.AcceptedAnswerId = A.Id INNER JOIN PostTags AS PT ON P.Id = PT.PostId INNER JOIN Tags AS T ON T.Id = PT.TagId WHERE P.PostTypeId = 1 AND (T.TagNam... | sede |
CREATE TABLE table_32363 (
"Crop (kilotonnes)" text,
"New South Wales" real,
"Victoria" real,
"Queensland" real,
"Western Australia" real,
"South Australia" real,
"Tasmania" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Wh... | SELECT MIN("Total") FROM table_32363 WHERE "New South Wales" = '42' AND "Victoria" < '68' | wikisql |
CREATE TABLE table_19611329_1 (
year_inducted VARCHAR,
inducted_as VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the player for 1945 for player
| SELECT "player" FROM table_19611329_1 WHERE year_inducted = 1945 AND inducted_as = "player" | sql_create_context |
CREATE TABLE table_203_368 (
id number,
"date" text,
"opponent" text,
"venue" text,
"result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many goals did cardiff city f.c. score in the month of april ?
| SELECT SUM("result") FROM table_203_368 WHERE "date" = 4 | squall |
CREATE TABLE table_8601 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the outcome of the match played on carpet surface?
| SELECT "Outcome" FROM table_8601 WHERE "Surface" = 'carpet' | wikisql |
CREATE TABLE table_49402 (
"Date" text,
"Venue" text,
"Opponents" text,
"Score" text,
"Round" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what Venue was the Score 1-1?
| SELECT "Venue" FROM table_49402 WHERE "Score" = '1-1' | wikisql |
CREATE TABLE table_60755 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score in the final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the outcome on March 20, 1994?
| SELECT "Outcome" FROM table_60755 WHERE "Date" = 'march 20, 1994' | wikisql |
CREATE TABLE table_25884 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What d... | SELECT "Date" FROM table_25884 WHERE "Series" = '0-2' | wikisql |
CREATE TABLE Detention (
detention_id INTEGER,
detention_type_code VARCHAR(10),
teacher_id INTEGER,
datetime_detention_start DATETIME,
datetime_detention_end DATETIME,
detention_summary VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Teachers (
teacher_id INTEGER,
address_id... | SELECT date_address_from, COUNT(date_address_from) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC | nvbench |
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 MAX(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 = 'implantation of heart pacemaker - permanent'... | eicu |
CREATE TABLE table_name_25 (
virtual_channel VARCHAR,
station_ownership VARCHAR,
call_sign VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Station Ownership of eicb tv, and a Call sign of ktcj-ld is what virtual network?
| SELECT virtual_channel FROM table_name_25 WHERE station_ownership = "eicb tv" AND call_sign = "ktcj-ld" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "6" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE table_2781 (
"R" real,
"Player" text,
"Position" text,
"League" real,
"Champions League" real,
"Coppa Italia" real,
"Super Coppa" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the position for chivu
| SELECT "Position" FROM table_2781 WHERE "Player" = 'Chivu' | wikisql |
CREATE TABLE table_63552 (
"Pick" real,
"Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What player was picked earlier than 126 by the Houston Oilers?
| SELECT "Player" FROM table_63552 WHERE "Pick" < '126' AND "Team" = 'houston oilers' | wikisql |
CREATE TABLE table_name_7 (
record VARCHAR,
result VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What record has w as the result, with January 2 as the date?
| SELECT record FROM table_name_7 WHERE result = "w" AND date = "january 2" | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51214" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE table_name_52 (
administrative_panel INTEGER,
nominated_by_the_taoiseach INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Administrative Panel has a Nominated by the Taoiseach smaller than 0?
| SELECT MIN(administrative_panel) FROM table_name_52 WHERE nominated_by_the_taoiseach < 0 | sql_create_context |
CREATE TABLE table_15539 (
"Call Sign" text,
"City of License" text,
"Frequency" text,
"age Watt" text,
"Coverage Area" text,
"Founded" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the city of license which has age Watt of 160 watts
| SELECT "City of License" FROM table_15539 WHERE "age Watt" = '160 watts' | wikisql |
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 t_kc21.MED_CLINIC_ID 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.AMOUNT > 2273.34) | css |
CREATE TABLE table_64564 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is t... | SELECT "Date of vacancy" FROM table_64564 WHERE "Position in table" = '16th' AND "Outgoing manager" = 'russell slade' | wikisql |
CREATE TABLE table_60173 (
"Shooter" text,
"Event" text,
"Rank points" text,
"Score points" text,
"Total" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Score Points, when Event is 'WC Rio De Janeiro', and when Rank Points is '10'?
| SELECT "Score points" FROM table_60173 WHERE "Event" = 'wc rio de janeiro' AND "Rank points" = '10' | wikisql |
CREATE TABLE table_18559 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result for the incumbent Milton H. West?
| SELECT "Result" FROM table_18559 WHERE "Incumbent" = 'Milton H. West' | wikisql |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
... | SELECT q.Id AS "post_link", q.CreationDate, q.OwnerUserId AS "user_link", COUNT(a.Id) AS "answersin30" FROM Posts AS q INNER JOIN Posts AS a ON q.Id = a.ParentId AND a.PostTypeId = 2 AND CAST((JULIANDAY(CreationDate) - JULIANDAY(q.CreationDate)) * 1440.0 AS INT) <= 60 WHERE q.PostTypeId = 1 AND q.ClosedDate IS NULL AND... | sede |
CREATE TABLE table_name_31 (
year INTEGER,
album VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the average Year of release for the Album, 'Da Baddest Bitch'?
| SELECT AVG(year) FROM table_name_31 WHERE album = "da baddest bitch" | sql_create_context |
CREATE TABLE table_57127 (
"Year" real,
"Men's singles" text,
"Women's singles" text,
"Men's doubles" text,
"Women's doubles" text,
"Mixed doubles" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which women's doubles had the accompanying Men's s... | SELECT "Women's doubles" FROM table_57127 WHERE "Men's singles" = 'ville lång' | wikisql |
CREATE TABLE Contacts (
contact_id INTEGER,
customer_id INTEGER,
gender VARCHAR(1),
first_name VARCHAR(80),
last_name VARCHAR(50),
contact_phone VARCHAR(80)
)
CREATE TABLE Addresses (
address_id INTEGER,
line_1_number_building VARCHAR(80),
city VARCHAR(50),
zip_postcode VARCHAR(... | SELECT product_name, COUNT(product_name) FROM Products WHERE product_price > 1000 OR product_price < 500 GROUP BY product_name ORDER BY product_name DESC | nvbench |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNot... | SELECT PostId AS "post_link", Score, Text, CreationDate FROM Comments WHERE (LENGTH(Text) < 19 AND Text LIKE 'Thanks%') ORDER BY Score DESC | sede |
CREATE TABLE table_27957 (
"meas. num." real,
"passed" text,
"YES votes" real,
"NO votes" real,
"% YES" text,
"Const. Amd.?" text,
"type" text,
"description" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the type when yes votes ... | SELECT "type" FROM table_27957 WHERE "YES votes" = '546255' | wikisql |
CREATE TABLE table_59952 (
"Rank" real,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number that 0 silver?
| SELECT COUNT("Total") FROM table_59952 WHERE "Silver" < '0' | wikisql |
CREATE TABLE table_name_7 (
opponent VARCHAR,
loss VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent when there was a loss of Francisco (1-1)?
| SELECT opponent FROM table_name_7 WHERE loss = "francisco (1-1)" | sql_create_context |
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 jyjgzbb (
BGDH text,
BGRQ tim... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB ... | css |
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.OUT_DIAG_DIS_CD, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '0255519' GROUP BY qtb.MED_ORG_DEPT_CD, qtb.OUT_DIAG_DIS_CD UNION SELECT gyb.MED_ORG_DEPT_CD, gyb.OUT_DIAG_DIS_CD, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '0255519' GROUP BY gyb.MED_ORG_DEPT_CD, gyb.... | css |
CREATE TABLE table_70203 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the chassis for a 1952 officine alfieri maserati with an entrant?
| SELECT "Chassis" FROM table_70203 WHERE "Entrant" = 'officine alfieri maserati' AND "Year" = '1952' | wikisql |
CREATE TABLE table_45401 (
"Province" text,
"Provincial capital" text,
"Largest city" text,
"Area (km 2 )" real,
"Population (2013)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Nelspruit's population?
| SELECT COUNT("Population (2013)") FROM table_45401 WHERE "Largest city" = 'nelspruit' | wikisql |
CREATE TABLE table_2562572_50 (
type VARCHAR,
settlement VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What type of settlemen is Kru edol Selo?
| SELECT type FROM table_2562572_50 WHERE settlement = "Krušedol Selo" | sql_create_context |
CREATE TABLE table_13221 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the To par of the Player from Argentina?
| SELECT "To par" FROM table_13221 WHERE "Country" = 'argentina' | wikisql |
CREATE TABLE table_name_75 (
hole VARCHAR,
country VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many holes did Mike Reid from United States have?
| SELECT hole FROM table_name_75 WHERE country = "united states" AND player = "mike reid" | sql_create_context |
CREATE TABLE table_name_36 (
game_1 VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 3rd Liga from Game 1 of 0-1 between the years 2008-09?
| SELECT 3 AS rd_liga_3rd FROM table_name_36 WHERE game_1 = "0-1" AND date = "2008-09" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.