instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE Residents (
resident_id INTEGER,
property_id INTEGER,
date_moved_in DATETIME,
date_moved_out DATETIME,
other_details VARCHAR(255)
)
CREATE TABLE Organizations (
organization_id INTEGER,
parent_organization_id INTEGER,
organization_details VARCHAR(255)
)
CREATE TABLE Timed_... | SELECT Customer_Event_ID, property_id FROM Customer_Events | nvbench |
CREATE TABLE table_name_92 (
to_par VARCHAR,
player VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the to par score for Tim Herron, who had a score of 69-72=141?
| SELECT to_par FROM table_name_92 WHERE score = 69 - 72 = 141 AND player = "tim herron" | sql_create_context |
CREATE TABLE table_14460937_1 (
afc_cup VARCHAR,
play_off VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many times has the playoff been 1 in the contest for the afc cup?
| SELECT COUNT(afc_cup) FROM table_14460937_1 WHERE play_off = 1 | sql_create_context |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | SELECT * FROM SuggestedEdits WHERE Comment LIKE '%encyclopedia%' | sede |
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 microlab (
microl... | 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 = '011-35642')) AND DATETIME(allergy.allergytime) <= DATETIME(CURRENT_TIME(), '-57 ... | eicu |
CREATE TABLE table_29828 (
"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.
-- How ma... | SELECT COUNT("Game") FROM table_29828 WHERE "Team" = 'Houston' | wikisql |
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 COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '凤夏彤' AND t_kc22.STA_DATE BETWEEN '2002-04-08' AND '2016-02-13' AND t_kc22.SELF_PAY_AMO > 3400.0 UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_NM = '凤夏彤' AND t... | css |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownV... | SELECT DISTINCT P.Title, P.ViewCount, P.Score, P.AcceptedAnswerId, P.Tags, 'http://stackoverflow.com/q/' + CAST(P.Id AS TEXT) AS URL FROM Posts AS P WHERE P.Tags LIKE '%<pandas>%' AND P.Tags LIKE '%<r>%' AND P.Score > 0 AND NOT P.AcceptedAnswerId IS NULL | sede |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "15" AND diagnoses.icd9_code = "4846" | mimicsql_data |
CREATE TABLE table_name_87 (
dates_administered VARCHAR,
lead_margin VARCHAR,
poll_source VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of the poll from Survey USA that showed a lead margin smaller than 5.5?
| SELECT dates_administered FROM table_name_87 WHERE lead_margin < 5.5 AND poll_source = "survey usa" | sql_create_context |
CREATE TABLE table_45883 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the team 2 with cobreloa as team 1?
| SELECT "Team 2" FROM table_45883 WHERE "Team 1" = 'cobreloa' | wikisql |
CREATE TABLE table_46690 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which location led to a decision and a record of 1-2?
| SELECT "Location" FROM table_46690 WHERE "Method" = 'decision' AND "Record" = '1-2' | wikisql |
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 diagnoses.short_title FROM diagnoses WHERE diagnoses.subject_id = "2560" | mimicsql_data |
CREATE TABLE teachers (
lastname text,
firstname text,
classroom number
)
CREATE TABLE list (
lastname text,
firstname text,
grade number,
classroom number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the first names of the teachers w... | SELECT DISTINCT T2.firstname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 1 | spider |
CREATE TABLE table_15544 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player has 69 as the score?
| SELECT "Player" FROM table_15544 WHERE "Score" = '69' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.insurance = "Private" | mimicsql_data |
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 ReviewTaskResults (
Id number,
Review... | SELECT u.Id, DisplayName, COUNT(p.Id) AS PostCount FROM Users AS u LEFT JOIN Posts AS p ON u.Id = p.OwnerUserId GROUP BY u.Id, DisplayName ORDER BY PostCount DESC LIMIT 10 | sede |
CREATE TABLE table_name_99 (
wins VARCHAR,
year VARCHAR,
matches VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of wins in 2010, when there were more than 14 matches?
| SELECT COUNT(wins) FROM table_name_99 WHERE year = "2010" AND matches > 14 | sql_create_context |
CREATE TABLE table_51819 (
"Tournament" text,
"1968" text,
"1969" text,
"1970" text,
"1971" text,
"1972" text,
"1973" text,
"1974" text,
"1975" text,
"1976" text,
"1977" text,
"1978" text,
"1979" text,
"Career SR" text,
"Career W\u2013L" text,
"Career Win ... | SELECT "Career W\u2013L" FROM table_51819 WHERE "1968" = 'a' AND "1974" = '4r' | 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 t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '9564037' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_CD | css |
CREATE TABLE table_24148 (
"Season" text,
"Games" real,
"Won" real,
"Lost" real,
"Tied" real,
"Points" real,
"Pct %" text,
"Goals For" real,
"Goals Against" real,
"Standing" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was... | SELECT MAX("Goals For") FROM table_24148 WHERE "Pct %" = '0.604' | wikisql |
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_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE proce... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'tsicu') | mimic_iii |
CREATE TABLE table_69088 (
"Year" real,
"Date" text,
"Title" text,
"Format(s)" text,
"Award Description(s)" text,
"Result(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which title has a year later than 1986 with an album as the format?
| SELECT "Title" FROM table_69088 WHERE "Year" > '1986' AND "Format(s)" = 'album' | wikisql |
CREATE TABLE table_name_34 (
enrollment VARCHAR,
founded VARCHAR,
team_nickname VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Enrollment for the Coyotes Founded in 1891?
| SELECT COUNT(enrollment) FROM table_name_34 WHERE founded = 1891 AND team_nickname = "coyotes" | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodi... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnosis.diagnosistime)) FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-24054'... | eicu |
CREATE TABLE table_2298 (
"#" text,
"Date" text,
"at/vs." text,
"Opponent" text,
"Score" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date of game 5?
| SELECT "Date" FROM table_2298 WHERE "#" = '5' | wikisql |
CREATE TABLE table_name_62 (
date VARCHAR,
description VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date listed for the item that has undergoing overhaul, restoration or repairs listed under description?
| SELECT date FROM table_name_62 WHERE description = "undergoing overhaul, restoration or repairs" | sql_create_context |
CREATE TABLE table_name_78 (
order_and_title VARCHAR,
elevated VARCHAR,
elector VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- With a date of May 1262 under elevated, Guillaume de Bray as the elector, what is the order and title?
| SELECT order_and_title FROM table_name_78 WHERE elevated = "may 1262" AND elector = "guillaume de bray" | sql_create_context |
CREATE TABLE table_51187 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What i... | SELECT "High points" FROM table_51187 WHERE "Date" = 'may 25' | wikisql |
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.gender, demographic.religion FROM demographic WHERE demographic.subject_id = "1121" | mimicsql_data |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid ... | SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'obstructive uropathy' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2105' GROUP BY STRFTIME('%y-%m', diagnosis.diagnosistime)) AS t1 | eicu |
CREATE TABLE table_56144 (
"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.
-- Which home teams had crowds larger than 4,000?
| SELECT "Home team" FROM table_56144 WHERE "Crowd" > '4,000' | 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 t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '39827509' AND t_kc21.MED_SER_ORG_NO = '1609490' AND t_kc21.IN_DIAG_DIS_NM LIKE '%合并%' | css |
CREATE TABLE table_32817 (
"Year" real,
"Rider" text,
"Country" text,
"Distance" text,
"Pacing" text,
"Velodrome" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country had a winner in 1907?
| SELECT "Country" FROM table_32817 WHERE "Year" = '1907' | wikisql |
CREATE TABLE table_51333 (
"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 venue is the home of the Carlton team?
| SELECT "Venue" FROM table_51333 WHERE "Home team" = 'carlton' | wikisql |
CREATE TABLE table_11630008_8 (
original_air_date VARCHAR,
written_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the original air date of the episode written by Karen Felix and Don Woodard?
| SELECT original_air_date FROM table_11630008_8 WHERE written_by = "Karen Felix and Don Woodard" | sql_create_context |
CREATE TABLE table_11657 (
"Sport" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When tennis has less than 2 bronze, what is the total number of Gold?
| SELECT COUNT("Gold") FROM table_11657 WHERE "Sport" = 'tennis' AND "Bronze" < '2' | wikisql |
CREATE TABLE table_13512105_3 (
rnd VARCHAR,
race VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- tell the number of times where kansas was the location
| SELECT COUNT(rnd) FROM table_13512105_3 WHERE race = "Kansas" | sql_create_context |
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.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND procedures.short_title = "Contr cerebr arteriogram" | mimicsql_data |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id numbe... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24268) AND prescriptions.drug = 'magnesium sulfate' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND ... | mimic_iii |
CREATE TABLE table_203_827 (
id number,
"name" text,
"1989" text,
"1990" text,
"1991" text,
"1992" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1997" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
... | SELECT "name" FROM table_203_827 WHERE id = (SELECT id FROM table_203_827 WHERE "name" = 'australian open') + 1 | squall |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,... | WITH Raw AS (SELECT MAX(DelHist.Id) AS DelHistId, UndelHist.Id AS UndelHistId, MAX(UndelHist.PostId) AS PostId, MAX(DelHist.CreationDate) AS DeletionDate, MAX(UndelHist.CreationDate) AS UndelDate, CAST((JULIANDAY(MAX(UndelHist.CreationDate)) - JULIANDAY(MAX(DelHist.CreationDate))) * 86400.0 AS INT) AS Seconds FROM Post... | sede |
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 (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '2768334' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING MAX(t_kc21.IN_HOSP_DAYS) < 16) AS T | css |
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 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 73713 AND admissions.dischtime IS NULL | mimic_iii |
CREATE TABLE table_52529 (
"Munsee Delaware" text,
"Unami Delaware" text,
"De Laet (1633)" text,
"Campanius (ca. 1645)" text,
"Interpreter (1684?)" text,
"Thomas (1698)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the De Laet term for... | SELECT "De Laet (1633)" FROM table_52529 WHERE "Munsee Delaware" = 'ní·ša' | wikisql |
CREATE TABLE table_28137 (
"Player" text,
"Nationality" text,
"Finals" real,
"Win-Loss" text,
"Year(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the win-loss record for the player from Switzerland?
| SELECT "Win-Loss" FROM table_28137 WHERE "Nationality" = 'Switzerland' | wikisql |
CREATE TABLE table_23341 (
"#" real,
"Episode" text,
"Rating" text,
"Share" real,
"Rating/Share (18-49)" text,
"Viewers (millions)" text,
"Rank (Night)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the rating/share is 3.8/10, what is th... | SELECT COUNT("Rating") FROM table_23341 WHERE "Rating/Share (18-49)" = '3.8/10' | wikisql |
CREATE TABLE table_name_9 (
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is 2012 when the tournament is win %?
| SELECT 2012 FROM table_name_9 WHERE tournament = "win %" | sql_create_context |
CREATE TABLE table_17819 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
)
-- Using valid SQLite, answer the follo... | SELECT "Won" FROM table_17819 WHERE "Try bonus" = '11' | wikisql |
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fa... | SELECT DISTINCT fare.fare_id FROM airport, airport_service, city, fare, flight, flight_fare WHERE (airport.airport_code = 'DFW' AND city.city_code = airport_service.city_code AND city.city_name = 'ATLANTA' AND flight.from_airport = airport_service.airport_code AND flight.to_airport = airport.airport_code) AND flight_fa... | atis |
CREATE TABLE table_name_29 (
opponent VARCHAR,
site VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Opponent has a Site of razorback stadium fayetteville, ar, and a Date of october 7, 1967?
| SELECT opponent FROM table_name_29 WHERE site = "razorback stadium • fayetteville, ar" AND date = "october 7, 1967" | sql_create_context |
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 AVG(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-188114')) AND intakeoutput.celllabel = 'ente... | eicu |
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 jybgb.JYKSBM, jybgb.JYKSMC FROM jybgb WHERE jybgb.JZLSH = '32751875737' | css |
CREATE TABLE table_23237 (
"Office" text,
"Branch" text,
"Location" text,
"Elected" real,
"Term began" text,
"Term ended" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many terms began when the term ended in January 3, 1989?
| SELECT COUNT("Term began") FROM table_23237 WHERE "Term ended" = 'January 3, 1989' | wikisql |
CREATE TABLE table_test_22 (
"id" int,
"ejection_fraction_ef" int,
"pregnancy_or_lactation" bool,
"child_pugh_class" string,
"hbv" bool,
"systolic_blood_pressure_sbp" int,
"active_infection" bool,
"leukocyte_count" int,
"hiv_infection" bool,
"left_ventricular_dysfunction" bool,
... | SELECT * FROM table_test_22 WHERE pregnancy_or_lactation = 1 | criteria2sql |
CREATE TABLE table_4352 (
"Pick" text,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the nationality of pick 140
| SELECT "Nationality" FROM table_4352 WHERE "Pick" = '140' | wikisql |
CREATE TABLE table_1193568_1 (
province VARCHAR,
member VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the province where member is frederick merriman category:articles with hcards
| SELECT province FROM table_1193568_1 WHERE member = "Frederick Merriman Category:Articles with hCards" | sql_create_context |
CREATE TABLE table_name_38 (
agg VARCHAR,
team_2 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the agg of team 2 for Vantour Club Mangoungou?
| SELECT agg FROM table_name_38 WHERE team_2 = "vantour club mangoungou" | sql_create_context |
CREATE TABLE table_69499 (
"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 time was Opponent Fredson Paix o beaten in?
| SELECT "Time" FROM table_69499 WHERE "Opponent" = 'fredson paixão' | wikisql |
CREATE TABLE table_72359 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What party does William J. Jefferson?
| SELECT "Party" FROM table_72359 WHERE "Incumbent" = 'William J. Jefferson' | wikisql |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDa... | SELECT TagName, COUNT(PostId) FROM Tags INNER JOIN PostTags ON Tags.Id = PostTags.TagId INNER JOIN Posts ON Posts.Id = PostTags.PostId WHERE Posts.CreationDate >= CURRENT_TIMESTAMP() - 50 GROUP BY TagName ORDER BY COUNT(PostId) DESC LIMIT 50 | sede |
CREATE TABLE table_29615 (
"Game" real,
"October" real,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of record for hp pavilion - 17,562
| SELECT COUNT("Record") FROM table_29615 WHERE "Location/Attendance" = 'HP Pavilion - 17,562' | wikisql |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerU... | SELECT Id AS "post_link" FROM Votes AS V WHERE VoteTypeId = 11 | sede |
CREATE TABLE table_name_48 (
home_captain VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Home Captain, when Date is 23,24,26,27,28,29 Feb, 1 Mar 1912?
| SELECT home_captain FROM table_name_48 WHERE date = "23,24,26,27,28,29 feb, 1 mar 1912" | sql_create_context |
CREATE TABLE table_name_28 (
points INTEGER,
poles INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the points sum of the series with less than 0 poles?
| SELECT SUM(points) FROM table_name_28 WHERE poles < 0 | sql_create_context |
CREATE TABLE table_60696 (
"Season" text,
"League" text,
"Teams" text,
"Home" text,
"Away" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the home for the league 3rd liga (iii)?
| SELECT "Home" FROM table_60696 WHERE "League" = '3rd liga (iii)' | 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 cost (
costid num... | SELECT vitalperiodic.sao2 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-37411')) AND NOT vitalperiodic.sao2 IS NULL AND DATETIME(v... | eicu |
CREATE TABLE table_28201906_1 (
points VARCHAR,
pts_agst VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points does the club that had 45 points against it have?
| SELECT points FROM table_28201906_1 WHERE pts_agst = 45 | sql_create_context |
CREATE TABLE table_37633 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the Lagos tournament?
| SELECT "Date" FROM table_37633 WHERE "Tournament" = 'lagos' | wikisql |
CREATE TABLE table_name_1 (
lost VARCHAR,
against INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many losses have points against less than 15?
| SELECT COUNT(lost) FROM table_name_1 WHERE against < 15 | sql_create_context |
CREATE TABLE table_204_27 (
id number,
"name" text,
"position" text,
"year" text,
"league\napps" number,
"league\ngoals" number,
"total\napps" number,
"total\ngoals" number,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what... | SELECT "league\ngoals" FROM table_204_27 WHERE "name" = 'billy sharp' | squall |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.religion = "PROTESTANT QUAKER" AND procedures.short_title = "Cont inv mec ven 96+ hrs" | mimicsql_data |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime t... | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime, patient.patienthealthsystemstayid FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'sodium phosphate... | eicu |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid num... | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '013-23115' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | eicu |
CREATE TABLE table_25489 (
"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.
-- Name t... | SELECT COUNT("High points") FROM table_25489 WHERE "Location Attendance" = 'Ford Center' | wikisql |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND lab.label = "Specific Gravity" | mimicsql_data |
CREATE TABLE table_50600 (
"Rank" real,
"Team" text,
"Played" real,
"Wins" real,
"Ties" real,
"Losses" real,
"Goals For" real,
"Goals Against" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total wins with ... | SELECT SUM("Wins") FROM table_50600 WHERE "Ties" < '2' AND "Goals Against" = '18' AND "Losses" < '2' | wikisql |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE microlab (
microlabid number,
... | 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 = '005-73237')) AND lab.labname = 'platelets x 1000' AND STRFTIME('%y-%m', lab.labresu... | eicu |
CREATE TABLE table_67841 (
"Rank" real,
"Team" text,
"Wins" real,
"Losses" real,
"Runs Allowed" real,
"Run Ratio" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many runs allowed did the team ranked 2 with more than 2 losses have?
| SELECT AVG("Runs Allowed") FROM table_67841 WHERE "Rank" = '2' AND "Losses" > '2' | wikisql |
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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" | mimicsql_data |
CREATE TABLE country (
country_id number,
country text,
last_update time
)
CREATE TABLE film_category (
film_id number,
category_id number,
last_update time
)
CREATE TABLE address (
address_id number,
address text,
address2 text,
district text,
city_id number,
postal_co... | SELECT COUNT(DISTINCT rating) FROM film | spider |
CREATE TABLE table_name_62 (
year VARCHAR,
qual VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The Qual of 120.006 took place in what year?
| SELECT year FROM table_name_62 WHERE qual = "120.006" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREA... | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-159173')) AND vitalperiodic.heartrate < 90.0 AN... | eicu |
CREATE TABLE table_37271 (
"Name" text,
"Date" text,
"Goals" real,
"Assists" real,
"Team" text,
"Venue" text,
"Opponent" text,
"Competition" text,
"Total Goals" real,
"Total Assists" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
--... | SELECT "Name" FROM table_37271 WHERE "Opponent" = 'pohang steelers' | wikisql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
... | SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10855)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial... | mimic_iii |
CREATE TABLE table_15448 (
"Year" text,
"Competition" text,
"Opponent" text,
"Score" text,
"Venue" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the venue with opponent of collingwood
| SELECT "Venue" FROM table_15448 WHERE "Opponent" = 'collingwood' | wikisql |
CREATE TABLE table_72959 (
"Name" text,
"GP-GS" text,
"Solo" real,
"Ast" real,
"Total" real,
"TFL-Yds" text,
"No-Yds" text,
"BrUp" real,
"QBH" real,
"No.-Yds" text,
"Avg" text,
"TD" real,
"Long" real,
"Rcv-Yds" text,
"FF" real,
"Blkd Kick" real
)
-- Usin... | SELECT "No.-Yds" FROM table_72959 WHERE "TFL-Yds" = '2.5-4' | wikisql |
CREATE TABLE table_34529 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what date were they playing ... | SELECT "Date" FROM table_34529 WHERE "Away team" = 'hawthorn' | 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 diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (... | SELECT inputevents_cv.charttime 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 = 19059)) AND DATETIME(inputevents_cv.charttime) <= DATETIME(CURRENT_TIME(), '-1106 day') ORDE... | mimic_iii |
CREATE TABLE table_name_49 (
previous_conference VARCHAR,
school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which conference held at School of whiting?
| SELECT previous_conference FROM table_name_49 WHERE school = "whiting" | sql_create_context |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT ACC_Road, AVG(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY AVG(Team_ID) | nvbench |
CREATE TABLE table_28127 (
"Result" text,
"Date" text,
"Race" text,
"Venue" text,
"Group" text,
"Distance" text,
"Weight (kg)" text,
"Jockey" text,
"Winner/2nd" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what race was the weig... | SELECT "Race" FROM table_28127 WHERE "Weight (kg)" = '55' AND "Winner/2nd" = '1st - Jim And Tonic' | wikisql |
CREATE TABLE table_29458 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many ... | SELECT COUNT("Date of vacancy") FROM table_29458 WHERE "Outgoing manager" = 'Bart De Roover' | wikisql |
CREATE TABLE table_67673 (
"Year" text,
"Champion" text,
"Country" text,
"Score" text,
"Purse ($)" real,
"Winner's share ($)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which average purse was earned by Erika Wicoff and has a winner's share ... | SELECT AVG("Purse ($)") FROM table_67673 WHERE "Champion" = 'erika wicoff' AND "Winner's share ($)" > '9,750' | wikisql |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS va... | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | nvbench |
CREATE TABLE table_25213146_2 (
winning_team VARCHAR,
circuit VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On the Circuit Zolder who was the winning team?
| SELECT winning_team FROM table_25213146_2 WHERE circuit = "circuit Zolder" | sql_create_context |
CREATE TABLE table_35826 (
"Date" text,
"City" text,
"Opponent" text,
"Results\u00b9" text,
"Type of game" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what type of game has the resuts of 1:0?
| SELECT "Type of game" FROM table_35826 WHERE "Results\u00b9" = '1:0' | wikisql |
CREATE TABLE table_13879 (
"Pick" real,
"Player" text,
"Team" text,
"Position" text,
"School" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the player from Vanderbilt University?
| SELECT "Player" FROM table_13879 WHERE "School" = 'vanderbilt university' | wikisql |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb 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 = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjl... | css |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,... | SELECT P.Id, SUBSTRING(P.Body, 0, 80), (SELECT COUNT(V.Id) FROM Votes AS V WHERE V.PostId = P.Id AND V.VoteTypeId = 16) AS "edits", CAST(TIME_TO_STR(P.CommunityOwnedDate, '%b %d, %Y') AS TEXT(12)), CAST(TIME_TO_STR(P.LastActivityDate, '%b %d, %Y') AS TEXT(12)) FROM Posts AS P, PostTypes AS Pt, Votes AS V, VoteTypes AS ... | sede |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.