instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_18356 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the party of the election in which Robert Bauman is the incumben... | SELECT "Party" FROM table_18356 WHERE "Incumbent" = 'Robert Bauman' | wikisql |
CREATE TABLE products (
product_id number,
product_details text
)
CREATE TABLE customer_contact_channels (
customer_id number,
channel_code text,
active_from_date time,
active_to_date time,
contact_number text
)
CREATE TABLE addresses (
address_id number,
address_content text,
... | SELECT COUNT(*) FROM customers | spider |
CREATE TABLE table_50247 (
"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.
-- The match that went 1 round, and had a method of su... | SELECT "Record" FROM table_50247 WHERE "Round" = '1' AND "Method" = 'submission (rear-naked choke)' | wikisql |
CREATE TABLE table_204_3 (
id number,
"rank" number,
"name" text,
"nationality" text,
"time" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many swimmers swam the 100 meters in under 55 seconds ?
| SELECT COUNT("name") FROM table_204_3 WHERE "time" < 55 | squall |
CREATE TABLE table_name_86 (
nationality VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Nationality has a Player of larry wright?
| SELECT nationality FROM table_name_86 WHERE player = "larry wright" | sql_create_context |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime ... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'platelet count') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83182 AND adm... | mimic_iii |
CREATE TABLE table_name_23 (
result VARCHAR,
location VARCHAR,
loser VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is result of the game at Arrowhead Stadium where the loser was the Kansas City Chiefs?
| SELECT result FROM table_name_23 WHERE location = "arrowhead stadium" AND loser = "kansas city chiefs" | sql_create_context |
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.short_title = "Suture bladder lacerat" | mimicsql_data |
CREATE TABLE table_18013 (
"Release" text,
"Title" text,
"Windows" text,
"5th Gen" text,
"6th Gen" text,
"Handheld" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What title was released on August 27?
| SELECT "Title" FROM table_18013 WHERE "Release" = 'August 27' | wikisql |
CREATE TABLE table_32216 (
"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.
-- Who is the away team at Windy Hill?
| SELECT "Away team" FROM table_32216 WHERE "Venue" = 'windy hill' | wikisql |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE zzmzjzjlb.JZZDSM = '酒精性肝硬化' AND jyjgzbb.JCZBDM = '200010' UNION SELECT jyjgzbb.CKZFWXX... | css |
CREATE TABLE table_46578 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the attendance when Bournemouth was the away team?
| SELECT "Attendance" FROM table_46578 WHERE "Away team" = 'bournemouth' | wikisql |
CREATE TABLE table_name_26 (
votes INTEGER,
vote__percentage INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the sum of votes % more than 19.5
| SELECT SUM(votes) FROM table_name_26 WHERE vote__percentage > 19.5 | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.short_title = "Endosc sphincterotomy" | mimicsql_data |
CREATE TABLE table_47827 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Score, when Place is 'T1'?
| SELECT "Score" FROM table_47827 WHERE "Place" = 't1' | wikisql |
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int
)
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real
)
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int... | SELECT Year, COUNT(Year) FROM exhibition WHERE Ticket_Price < 15 GROUP BY Theme | nvbench |
CREATE TABLE table_26460435_5 (
heir VARCHAR,
monarch VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the heir when the monarch was Wareru?
| SELECT heir FROM table_26460435_5 WHERE monarch = "Wareru" | sql_create_context |
CREATE TABLE table_8593 (
"Track Name" text,
"Location" text,
"Length" text,
"Sanction" text,
"Program" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the sanction of the event at Nashville, Illinois?
| SELECT "Sanction" FROM table_8593 WHERE "Location" = 'nashville, illinois' | wikisql |
CREATE TABLE table_204_791 (
id number,
"event" text,
"winner" text,
"second" text,
"third" text,
"fourth" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- at which event did taylor jensen first win ?
| SELECT "event" FROM table_204_791 WHERE "winner" = 'taylor jensen' ORDER BY "event" LIMIT 1 | squall |
CREATE TABLE table_name_64 (
opponent VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Opponent has a Score of 2 6?
| SELECT opponent FROM table_name_64 WHERE score = "2–6" | sql_create_context |
CREATE TABLE table_18662026_10 (
parallel_bars VARCHAR,
floor VARCHAR,
horizontal_bar VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the horizontal bar is n/a and the floor is 14.175, what is the number for the parallel bars?
| SELECT parallel_bars FROM table_18662026_10 WHERE floor = "14.175" AND horizontal_bar = "N/A" | sql_create_context |
CREATE TABLE hz_info_zyjzjlb (
JZLSH number,
YLJGDM number,
zyjzjlb_id number
)
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,
... | SELECT COUNT(*) 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 mzjzjlb.JZKSRQ BETWEEN '2001-04-21' AND '2019-08-21' AND mzjzjlb.YLJGDM = '3211067' | css |
CREATE TABLE table_204_802 (
id number,
"tie no" number,
"home team" text,
"score" text,
"away team" text,
"date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many games had less than 5 total goals scored ?
| SELECT COUNT(*) FROM table_204_802 WHERE "score" + "score" < 5 | squall |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9cod... | SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'antidepressant - vanafaxine (effexor)' AND STRFTIME(... | eicu |
CREATE TABLE table_76721 (
"Newspaper/Magazine" text,
"Type" text,
"Language" text,
"Headquarter" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Headquarter, when Language is English, and when Type is Independent Online News P... | SELECT "Headquarter" FROM table_76721 WHERE "Language" = 'english' AND "Type" = 'independent online news portal' | wikisql |
CREATE TABLE table_name_44 (
rank VARCHAR,
gross VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What rank has a gross of $35,976,000?
| SELECT rank FROM table_name_44 WHERE gross = "$35,976,000" | sql_create_context |
CREATE TABLE church (
Church_ID int,
Name text,
Organized_by text,
Open_Date int,
Continuation_of text
)
CREATE TABLE people (
People_ID int,
Name text,
Country text,
Is_Male text,
Age int
)
CREATE TABLE wedding (
Church_ID int,
Male_ID int,
Female_ID int,
Year ... | SELECT Open_Date, COUNT(Open_Date) FROM church ORDER BY COUNT(Open_Date) | nvbench |
CREATE TABLE table_5288 (
"Rank" real,
"Player" text,
"Country" text,
"Earnings ( $ )" real,
"Events" real,
"Wins" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player is ranked number 3?
| SELECT "Player" FROM table_5288 WHERE "Rank" = '3' | wikisql |
CREATE TABLE table_23380 (
"Rank" real,
"Dismissals" real,
"Player" text,
"Caught" real,
"Stumped" real,
"Matches" real,
"Innings" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the least number of stumps in a game with 13 dismissals... | SELECT MIN("Stumped") FROM table_23380 WHERE "Dismissals" = '13' | 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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Cerebral aneurysm, nonruptured" | mimicsql_data |
CREATE TABLE table_29741 (
"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.
-- In how... | SELECT COUNT("Score") FROM table_29741 WHERE "High assists" = 'Terrence Williams (9)' | wikisql |
CREATE TABLE table_name_5 (
ends VARCHAR,
transfer_fee VARCHAR,
moving_from VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the ends with a free transfer fee and was moved from middlesbrough?
| SELECT ends FROM table_name_5 WHERE transfer_fee = "free" AND moving_from = "middlesbrough" | sql_create_context |
CREATE TABLE gyb (
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 SUM(mzb.MED_CLINIC_ID) FROM mzb WHERE mzb.PERSON_SEX = '郑子珍' | css |
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 PendingFlags (
Id number,
FlagTypeId ... | SELECT DATEADD(MONTH, DATEDIFF(MONTH, 0, CreationDate), 0) AS Month, COUNT(*) FROM Votes WHERE VoteTypeId = 2 AND CreationDate >= '2016-01-01' GROUP BY DATEADD(MONTH, DATEDIFF(MONTH, 0, CreationDate), 0) UNION ALL SELECT NULL, 0 ORDER BY Month | sede |
CREATE TABLE table_44974 (
"Player" text,
"League" real,
"Title Playoff" real,
"Super Cup" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of Super Cup, when Title Playoff is '0', when Total is greater than 9, a... | SELECT COUNT("Super Cup") FROM table_44974 WHERE "Title Playoff" = '0' AND "Total" > '9' AND "League" < '11' | wikisql |
CREATE TABLE table_204_974 (
id number,
"season" number,
"level" text,
"division" text,
"section" text,
"administration" text,
"position" text,
"movements" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many consecutive times did the... | SELECT COUNT(*) FROM table_204_974 WHERE "level" = 'tier 4' | squall |
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 lab (
subject_id text,
hadm_id text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "68" AND lab.fluid = "Cerebrospinal Fluid (CSF)" | mimicsql_data |
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password VARCHAR(10),
personal_name VARCHAR(40),
middle_name VARCHAR(40),
family_name VARCHAR(40)
)
CREATE TABLE Student_Course_Enrolment (
registration_... | SELECT course_name, COUNT(*) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name | nvbench |
CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
account_name VARCHAR(50),
other_account_details VARCHAR(255)
)
CREATE TABLE Financial_Transactions (
transaction_id INTEGER,
previous_transaction_id INTEGER,
account_id INTEGER,
card_id INTEGER,
transaction_type VARCHA... | SELECT account_id, COUNT(*) FROM Financial_Transactions GROUP BY account_id | nvbench |
CREATE TABLE table_name_6 (
goals VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many goals did a player from France have?
| SELECT goals FROM table_name_6 WHERE country = "france" | sql_create_context |
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 jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.... | css |
CREATE TABLE customer (
cust_name VARCHAR,
acc_type VARCHAR,
acc_bal VARCHAR,
credit_score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the name, account type, and account balance of the customer who has the highest credit score.
| SELECT cust_name, acc_type, acc_bal FROM customer ORDER BY credit_score DESC LIMIT 1 | 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 WHERE demographic.admission_type = "ELECTIVE" AND demographic.insurance = "Medicare" | mimicsql_data |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE fare (
fare_id int,
from_... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.... | atis |
CREATE TABLE table_name_15 (
silver INTEGER,
gold VARCHAR,
rank VARCHAR,
bronze VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest silver that has 1 for the bronze, 1 as the total, 17 as the rank, with a gold less th... | SELECT MIN(silver) FROM table_name_15 WHERE bronze = 1 AND total = 1 AND rank = "17" AND gold < 0 | sql_create_context |
CREATE TABLE table_name_65 (
air_date VARCHAR,
viewers VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did the episode air that had 7.3 viewers?
| SELECT air_date FROM table_name_65 WHERE viewers = 7.3 | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "WIDOWED" AND prescriptions.route = "BOTH EYES" | 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_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '84027429' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED... | css |
CREATE TABLE table_name_70 (
record VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record of the game on 13 May?
| SELECT record FROM table_name_70 WHERE date = "13 may" | sql_create_context |
CREATE TABLE table_name_75 (
gross_tonnage INTEGER,
ship VARCHAR,
material VARCHAR,
date_commissioned VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the sum of gross tonnage for wood on date more tahn 1846 for comissioned and ship of esk
| SELECT SUM(gross_tonnage) FROM table_name_75 WHERE material = "wood" AND date_commissioned > 1846 AND ship = "esk" | sql_create_context |
CREATE TABLE table_41688 (
"Club" text,
"Played" 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 following questions f... | SELECT "Points" FROM table_41688 WHERE "Club" = 'clwb rygbi cymru caerdydd rfc' | wikisql |
CREATE TABLE table_203_9 (
id number,
"state" text,
"last execution date" text,
"name" text,
"crime" text,
"method" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- arizona last put someone to death in october 2013 what state had the closest previ... | SELECT "state" FROM table_203_9 WHERE "last execution date" < (SELECT "last execution date" FROM table_203_9 WHERE "state" = 'arizona') ORDER BY "last execution date" DESC LIMIT 1 | squall |
CREATE TABLE table_18035 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team was the opponent at Mile High Stadium?
| SELECT "Opponent" FROM table_18035 WHERE "Game site" = 'Mile High Stadium' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE diagnosis (
diagnosisid number,
... | SELECT t3.labname FROM (SELECT t2.labname, 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 = 'congestive heart failure - diastolic') AS t1 JOIN (S... | eicu |
CREATE TABLE table_186468_1 (
ka_band VARCHAR,
v_band VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When 4 is the v-band what is the overall amount of ka-bands?
| SELECT COUNT(ka_band) FROM table_186468_1 WHERE v_band = "4" | sql_create_context |
CREATE TABLE FlagTypes (
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 TABLE Rev... | SELECT p.Id AS "post_id", CONCAT('stackoverflow.com/q/', p.Id) AS "so_link", p.Title AS "question_title" FROM Posts AS p JOIN PostHistory AS ph ON ph.PostId = p.Id WHERE p.PostTypeId = 1 AND ph.PostHistoryTypeId = 10 AND ph.Comment = 103 AND p.AnswerCount <= 5 | sede |
CREATE TABLE table_71774 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent at the game when the record was 54-58?
| SELECT "Opponent" FROM table_71774 WHERE "Record" = '54-58' | wikisql |
CREATE TABLE table_42466 (
"Player" text,
"Nationality" text,
"Position" text,
"Years in Orlando" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the School/Club Team with a nationality of United States for Arron Affl... | SELECT "School/Club Team" FROM table_42466 WHERE "Nationality" = 'united states' AND "Player" = 'arron afflalo' | wikisql |
CREATE TABLE table_12547903_3 (
branding VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the branding in Dagupan?
| SELECT branding FROM table_12547903_3 WHERE location = "Dagupan" | 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 WHERE diagnoses.short_title = "Chordae tendinae rupture" | mimicsql_data |
CREATE TABLE table_34251 (
"interval name" text,
"size (steps)" real,
"size (cents)" real,
"just ratio" text,
"just (cents)" real,
"error" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- size (steps) of 15, and a just (cents) larger than 435.08 i... | SELECT MAX("size (cents)") FROM table_34251 WHERE "size (steps)" = '15' AND "just (cents)" > '435.08' | wikisql |
CREATE TABLE table_915 (
"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 followi... | SELECT "Points" FROM table_915 WHERE "Try bonus" = '10' | wikisql |
CREATE TABLE table_name_80 (
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is north melbourne's score as an away side?
| SELECT away_team AS score FROM table_name_80 WHERE away_team = "north melbourne" | sql_create_context |
CREATE TABLE table_1708610_3 (
march_27_29 VARCHAR,
november_3 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the march 27-29 for november 3 being 133
| SELECT march_27_29 FROM table_1708610_3 WHERE november_3 = "133" | sql_create_context |
CREATE TABLE Skills_Required_To_Fix (
part_fault_id INTEGER,
skill_id INTEGER
)
CREATE TABLE Fault_Log_Parts (
fault_log_entry_id INTEGER,
part_fault_id INTEGER,
fault_status VARCHAR(10)
)
CREATE TABLE Assets (
asset_id INTEGER,
maintenance_contract_id INTEGER,
supplier_company_id INTE... | SELECT part_name, COUNT(*) FROM Parts AS T1 JOIN Asset_Parts AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_name | nvbench |
CREATE TABLE table_41291 (
"Team" text,
"City" text,
"State" text,
"Home venue" text,
"Capacity" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Team with a venue of Anyang Stadium?
| SELECT "Team" FROM table_41291 WHERE "Home venue" = 'anyang stadium' | wikisql |
CREATE TABLE table_204_496 (
id number,
"pos" number,
"no" number,
"driver" text,
"team" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the number of laps da... | SELECT "laps" FROM table_204_496 WHERE "driver" = 'dan clarke' | squall |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId ... | SELECT * FROM Posts WHERE Id > 1 | sede |
CREATE TABLE table_name_28 (
heat INTEGER,
mark VARCHAR,
lane VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average heat that has 52.83 sb mark and lane less than 4?
| SELECT AVG(heat) FROM table_name_28 WHERE mark = "52.83 sb" AND lane < 4 | sql_create_context |
CREATE TABLE table_71572 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score against andrei pavel?
| SELECT "Score" FROM table_71572 WHERE "Opponent" = 'andrei pavel' | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.icd9_code = "E9394" | mimicsql_data |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(... | SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID | nvbench |
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int
)
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... | SELECT Year, COUNT(Year) FROM exhibition ORDER BY COUNT(Year) | nvbench |
CREATE TABLE table_name_39 (
chassis VARCHAR,
year VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What chassis had fewer than 0 points in a year before 1954?
| SELECT chassis FROM table_name_39 WHERE year < 1954 AND points = 0 | sql_create_context |
CREATE TABLE table_203_306 (
id number,
"no." number,
"title" text,
"directed by" text,
"written by" text,
"original air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many of the episodes did not air in the u.s. ?
| SELECT COUNT("title") FROM table_203_306 WHERE "original air date" IS NULL | squall |
CREATE TABLE dorm_amenity (
amenid number,
amenity_name text
)
CREATE TABLE dorm (
dormid number,
dorm_name text,
student_capacity number,
gender text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
... | SELECT COUNT(DISTINCT dormid) FROM has_amenity | spider |
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Reviewer (
rID int,
name text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For d... | SELECT year, COUNT(year) FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title <> T2.title GROUP BY title ORDER BY year | nvbench |
CREATE TABLE table_name_15 (
_number_of_cosponsors VARCHAR,
date_introduced VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many cosponsors have a Date introduced of may 22, 2008?
| SELECT COUNT(_number_of_cosponsors) FROM table_name_15 WHERE date_introduced = "may 22, 2008" | sql_create_context |
CREATE TABLE Participates_in (
stuid INTEGER,
actid INTEGER
)
CREATE TABLE Faculty_Participates_in (
FacID INTEGER,
actid INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
c... | SELECT Rank, COUNT(*) FROM Faculty GROUP BY Sex, Rank | nvbench |
CREATE TABLE table_204_409 (
id number,
"date" text,
"race name" text,
"location" text,
"uci rating" number,
"winner" text,
"team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the name of the last race ?
| SELECT "race name" FROM table_204_409 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE table_27935 (
"meas. num." real,
"passed" text,
"YES votes" real,
"NO votes" real,
"% YES" text,
"Const. Amd.?" text,
"type" text,
"description" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many figures are there for N... | SELECT COUNT("NO votes") FROM table_27935 WHERE "description" = 'Forest Rehabilitation Debt Limit Amendment' | wikisql |
CREATE TABLE table_name_85 (
winner VARCHAR,
stage VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won at stage 22?
| SELECT winner FROM table_name_85 WHERE stage = "22" | sql_create_context |
CREATE TABLE table_71523 (
"Rank" real,
"Stadium" text,
"Capacity" real,
"Club" text,
"Region" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What club does the stadium stc krymteplitsia belong to?
| SELECT "Club" FROM table_71523 WHERE "Stadium" = 'stc krymteplitsia' | wikisql |
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
... | SELECT DISTINCT airline_code FROM airline WHERE airline_code = 'DL' | atis |
CREATE TABLE table_9884 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score in the final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the partner where the scor... | SELECT "Partner" FROM table_9884 WHERE "Year" > '2007' AND "Score in the final" = '2–6, 3–6' | wikisql |
CREATE TABLE table_30551 (
"#" real,
"Player" text,
"Country" text,
"Points" real,
"Reset points" real,
"Events" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the place where the person is luke donald
| SELECT "Country" FROM table_30551 WHERE "Player" = 'Luke Donald' | wikisql |
CREATE TABLE table_73197 (
"LMS No." real,
"WD No." real,
"Builder" text,
"Serial No." real,
"Date built" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the builder for serial number being 377
| SELECT "Builder" FROM table_73197 WHERE "Serial No." = '377' | wikisql |
CREATE TABLE table_204_969 (
id number,
"composer" text,
"title" text,
"genre" text,
"date" number,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which composer published first granville bantock or emil petrovics ?
| SELECT "composer" FROM table_204_969 WHERE "composer" IN ('granville bantock', 'emil petrovics') ORDER BY "date" LIMIT 1 | squall |
CREATE TABLE student (
id text,
name text,
dept_name text,
tot_cred number
)
CREATE TABLE course (
course_id text,
title text,
dept_name text,
credits number
)
CREATE TABLE instructor (
id text,
name text,
dept_name text,
salary number
)
CREATE TABLE department (
d... | SELECT dept_name, AVG(salary) FROM instructor GROUP BY dept_name HAVING AVG(salary) > 42000 | spider |
CREATE TABLE table_17355716_10 (
high_rebounds VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the high rebounds stat on april 11
| SELECT high_rebounds FROM table_17355716_10 WHERE date = "April 11" | sql_create_context |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime ... | SELECT (SELECT chartevents.valuenum 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 = 4368) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemi... | mimic_iii |
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 hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '06717706' AND hz_info.YLJGDM = '0879465' AND zyjzjlb.CYKSMC LIKE '%运动%' | css |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | SELECT EMAIL, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMAIL DESC | nvbench |
CREATE TABLE table_204_731 (
id number,
"rank" number,
"athlete" text,
"shooting\nscore (pts)" text,
"fencing\nvictories (pts)" text,
"swimming\ntime (pts)" text,
"riding\npenalties (pts)" text,
"running\ntime (pts)" text,
"total" number
)
-- Using valid SQLite, answer the followin... | SELECT COUNT("athlete") FROM table_204_731 WHERE "riding\npenalties (pts)" > 1100 | squall |
CREATE TABLE table_7782 (
"Year" real,
"Tournament" text,
"Surface" text,
"Round" text,
"Winner" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Winner, when Year is 2013?
| SELECT "Winner" FROM table_7782 WHERE "Year" = '2013' | wikisql |
CREATE TABLE student (
dept_code VARCHAR,
stu_gpa INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the max, average, and minimum gpa of all students in each department.
| SELECT MAX(stu_gpa), AVG(stu_gpa), MIN(stu_gpa), dept_code FROM student GROUP BY dept_code | sql_create_context |
CREATE TABLE table_name_95 (
lineup VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which lineup has a Location of usa virginia beach?
| SELECT lineup FROM table_name_95 WHERE location = "usa virginia beach" | sql_create_context |
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.admission_type = "URGENT" AND diagnoses.icd9_code = "42840" | 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 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2156" AND prescriptions.drug = "Fentanyl Citrate" | mimicsql_data |
CREATE TABLE gyb (
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '54049149' AND qtb.MED_SER_ORG_NO = '1343392' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '54049149' AND gyb.MED_SER_ORG_NO = '1343... | css |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.