instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 650 AND STRFTIME('%y', patient.unitadmittime) <= '2104' | eicu |
CREATE TABLE table_10194 (
"Date" text,
"Course" text,
"Distance" text,
"Type" text,
"Winner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How far is the olbia to sassari route?
| SELECT "Distance" FROM table_10194 WHERE "Course" = 'olbia to sassari' | 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 zyjzjlb (
CYBQDM text,
CYBQMC... | SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM wdmzjzjlb JOIN jybgb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE wdmzjzjlb.YLJGDM = '1400547' AND jybgb.BGRQ BETWEEN '2009-09-26' AND '2018-10-23' GROUP BY jybgb.KSBM HAVING COUNT(*) <= 5 UNION SELECT jybgb.KSBM FROM bdmzjzjlb J... | css |
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_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '孙子怡' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 3407.67) | css |
CREATE TABLE table_4377 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What competition was held 1 March 1909?
| SELECT "Competition" FROM table_4377 WHERE "Date" = '1 march 1909' | wikisql |
CREATE TABLE table_204_882 (
id number,
"number" number,
"builder" text,
"entered service" text,
"withdrawn" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- can you find the top entered service ?
| SELECT "entered service" FROM table_204_882 WHERE id = 1 | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.age < "68" | mimicsql_data |
CREATE TABLE table_80361 (
"Tournament" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the 2011 when 2010 is 2r
| SELECT "2011" FROM table_80361 WHERE "2010" = '2r' | wikisql |
CREATE TABLE table_2468961_4 (
title VARCHAR,
no_in_series VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the title of series number 56?
| SELECT title FROM table_2468961_4 WHERE no_in_series = 56 | sql_create_context |
CREATE TABLE table_9055 (
"Outcome" text,
"Date" real,
"Championship" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the championship during the match with the opponent of richard fromberg?... | SELECT "Championship" FROM table_9055 WHERE "Opponent" = 'richard fromberg' | wikisql |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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,
... | SELECT AVG(t_kc21.IN_HOSP_DAYS) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '9922597' AND t_kc21.IN_HOSP_DATE BETWEEN '2013-02-02' AND '2021-11-09' | css |
CREATE TABLE table_68346 (
"Rank" real,
"Team" text,
"Country" text,
"Value ($M)" real,
"Debt as % of value" real,
"% change on year" text,
"Revenue ($M)" real,
"Operating income ($m)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name ... | SELECT MAX("Revenue ($M)") FROM table_68346 WHERE "Operating income ($m)" > '27' AND "Team" = 'hamburg' AND "Debt as % of value" < '0' | wikisql |
CREATE TABLE table_9742 (
"Game" text,
"Date" text,
"Home Team" text,
"Result" text,
"Road Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the result for game 5?
| SELECT "Result" FROM table_9742 WHERE "Game" = 'game 5' | wikisql |
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 (SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'oth nonaut... | mimic_iii |
CREATE TABLE table_65693 (
"School" text,
"Location" text,
"Mascot" text,
"Enrollment" real,
"IHSAA Class" text,
"IHSAA Football Class" text,
"County" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What school has the Lancers as their mascot... | SELECT "Location" FROM table_65693 WHERE "Mascot" = 'lancers' | wikisql |
CREATE TABLE table_60420 (
"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 tie number for the game with an away team of Hartlepool United?
| SELECT "Tie no" FROM table_60420 WHERE "Away team" = 'hartlepool united' | wikisql |
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, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'bone fracture(s) - left lower extremity' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '... | eicu |
CREATE TABLE table_name_92 (
round VARCHAR,
race VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the round for the Int. Adac-Preis Der Tourenwagen Von Sachsen-Anhalt?
| SELECT round FROM table_name_92 WHERE race = "int. adac-preis der tourenwagen von sachsen-anhalt" | 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_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT COUNT(*) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '尤学民' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2006-11-12' AND '2013-01-31' AND t_kc24.MED_AMOUT <= 10 UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE fgwyjzb.P... | css |
CREATE TABLE table_203_606 (
id number,
"region" text,
"rnd" number,
"host" text,
"venue" text,
"city" text,
"state" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- total number of venues that hosted first and second round games .
| SELECT COUNT("venue") FROM table_203_606 WHERE "rnd" = 1 OR "rnd" = 2 | squall |
CREATE TABLE table_54219 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which constructor has laps less than 100 and a time/retired +10 laps?
| SELECT "Constructor" FROM table_54219 WHERE "Laps" < '100' AND "Time/Retired" = '+10 laps' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugsto... | 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 = '003-83')) AND intakeoutput.cellpath LIKE '%intake%' A... | eicu |
CREATE TABLE table_22083044_2 (
winning_team VARCHAR,
circuit VARCHAR,
fastest_lap VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the winning team where Tim Macrow won the fastest lap on Queensland Raceway circuit?
| SELECT winning_team FROM table_22083044_2 WHERE circuit = "Queensland Raceway" AND fastest_lap = "Tim Macrow" | sql_create_context |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE c... | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19428) AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-3 year') | mimic_iii |
CREATE TABLE table_57614 (
"Serial Title" text,
"Year" text,
"Chapters" text,
"Director" text,
"Cast" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the cast for b. reeves eason and joseph kane
| SELECT "Cast" FROM table_57614 WHERE "Director" = 'b. reeves eason and joseph kane' | wikisql |
CREATE TABLE table_76555 (
"Date" text,
"Captain 1" text,
"Team 2" text,
"Captain 2" text,
"Venue" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Captain 2 has a Result of final?
| SELECT "Captain 2" FROM table_76555 WHERE "Result" = 'final' | 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 COUNT(*) FROM (SELECT qtb.MED_ORG_DEPT_CD FROM qtb WHERE qtb.MED_SER_ORG_NO = '3523362' GROUP BY qtb.MED_ORG_DEPT_CD HAVING MIN(qtb.IN_HOSP_DAYS) > 8 UNION SELECT gyb.MED_ORG_DEPT_CD FROM gyb WHERE gyb.MED_SER_ORG_NO = '3523362' GROUP BY gyb.MED_ORG_DEPT_CD HAVING MIN(gyb.IN_HOSP_DAYS) > 8 UNION SELECT zyb.MED_O... | css |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 85895) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY prescriptions.startdate DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_33986 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record on April 1?
| SELECT "Record" FROM table_33986 WHERE "Date" = 'april 1' | wikisql |
CREATE TABLE table_name_29 (
entered_service VARCHAR,
serial_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the entered service date for serial number 85-1222?
| SELECT entered_service FROM table_name_29 WHERE serial_no = "85-1222" | sql_create_context |
CREATE TABLE table_21515673_2 (
rr1_pts VARCHAR,
team_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points does Swedish America's Cup Challenge have for rr1?
| SELECT COUNT(rr1_pts) FROM table_21515673_2 WHERE team_name = "Swedish America's Cup Challenge" | sql_create_context |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE comment_instructor (
instructor_id int,
... | SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr... | advising |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS va... | SELECT JOB_ID, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY JOB_ID | nvbench |
CREATE TABLE table_name_24 (
lowest INTEGER,
average INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest attendance for a stadium that has an average smaller than 307?
| SELECT AVG(lowest) FROM table_name_24 WHERE average < 307 | sql_create_context |
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
)
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people are under 4... | SELECT gender, COUNT(*) FROM Person WHERE age < 40 GROUP BY gender ORDER BY gender | nvbench |
CREATE TABLE table_22883210_11 (
high_assists VARCHAR,
series VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When 0-1 is the series who has the highest amount of assists?
| SELECT high_assists FROM table_22883210_11 WHERE series = "0-1" | sql_create_context |
CREATE TABLE enroll (
class_code text,
stu_num number,
enroll_grade text
)
CREATE TABLE employee (
emp_num number,
emp_lname text,
emp_fname text,
emp_initial text,
emp_jobcode text,
emp_hiredate time,
emp_dob time
)
CREATE TABLE professor (
emp_num number,
dept_code te... | SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN class AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code JOIN department AS T5 ON T5.dept_code = T4.dept_code WHERE T5.dept_name = 'Accounting' INTERSECT SELECT T1.stu_fname FROM student AS T1 JOI... | spider |
CREATE TABLE table_203_43 (
id number,
"polling firm" text,
"month" text,
"link" text,
"favor" number,
"oppose" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many months had more than 55 favor votes ?
| SELECT COUNT("month") FROM table_203_43 WHERE "favor" > 55 | squall |
CREATE TABLE table_78401 (
"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 score for south melbourne at home?
| SELECT "Home team score" FROM table_78401 WHERE "Home team" = 'south melbourne' | wikisql |
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 demographic.diagnosis, demographic.admittime FROM demographic WHERE demographic.subject_id = "53707" | mimicsql_data |
CREATE TABLE table_test_24 (
"id" int,
"history_of_bleeding_diathesis" bool,
"bleeding" int,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"blood_draw" bool,
"renal_disease" bool,
"allergy_to_aspirin" bool,
"allergy_to_clopidogrel" bool,
"cardiogenic_shock" boo... | SELECT * FROM table_test_24 WHERE gastrointestinal_disease = 1 OR bleeding = 1 OR platelet_count < 100000 OR hemoglobin_a1c_hba1c < 10 | criteria2sql |
CREATE TABLE table_204_971 (
id number,
"m" number,
"date" text,
"tournament" text,
"round" text,
"ground" text,
"opponent" text,
"score" text,
"attendance" number,
"dinamo scorers" text,
"report" text
)
-- Using valid SQLite, answer the following questions for the tables p... | SELECT COUNT(*) FROM table_204_971 WHERE "attendance" >= 8000 | squall |
CREATE TABLE region (
Region_id int,
Region_code text,
Region_name text
)
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Number_Deaths int
)
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_cit... | SELECT Dates_active, Number_Deaths FROM storm WHERE Number_Deaths >= 1 ORDER BY Dates_active | nvbench |
CREATE TABLE table_68512 (
"Rank" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most time for katrin mei ner and rank less than 5
| SELECT MAX("Time") FROM table_68512 WHERE "Name" = 'katrin meißner' AND "Rank" < '5' | wikisql |
CREATE TABLE table_26368963_1 (
under_13 VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In the year 2009 who was the under-13?
| SELECT under_13 FROM table_26368963_1 WHERE year = 2009 | sql_create_context |
CREATE TABLE table_name_4 (
horizontal_bar INTEGER,
country VARCHAR,
rings VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the highest Horizontal Bar which is in france and Rings smaller than 58.975?
| SELECT MAX(horizontal_bar) FROM table_name_4 WHERE country = "france" AND rings < 58.975 | sql_create_context |
CREATE TABLE table_name_74 (
county VARCHAR,
geo_id VARCHAR,
latitude VARCHAR,
ansi_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the county when the latitude is more than 48.581299, ansi code is more than 1037103 and the geo id is 3801... | SELECT county FROM table_name_74 WHERE latitude > 48.581299 AND ansi_code > 1037103 AND geo_id = 3801985060 | sql_create_context |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Na... | SELECT p.Id AS "post_link", p.Score AS "Score", p.AnswerCount AS "Answers", bs.BountyAmount AS "Amount", p.Tags, CAST(TIME_TO_STR(bs.CreationDate, '%Y-%m-%d %H:%M:%S') AS TEXT(10)) AS "Bounty Start" FROM Posts AS p INNER JOIN Votes AS bs ON p.Id = bs.PostId AND bs.VoteTypeId = 8 AND p.Tags LIKE '%<##Tagname##>%' ORDER ... | sede |
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 T1.Name, T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID ORDER BY T1.Name DESC | nvbench |
CREATE TABLE table_name_69 (
total INTEGER,
to_par VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many strokes for arnold palmer with a to par of greater than 9?
| SELECT AVG(total) FROM table_name_69 WHERE to_par > 9 AND player = "arnold palmer" | sql_create_context |
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
applica... | 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, days, flight WHERE ((((((flight.arrival_time < 41 OR flight.time_elapsed >= 60) AND flight.departure_time > flight.arrival_time) AND days.day_name = 'THURSDAY' AND flight.fli... | atis |
CREATE TABLE table_73703 (
"Name" text,
"Nation" text,
"Seasons" text,
"Championship titles" text,
"Races (Starts)" text,
"Poles" real,
"Wins" real,
"Podiums" real,
"Fastest Laps" real,
"Points (Dropped points)" text
)
-- Using valid SQLite, answer the following questions for t... | SELECT "Races (Starts)" FROM table_73703 WHERE "Points (Dropped points)" = '18' | wikisql |
CREATE TABLE table_1341568_14 (
opponent VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was Henry Hyde's opponent in the race?
| SELECT opponent FROM table_1341568_14 WHERE incumbent = "Henry Hyde" | sql_create_context |
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_Road, School_ID FROM basketball_match ORDER BY School_ID | nvbench |
CREATE TABLE field (
fieldid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE paperda... | SELECT DISTINCT paper.paperid FROM dataset, paper, paperdataset WHERE dataset.datasetname = 'NELL' AND paperdataset.datasetid = dataset.datasetid AND paper.paperid = paperdataset.paperid | scholar |
CREATE TABLE table_name_47 (
tournament VARCHAR,
runner_s__up VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which tournament has a Runner(s)-up of Gary McCord?
| SELECT tournament FROM table_name_47 WHERE runner_s__up = "gary mccord" | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodi... | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '021-221706' AND patient.hospitaladmitsource = 'floor' AND DATETIME(patient.hospitaladmittime) <= DATETIME(CURRENT_TIME(), '-4 year') ORDER BY patient.hospitaladmittime DESC LIMIT 1 | eicu |
CREATE TABLE table_22993636_2 (
overall_record VARCHAR,
road_record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the overall record of the team with 4-3 road record?
| SELECT overall_record FROM table_22993636_2 WHERE road_record = "4-3" | sql_create_context |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
t... | SELECT DISTINCT instructor.name, program_course.workload FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN program_course ON program_course.course_id = cour... | advising |
CREATE TABLE table_54042 (
"Driver" text,
"Entrant" text,
"Constructor" text,
"Chassis" text,
"Engine" text,
"Tyre" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the constructor when the tyre is d, the engine is talbot 23cv 4.5 l6, the c... | SELECT "Constructor" FROM table_54042 WHERE "Tyre" = 'd' AND "Engine" = 'talbot 23cv 4.5 l6' AND "Chassis" = 'talbot-lago t26c' AND "Entrant" = 'ecurie belge' | wikisql |
CREATE TABLE table_47828 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Place, when To Par is '5', and when Score is '72-73=145'?
| SELECT "Place" FROM table_47828 WHERE "To par" = '5' AND "Score" = '72-73=145' | wikisql |
CREATE TABLE table_67462 (
"Minister" text,
"Party" text,
"Governments" text,
"Term start" text,
"Term end" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When is the term end of Shlomo-Yisrael Ben-Meir of the National Religious Party?
| SELECT "Term end" FROM table_67462 WHERE "Party" = 'national religious party' AND "Minister" = 'shlomo-yisrael ben-meir' | wikisql |
CREATE TABLE editor (
Name VARCHAR,
Age VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the names of editors in ascending order of age.
| SELECT Name FROM editor ORDER BY Age | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TAB... | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-13409')) AND DATETIME(medication.drugstarttime) <= DATETIM... | eicu |
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 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 lab.patientunitstayid FROM lab WHERE lab.labname = 'cortisol')) AND DATETIME(cost.chargetime) <= DATETIME(CURRENT_TIME()... | eicu |
CREATE TABLE Ref_Budget_Codes (
Budget_Type_Code CHAR(15),
Budget_Type_Description VARCHAR(255)
)
CREATE TABLE Projects (
Project_ID INTEGER,
Project_Details VARCHAR(255)
)
CREATE TABLE Documents (
Document_ID INTEGER,
Document_Type_Code CHAR(15),
Project_ID INTEGER,
Document_Date DATE... | SELECT Budget_Type_Code, COUNT(*) FROM Documents_with_Expenses GROUP BY Budget_Type_Code | nvbench |
CREATE TABLE table_31969 (
"Heat Rank" real,
"Lane" real,
"Swimmer" text,
"Country" text,
"Time" real,
"Overall Rank" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In heat rank 7, what is the sum of lanes?
| SELECT SUM("Lane") FROM table_31969 WHERE "Heat Rank" = '7' | wikisql |
CREATE TABLE table_51037 (
"Date" text,
"Series" text,
"Circuit" text,
"City / State" text,
"Winner" text,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the city/state of the circuit where Russell Ingall Larry Perkins was the win... | SELECT "City / State" FROM table_51037 WHERE "Winner" = 'russell ingall larry perkins' | wikisql |
CREATE TABLE table_143352_1 (
construction_started INTEGER,
net_mwe VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did construction start on the Power station with a net MWE of 1190
| SELECT MIN(construction_started) FROM table_143352_1 WHERE net_mwe = 1190 | sql_create_context |
CREATE TABLE table_26866233_1 (
director VARCHAR,
series__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who are the directors of the episode in series # 54?
| SELECT director FROM table_26866233_1 WHERE series__number = 54 | 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 t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '56549574' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 6975.76) | css |
CREATE TABLE table_71546 (
"Date" text,
"Winner" text,
"Score" text,
"Location" text,
"Series" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Location, when the Score is 38-29?
| SELECT "Location" FROM table_71546 WHERE "Score" = '38-29' | wikisql |
CREATE TABLE table_name_79 (
week VARCHAR,
host_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which week did the Baltimore Ravens play at home ?
| SELECT week FROM table_name_79 WHERE host_team = "baltimore ravens" | sql_create_context |
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE airline (
... | 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, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND days.day_name = 'SUNDAY' AND flight.flight_days = days.day... | atis |
CREATE TABLE table_203_756 (
id number,
"year" number,
"title" text,
"role" text,
"network" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- count of unique roles
| SELECT COUNT("role") FROM table_203_756 | squall |
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.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" AND procedures.icd9_code = "8856" | mimicsql_data |
CREATE TABLE table_name_62 (
record VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Record has an Attendance of 24,597?
| SELECT record FROM table_name_62 WHERE attendance = "24,597" | sql_create_context |
CREATE TABLE table_62596 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had a finish of t15?
| SELECT "Player" FROM table_62596 WHERE "Finish" = 't15' | wikisql |
CREATE TABLE table_62642 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog number" text,
"Lyrics" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what language is the Lyrics of the release on August 10, 2005 with Catalog numb... | SELECT "Lyrics" FROM table_62642 WHERE "Date" = 'august 10, 2005' AND "Catalog number" = 'tocp-66427' | 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.JZLSH FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '范秀逸' AND hz_info.YLJGDM = '3470456' AND wdmzjzjlb.JZKSMC LIKE '%变态反应%' UNION SELECT bdmzjzjlb... | css |
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Description VARCHAR(255)
)
CREATE TABLE All_Documents (
Document_ID INTEGER,
Date_Stored DATETIME,
Document_Type_Code CHAR(15),
Document_Name CHAR(255),
Document_Description CHA... | SELECT Calendar_Date, COUNT(Calendar_Date) FROM Ref_Calendar | nvbench |
CREATE TABLE Photos (
Photo_ID INTEGER,
Tourist_Attraction_ID INTEGER,
Name VARCHAR(255),
Description VARCHAR(255),
Filename VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Staff (
Staff_ID INTEGER,
Tourist_Attraction_ID INTEGER,
Name VARCHAR(40),
Other_Details VARCHAR(2... | SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID | nvbench |
CREATE TABLE table_36 (
"Calls" text,
"Frequency" text,
"Branding" text,
"Format" text,
"Market/Rank" text,
"Timeslot" text,
"Group owner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Branding for Group Owner Qantam of Cape Cod... | SELECT "Branding" FROM table_36 WHERE "Group owner" = 'Qantam of Cape Cod, LLC' | wikisql |
CREATE TABLE table_9053 (
"Date" text,
"Venue" text,
"Score" text,
"Competition" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Competition on November 16, 2007?
| SELECT "Competition" FROM table_9053 WHERE "Date" = 'november 16, 2007' | wikisql |
CREATE TABLE table_name_46 (
television_service VARCHAR,
language VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which television service has italian for its language?
| SELECT television_service FROM table_name_46 WHERE language = "italian" | sql_create_context |
CREATE TABLE table_39379 (
"Year" real,
"English title" text,
"Original title" text,
"Country" text,
"Director" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- English title of am lie had what year?
| SELECT "Year" FROM table_39379 WHERE "English title" = 'amélie' | wikisql |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'CICS' AND course.number = 301 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.o... | advising |
CREATE TABLE table_61007 (
"Position" real,
"Club" text,
"Played" real,
"Points" real,
"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 for") FROM table_61007 WHERE "Draws" < '6' AND "Losses" < '7' | wikisql |
CREATE TABLE table_name_4 (
inhabitants INTEGER,
mayor VARCHAR,
election VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Inhabitants have a Mayor of matteo renzi, and an Election larger than 2009?
| SELECT MIN(inhabitants) FROM table_name_4 WHERE mayor = "matteo renzi" AND election > 2009 | sql_create_context |
CREATE TABLE table_204_91 (
id number,
"year" number,
"original title" text,
"english title" text,
"role" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was henrick malberg 's first film ?
| SELECT "original title" FROM table_204_91 ORDER BY "year" LIMIT 1 | squall |
CREATE TABLE teaches (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0)
)
CREATE TABLE classroom (
building varchar(15),
room_number varchar(7),
capacity numeric(4,0)
)
CREATE TABLE instructor (
ID varchar(5),
name varchar(20),
... | SELECT dept_name, AVG(salary) FROM instructor GROUP BY dept_name ORDER BY dept_name | nvbench |
CREATE TABLE table_15315816_1 (
year VARCHAR,
champion VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When are all years that the champion is Ji Min Jeong?
| SELECT year FROM table_15315816_1 WHERE champion = "Ji Min Jeong" | sql_create_context |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE p... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'MUSICOL' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Sum... | advising |
CREATE TABLE table_name_58 (
location VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the location when the score is w 105-99?
| SELECT location FROM table_name_58 WHERE score = "w 105-99" | sql_create_context |
CREATE TABLE table_69468 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which entrant has a year after 1999?
| SELECT "Entrant" FROM table_69468 WHERE "Year" > '1999' | wikisql |
CREATE TABLE table_name_52 (
year INTEGER,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest Year, when Opponent is #2 Syracuse?
| SELECT MAX(year) FROM table_name_52 WHERE opponent = "#2 syracuse" | sql_create_context |
CREATE TABLE table_842 (
"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 did ... | SELECT "Team" FROM table_842 WHERE "Record" = '45-36' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE chartevents ... | SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'insulin human regular' AND admissions.subject_id = 7165 AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-31 mont... | mimic_iii |
CREATE TABLE table_20137 (
"Condition" text,
"Prothrombin time" text,
"Partial thromboplastin time" text,
"Bleeding time" text,
"Platelet count" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are all the possible bleeding time results where pro... | SELECT "Bleeding time" FROM table_20137 WHERE "Prothrombin time" = 'Unaffected' AND "Platelet count" = 'Unaffected' | wikisql |
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "TERAZ5" AND lab.fluid = "Urine" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.