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 microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodi... | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'treatment' AND cost.eventid IN (SELECT treatment.treatmentid FROM treatment WHERE treatment.treatmentname = 'vasopressors - norepinephrine > 0.1 micrograms/kg/min') | eicu |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,... | 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-10951' AND NOT patient.hospitaldischargetime IS NULL ORDER... | eicu |
CREATE TABLE table_77241 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many years was the opponent petr korda?
| SELECT COUNT("Year") FROM table_77241 WHERE "Opponent" = 'petr korda' | wikisql |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT wdmzjzjlb.JZLSH FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '35864254' AND hz_info.YLJGDM = '9397980' AND NOT wdmzjzjlb.JZKSMC LIKE '%激光%' UNION SELECT bdmzjzjlb.JZLSH FROM hz_info JOIN bdmzjzjlb ON hz_info.YL... | css |
CREATE TABLE table_27553627_2 (
tv_season VARCHAR,
viewers__in_millions_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What tv season year had 14.54 million viewers?
| SELECT tv_season FROM table_27553627_2 WHERE viewers__in_millions_ = "14.54" | sql_create_context |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop... | SELECT COUNT(*) > 0 FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND NOT COURSEalias0.course_id IN... | advising |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT demographic.marital_status FROM demographic WHERE demographic.name = "Kelly Gallardo" | mimicsql_data |
CREATE TABLE table_54473 (
"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 many events for bob murphy?
| SELECT MAX("Events") FROM table_54473 WHERE "Player" = 'bob murphy' | wikisql |
CREATE TABLE table_name_4 (
record VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record of the game on May 6?
| SELECT record FROM table_name_4 WHERE date = "may 6" | sql_create_context |
CREATE TABLE table_train_193 (
"id" int,
"gender" string,
"c_peptide_level" float,
"hemoglobin_a1c_hba1c" float,
"proteinuria" int,
"body_mass_index_bmi" float,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- a norma... | SELECT * FROM table_train_193 WHERE c_peptide_level > 0.9 | criteria2sql |
CREATE TABLE table_45146 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent in the bout that led to a win ... | SELECT "Opponent" FROM table_45146 WHERE "Res." = 'win' AND "Time" = '1:21' | wikisql |
CREATE TABLE table_name_99 (
total VARCHAR,
usca VARCHAR,
joint_music_award VARCHAR,
rthk VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Total with a Joint Music Award of 1, RTHK of 4, and USCA of 4?
| SELECT total FROM table_name_99 WHERE joint_music_award = "1" AND rthk = "4" AND usca = "4" | sql_create_context |
CREATE TABLE table_name_27 (
away_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score for the away team that played at Glenferrie Oval?
| SELECT away_team AS score FROM table_name_27 WHERE venue = "glenferrie oval" | sql_create_context |
CREATE TABLE participants (
Participant_ID VARCHAR
)
CREATE TABLE EVENTS (
service_id VARCHAR,
Event_ID VARCHAR
)
CREATE TABLE services (
Service_Type_Code VARCHAR,
service_id VARCHAR
)
CREATE TABLE Participants_in_Events (
Participant_ID VARCHAR,
Event_ID VARCHAR
)
-- Using valid SQLit... | SELECT T3.service_id, T4.Service_Type_Code FROM participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID JOIN EVENTS AS T3 ON T2.Event_ID = T3.Event_ID JOIN services AS T4 ON T3.service_id = T4.service_id GROUP BY T3.service_id ORDER BY COUNT(*) LIMIT 1 | sql_create_context |
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.
-- which number was in service the least amount of time ?
| SELECT "number" FROM table_204_882 ORDER BY "withdrawn" - "entered service" LIMIT 1 | squall |
CREATE TABLE table_5091 (
"Station Code" text,
"Station Name" text,
"Arrival" text,
"Departure" text,
"Platform" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Arrival time of the Patna Junction Station?
| SELECT "Arrival" FROM table_5091 WHERE "Station Name" = 'patna junction' | wikisql |
CREATE TABLE table_name_92 (
scoring_average VARCHAR,
year VARCHAR,
wins VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the scoring average for year less than 1998 and wins more than 3
| SELECT scoring_average FROM table_name_92 WHERE year < 1998 AND wins > 3 | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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... | SELECT * FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE hz_inf... | css |
CREATE TABLE table_26013618_1 (
nsg_nr INTEGER,
date_established VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Nature reserve number was established on 19961220 20.12.1996
| SELECT MIN(nsg_nr) FROM table_26013618_1 WHERE date_established = "19961220 20.12.1996" | sql_create_context |
CREATE TABLE table_name_16 (
tournament VARCHAR,
opponent_in_the_final VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For what tournament was Bla Kav i the opponent in the final?
| SELECT tournament FROM table_name_16 WHERE opponent_in_the_final = "blaž kavčič" | 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 Team_ID, All_Games_Percent FROM basketball_match GROUP BY Team_Name | nvbench |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime ... | SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'hematocrit') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.ag... | mimic_iii |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22245) AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-21 month') ORDER BY prescriptions.startdate DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_name_36 (
home_team VARCHAR,
tie_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the home team for the game that has a Tie value of 3?
| SELECT home_team FROM table_name_36 WHERE tie_no = "3" | sql_create_context |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDSM = '口齿病(龋齿病)' AND jyjgzbb.JCZBDM = '396011' | css |
CREATE TABLE table_53370 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want to know the driver when grid is greater than 13 and laps is less than 60 with time/retired o... | SELECT "Driver" FROM table_53370 WHERE "Grid" > '13' AND "Laps" < '60' AND "Time/retired" = 'accident' | wikisql |
CREATE TABLE Student_Addresses (
monthly_rental VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find all information about student addresses, and sort by monthly rental in descending order.
| SELECT * FROM Student_Addresses ORDER BY monthly_rental DESC | sql_create_context |
CREATE TABLE table_67261 (
"Name" text,
"City/State" text,
"Country" text,
"Status" text,
"Status Date" text,
"Episode Number" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which city/state was associated with a contestant whose status was 2nd ... | SELECT "City/State" FROM table_67261 WHERE "Status" = '2nd runner-up' | wikisql |
CREATE TABLE mission (
mission_id number,
ship_id number,
code text,
launched_year number,
location text,
speed_knots number,
fate text
)
CREATE TABLE ship (
ship_id number,
name text,
type text,
nationality text,
tonnage number
)
-- Using valid SQLite, answer the foll... | SELECT T1.code, T1.fate, T2.name FROM mission AS T1 JOIN ship AS T2 ON T1.ship_id = T2.ship_id | spider |
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 WHERE demographic.discharge_location = "HOME" AND demographic.days_stay > "11" | mimicsql_data |
CREATE TABLE table_25713 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents in final" text,
"Score in final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what are every one of the rivals in concl... | SELECT "Opponents in final" FROM table_25713 WHERE "Championship" = 'Zürich' | wikisql |
CREATE TABLE table_name_24 (
class VARCHAR,
tyres VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which class more recent than 1988 has G tyres?
| SELECT class FROM table_name_24 WHERE tyres = "g" AND year > 1988 | sql_create_context |
CREATE TABLE table_name_57 (
engine VARCHAR,
year VARCHAR,
chassis VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the engine that saw a Chassis of porsche 718, and 0 points, prior to 1964?
| SELECT engine FROM table_name_57 WHERE chassis = "porsche 718" AND points = 0 AND year < 1964 | sql_create_context |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE intakeoutput (
in... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-16517... | eicu |
CREATE TABLE table_name_11 (
score VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What score has 1/22 as the date?
| SELECT score FROM table_name_11 WHERE date = "1/22" | sql_create_context |
CREATE TABLE table_32531 (
"Week" text,
"Kickoff" text,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game site" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the week 2's record?
| SELECT "Record" FROM table_32531 WHERE "Week" = '2' | wikisql |
CREATE TABLE table_9323 (
"Articulatory class" text,
"Non- stop" text,
"Plain stop" text,
"Aspirated stop" text,
"\"Muddy\" voice" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the Non- stop is ( ), what is the Articulatory Class?
| SELECT "Articulatory class" FROM table_9323 WHERE "Non- stop" = '(ㆁ)' | wikisql |
CREATE TABLE table_36745 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the incumbent that was first elected in 1892 and retired to run for the senate democrat... | SELECT "Incumbent" FROM table_36745 WHERE "First elected" = '1892' AND "Result" = 'retired to run for the senate democratic hold' | wikisql |
CREATE TABLE film (
title VARCHAR,
replacement_cost INTEGER,
LENGTH VARCHAR,
rating VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find all the films longer than 100 minutes, or rated PG, except those who cost more than 200 for replacement. List the ... | SELECT title FROM film WHERE LENGTH > 100 OR rating = 'PG' EXCEPT SELECT title FROM film WHERE replacement_cost > 200 | sql_create_context |
CREATE TABLE loan (
loan_ID varchar(3),
loan_type varchar(15),
cust_ID varchar(3),
branch_ID varchar(3),
amount int
)
CREATE TABLE bank (
branch_ID int,
bname varchar(20),
no_of_customers int,
city varchar(10),
state varchar(20)
)
CREATE TABLE customer (
cust_ID varchar(3),... | SELECT cust_name, credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_ID = T2.cust_ID ORDER BY credit_score DESC | nvbench |
CREATE TABLE classroom (
building VARCHAR,
capacity INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the number of rooms with more than 50 capacity for each building.
| SELECT COUNT(*), building FROM classroom WHERE capacity > 50 GROUP BY building | 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 prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Malig neo bladder NEC" AND lab.fluid = "Joint Fluid" | mimicsql_data |
CREATE TABLE table_64657 (
"English" text,
"German" text,
"Dutch" text,
"Latin" text,
"Romanian" text,
"Portuguese" text,
"Spanish" text,
"Italian" text,
"French" text,
"Greek (Modern)" text,
"Bulgarian" text,
"Macedonian" text,
"Polish (extinct)" text
)
-- Using va... | SELECT "Portuguese" FROM table_64657 WHERE "French" = 'ils/elles avaient entendu' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom te... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT icustays.hadm_id FROM icustays WHERE icustays.icustay_id IN (SELECT inputevents_cv.icustay_id FROM inputevents_cv WHERE inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 's 20 fe ng' AND d_i... | mimic_iii |
CREATE TABLE table_30117 (
"Episode #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Originalairdate" text,
"Viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest episode number that had 4.03 million... | SELECT MIN("Episode #") FROM table_30117 WHERE "Viewers (millions)" = '4.03' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND diagnoses.icd9_code = "51881" | mimicsql_data |
CREATE TABLE table_26866434_1 (
writer VARCHAR,
series__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who wrote episode 122 in the series?
| SELECT writer FROM table_26866434_1 WHERE series__number = 122 | sql_create_context |
CREATE TABLE table_26851 (
"Governorate" text,
"Kurdistan Democratic Party" real,
"Patriotic Union of Kurdistan" real,
"Total Kurdistan List" real,
"Total Governorate Seats" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most total governor... | SELECT MAX("Total Governorate Seats") FROM table_26851 WHERE "Governorate" = 'Hewler' | wikisql |
CREATE TABLE table_204_24 (
id number,
"year" number,
"league" text,
"record" text,
"finish" text,
"manager" text,
"playoffs" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total number of years the sunset leagu... | SELECT COUNT("year") FROM table_204_24 WHERE "league" = 'sunset league' AND "manager" = 'thomas lloyd' | squall |
CREATE TABLE table_687 (
"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 thomas foglietta from?
| SELECT "Party" FROM table_687 WHERE "Incumbent" = 'Thomas Foglietta' | wikisql |
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 COUNT(DISTINCT patient.patienthealthsystemstayid) FROM patient WHERE patient.uniquepid = '010-5308' | eicu |
CREATE TABLE table_name_96 (
shot_pct VARCHAR,
skip VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Madeleine Dupont's shot pct.?
| SELECT shot_pct FROM table_name_96 WHERE skip = "madeleine dupont" | sql_create_context |
CREATE TABLE table_9965 (
"Season" text,
"Races" real,
"Wins" real,
"Podiums" real,
"Poles" real,
"FLaps" real,
"Points" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of poles and 63 points?
| SELECT COUNT("Poles") FROM table_9965 WHERE "Points" = '63' | wikisql |
CREATE TABLE table_34735 (
"Team" text,
"Stadium" text,
"Capacity" real,
"Highest" real,
"Lowest" real,
"Average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Lowest larger than 288, and a Team of east stirlingshire has what lowest average?
| SELECT MIN("Average") FROM table_34735 WHERE "Lowest" > '288' AND "Team" = 'east stirlingshire' | wikisql |
CREATE TABLE has_allergy (
stuid number,
allergy text
)
CREATE TABLE allergy_type (
allergy text,
allergytype text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
-- Using valid SQLite... | SELECT stuid FROM student WHERE age > 20 | spider |
CREATE TABLE table_7571 (
"Volume:Issue" text,
"Issue Date(s)" text,
"Weeks on Top" real,
"Song" text,
"Artist" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Volume:Issue, when Weeks on Top is less than 5, and when Issue Date(s) are 10 July... | SELECT "Volume:Issue" FROM table_7571 WHERE "Weeks on Top" < '5' AND "Issue Date(s)" = '10 july - 24 july' | wikisql |
CREATE TABLE table_44999 (
"Rank" real,
"Name" text,
"Team" text,
"Games" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the total number of points that the rank is less than 5 and has Tiago Splitter?
| SELECT COUNT("Points") FROM table_44999 WHERE "Name" = 'tiago splitter' AND "Rank" < '5' | wikisql |
CREATE TABLE table_dev_35 (
"id" int,
"white_blood_cell_count_wbc" int,
"platelets" int,
"neutrophil_count" int,
"serum_creatinine" float,
"albumin" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- wbc count >= 3000 / mm3
| SELECT * FROM table_dev_35 WHERE white_blood_cell_count_wbc >= 3000 | criteria2sql |
CREATE TABLE table_name_21 (
attendance VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Jets week 17 attendance?
| SELECT attendance FROM table_name_21 WHERE week = 17 | sql_create_context |
CREATE TABLE table_273617_6 (
status VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the 2001 % for the status widowed or surviving partner?
| SELECT 2001 AS __percentage FROM table_273617_6 WHERE status = "Widowed or surviving partner" | sql_create_context |
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 lab ON demographic.hadm_id = lab.hadm_id WHERE lab.flag = "abnormal" AND lab.label = "Triiodothyronine (T3)" | mimicsql_data |
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 prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Injury to femoral nerve" AND lab.flag = "delta" | mimicsql_data |
CREATE TABLE table_50385 (
"Tournament" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- With a 2... | SELECT "2006" FROM table_50385 WHERE "2011" = '0' | wikisql |
CREATE TABLE table_24706337_1 (
name_of_the_war VARCHAR,
ottoman_sultan VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the war where the Ottoman sultan was Selim I?
| SELECT name_of_the_war FROM table_24706337_1 WHERE ottoman_sultan = "Selim I" | sql_create_context |
CREATE TABLE table_66858 (
"Year" real,
"Date" text,
"Title" text,
"Format(s)" text,
"Award description(s)" text,
"Result(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average year with an award of platinum?
| SELECT AVG("Year") FROM table_66858 WHERE "Award description(s)" = 'platinum' | wikisql |
CREATE TABLE table_name_15 (
wins VARCHAR,
year VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the wins for 1963 bultaco
| SELECT wins FROM table_name_15 WHERE year = 1963 AND team = "bultaco" | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2121" AND lab.flag = "delta" | mimicsql_data |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT SUM(t_kc24.PER_ACC_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '马曼丽' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2011-03-22' AND '2019-04-16' | css |
CREATE TABLE table_34476 (
"Year" real,
"Class" text,
"Team name" text,
"Bike" text,
"Riders" text,
"Races" text,
"Wins" real,
"Podiums" real,
"Poles" real,
"F.laps" real,
"Points" text,
"Pos." text
)
-- Using valid SQLite, answer the following questions for the tables ... | SELECT COUNT("Poles") FROM table_34476 WHERE "Bike" = 'honda rc212v' AND "Podiums" < '0' | wikisql |
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_kc21.MED_ORG_DEPT_NM, t_kc21.IN_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '8435928' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.IN_DIAG_DIS_NM HAVING AVG(t_kc21.PERSON_AGE) < 29 | css |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT t_kc21.OUT_DIAG_DOC_CD, t_kc21.OUT_DIAG_DOC_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '58997444' AND t_kc21.IN_HOSP_DATE BETWEEN '2005-07-14' AND '2014-03-13' GROUP BY t_kc21.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE program_requirement (
program_id int... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 15 AND program_course.category LIKE 'ULCS' | advising |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Suggeste... | SELECT Id, CreationDate, ViewCount, Title, Body, Tags FROM Posts WHERE (Title LIKE 'php%' OR Tags LIKE 'php%') | sede |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.i... | mimic_iii |
CREATE TABLE table_48869 (
"Season" real,
"Total Attendance" real,
"Games" real,
"Average" real,
"High avg." real,
"Team" text,
"No. Of Clubs" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest average for Beijing Guo'an whe... | SELECT MIN("Average") FROM table_48869 WHERE "Team" = 'beijing guo''an' AND "Games" > '240' | wikisql |
CREATE TABLE table_10615 (
"Entrant" text,
"Constructor" text,
"Chassis" text,
"Engine" text,
"Tyre" text,
"Driver" text,
"Rounds" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what rounds did Scuderia Milano participate?
| SELECT "Rounds" FROM table_10615 WHERE "Entrant" = 'scuderia milano' | wikisql |
CREATE TABLE qtb (
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_NM, qtb.IN_DIAG_DIS_NM, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '5056458' GROUP BY qtb.MED_ORG_DEPT_NM, qtb.IN_DIAG_DIS_NM UNION SELECT gyb.MED_ORG_DEPT_NM, gyb.IN_DIAG_DIS_NM, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '5056458' GROUP BY gyb.MED_ORG_DEPT_NM, gyb.IN_... | css |
CREATE TABLE table_4317 (
"Player" text,
"Nationality" text,
"Position" text,
"Years in Toronto" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What School/Club Team played in Toronto during 2012?
| SELECT "School/Club Team" FROM table_4317 WHERE "Years in Toronto" = '2012' | wikisql |
CREATE TABLE table_66461 (
"District" text,
"s Barangay" real,
"Population (2010 census)" real,
"Area ( has .)" real,
"Pop. density (per km2)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest population density that is less than 11... | SELECT MAX("Pop. density (per km2)") FROM table_66461 WHERE "Population (2010 census)" < '115,942' AND "s Barangay" < '82' | wikisql |
CREATE TABLE table_64957 (
"Year" real,
"League Champion" text,
"Best Blocker" text,
"Rookie of the Year" text,
"C.A.N.T.S.L.E.E.P. Award" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the best blocker for the year that has a League Champio... | SELECT "Best Blocker" FROM table_64957 WHERE "League Champion" = 'queens of pain' AND "C.A.N.T.S.L.E.E.P. Award" = 'chassis crass (brooklyn)' | wikisql |
CREATE TABLE table_2226817_12 (
title VARCHAR,
production_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the name of the episode if the production code is 11.12?
| SELECT title FROM table_2226817_12 WHERE production_code = "11.12" | sql_create_context |
CREATE TABLE table_name_61 (
plautdietsch VARCHAR,
dutch VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Plautdietsch has Dutch of maken?
| SELECT plautdietsch FROM table_name_61 WHERE dutch = "maken" | sql_create_context |
CREATE TABLE table_46576 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Player had a Score of 70-71=141?
| SELECT "Player" FROM table_46576 WHERE "Score" = '70-71=141' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... | SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 20 AND 29) AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')... | eicu |
CREATE TABLE table_name_82 (
location_attendance VARCHAR,
high_assists VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the location attendance when the high assists is by ramon sessions (8) on march 30?
| SELECT location_attendance FROM table_name_82 WHERE high_assists = "ramon sessions (8)" AND date = "march 30" | sql_create_context |
CREATE TABLE table_80155 (
"Player" text,
"Round" real,
"Pick" real,
"Position" text,
"NFL Club" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest round number of a Pick after 209.
| SELECT MAX("Round") FROM table_80155 WHERE "Pick" > '209' | wikisql |
CREATE TABLE table_203_253 (
id number,
"model" text,
"frame" text,
"years mfg'd" text,
"caliber(s)" text,
"production" text,
"barrel" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which model is the only model to have the... | SELECT "model" FROM table_203_253 ORDER BY "caliber(s)" LIMIT 1 | squall |
CREATE TABLE table_74542 (
"Class" text,
"Date" text,
"Race" text,
"Driver" text,
"Position" real,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what class has the date of 8/1954?
| SELECT "Class" FROM table_74542 WHERE "Date" = '8/1954' | wikisql |
CREATE TABLE table_28540609_2 (
player VARCHAR,
starts VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player made exactly 26 starts?
| SELECT player FROM table_28540609_2 WHERE starts = 26 | sql_create_context |
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_M... | SELECT JYKSBM, JYKSMC FROM jybgb WHERE BGDH = '40675785383' | css |
CREATE TABLE table_20361783_1 (
mixed_doubles VARCHAR,
womens_singles VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who won mixed doubles when wang yihan won womens singles
| SELECT mixed_doubles FROM table_20361783_1 WHERE womens_singles = "Wang Yihan" | sql_create_context |
CREATE TABLE table_47472 (
"Subclass" text,
"Part 1" text,
"Part 2" text,
"Part 3" text,
"Part 4" text,
"Verb meaning" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the part 3 with *hegait in part 2?
| SELECT "Part 3" FROM table_47472 WHERE "Part 2" = '*hegait' | wikisql |
CREATE TABLE table_29149 (
"Common Name" text,
"Genus & Species" text,
"NCBI Accession Number" text,
"Length (AA)" real,
"% Identity to C7orf38" real,
"% Similarity to C7orf38" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the % identit... | SELECT MAX("% Identity to C7orf38") FROM table_29149 WHERE "Genus & Species" = 'Mus musculus' | wikisql |
CREATE TABLE Customers (
Customer_ID INTEGER,
Customer_Details VARCHAR(255)
)
CREATE TABLE Claims (
Claim_ID INTEGER,
Policy_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,
Amount_Settled INTEGER
)
CREATE TABLE Customer_Policies (
Policy_ID INTEGE... | SELECT Date_Payment_Made, AVG(Amount_Payment) FROM Payments WHERE Payment_Method_Code = 'Visa' | nvbench |
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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.long_title = "Percutaneous aspiration of liver" | mimicsql_data |
CREATE TABLE table_51103 (
"Owner" text,
"Class" text,
"Number in class" real,
"Road numbers" text,
"Built" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number in class for the Whitehaven Coal?
| SELECT SUM("Number in class") FROM table_51103 WHERE "Owner" = 'whitehaven coal' | wikisql |
CREATE TABLE table_79563 (
"Year" real,
"Competition Description" text,
"Location" text,
"Apparatus" text,
"Rank-Final" text,
"Score-Final" real,
"Rank-Qualifying" text,
"Score-Qualifying" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- O... | SELECT "Apparatus" FROM table_79563 WHERE "Score-Final" < '75.5' AND "Score-Qualifying" < '18.7' | wikisql |
CREATE TABLE table_2701851_5 (
production_code VARCHAR,
written_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the production code for the episode written by Kat Likkel & Denise Downer?
| SELECT production_code FROM table_2701851_5 WHERE written_by = "Kat Likkel & Denise Downer" | sql_create_context |
CREATE TABLE table_20724 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the date for richmond
| SELECT "Date" FROM table_20724 WHERE "Away team" = 'Richmond' | wikisql |
CREATE TABLE table_50324 (
"Season" text,
"North" text,
"South" text,
"East" text,
"West" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the north with sb rosenheim as the south?
| SELECT "North" FROM table_50324 WHERE "South" = 'sb rosenheim' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.