instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TA... | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-2586')) AND intakeoutput.celllabel = 'dopami... | eicu |
CREATE TABLE table_15463188_7 (
school_club_team VARCHAR,
season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the school/club team when season is 2009-2011
| SELECT school_club_team FROM table_15463188_7 WHERE season = "2009-2011" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CRE... | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-52724')) AND lab.labname = 'platelets x 1000' AND DATETIME(lab.labresulttime, '... | eicu |
CREATE TABLE table_name_17 (
pinnacle_height VARCHAR,
town VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Pinnacle height for Metcalf, Georgia?
| SELECT pinnacle_height FROM table_name_17 WHERE town = "metcalf, georgia" | sql_create_context |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
... | SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 40435 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = ... | mimic_iii |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicaid" AND procedures.icd9_code = "5198" | mimicsql_data |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,... | SELECT microbiologyevents.spec_type_desc FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12572) AND DATETIME(microbiologyevents.charttime) <= DATETIME(CURRENT_TIME(), '-19 month') ORDER BY microbiologyevents.charttime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_name_45 (
player VARCHAR,
to_par VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Player that has a To standard of 4, and a Score of 74-70-68=212?
| SELECT player FROM table_name_45 WHERE to_par = "–4" AND score = 74 - 70 - 68 = 212 | sql_create_context |
CREATE TABLE table_name_3 (
ceased_to_be_queen VARCHAR,
birth VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was born on 10 May 1788 that ceased to be queen?
| SELECT ceased_to_be_queen FROM table_name_3 WHERE birth = "10 may 1788" | sql_create_context |
CREATE TABLE table_66444 (
"Rank" real,
"Athletes" text,
"Country" text,
"Time" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the rank for the man from China with notes of QS?
| SELECT MAX("Rank") FROM table_66444 WHERE "Notes" = 'qs' AND "Country" = 'china' | wikisql |
CREATE TABLE table_69163 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which area served coed genders at Kaharoa school and had a Decile of 9?
| SELECT "Area" FROM table_69163 WHERE "Gender" = 'coed' AND "Decile" = '9' AND "Name" = 'kaharoa school' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)... | SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-6603')) AND diagnosis.diagnosisname = 'traumatic injury to major vessels... | eicu |
CREATE TABLE table_69375 (
"Frame size" text,
"Width" real,
"Height" real,
"Mpix" real,
"Aspect Ratio" text,
"max. fps" real,
"max. fps HDRx" real,
"lowest possible REDCODE at 24 fps" text,
"lowest possible REDCODE at max. fps" text
)
-- Using valid SQLite, answer the following que... | SELECT "Aspect Ratio" FROM table_69375 WHERE "max. fps HDRx" = '80' | wikisql |
CREATE TABLE table_46575 (
"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 New Zealand Player?
| SELECT "To par" FROM table_46575 WHERE "Country" = 'new zealand' | wikisql |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost numb... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'cefepime') AS t1 JOIN (SELECT admissions.subject_id, prescription... | mimic_iii |
CREATE TABLE table_28281704_1 (
stadium VARCHAR,
city VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the stadium for nizhny novgorod
| SELECT stadium FROM table_28281704_1 WHERE city = "Nizhny Novgorod" | sql_create_context |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostHistory (
Id number,
... | SELECT DisplayName FROM Users WHERE NOT EXISTS(SELECT * FROM Posts WHERE Posts.OwnerUserId = Users.Id AND NOT EXISTS(SELECT * FROM Comments WHERE Comments.PostId = Posts.Id AND Comments.UserId = Users.Id)) | sede |
CREATE TABLE table_name_37 (
s_default_argument VARCHAR,
pseudorandom_number_generation VARCHAR,
eval_function VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the s default argument without a pseudorandom number generation and no eval function?
| SELECT s_default_argument FROM table_name_37 WHERE pseudorandom_number_generation = "no" AND eval_function = "no" | sql_create_context |
CREATE TABLE table_name_88 (
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What 2007 has wimbledon as the tournament?
| SELECT 2007 FROM table_name_88 WHERE tournament = "wimbledon" | sql_create_context |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CR... | SELECT STRFTIME('%j', admissions.dischtime) - STRFTIME('%j', admissions.admittime) FROM admissions WHERE admissions.subject_id = 9038 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_12661 (
"Club" text,
"League" text,
"Sport" text,
"Established" text,
"Championships" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Established has a League of ontario australian football league?
| SELECT "Established" FROM table_12661 WHERE "League" = 'ontario australian football league' | wikisql |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
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... | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | nvbench |
CREATE TABLE table_31710 (
"Outcome" text,
"Date" real,
"Championship" 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.
-- Tell me the total number of date for carpet
| SELECT COUNT("Date") FROM table_31710 WHERE "Surface" = 'carpet' | wikisql |
CREATE TABLE table_49868 (
"Date" text,
"Home team" text,
"Score" text,
"Away team" text,
"Venue" text,
"Box Score" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the box core for the Melbourne Tigers?
| SELECT "Box Score" FROM table_49868 WHERE "Home team" = 'melbourne tigers' | wikisql |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '57086830' AND MED_SER_ORG_NO = '1629085' AND OUT_DIAG_DIS_NM LIKE '%瘙痒症%' | css |
CREATE TABLE table_204_834 (
id number,
"rank" number,
"name" text,
"nationality" text,
"time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many ranked swimmers were from the united states ?
| SELECT COUNT(*) FROM table_204_834 WHERE "nationality" = 'united states' | squall |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12775) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'magnesium') AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-11 m... | mimic_iii |
CREATE TABLE gwyjzb (
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 COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '8269235' AND gwyjzb.HOSP_STS > 0 UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '8269235' AND fgwyjzb.HOSP_STS > 0 | css |
CREATE TABLE table_44804 (
"Year" real,
"Network" text,
"Play-by-play" text,
"Color commentator(s)" text,
"Pregame host" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What network has a Play-by-play by Jack Edwards in 2000?
| SELECT "Network" FROM table_44804 WHERE "Play-by-play" = 'jack edwards' AND "Year" = '2000' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hyponatremia' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2101') AS t... | eicu |
CREATE TABLE table_38778 (
"Team" text,
"Stadium" text,
"Capacity" real,
"Highest" real,
"Lowest" real,
"Average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Average larger than 2,279, and a Team of queen of the south, and a Capacity larger t... | SELECT SUM("Lowest") FROM table_38778 WHERE "Average" > '2,279' AND "Team" = 'queen of the south' AND "Capacity" > '6,412' | wikisql |
CREATE TABLE table_74860 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many top 10s associated with 3 top 5s and under 22 cuts made... | SELECT MAX("Top-10") FROM table_74860 WHERE "Top-5" = '3' AND "Cuts made" < '22' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "56" AND demographic.admityear < "2176" | mimicsql_data |
CREATE TABLE table_70232 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which engine has a Chassis of lotus 44 f2?
| SELECT "Engine" FROM table_70232 WHERE "Chassis" = 'lotus 44 f2' | wikisql |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_procedures (
row_i... | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 85169 AND STRFTIME('%y', admissions.admittime) = '2102' | mimic_iii |
CREATE TABLE table_18578 (
"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 district is eugene worley from?
| SELECT "District" FROM table_18578 WHERE "Incumbent" = 'Eugene Worley' | wikisql |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight i... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND date_day.day_number = 8 AND date_day.month_number = 8 AND dat... | atis |
CREATE TABLE table_7525 (
"Event" text,
"2006\u201307" text,
"2007\u201308" text,
"2008\u201309" text,
"2010\u201311" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what kind of 2006 07 has a 2010 11 of n/a, and an Event of masters?
| SELECT "2006\u201307" FROM table_7525 WHERE "2010\u201311" = 'n/a' AND "Event" = 'masters' | wikisql |
CREATE TABLE table_31260 (
"Name" text,
"Number" real,
"Position" text,
"Height" text,
"Weight" real,
"Year" text,
"Hometown" text,
"Last School/College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the school for chris mcnamar... | SELECT "Last School/College" FROM table_31260 WHERE "Name" = 'Chris McNamara' | wikisql |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid n... | SELECT COUNT(*) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14836)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'chest tube #1' AND... | mimic_iii |
CREATE TABLE table_name_59 (
score_in_final VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Score in Final on February 19, 1989?
| SELECT score_in_final FROM table_name_59 WHERE date = "february 19, 1989" | 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 TagName, COUNT(*) AS DownVotes FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id AND VoteTypeId = 3 WHERE Posts.OwnerUserId = @UserId GROUP BY TagName ORDER BY DownVotes DESC | sede |
CREATE TABLE table_name_7 (
player VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player was the forward?
| SELECT player FROM table_name_7 WHERE position = "forward" | sql_create_context |
CREATE TABLE table_16864 (
"Player" text,
"No." text,
"Nationality" text,
"Position" text,
"Years for Jazz" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player played the years for Jazz in 1995-2000, 2004-05
| SELECT "Player" FROM table_16864 WHERE "Years for Jazz" = '1995-2000, 2004-05' | wikisql |
CREATE TABLE Ref_Characteristic_Types (
characteristic_type_code VARCHAR(15),
characteristic_type_description VARCHAR(80)
)
CREATE TABLE Ref_Product_Categories (
product_category_code VARCHAR(15),
product_category_description VARCHAR(80),
unit_of_measure VARCHAR(20)
)
CREATE TABLE Characteristics ... | SELECT product_category_description, COUNT(product_category_description) FROM Ref_Product_Categories AS T1 JOIN Products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%' GROUP BY product_category_description ORDER BY product_category_description | nvbench |
CREATE TABLE country (
Country_ID int,
Name text,
Population int,
Area int,
Languages text
)
CREATE TABLE roller_coaster (
Roller_Coaster_ID int,
Name text,
Park text,
Country_ID int,
Length real,
Height real,
Speed text,
Opened text,
Status text
)
-- Using val... | SELECT T1.Name, AVG(T2.Speed) FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Name | nvbench |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtim... | SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'bronchodilator - beta-agonist') AS t1 JOIN (... | eicu |
CREATE TABLE table_42231 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who ha... | SELECT "High rebounds" FROM table_42231 WHERE "Team" = 'detroit' | wikisql |
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 prescriptions.icustay_id, prescriptions.formulary_drug_cd FROM prescriptions WHERE prescriptions.subject_id = "65652" | mimicsql_data |
CREATE TABLE table_203_397 (
id number,
"series" text,
"launch date" text,
"finale date" text,
"days" number,
"housemates" number,
"winner" text,
"main presenter" text,
"grand prize" text,
"liveshow\naudience\nmillions" number
)
-- Using valid SQLite, answer the following quest... | SELECT "winner" FROM table_203_397 WHERE "grand prize" = (SELECT MAX("grand prize") FROM table_203_397) | squall |
CREATE TABLE table_name_66 (
crowd VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the attendance when St Kilda played as the home team?
| SELECT COUNT(crowd) FROM table_name_66 WHERE home_team = "st kilda" | sql_create_context |
CREATE TABLE table_name_39 (
country VARCHAR,
place VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Country of the Player in Place 1?
| SELECT country FROM table_name_39 WHERE place = "1" | sql_create_context |
CREATE TABLE table_50831 (
"Nat." text,
"Name" text,
"Moving from" text,
"Type" text,
"Transfer window" text,
"Ends" real,
"Transfer fee" text,
"Source" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the transfer fee for evilasio... | SELECT "Transfer fee" FROM table_50831 WHERE "Name" = 'evilasio' | wikisql |
CREATE TABLE table_name_15 (
tires VARCHAR,
team VARCHAR,
engine VARCHAR,
chassis VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What tires did BFM Enterprises run on their Offy engine and manta chassis?
| SELECT tires FROM table_name_15 WHERE engine = "offy" AND chassis = "manta" AND team = "bfm enterprises" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,... | SELECT COUNT(*) FROM zyjzjlb JOIN hz_info_zyjzjlb JOIN hz_info ON hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.zyjzjlb_id = zyjzjlb.zyjzjlb_id AND hz_info_zyjzjlb.YLJGDM = hz_info.YLJGDM WHERE hz_info.YLJGDM = '40... | css |
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND diagnoses.short_title = "B-complex defic NEC" | mimicsql_data |
CREATE TABLE albums (
id number,
title text,
artist_id number
)
CREATE TABLE employees (
id number,
last_name text,
first_name text,
title text,
reports_to number,
birth_date time,
hire_date time,
address text,
city text,
state text,
country text,
postal_code... | SELECT milliseconds FROM tracks WHERE name = "Fast As a Shark" | spider |
CREATE TABLE table_24107 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Black Knights points" real,
"Opponents" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the opponents for game 5
| SELECT "Opponents" FROM table_24107 WHERE "Game" = '5' | wikisql |
CREATE TABLE table_32322 (
"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.
-- Where was the game held when the home team score... | SELECT "Venue" FROM table_32322 WHERE "Home team score" = '8.18 (66)' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "WIDOWED" AND procedures.long_title = "Pericardiocentesis" | mimicsql_data |
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_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '1511465' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_CD | css |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
s... | SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'transferrin')) AND STRFTIME('%y', cost.chargetime) <= '2102' GROUP BY cost.hadm_id) AS t1 | mimic_iii |
CREATE TABLE table_203_525 (
id number,
"car" text,
"engine" text,
"compression" text,
"power" text,
"torque" text,
"turbo" text,
"stock boost" text,
"turbine" text,
"compressor" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- whi... | SELECT "engine" FROM table_203_525 ORDER BY "power" LIMIT 1 | squall |
CREATE TABLE table_65904 (
"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 for Jiyai Shin in place t1?
| SELECT "To par" FROM table_65904 WHERE "Place" = 't1' AND "Player" = 'jiyai shin' | wikisql |
CREATE TABLE table_53667 (
"English" text,
"Scots" text,
"West Frisian" text,
"Afrikaans" text,
"Dutch" text,
"Dutch ( Limburgish )" text,
"Low German" text,
"Low German ( Groningen )" text,
"Middle German ( Luxemburgish )" text,
"German" text,
"Yiddish" text,
"Gothic" te... | SELECT "English" FROM table_53667 WHERE "Dutch ( Limburgish )" = 'twie' | wikisql |
CREATE TABLE table_name_11 (
weeks_3_4 VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what week had a player named zach
| SELECT weeks_3_4 FROM table_name_11 WHERE name = "zach" | sql_create_context |
CREATE TABLE table_27756164_8 (
score VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score when the team is Orlando?
| SELECT COUNT(score) FROM table_27756164_8 WHERE team = "Orlando" | sql_create_context |
CREATE TABLE table_name_85 (
name VARCHAR,
pos VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name when the position was fullback, hooker?
| SELECT name FROM table_name_85 WHERE pos = "fullback, hooker" | sql_create_context |
CREATE TABLE table_37681 (
"Category" text,
"Type" text,
"Attribute" text,
"Bubbles" text,
"Cancelable" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Let's say Type is of datasetcomplete, what is the Attribute?
| SELECT "Attribute" FROM table_37681 WHERE "Type" = 'datasetcomplete' | wikisql |
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 COUNT(hz_info.RYBH) FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE wdmzjzjlb.ZZYSGH = '22158304' AND wdmzjzjlb.JZKSRQ BETWEEN '2003-05-25' AND '2013-08-20' UNION SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN bdmzjzjlb ON hz_info... | css |
CREATE TABLE table_name_69 (
party VARCHAR,
ipsos_6_3_09 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had an Ipsos of 27%?
| SELECT party FROM table_name_69 WHERE ipsos_6_3_09 = "27%" | sql_create_context |
CREATE TABLE table_15315816_1 (
dates VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are all of the dates in the country of Canada?
| SELECT dates FROM table_15315816_1 WHERE country = "Canada" | sql_create_context |
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TE... | SELECT Name, COUNT(Name) FROM appellations AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Monterey" AND T2.Price < 50 GROUP BY Name ORDER BY COUNT(Name) DESC | nvbench |
CREATE TABLE table_name_59 (
name VARCHAR,
qual_1 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Name of the person with a Qual 1 of 1:26.056?
| SELECT name FROM table_name_59 WHERE qual_1 = "1:26.056" | sql_create_context |
CREATE TABLE table_49137 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country scored 67?
| SELECT "Country" FROM table_49137 WHERE "Score" = '67' | wikisql |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE Comments (
Id number,
PostId num... | SELECT * FROM Votes WHERE PostId = '##postid:int?1##' | sede |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND procedures.icd9_code = "9671" | mimicsql_data |
CREATE TABLE table_name_40 (
location VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where was the match played in 1998?
| SELECT location FROM table_name_40 WHERE year = 1998 | sql_create_context |
CREATE TABLE table_20133 (
"City of License /Market" text,
"Station" text,
"Channel TV ( DT )" text,
"Years owned" text,
"Current affiliation" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who currently affiliates in San Francisco - Oakland - San J... | SELECT "Current affiliation" FROM table_20133 WHERE "City of License /Market" = 'San Francisco - Oakland - San Jose' | wikisql |
CREATE TABLE table_14389782_2 (
quarterback VARCHAR,
winning_pct VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the quarter back for a winning pct of .792
| SELECT quarterback FROM table_14389782_2 WHERE winning_pct = ".792" | sql_create_context |
CREATE TABLE table_name_9 (
date_made VARCHAR,
type VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date of creation for the locomotive having a type of 0-4-2
| SELECT date_made FROM table_name_9 WHERE type = "0-4-2" | sql_create_context |
CREATE TABLE table_204_145 (
id number,
"representative" text,
"state" text,
"district(s)" text,
"served" text,
"party" text,
"date of birth" text,
"date of death" text,
"age" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how long d... | SELECT "served" - "served" FROM table_204_145 WHERE "representative" = 'sala burton' | squall |
CREATE TABLE table_53493 (
"Pick" real,
"Round" text,
"Player" text,
"Position" text,
"School" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the pick number for the kicker in round 8?
| SELECT COUNT("Pick") FROM table_53493 WHERE "Round" = 'round 8' AND "Position" = 'kicker' | wikisql |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId numbe... | SELECT a.Id AS "post_link", a.Score, a.OwnerUserId AS "user_link" FROM Posts AS a JOIN Posts AS q ON a.ParentId = q.Id WHERE (a.PostTypeId = 2) AND (q.PostTypeId = 1) AND (q.Tags LIKE '%<##Tagname##>%') ORDER BY Score DESC LIMIT 200 | sede |
CREATE TABLE wedding (
YEAR VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many weddings are there in year 2016?
| SELECT COUNT(*) FROM wedding WHERE YEAR = 2016 | sql_create_context |
CREATE TABLE table_13714 (
"Year" real,
"MISS EARTH" text,
"Miss Air (1st Runner-up)" text,
"Miss Water (2nd Runner-up)" text,
"Miss Fire (3rd Runner-up)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won Miss Air (1st Runner-up) when Catherine... | SELECT "Miss Air (1st Runner-up)" FROM table_13714 WHERE "Year" < '2007' AND "Miss Water (2nd Runner-up)" = 'catherine untalan' | wikisql |
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 allergy (
allergy... | SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '012-2739' | eicu |
CREATE TABLE table_24354 (
"Type of Record" text,
"Attendance" real,
"Date/Year" text,
"Stadium" text,
"Result/Games" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many records had result/games: 10 games (29,606 avg.)
| SELECT COUNT("Type of Record") FROM table_24354 WHERE "Result/Games" = '10 games (29,606 avg.)' | wikisql |
CREATE TABLE table_13527 (
"Frequency" text,
"Call sign" text,
"Branding" text,
"Format" text,
"Owner" text,
"Language/Rebroadcast" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the format when the frequency is fm 94.5?
| SELECT "Format" FROM table_13527 WHERE "Frequency" = 'fm 94.5' | wikisql |
CREATE TABLE table_66321 (
"Producer" text,
"Product" text,
"Samples taken" real,
"Samples failed" real,
"Melamine content(mg/kg)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the most melamine content that has more than 1 samples failed an... | SELECT MAX("Melamine content(mg/kg)") FROM table_66321 WHERE "Producer" = 'guangzhou jinding dairy products factory' AND "Samples failed" > '1' | wikisql |
CREATE TABLE table_name_82 (
position VARCHAR,
pick VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the position of the player with a pick less than 3 from team san diego?
| SELECT position FROM table_name_82 WHERE pick < 3 AND team = "san diego" | sql_create_context |
CREATE TABLE table_name_78 (
nationality VARCHAR,
year VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- After 2009, what's the nationality of a player named Dwayne de Rosario Category:articles with hcards?
| SELECT nationality FROM table_name_78 WHERE year > 2009 AND player = "dwayne de rosario category:articles with hcards" | sql_create_context |
CREATE TABLE table_24168 (
"Episode" text,
"Broadcast date" text,
"Run time" text,
"Viewers (in millions)" text,
"Archive" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is all the broadcast date when viewers were 8.4 millions
| SELECT COUNT("Broadcast date") FROM table_24168 WHERE "Viewers (in millions)" = '8.4' | wikisql |
CREATE TABLE table_1506619_1 (
school_board VARCHAR,
number_of_elementary_schools VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where are all school boards associated with a number of elementary schools of 96?
| SELECT school_board FROM table_1506619_1 WHERE number_of_elementary_schools = 96 | sql_create_context |
CREATE TABLE culture_company (
company_name text,
type text,
incorporated_in text,
group_equity_shareholding number,
book_club_id text,
movie_id text
)
CREATE TABLE book_club (
book_club_id number,
year number,
author_or_editor text,
book_title text,
publisher text,
cate... | SELECT category FROM book_club WHERE year > 1989 GROUP BY category HAVING COUNT(*) >= 2 | spider |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.AMOUNT FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '02126959217' AND t_kc22.SOC_SRT_DIRE_NM LIKE '%泮片%' | css |
CREATE TABLE table_6424 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game Site" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Attendance at the Game with a Result of w 21 7?
| SELECT AVG("Attendance") FROM table_6424 WHERE "Result" = 'w 21–7' | wikisql |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate tim... | SELECT * FROM Comments LIMIT 10 | sede |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | SELECT ZYZYZDZZBM, ZYZYZDZZMC FROM zyjzjlb WHERE JZLSH = '66471271031' | css |
CREATE TABLE table_name_87 (
date VARCHAR,
loan_expires VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date has a loan expires date of end of the season, and a Position of mf?
| SELECT date FROM table_name_87 WHERE loan_expires = "end of the season" AND position = "mf" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.