instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_10718984_2 (
no_in_season INTEGER,
written_by VARCHAR,
us_viewers__millions_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number in the season that Marlene Meyer wrote and 20.49 million people watched?
| SELECT MAX(no_in_season) FROM table_10718984_2 WHERE written_by = "Marlene Meyer" AND us_viewers__millions_ = "20.49" | sql_create_context |
CREATE TABLE mzb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | SELECT * FROM qtb WHERE qtb.MED_SER_ORG_NO = '6264917' AND qtb.IN_HOSP_DATE BETWEEN '2001-05-03' AND '2011-04-15' UNION SELECT * FROM gyb WHERE gyb.MED_SER_ORG_NO = '6264917' AND gyb.IN_HOSP_DATE BETWEEN '2001-05-03' AND '2011-04-15' UNION SELECT * FROM zyb WHERE zyb.MED_SER_ORG_NO = '6264917' AND zyb.IN_HOSP_DATE BETW... | css |
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 * FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '俞玉宸' AND hz_info.YLJGDM = '4840688' AND NOT zyjzjlb.JZKSMC LIKE '%乳腺%' | css |
CREATE TABLE tryout (
cName VARCHAR,
pID VARCHAR
)
CREATE TABLE player (
pID VARCHAR,
pName VARCHAR
)
CREATE TABLE college (
state VARCHAR,
cName VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the state of the college which player Char... | SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName JOIN player AS T3 ON T2.pID = T3.pID WHERE T3.pName = 'Charles' | sql_create_context |
CREATE TABLE table_name_98 (
land_area__km²_ INTEGER,
country VARCHAR,
population_density__pop_per_km²_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the land area of Switzerland with a population density fewer than 188 km ?
| SELECT AVG(land_area__km²_) FROM table_name_98 WHERE country = "switzerland" AND population_density__pop_per_km²_ < 188 | sql_create_context |
CREATE TABLE table_60565 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score of the game played 26 July 2010?
| SELECT "Score" FROM table_60565 WHERE "Date" = '26 july 2010' | wikisql |
CREATE TABLE table_72799 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What college does Jean-Nicolas Carriere play for?
| SELECT "College" FROM table_72799 WHERE "Player" = 'Jean-Nicolas Carriere' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "3051" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE wdmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | SELECT 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 NOT wdmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2009-07-3... | css |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,... | SELECT DISTINCT flight_id FROM flight WHERE (((departure_time > 400 AND to_airport IN (SELECT AIRPORT_SERVICEalias1.airport_code FROM airport_service AS AIRPORT_SERVICEalias1 WHERE AIRPORT_SERVICEalias1.city_code IN (SELECT CITYalias1.city_code FROM city AS CITYalias1 WHERE CITYalias1.city_name = 'SAN FRANCISCO'))) AND... | atis |
CREATE TABLE table_name_97 (
competition VARCHAR,
result VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the competition on 29 November 1997 that resulted in a draw?
| SELECT competition FROM table_name_97 WHERE result = "draw" AND date = "29 november 1997" | sql_create_context |
CREATE TABLE table_22261877_1 (
us_viewers__million_ VARCHAR,
production_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many viewers in millions watched the episode with the production code 6acx16?
| SELECT us_viewers__million_ FROM table_22261877_1 WHERE production_code = "6ACX16" | sql_create_context |
CREATE TABLE table_28601467_1 (
winner VARCHAR,
result VARCHAR,
runner_up VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are all the winning records when the result is Scotland won on points table and the Runner-Up result is [[|]] 4 points?
| SELECT winner FROM table_28601467_1 WHERE result = "Scotland won on points table" AND runner_up = "[[|]] 4 points" | 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 COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-36108')) AND DATETIME(allergy.allergytime, 'start of year') = DATETIME(CURRE... | eicu |
CREATE TABLE table_29339 (
"Year" real,
"Winner" text,
"Location" text,
"Entrants" real,
"Winners Prize" text,
"Total Prize Pool" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many prizes were available in the competition where 696 people e... | SELECT COUNT("Winners Prize") FROM table_29339 WHERE "Entrants" = '696' | wikisql |
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real
)
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int
)
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int... | SELECT Year_Join, COUNT(Year_Join) FROM artist WHERE Country <> 'United States' GROUP BY Year_Join ORDER BY COUNT(Year_Join) DESC | nvbench |
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.age < "89" AND diagnoses.long_title = "Candidiasis of vulva and vagina" | mimicsql_data |
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 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 = '10652950132' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.SELF_PAY_AMO) DES... | css |
CREATE TABLE table_261954_1 (
joined VARCHAR,
institution VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many values for joined occur at Guilford College?
| SELECT COUNT(joined) FROM table_261954_1 WHERE institution = "Guilford College" | sql_create_context |
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '81459201' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC | css |
CREATE TABLE table_72152 (
"School" text,
"Mascot" text,
"Location" text,
"League" text,
"Enrollment" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What city and state is the Lancers mascot located?
| SELECT "Location" FROM table_72152 WHERE "Mascot" = 'Lancers' | wikisql |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Has_Allergy (
StuID INTEGE... | SELECT AllergyType, COUNT(AllergyType) FROM Allergy_Type GROUP BY AllergyType ORDER BY COUNT(AllergyType) DESC | nvbench |
CREATE TABLE table_8180 (
"Player" text,
"Nationality" text,
"Jersey Number(s)" text,
"Position" text,
"Years" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Position when Player is Drew Barry Category:Articles With hCards?
| SELECT "Position" FROM table_8180 WHERE "Player" = 'drew barry category:articles with hcards' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE medication (
me... | SELECT STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', patient.hospitaladmittime) FROM patient WHERE patient.uniquepid = '027-23129' AND NOT patient.hospitaladmittime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1 | eicu |
CREATE TABLE table_name_17 (
opponent VARCHAR,
loss VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Opponent has a Loss of b ez (5-5)?
| SELECT opponent FROM table_name_17 WHERE loss = "báez (5-5)" | sql_create_context |
CREATE TABLE table_58059 (
"Species" text,
"Strain" text,
"Type" text,
"Base Pairs" text,
"Genes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many genes are in species burkholderia pseudomallei with 4,126,292 base pairs?
| SELECT "Genes" FROM table_58059 WHERE "Species" = 'burkholderia pseudomallei' AND "Base Pairs" = '4,126,292' | wikisql |
CREATE TABLE table_21584 (
"County" text,
"Kerry%" text,
"Kerry#" real,
"Bush%" text,
"Bush#" real,
"Others%" text,
"Others#" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the percentage of others when the number for Bush is 1329?
| SELECT "Others%" FROM table_21584 WHERE "Bush#" = '1329' | wikisql |
CREATE TABLE table_name_71 (
interview INTEGER,
average VARCHAR,
swimsuit VARCHAR,
evening_gown VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which smallest interview number had a swimsuit stat of less than 9.322, an evening gown score of more than ... | SELECT MIN(interview) FROM table_name_71 WHERE swimsuit < 9.322 AND evening_gown > 9.259 AND average = 9.321 | sql_create_context |
CREATE TABLE table_77806 (
"Rank" real,
"Constituency" text,
"Winning party 2007" text,
"Swing to gain" real,
"LD's place 2007" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the constituency when the swing to gain is less... | SELECT "Constituency" FROM table_77806 WHERE "Swing to gain" < '4.16' AND "Winning party 2007" = 'snp' AND "LD's place 2007" = '2nd' | wikisql |
CREATE TABLE table_78328 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many golds for nations with over 0 silvers, over 1 total, and over 3 bronze?
| SELECT COUNT("Gold") FROM table_78328 WHERE "Silver" > '0' AND "Total" > '1' AND "Bronze" > '3' | wikisql |
CREATE TABLE table_14210 (
"Title" text,
"Series" text,
"Director" text,
"Production Number" text,
"Release date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Title of the LT Series Filmography with a Release date of 1964-02-08?
| SELECT "Title" FROM table_14210 WHERE "Series" = 'lt' AND "Release date" = '1964-02-08' | wikisql |
CREATE TABLE table_name_90 (
react INTEGER,
rank VARCHAR,
nationality VARCHAR,
lane VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the smallest react of Zimbabwe, ranked after 1 in a lane after 3 and a time less than 20.3?
| SELECT MIN(react) FROM table_name_90 WHERE lane > 3 AND time < 20.3 AND nationality = "zimbabwe" AND rank > 1 | sql_create_context |
CREATE TABLE table_11094950_1 (
team VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which teams are located in highland township?
| SELECT team FROM table_11094950_1 WHERE location = "Highland Township" | sql_create_context |
CREATE TABLE table_57638 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the high silver total for nations with 3 golds and under 5 bronzes?
| SELECT MAX("Silver") FROM table_57638 WHERE "Gold" = '3' AND "Bronze" < '5' | wikisql |
CREATE TABLE table_name_37 (
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score of away team, North Melbourne?
| SELECT away_team AS score FROM table_name_37 WHERE away_team = "north melbourne" | sql_create_context |
CREATE TABLE table_204_636 (
id number,
"season" text,
"tier" number,
"division" text,
"pos." text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which division played most : division de honor or primera nacional ?
| SELECT "division" FROM table_204_636 WHERE "division" IN ('division de honor', 'primera nacional') GROUP BY "division" ORDER BY COUNT(*) DESC LIMIT 1 | squall |
CREATE TABLE table_56307 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the Mariners opponent at the game attended by 7,893?
| SELECT "Opponent" FROM table_56307 WHERE "Attendance" = '7,893' | wikisql |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABL... | SELECT COUNT(DISTINCT course.department, course.name, course.number, semester.semester) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'department0' AND course.number BETWEEN 100 AND 100 + 100 AND semester.semester IN ('FA', 'WN') AND semester.semester_... | advising |
CREATE TABLE table_name_20 (
type VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What type is Gonz lez?
| SELECT type FROM table_name_20 WHERE name = "gonzález" | sql_create_context |
CREATE TABLE customer_orders (
order_id number,
customer_id number,
order_status_code text,
order_date time
)
CREATE TABLE department_store_chain (
dept_store_chain_id number,
dept_store_chain_name text
)
CREATE TABLE order_items (
order_item_id number,
order_id number,
product_id ... | SELECT T1.product_id FROM product_suppliers AS T1 JOIN products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 2 AND T2.product_price > (SELECT AVG(product_price) FROM products) | spider |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT demographic.age, demographic.insurance FROM demographic WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE table_name_75 (
laps INTEGER,
manufacturer VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which manufacturer of aprilia wth time of +1:36.557 has the highest lap?
| SELECT MAX(laps) FROM table_name_75 WHERE manufacturer = "aprilia" AND time = "+1:36.557" | sql_create_context |
CREATE TABLE table_name_80 (
high_assists VARCHAR,
high_rebounds VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is High Assists, when High Rebounds is 'Dwight Howard , Rashard Lewis (10)'?
| SELECT high_assists FROM table_name_80 WHERE high_rebounds = "dwight howard , rashard lewis (10)" | sql_create_context |
CREATE TABLE table_name_17 (
place INTEGER,
points INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest Place, when Points are greater than 2?
| SELECT MIN(place) FROM table_name_17 WHERE points > 2 | sql_create_context |
CREATE TABLE table_16423070_4 (
tennis VARCHAR,
softball VARCHAR,
volleyball VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who won tennis when ashland won softball and wooster won volleybal
| SELECT tennis FROM table_16423070_4 WHERE softball = "Ashland" AND volleyball = "Wooster" | sql_create_context |
CREATE TABLE table_23985 (
"Model Type" text,
"Model Designation" text,
"Engine" text,
"Wheelbase (mm/inch)" text,
"GVW (kg/ton)" text,
"Axle Ratio" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many engines are there for model 97H00?
| SELECT COUNT("Engine") FROM table_23985 WHERE "Model Designation" = '97H00' | wikisql |
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 t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'chest x-r... | eicu |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT * FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i... | css |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Descr... | SELECT v.UserId, vt.Name, COUNT(*) FROM Posts AS p INNER JOIN Votes AS v ON v.PostId = p.Id INNER JOIN VoteTypes AS vt ON v.VoteTypeId = vt.Id WHERE p.OwnerUserId = '##UserId##' GROUP BY vt.Name, v.UserId ORDER BY 1, 3 | sede |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val... | SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25733)) AND DATETIME(inputevents_cv.charttime, 'start of day') = DATETIME(CURRENT_TIME(), ... | mimic_iii |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | 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 = 26175)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'chest tubes left p... | mimic_iii |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM, MAX(t_kc24.CIVIL_SUBSIDY / t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '2325366' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM ORDER BY MAX(t_kc24.CIVIL_SUBSIDY / t_kc24.MED_AMOUT) D... | css |
CREATE TABLE storm (
storm_id number,
name text,
dates_active text,
max_speed number,
damage_millions_usd number,
number_deaths number
)
CREATE TABLE affected_region (
region_id number,
storm_id number,
number_city_affected number
)
CREATE TABLE region (
region_id number,
r... | SELECT name FROM storm EXCEPT SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING COUNT(*) >= 2 | spider |
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 * FROM t_kc21 WHERE PERSON_ID = '55245256' AND MED_SER_ORG_NO = '6462307' AND NOT MED_ORG_DEPT_NM LIKE '%针灸科%' | css |
CREATE TABLE table_1139 (
"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.
-- how many result with opponent being cleveland browns
| SELECT COUNT("Result") FROM table_1139 WHERE "Opponent" = 'Cleveland Browns' | wikisql |
CREATE TABLE table_name_96 (
game VARCHAR,
decision VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What game has valiquette as the decision, with @ los angeles kings as the opponent?
| SELECT game FROM table_name_96 WHERE decision = "valiquette" AND opponent = "@ los angeles kings" | sql_create_context |
CREATE TABLE table_15618 (
"Year" real,
"Men's singles" text,
"Women's singles" text,
"Men's doubles" text,
"Women's doubles" text,
"Mixed doubles" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who all played mixed doubles in 2010?
| SELECT "Mixed doubles" FROM table_15618 WHERE "Year" = '2010' | wikisql |
CREATE TABLE table_204_195 (
id number,
"team" text,
"home city" text,
"stadium" text,
"capacity" number,
"last season" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many stadiums hold ore than 2000 people ?
| SELECT COUNT("stadium") FROM table_204_195 WHERE "capacity" > 2000 | squall |
CREATE TABLE diagnoses (
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
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "F" AND procedures.icd9_code = "8960" | mimicsql_data |
CREATE TABLE table_name_5 (
attendance INTEGER,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average Attendance for the game on November 1, 1981?
| SELECT AVG(attendance) FROM table_name_5 WHERE date = "november 1, 1981" | 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 Users (
Id number,
Reputation number,... | WITH Population(TotalUsers, UsersBelowMe) AS (SELECT SUM(CASE WHEN uAll.Reputation > '##MinReputation##' THEN 1 ELSE 0 END) AS TotalUsers, SUM(CASE WHEN uAll.Reputation < uMe.Reputation AND uAll.Reputation > '##MinReputation##' THEN 1 ELSE 0 END) AS UsersBelowMe FROM Users AS uMe CROSS JOIN Users AS uAll WHERE uMe.Id =... | sede |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT diagnoses_icd.icd9_code FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 76494) AND STRFTIME('%y', diagnoses_icd.charttime) = '2102' ORDER BY diagn... | mimic_iii |
CREATE TABLE table_30220 (
"Council" text,
"TUV" real,
"Democratic Unionist" real,
"Ulster Unionist" real,
"Alliance" real,
"SDLP" real,
"Sinn F\u00e9in" real,
"Green (NI)" real,
"Independent" real,
"Others" text,
"Total" real
)
-- Using valid SQLite, answer the following q... | SELECT MIN("Alliance") FROM table_30220 WHERE "Total" = '25' | wikisql |
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM tex... | SELECT COUNT(DISTINCT hz_info.RYBH) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE mzjzjlb.ZZYSGH = '75246625' AND mzjzjlb.JZKSRQ BETWEEN '2000-11-21' AND '2017-06-25' | css |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "UNKNOWN/NOT SPECIFIED" AND demographic.diagnosis = "AORTIC VALVE INSUFFIENCY\AORTIC VALVE REPLACEMENT /SDA" | mimicsql_data |
CREATE TABLE table_name_21 (
capacity INTEGER,
city VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total capacity for the city of Trogir?
| SELECT SUM(capacity) FROM table_name_21 WHERE city = "trogir" | sql_create_context |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJ... | css |
CREATE TABLE table_36463 (
"School" text,
"Team" text,
"City" text,
"State" text,
"Conference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What school has oregon as the state, and ashland as the city?
| SELECT "School" FROM table_36463 WHERE "State" = 'oregon' AND "City" = 'ashland' | wikisql |
CREATE TABLE table_46769 (
"Tournament" text,
"2002" 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 ab... | SELECT "2009" FROM table_46769 WHERE "2004" = '107' | wikisql |
CREATE TABLE table_37853 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which home team had a visitor of Chicago Black Hawks with a score of 2 3?
| SELECT "Home" FROM table_37853 WHERE "Visitor" = 'chicago black hawks' AND "Score" = '2–3' | wikisql |
CREATE TABLE table_2361 (
"Round" real,
"Choice" real,
"Player" text,
"Position" text,
"Height" text,
"Weight" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the round?
| SELECT MIN("Round") FROM table_2361 | wikisql |
CREATE TABLE table_name_89 (
outcome VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the outcome of the match with Roger Federer as the opponent?
| SELECT outcome FROM table_name_89 WHERE opponent = "roger federer" | sql_create_context |
CREATE TABLE table_name_16 (
rank INTEGER,
lane VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Rank of the Swimmer in Lane 5?
| SELECT AVG(rank) FROM table_name_16 WHERE lane = 5 | sql_create_context |
CREATE TABLE table_name_79 (
date VARCHAR,
location VARCHAR,
result VARCHAR,
competition VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date has a result of win, in a friendly competition in Porto?
| SELECT date FROM table_name_79 WHERE result = "win" AND competition = "friendly" AND location = "porto" | sql_create_context |
CREATE TABLE table_17487395_1 (
location VARCHAR,
callsign VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many locations have the call signs dxjp-fm?
| SELECT COUNT(location) FROM table_17487395_1 WHERE callsign = "DXJP-FM" | sql_create_context |
CREATE TABLE table_64205 (
"Years covered" text,
"All bills sponsored" real,
"All amendments sponsored" real,
"All bills cosponsored" real,
"All amendments cosponsored" real,
"Bills originally cosponsored" real,
"Amendments originally cosponsored" real
)
-- Using valid SQLite, answer the f... | SELECT "All bills sponsored" FROM table_64205 WHERE "Bills originally cosponsored" > '113' AND "All amendments cosponsored" < '47' | wikisql |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE person_info.XM = '褚芳芳' AND NOT mzjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ <= '2013-05-19' UNI... | css |
CREATE TABLE table_16504 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When are the vacan... | SELECT "Date of vacancy" FROM table_16504 WHERE "Outgoing manager" = 'Damien Fox' | wikisql |
CREATE TABLE table_name_88 (
capital VARCHAR,
hanja VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the capital of the province with in Hanja?
| SELECT capital FROM table_name_88 WHERE hanja = "漢州" | sql_create_context |
CREATE TABLE table_11374 (
"Year" real,
"Team" text,
"League" text,
"Record" text,
"Finish" text,
"Organization" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which year has an Organization of new york yankees, and a Team of johnson city yankee... | SELECT "Year" FROM table_11374 WHERE "Organization" = 'new york yankees' AND "Team" = 'johnson city yankees' | wikisql |
CREATE TABLE table_72056 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of silver medals for countries of rank 14, with less than 1 total m... | SELECT SUM("Silver") FROM table_72056 WHERE "Rank" = '14' AND "Total" < '1' | wikisql |
CREATE TABLE table_204_748 (
id number,
"composer" text,
"born" number,
"died" number,
"nationality" text,
"notable works for piano" text,
"remarks" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- were there more than 4 american composers lis... | SELECT (SELECT COUNT(*) FROM table_204_748 WHERE "nationality" = 'american') > 4 | squall |
CREATE TABLE table_33226 (
"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 crowd size when the home team score... | SELECT "Crowd" FROM table_33226 WHERE "Home team score" = '17.14 (116)' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
trea... | SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'change in mental status' AND STRFTIME('%y', ... | eicu |
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 diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Self Pay" AND demographic.dob_year < "2138" | mimicsql_data |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "7" AND procedures.long_title = "Other partial resection of small intestine" | mimicsql_data |
CREATE TABLE table_13248 (
"National team" text,
"Club" text,
"Year" text,
"Apps" real,
"Goals" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which National team has a Year of total?
| SELECT "National team" FROM table_13248 WHERE "Year" = 'total' | wikisql |
CREATE TABLE table_name_63 (
lost INTEGER,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest lost that has 6 for points?
| SELECT MAX(lost) FROM table_name_63 WHERE points = 6 | sql_create_context |
CREATE TABLE table_59285 (
"Year" real,
"Award" text,
"Category" text,
"Film" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of Year, when Award is 'Vamsi Berkley Award', and when Category is 'Best Actor'?
| SELECT COUNT("Year") FROM table_59285 WHERE "Award" = 'vamsi berkley award' AND "Category" = 'best actor' | wikisql |
CREATE TABLE table_name_56 (
year INTEGER,
points VARCHAR,
team VARCHAR,
wins VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest year that Carlos drove for repsol honda and had less than 4 wins and less than 162 points?
| SELECT MAX(year) FROM table_name_56 WHERE team = "repsol honda" AND wins < 4 AND points < 162 | sql_create_context |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Price, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name | nvbench |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetake... | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute respirato... | eicu |
CREATE TABLE table_name_44 (
attendance VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- with a record of 63-76 what was the attendance?
| SELECT attendance FROM table_name_44 WHERE record = "63-76" | sql_create_context |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Posts (
... | WITH numbers(x) AS (SELECT ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) FROM (VALUES (0), (0), (0), (0), (0), (0), (0), (0), (0), (0)) AS n0(x) CROSS JOIN (VALUES (0), (0), (0), (0), (0), (0), (0), (0), (0), (0)) AS n1(x) CROSS JOIN (VALUES (0), (0), (0), (0), (0), (0), (0), (0), (0), (0)) AS n2(x)) SELECT x, x % (2 * @n... | sede |
CREATE TABLE table_32288 (
"Date" text,
"Time" text,
"Epicenter" text,
"Magnitude" text,
"Fatalities" text,
"Name" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Name has a Time of 01:17:01?
| SELECT "Name" FROM table_32288 WHERE "Time" = '01:17:01' | wikisql |
CREATE TABLE table_41919 (
"Series" text,
"Host" text,
"Launch date" text,
"Finale date" text,
"Days" real,
"Winner" text,
"Prize" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Highest Days, when Launch Date is 23 January 2010?
| SELECT MAX("Days") FROM table_41919 WHERE "Launch date" = '23 january 2010' | wikisql |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TAB... | SELECT u.Id AS "user_link", u.Reputation, SUM(CASE WHEN p.PostTypeId = 1 THEN 1 ELSE 0 END) AS "total_questions", SUM(CASE WHEN p.PostTypeId = 2 THEN 1 ELSE 0 END) AS "total_answers", SUM(CASE WHEN p.PostTypeId = 1 THEN p.Score ELSE 0 END) AS "score_questions", SUM(CASE WHEN p.PostTypeId = 1 THEN p.Score ELSE 0 END) AS... | sede |
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(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-77945')) AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TIME()... | eicu |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
Cr... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Users.Id AS "user_link", Reputation, Badges.Name AS Badge, Badges.Class AS Class, Location FROM Users, Badges WHERE Users.Id = Badges.UserId AND Badges.TagBased = 1 AND Badges.Name IN ('angular', 'reactjs', 'frontend', 'vuejs', 'aurelia', 'ember.js', 'html', '... | sede |
CREATE TABLE table_71396 (
"Player" text,
"Country" text,
"Year(s) Won" text,
"Total" real,
"To par" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was a game won with more than 11 to par?
| SELECT "Year(s) Won" FROM table_71396 WHERE "To par" > '11' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.