instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_52 (
score VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT SCORE WAS ON 1999-05-31?
| SELECT score FROM table_name_52 WHERE date = "1999-05-31" | 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 MIN(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 = '007-1517') AND NOT patient.unitdischargetime IS ... | 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 hz_info.person_info_JGDM, hz_info.person_info_JGMC, COUNT(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.JZZDBM = 'M79.046' GROUP BY hz_info.person_info_JGDM | css |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE chartevents... | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 16066) AND prescriptions.drug = 'rifampin' AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-6 year') | mimic_iii |
CREATE TABLE table_4114 (
"Townland" text,
"s Acre" real,
"Barony" text,
"Civil parish" text,
"Poor law union" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the maximum acres in Castledermot?
| SELECT MAX("s Acre") FROM table_4114 WHERE "Civil parish" = 'Castledermot' | wikisql |
CREATE TABLE table_40335 (
"Year" text,
"GP/GS" text,
"Shots" real,
"Goals" real,
"Assists" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of Points that were in a Year that was 2005?
| SELECT COUNT("Points") FROM table_40335 WHERE "Year" = '2005' | wikisql |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
... | WITH Raw AS (SELECT TIME_TO_STR(Users.CreationDate, '%Y') AS UserYear, DATEFROMPARTS(TIME_TO_STR(Posts.CreationDate, '%Y'), TIME_TO_STR(Posts.CreationDate, '%-M'), 1) AS PostMonth, COUNT(*) AS Count FROM Posts, Users WHERE Posts.OwnerUserId = Users.Id AND Posts.OwnerUserId > 0 GROUP BY TIME_TO_STR(Users.CreationDate, '... | sede |
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 COUNT(*) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '75486371' AND mzjzjlb.JZKSRQ BETWEEN '2001-11-10' AND '2016-09-16' AND mzjzjlb.YLJGDM = '7090006' | css |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH te... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb... | css |
CREATE TABLE table_28059992_5 (
pick__number INTEGER,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What draft pick number was Andy Brereton?
| SELECT MIN(pick__number) FROM table_28059992_5 WHERE player = "Andy Brereton" | sql_create_context |
CREATE TABLE table_204_616 (
id number,
"township" text,
"fips" number,
"population\ncenter" text,
"population" number,
"population\ndensity\n/km2 (/sq mi)" text,
"land area\nkm2 (sq mi)" text,
"water area\nkm2 (sq mi)" text,
"water %" text,
"geographic coordinates" text
)
-- U... | SELECT COUNT("township") FROM table_204_616 | squall |
CREATE TABLE table_name_79 (
country VARCHAR,
director VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Country has the Director Chen Kaige?
| SELECT country FROM table_name_79 WHERE director = "chen kaige" | sql_create_context |
CREATE TABLE table_name_78 (
long VARCHAR,
car VARCHAR,
yards VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the long for the player with under 30 carries and 0 yards?
| SELECT long FROM table_name_78 WHERE car < 30 AND yards = "0" | sql_create_context |
CREATE TABLE table_11474 (
"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.
-- When Richmond is the Away team, what did they sc... | SELECT "Away team score" FROM table_11474 WHERE "Away team" = 'richmond' | wikisql |
CREATE TABLE table_2562572_43 (
dominant_religion__2002_ VARCHAR,
largest_ethnic_group__2002_ VARCHAR,
type VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the 2002 dominant religion when the largest ethnic group (2002) was slovaks and type is vi... | SELECT dominant_religion__2002_ FROM table_2562572_43 WHERE largest_ethnic_group__2002_ = "Slovaks" AND type = "village" | 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 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 jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2021-04-10') | css |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Code | nvbench |
CREATE TABLE table_25822 (
"Outcome" text,
"Year" 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.
-- In which championship did John Newcombe play against K... | SELECT "Championship" FROM table_25822 WHERE "Opponent in the final" = 'Ken Rosewall' | wikisql |
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station_id INTEGER,
bike_id INTEGER,
subscription_type TEXT,
zip_code INTEGER
)
CREATE TABLE status (
station_i... | SELECT date, AVG(mean_humidity) FROM weather ORDER BY max_gust_speed_mph DESC LIMIT 3 | nvbench |
CREATE TABLE table_79129 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Finish, when Year(s) Won is '1991'?
| SELECT "Finish" FROM table_79129 WHERE "Year(s) won" = '1991' | 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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "29" AND procedures.long_title = "Exteriorization of small intestine" | mimicsql_data |
CREATE TABLE table_47819 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the attendance of week 8?
| SELECT COUNT("Attendance") FROM table_47819 WHERE "Week" = '8' | wikisql |
CREATE TABLE table_203_268 (
id number,
"date" text,
"name" text,
"nationality" text,
"tonnage\n(grt)" number,
"fate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what where the only two submarines that where only damaged ?
| SELECT "name" FROM table_203_268 WHERE "fate" = 'damaged' | squall |
CREATE TABLE table_9405 (
"Country" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Label has a Catalog of 7243 8 49494 2 6?
| SELECT "Label" FROM table_9405 WHERE "Catalog" = '7243 8 49494 2 6' | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "1846" AND procedures.short_title = "Coronary arteriogram NEC" | mimicsql_data |
CREATE TABLE table_48293 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Country has a Place of t9, and a Score of 71-71-72=214, and a Player of ernie els?
| SELECT "Country" FROM table_48293 WHERE "Place" = 't9' AND "Score" = '71-71-72=214' AND "Player" = 'ernie els' | wikisql |
CREATE TABLE table_name_72 (
visitor VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team was the visitor on 3/2?
| SELECT visitor FROM table_name_72 WHERE date = "3/2" | sql_create_context |
CREATE TABLE table_name_65 (
time_retired VARCHAR,
grid VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What time/retired has a Grid larger than 3, and a Driver of kimi r ikk nen?
| SELECT time_retired FROM table_name_65 WHERE grid > 3 AND driver = "kimi räikkönen" | sql_create_context |
CREATE TABLE table_27403436_1 (
us_viewers__million_ VARCHAR,
written_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many viewers watched the episode written by shana goldberg-meehan & greg malins?
| SELECT us_viewers__million_ FROM table_27403436_1 WHERE written_by = "Shana Goldberg-Meehan & Greg Malins" | sql_create_context |
CREATE TABLE table_name_32 (
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is south melbourne's scores when they are the away team?
| SELECT away_team AS score FROM table_name_32 WHERE away_team = "south melbourne" | sql_create_context |
CREATE TABLE table_13934 (
"Date" text,
"Type" text,
"Time (greatest)" text,
"Saros" real,
"Member" real,
"Gamma" real,
"Magnitude" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the date when saros is more than 124, the type is tota... | SELECT "Date" FROM table_13934 WHERE "Saros" > '124' AND "Type" = 'total' AND "Magnitude" > '1.0535' AND "Time (greatest)" = '20:55:28' | wikisql |
CREATE TABLE journal (
Journal_ID int,
Date text,
Theme text,
Sales int
)
CREATE TABLE editor (
Editor_ID int,
Name text,
Age real
)
CREATE TABLE journal_committee (
Editor_ID int,
Journal_ID int,
Work_Type text
)
-- Using valid SQLite, answer the following questions for the ... | SELECT Name, Age FROM editor ORDER BY Age DESC | nvbench |
CREATE TABLE table_64215 (
"Position" real,
"Gymnast" text,
"Floor" text,
"Pommel Horse" text,
"Rings" text,
"Vault" text,
"Parallel Bars" text,
"Horizontal Bar" text,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- With a par... | SELECT AVG("Total") FROM table_64215 WHERE "Parallel Bars" = '14.625' | wikisql |
CREATE TABLE table_name_9 (
vertical_drop__m_ INTEGER,
length__m_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest vertical drop among the 1,200 meter long tracks?
| SELECT MAX(vertical_drop__m_) FROM table_name_9 WHERE length__m_ = 1 OFFSET 200 | sql_create_context |
CREATE TABLE table_name_25 (
american VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is 17th c., when American is ' '?
| SELECT 17 AS th_c FROM table_name_25 WHERE american = "ə" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Unspecified disorder of kidney and ureter" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicatio... | SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-171217')) AND lab.labname = '-bands' AND STRFTIME('%y', lab.labresulttime) <= '2104' | eicu |
CREATE TABLE table_name_66 (
location VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the location of the fight when Gassaway fought kevin knabjian?
| SELECT location FROM table_name_66 WHERE opponent = "kevin knabjian" | sql_create_context |
CREATE TABLE table_14778650_1 (
writer VARCHAR,
length VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the writer for the song 4:29 in length?
| SELECT writer FROM table_14778650_1 WHERE length = "4:29" | sql_create_context |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT All_Home, SUM(Team_ID) FROM basketball_match GROUP BY All_Home | nvbench |
CREATE TABLE table_name_28 (
platform VARCHAR,
latest_stable_release VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the platform for the latest release 8.4?
| SELECT platform FROM table_name_28 WHERE latest_stable_release = "8.4" | sql_create_context |
CREATE TABLE table_16339 (
"Model" text,
"RU" real,
"Max processors" text,
"Processor frequency" text,
"Max memory" text,
"Max disk capacity" text,
"GA Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the max memory of the t5120 ... | SELECT "Max memory" FROM table_16339 WHERE "Model" = 'T5120' | wikisql |
CREATE TABLE table_name_54 (
venue VARCHAR,
state VARCHAR,
host VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What venue is located in Indiana and hosted at Purdue University?
| SELECT venue FROM table_name_54 WHERE state = "indiana" AND host = "purdue university" | sql_create_context |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '0936106' AND gwyjzb.IN_HOSP_DATE BETWEEN '2000-08-24' AND '2001-03-11' AND gwyjzb.PERSON_NM LIKE '吴%' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '0936106' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2000-08-24' AND '2001-03-11' AND fgwyjzb.PERSON_NM LIKE '吴%' | css |
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE... | SELECT DISTINCT transport_type FROM ground_service WHERE (airport_code IN (SELECT AIRPORTalias0.airport_code FROM airport AS AIRPORTalias0 WHERE AIRPORTalias0.airport_code = 'LGA') AND city_code IN (SELECT CITYalias0.city_code FROM city AS CITYalias0 WHERE CITYalias0.city_name = 'NEW YORK')) | atis |
CREATE TABLE table_47244 (
"Name" text,
"Club" text,
"Date of departure" text,
"Replacement" text,
"Date of appointment" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did Brendan Rodgers depart his position?
| SELECT "Date of departure" FROM table_47244 WHERE "Name" = 'brendan rodgers' | wikisql |
CREATE TABLE Functional_Areas (
functional_area_code VARCHAR(15),
parent_functional_area_code VARCHAR(15),
functional_area_description VARCHAR(80)
)
CREATE TABLE Images (
image_id INTEGER,
image_alt_text VARCHAR(80),
image_name VARCHAR(40),
image_url VARCHAR(255)
)
CREATE TABLE Document_Se... | SELECT role_code, COUNT(*) FROM Users GROUP BY role_code | nvbench |
CREATE TABLE table_38287 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is th... | SELECT "Tries against" FROM table_38287 WHERE "Lost" = '12' AND "Club" = 'pontycymmer rfc' | wikisql |
CREATE TABLE table_204_655 (
id number,
"year" number,
"winner" text,
"album" text,
"other finalists" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what album won before borrowed time did in 2006 ?
| SELECT "album" FROM table_204_655 WHERE "year" < (SELECT "year" FROM table_204_655 WHERE "album" = 'borrowed time') ORDER BY "year" DESC LIMIT 1 | squall |
CREATE TABLE hz_info (
KH text,
KLX number,
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,
MZBMLX num... | SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND person_info_hz_info.KH = hz_info.KH AND pers... | css |
CREATE TABLE table_name_51 (
away_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team played at lake oval while away?
| SELECT away_team FROM table_name_51 WHERE venue = "lake oval" | sql_create_context |
CREATE TABLE table_name_23 (
main_span_metres VARCHAR,
main_span_feet VARCHAR,
year_to_open VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Main span of the bridge from China with a Year to open of 2013 and Main span feet ... | SELECT main_span_metres FROM table_name_23 WHERE year_to_open = 2013 AND country = "china" AND main_span_feet = "2,585" | sql_create_context |
CREATE TABLE table_name_63 (
attendance INTEGER,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the attendance of week 12?
| SELECT MIN(attendance) FROM table_name_63 WHERE week = 12 | sql_create_context |
CREATE TABLE table_name_26 (
points INTEGER,
drawn VARCHAR,
games VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the highest points where there were less than 2 drawn and the games were less than 6?
| SELECT MAX(points) FROM table_name_26 WHERE drawn < 2 AND games < 6 | sql_create_context |
CREATE TABLE table_name_53 (
grid INTEGER,
car_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Car number 98's lowest grid?
| SELECT MIN(grid) FROM table_name_53 WHERE car_no = 98 | sql_create_context |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
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 d_icd_procedures (
... | SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_di... | 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 = "Government" AND procedures.long_title = "Drug detoxification" | mimicsql_data |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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 t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.diagnosis = "PNEUMONIA" | mimicsql_data |
CREATE TABLE table_name_77 (
years_at_club VARCHAR,
debut_year VARCHAR,
games VARCHAR,
goals VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of Years at Club for the player who has had more games than 28, more Goals than 225, and hi... | SELECT years_at_club FROM table_name_77 WHERE games > 28 AND goals > 225 AND debut_year > 1950 | 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 d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
... | SELECT STRFTIME('%j', icustays.outtime) - STRFTIME('%j', icustays.intime) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20000) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_name_2 (
away_team VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Away team has the Home team of Carlton?
| SELECT away_team FROM table_name_2 WHERE home_team = "carlton" | sql_create_context |
CREATE TABLE table_69181 (
"Date" text,
"Opponent" text,
"Result" text,
"Game Site" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent on the game on April 14, 2007?
| SELECT "Opponent" FROM table_69181 WHERE "Date" = 'april 14, 2007' | wikisql |
CREATE TABLE table_21550870_1 (
production_code VARCHAR,
written_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of production code for episode by steve cohen & andrew dettman
| SELECT COUNT(production_code) FROM table_21550870_1 WHERE written_by = "Steve Cohen & Andrew Dettman" | 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 patient (
uniquep... | SELECT (SELECT vitalperiodic.heartrate FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-4987')) AND NOT vitalperiodic.heartrate IS NU... | eicu |
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.admittime, demographic.dischtime FROM demographic WHERE demographic.subject_id = "94762" | mimicsql_data |
CREATE TABLE table_76618 (
"Fin. Pos" text,
"Car No." text,
"Driver" text,
"Team" text,
"Laps" text,
"Time/Retired" text,
"Grid" text,
"Laps Led" text,
"Points" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points does driv... | SELECT "Points" FROM table_76618 WHERE "Driver" = 'kosuke matsuura' | wikisql |
CREATE TABLE table_name_21 (
time VARCHAR,
nationality VARCHAR,
heat VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Russia's time with a heat higher than 3?
| SELECT time FROM table_name_21 WHERE nationality = "russia" AND heat > 3 | sql_create_context |
CREATE TABLE table_26015 (
"Branding" text,
"Callsign" text,
"Ch. #" text,
"Power kW" text,
"Station Type" text,
"Location (Transmitter site)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When dwhr-tv is the call sign how many station types ar... | SELECT COUNT("Station Type") FROM table_26015 WHERE "Callsign" = 'DWHR-TV' | wikisql |
CREATE TABLE table_171236_1 (
census_ranking VARCHAR,
area_km_2 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the area is 34.73, what is the census ranking?
| SELECT census_ranking FROM table_171236_1 WHERE area_km_2 = "34.73" | sql_create_context |
CREATE TABLE table_name_44 (
decile INTEGER,
roll VARCHAR,
authority VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total amount of decile with the authority of state around the Pokuru School and a roll smaller than 109?
| SELECT SUM(decile) FROM table_name_44 WHERE authority = "state" AND name = "pokuru school" AND roll < 109 | sql_create_context |
CREATE TABLE table_name_91 (
week INTEGER,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what week was the Result L 15-13?
| SELECT AVG(week) FROM table_name_91 WHERE result = "l 15-13" | sql_create_context |
CREATE TABLE table_name_24 (
player VARCHAR,
school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What player is from Seton Hall University?
| SELECT player FROM table_name_24 WHERE school = "seton hall university" | sql_create_context |
CREATE TABLE table_name_48 (
place VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the place when the score is 70-72=142?
| SELECT place FROM table_name_48 WHERE score = 70 - 72 = 142 | 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 WHERE demographic.days_stay > "15" AND diagnoses.short_title = "Acute pancreatitis" | mimicsql_data |
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_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate, admissions.hadm_id FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'doxorubicin' AND STRFTIME('%y', prescriptions... | mimic_iii |
CREATE TABLE table_46041 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Gold has a Rank of 7, a Nation of italy, and a Silver smaller than 0?
| SELECT COUNT("Gold") FROM table_46041 WHERE "Rank" = '7' AND "Nation" = 'italy' AND "Silver" < '0' | 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 jybgb.BGDH FROM hz_info JOIN zzmzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '45065975' AND jybgb.BGRQ BETWEEN '2003-05-03' AND '2009-... | css |
CREATE TABLE table_name_21 (
score VARCHAR,
venue VARCHAR,
champion VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score of the match won by Willie Hunter at the Royal Liverpool Golf Club?
| SELECT score FROM table_name_21 WHERE venue = "royal liverpool golf club" AND champion = "willie hunter" | sql_create_context |
CREATE TABLE tasks (
task_id number,
project_id number,
task_details text,
eg agree objectives text
)
CREATE TABLE organisations (
organisation_id number,
organisation_type text,
organisation_details text
)
CREATE TABLE documents (
document_id number,
document_type_code text,
g... | SELECT document_type_code FROM document_types WHERE document_description LIKE 'Initial%' | spider |
CREATE TABLE table_7098 (
"Year" real,
"Album" text,
"U.S." text,
"U.S. Christian" text,
"U.S. Indie" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest Year with an Album that is live love in London?
| SELECT MIN("Year") FROM table_7098 WHERE "Album" = 'live love in london' | wikisql |
CREATE TABLE table_28576 (
"Country" text,
"Area (km\u00b2) 2010" real,
"Population 2011" real,
"GDP (PPP) ( Intl. $ ) 2011" text,
"GDP (PPP) per capita ( Intl. $ ) 2011" text,
"Income inequality 1992-2010 (latest available)" text,
"HDI 2012" text,
"FSI 2012" text,
"CPI 2012" text,
... | SELECT "FSI 2012" FROM table_28576 WHERE "CPI 2012" = '42.7' | wikisql |
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 d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE out... | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT outputevents.itemid 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 = 8888)) AND DATETIME(outputevents.charttime... | mimic_iii |
CREATE TABLE table_name_84 (
surface VARCHAR,
opponent_in_the_final VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On which surface did Mathieu play against Antonio Vei ?
| SELECT surface FROM table_name_84 WHERE opponent_in_the_final = "antonio veić" | sql_create_context |
CREATE TABLE table_210279_2 (
area__km_2__ VARCHAR,
barangay VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the area where barangay is guadalupe viejo?
| SELECT area__km_2__ FROM table_210279_2 WHERE barangay = "Guadalupe Viejo" | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid... | SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-9230' AND patient.hospitaldischargetime IS NULL) AND NOT patient.admissionheight IS NULL ORDER BY patient.unitadmittime LIMIT 1 | eicu |
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 KH, KLX FROM mzjzjlb WHERE JZLSH = '97338418415' | css |
CREATE TABLE table_27679 (
"Position" text,
"Number" real,
"Horse" text,
"Jockey" text,
"Age" real,
"Handicap" text,
"SP" text,
"Distance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the handicap where the distance is 9 length... | SELECT "Handicap" FROM table_27679 WHERE "Distance" = '9 lengths' | wikisql |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '0952187' AND t_kc21.IN_HOSP_DATE BETWEEN '2002-07-26' AND '2015-08-16' AND t_kc21.INSURED_STS = '未就业' AND t_kc21.MED_AMOUT >= 7027.62 | css |
CREATE TABLE Orders (
order_id INTEGER,
customer_id INTEGER,
order_status VARCHAR(10),
date_order_placed DATETIME,
order_details VARCHAR(255)
)
CREATE TABLE Shipments (
shipment_id INTEGER,
order_id INTEGER,
invoice_number INTEGER,
shipment_tracking_number VARCHAR(80),
shipment_... | SELECT date_order_placed, COUNT(date_order_placed) FROM Customers AS T1 JOIN Orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = "Jeramie" | nvbench |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM ... | SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = ... | css |
CREATE TABLE table_39914 (
"Game" real,
"March" real,
"Opponent" text,
"Score" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which record's march was 26?
| SELECT "Record" FROM table_39914 WHERE "March" = '26' | wikisql |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE hz_info (
KH text,
KLX number... | SELECT jybgb.JYKSBM, jybgb.JYKSMC FROM jybgb WHERE jybgb.JZLSH = '09444918372' | 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 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 hz_info.YLJGDM = '9262295' AND mzjzjlb.JZKSMC LIKE '%遗传%' | css |
CREATE TABLE table_52911 (
"Name" text,
"Height" text,
"Weight" text,
"Spike" text,
"2008 club" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was in the 2008 club of gabeca montichiari?
| SELECT "Name" FROM table_52911 WHERE "2008 club" = 'gabeca montichiari' | wikisql |
CREATE TABLE table_26032940_2 (
network_tv_run_time VARCHAR,
episode__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many runtimes does episode 53 have?
| SELECT COUNT(network_tv_run_time) FROM table_26032940_2 WHERE episode__number = 53 | sql_create_context |
CREATE TABLE table_68881 (
"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.
-- What was the result of the fight with Tony Halme?
| SELECT "Res." FROM table_68881 WHERE "Opponent" = 'tony halme' | wikisql |
CREATE TABLE table_201_14 (
id number,
"crossing" text,
"carries" text,
"location" text,
"coordinates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which bridge is in delaware and carries de 9 ?
| SELECT "crossing" FROM table_201_14 WHERE "location" = 'delaware' AND "carries" = 'de 9' | squall |
CREATE TABLE table_46711 (
"Name of System" text,
"Location" text,
"Traction Type" text,
"Date (From)" text,
"Date (To)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which date has date started from 30 Sep 1913?
| SELECT "Date (To)" FROM table_46711 WHERE "Date (From)" = '30 sep 1913' | wikisql |
CREATE TABLE table_name_41 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average 2001 value with a 2010 value greater than 414, a 2011 value of 7192, and a 2005 value larger than 7340?
| SELECT AVG(2001) FROM table_name_41 WHERE 2010 > 414 AND 2011 = 7192 AND 2005 > 7340 | sql_create_context |
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 microbiologyevents (
row_id number,
subject_id number,
... | SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'retrograde pyelogram') AND DATETIME(procedures_icd.charttime) <= DATETIME(CURRENT_TIME(), '-1 year') | mimic_iii |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.