instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_62 (
voter_turnout INTEGER,
byut VARCHAR,
ou_psd VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lower turnout that has a byut of 50.7 and an ou psd smaller than 36.8?
| SELECT MIN(voter_turnout) FROM table_name_62 WHERE byut = 50.7 AND ou_psd < 36.8 | sql_create_context |
CREATE TABLE table_78969 (
"Constituency number" text,
"Name" text,
"Reserved for ( SC / ST /None)" text,
"District" text,
"Number of electorates (2009)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Number of electorates (2009) has a Constit... | SELECT AVG("Number of electorates (2009)") FROM table_78969 WHERE "Constituency number" = '46' | wikisql |
CREATE TABLE region (
Region_id int,
Region_code text,
Region_name text
)
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_city_affected real
)
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Nu... | SELECT Dates_active, Number_Deaths FROM storm WHERE Number_Deaths >= 1 ORDER BY Number_Deaths DESC | nvbench |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Ath ext ntv at w claudct" | mimicsql_data |
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM tex... | SELECT mzjzjlb.JZLSH 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 = '40108491' AND NOT mzjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ <= '2011-09-11') | css |
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_M... | SELECT RYTJDM, RYTJMC FROM zyjzjlb WHERE JZLSH = '39851843443' | css |
CREATE TABLE table_30895 (
"Month Sequence" real,
"Numbered Month" text,
"Month Name" text,
"Regular Year" text,
"Defective Year" real,
"Excessive Year" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the defective year for the eighth num... | SELECT "Defective Year" FROM table_30895 WHERE "Numbered Month" = 'Eighth' | 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 * FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '水天干' AND hz_info.YLJGDM = '7539997' AND zyjzjlb.JZKSMC LIKE '%耳鼻喉科%' | css |
CREATE TABLE table_name_51 (
fcc_info VARCHAR,
call_sign VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the FCC info for call sign of k208eq
| SELECT fcc_info FROM table_name_51 WHERE call_sign = "k208eq" | sql_create_context |
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 t_kc21 WHERE t_kc21.PERSON_NM = '秦鹏赋' AND t_kc21.IN_HOSP_DATE BETWEEN '2003-08-17' AND '2014-05-16' AND t_kc21.CLINIC_TYPE = '住院' | css |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.religion = "PROTESTANT QUAKER" AND demographic.admityear < "2179" | mimicsql_data |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetake... | SELECT diagnosis.diagnosisname FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '008-10139' AND NOT patient.hospitaldischargetime IS NULL ORDER BY... | eicu |
CREATE TABLE Financial_transactions (
account_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many transaction does each account have? Show the number and account id.
| SELECT COUNT(*), account_id FROM Financial_transactions | sql_create_context |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '孔婉丽' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT >= 1836.29) | css |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOI... | eicu |
CREATE TABLE table_69383 (
"Name" text,
"League" real,
"FA Cup" real,
"League Cup" real,
"Other" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of the value 'League Cup', when the Total is less than 1, and when the ... | SELECT SUM("League Cup") FROM table_69383 WHERE "Total" < '1' AND "League" < '0' | 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 t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '施舒兰' AND NOT t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 5222.71) | css |
CREATE TABLE table_9913 (
"Rank" text,
"Name" text,
"Sprint Points" text,
"Extra Laps" text,
"Total Points" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is at rank 13 with 23 total points?
| SELECT "Name" FROM table_9913 WHERE "Total Points" = '23' AND "Rank" = '13' | wikisql |
CREATE TABLE table_78207 (
"Date(s) conducted" text,
"Polling organisation/client" text,
"Cons" text,
"Plaid Cymru" text,
"Lib Dem" text,
"Others" text,
"Lead" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want the plaid cymru for Polling... | SELECT "Plaid Cymru" FROM table_78207 WHERE "Polling organisation/client" = 'yougov/itv wales' AND "Date(s) conducted" = '4 may 2011' | wikisql |
CREATE TABLE table_1881642_1 (
date_released VARCHAR,
green_communist VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date did the Green-Communists receive 5.7%?
| SELECT date_released FROM table_1881642_1 WHERE green_communist = "5.7%" | sql_create_context |
CREATE TABLE table_58637 (
"2 twee" text,
"3 dree" text,
"4 vea" text,
"5 fiew" text,
"6 sas" text,
"7 s\u00e4wen" text,
"8 acht" text,
"9 n\u00e4ajen" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is 7 s wen if 3 dree is 3d dredda... | SELECT "7 s\u00e4wen" FROM table_58637 WHERE "3 dree" = '3d dredda' | wikisql |
CREATE TABLE Documents_to_be_destroyed (
Destruction_Authorised_by_Employee_ID VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the id of each employee and the number of document destruction authorised by that employee.
| SELECT Destruction_Authorised_by_Employee_ID, COUNT(*) FROM Documents_to_be_destroyed GROUP BY Destruction_Authorised_by_Employee_ID | sql_create_context |
CREATE TABLE table_name_27 (
school VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What school has the Kansas City Royals for a team?
| SELECT school FROM table_name_27 WHERE team = "kansas city royals" | sql_create_context |
CREATE TABLE table_27865 (
"Settlement" text,
"Cyrillic Name Other Names" text,
"Type" text,
"Population (2011)" real,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the larg... | SELECT "Largest ethnic group (2002)" FROM table_27865 WHERE "Cyrillic Name Other Names" = 'Мале Пијаце (Hungarian: Kispiac)' | wikisql |
CREATE TABLE table_name_61 (
description VARCHAR,
livery VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What description does Livery of ews have?
| SELECT description FROM table_name_61 WHERE livery = "ews" | sql_create_context |
CREATE TABLE txmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | SELECT txmzjzjlb.JZKSBM, txmzjzjlb.JZKSMC FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '78504976219' UNION SELECT ftxmzjzjlb.JZKSBM, ftxmzjzjlb.JZKSMC FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZLSH = '78504976219' | css |
CREATE TABLE table_name_2 (
gold INTEGER,
total INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total gold with a total less than 1?
| SELECT SUM(gold) FROM table_name_2 WHERE total < 1 | sql_create_context |
CREATE TABLE table_name_51 (
channel VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the channel with a 03:40 time?
| SELECT channel FROM table_name_51 WHERE time = "03:40" | sql_create_context |
CREATE TABLE table_name_2 (
track VARCHAR,
city VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the track in Holland?
| SELECT track FROM table_name_2 WHERE city = "holland" | sql_create_context |
CREATE TABLE table_name_71 (
wheels INTEGER,
type VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What average wheels has accounting as the type, with IBM Collection as the location?
| SELECT AVG(wheels) FROM table_name_71 WHERE type = "accounting" AND location = "ibm collection" | sql_create_context |
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 diagnoses.short_title, diagnoses.long_title FROM diagnoses WHERE diagnoses.icd9_code = "E8781" | mimicsql_data |
CREATE TABLE table_name_32 (
authority VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Whakamaru school's authority?
| SELECT authority FROM table_name_32 WHERE name = "whakamaru school" | sql_create_context |
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
Date_of_Birth text
)
CREATE TABLE entrepreneur (
Entrepreneur_ID int,
People_ID int,
Company text,
Money_Requested real,
Investor text
)
-- Using valid SQLite, answer the following questions for the tabl... | SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor | nvbench |
CREATE TABLE table_49892 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record of the game with the toronto huskies as the opponent?
| SELECT "Record" FROM table_49892 WHERE "Opponent" = 'toronto huskies' | wikisql |
CREATE TABLE table_16085 (
"Year" real,
"Games" real,
"Games started" real,
"Completions" real,
"Attempts" real,
"Completion %" text,
"Yards" real,
"Yards/Attempt" text,
"Touchdowns" real,
"Interceptions" real,
"Rating" text
)
-- Using valid SQLite, answer the following que... | SELECT MIN("Touchdowns") FROM table_16085 WHERE "Completion %" = '56.0' | wikisql |
CREATE TABLE district (
district_id number,
district_name text,
headquartered_city text,
city_population number,
city_area number
)
CREATE TABLE store_district (
store_id number,
district_id number
)
CREATE TABLE store (
store_id number,
store_name text,
type text,
area_siz... | SELECT AVG(pages_per_minute_color) FROM product | spider |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE patient (
uniquepid text,
patientheal... | SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-13494')) AND lab.labname = 'total co2' AND DATETIME(lab.labresulttime) <= DATETIME(... | eicu |
CREATE TABLE table_5838 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Save" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which score has a save of Smith (25)?
| SELECT "Score" FROM table_5838 WHERE "Save" = 'smith (25)' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
... | SELECT SUM(outputevents.value) 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 = 7519)) AND DATETIME(outputevents.charttime) <= DATETIME(CURRENT_TIME(), '-1160 day') | mimic_iii |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | SELECT Comments.Id AS "comment_link", Posts.Score AS "post_score", Comments.Score AS "comment_score", Comments.Score / Posts.Score AS "score_ratio" FROM Comments JOIN Posts ON Comments.PostId = Posts.Id WHERE Posts.Score != 0 AND Posts.PostTypeId = 1 ORDER BY 'score_ratio' DESC LIMIT 100 | sede |
CREATE TABLE table_47727 (
"Date" text,
"Home" text,
"Score" text,
"Away" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Home has an Attendance larger than 1,858?
| SELECT "Home" FROM table_47727 WHERE "Attendance" > '1,858' | wikisql |
CREATE TABLE table_name_35 (
mult VARCHAR,
release_price___usd__ VARCHAR,
sspec_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the multiplier of the processor with sSpec number of SLGPR(C0) and a release price of N/A?
| SELECT mult FROM table_name_35 WHERE release_price___usd__ = "n/a" AND sspec_number = "slgpr(c0)" | sql_create_context |
CREATE TABLE table_23489 (
"Season" real,
"Network" text,
"Host" text,
"Contestants" real,
"Winner" text,
"Destination" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the destination of the season won by Anwar Syed?
| SELECT "Destination" FROM table_23489 WHERE "Winner" = 'Anwar Syed' | wikisql |
CREATE TABLE table_67514 (
"Venue" text,
"City" text,
"State" text,
"Tickets Sold / Available" text,
"Gross Revenue (1982)" text,
"Gross Revenue (2011)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the gross revenue in 2011 for MO?
| SELECT "Gross Revenue (2011)" FROM table_67514 WHERE "State" = 'mo' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TA... | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'urinary sodium')) GROUP BY cost.patienthealthsystemstayid) AS t1 | eicu |
CREATE TABLE table_204_293 (
id number,
"district" number,
"name" text,
"party" text,
"district office" text,
"first elected" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- j.p morrell was elected in 2008 - the same as which other louisiana st... | SELECT "name" FROM table_204_293 WHERE "name" <> 'j.p. morrell' AND "first elected" = 2008 | squall |
CREATE TABLE table_57958 (
"Season" text,
"Level" text,
"Goals" text,
"Points" real,
"Domestic Cup" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which level is quarterfinals domestic cup?
| SELECT "Level" FROM table_57958 WHERE "Domestic Cup" = 'quarterfinals' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeri... | SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-68848')) AND lab.labname = 'creatinine' AND lab.labresulttime = '2102-08-01... | eicu |
CREATE TABLE table_name_75 (
award_ceremony VARCHAR,
result VARCHAR,
category VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Award Ceremony has a Result of nominated, and a Category of best revival of a musical?
| SELECT award_ceremony FROM table_name_75 WHERE result = "nominated" AND category = "best revival of a musical" | sql_create_context |
CREATE TABLE table_55903 (
"Runs" text,
"Wicket" text,
"Partnerships" text,
"Versus" text,
"Venue" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the venue where 153 runs were scored?
| SELECT "Venue" FROM table_55903 WHERE "Runs" = '153' | wikisql |
CREATE TABLE table_28437 (
"Sd" real,
"Rk" real,
"Player" text,
"Points" real,
"Points defending" real,
"Points won" real,
"New points" real,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many time was points 6675?
| SELECT COUNT("Points won") FROM table_28437 WHERE "Points" = '6675' | wikisql |
CREATE TABLE table_name_11 (
lead VARCHAR,
skip VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the lead when Jamie Meikle was the skip?
| SELECT lead FROM table_name_11 WHERE skip = "jamie meikle" | sql_create_context |
CREATE TABLE table_name_56 (
opponent VARCHAR,
game VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent at the game later than game 22 when the record was 17-10-4?
| SELECT opponent FROM table_name_56 WHERE game > 22 AND record = "17-10-4" | sql_create_context |
CREATE TABLE table_55989 (
"School's name" text,
"School's namesake" text,
"Year opened" text,
"Principal" text,
"Mascot" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What principal has a school mascot of the patriots?
| SELECT "Principal" FROM table_55989 WHERE "Mascot" = 'patriots' | 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... | WITH Edits AS (SELECT RANK() OVER (ORDER BY COUNT(*) DESC) AS Rank, UserId AS UserID, COUNT(*) AS NumRevisions FROM PostHistory WHERE PostHistoryTypeId BETWEEN 4 AND 9 GROUP BY UserId) SELECT Rank, UserId, NumRevisions FROM Edits WHERE Rank < 100 OR UserId = '##UserID##' ORDER BY Rank | sede |
CREATE TABLE table_27132 (
"Week" real,
"Date" text,
"Kickoff" text,
"Opponent" text,
"Final score" text,
"Team record" text,
"Game site" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What week did the Galaxy play the... | SELECT "Week" FROM table_27132 WHERE "Opponent" = 'Amsterdam Admirals' | wikisql |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
... | SELECT Id, PostId, CreationDate, UserId FROM Comments | sede |
CREATE TABLE customer_orders (
order_id number,
customer_id number,
order_status_code text,
order_date time
)
CREATE TABLE suppliers (
supplier_id number,
supplier_name text,
supplier_phone text
)
CREATE TABLE departments (
department_id number,
dept_store_id number,
department... | SELECT T1.staff_id, T1.staff_gender FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = "Department Manager" | spider |
CREATE TABLE table_44627 (
"Poll Source" text,
"Sample Size" real,
"Margin of Error" real,
"Date" text,
"Democrat" text,
"Republican" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date that the polls were going on at quinnipiac when... | SELECT "Date" FROM table_44627 WHERE "Republican" = 'john mccain' AND "Poll Source" = 'quinnipiac' AND "Democrat" = 'barack obama' AND "Sample Size" > '1427' | wikisql |
CREATE TABLE table_43166 (
"Rank" real,
"Name" text,
"S-League" text,
"Singapore Cup" text,
"Singapore League Cup" text,
"Total" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Singapore League Cup when rank is more than 4, and the S-... | SELECT "Singapore League Cup" FROM table_43166 WHERE "Rank" > '4' AND "S-League" = '2 (12)' | wikisql |
CREATE TABLE table_69097 (
"Outcome" text,
"Date" text,
"Surface" text,
"Partnering" text,
"Opponents in the final" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the outcome on May 25, 2009?
| SELECT "Outcome" FROM table_69097 WHERE "Date" = 'may 25, 2009' | wikisql |
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 WHERE demographic.language = "PORT" AND demographic.age < "64" | mimicsql_data |
CREATE TABLE table_204_42 (
id number,
"season" number,
"level" text,
"division" text,
"section" text,
"position" text,
"movements" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many times did the team finish in 2nd position ?
| SELECT COUNT(*) FROM table_204_42 WHERE "position" = 2 | squall |
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 jybgb_jyjgzbb (
JYZBLSH number,
... | SELECT COUNT(*) FROM jybgb WHERE jybgb.JZLSH = '91340380252' | css |
CREATE TABLE table_8442 (
"Name" text,
"Country" text,
"Role" text,
"Period" text,
"Teams" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which name is on the of fc s te olympique de marseille?
| SELECT "Name" FROM table_8442 WHERE "Teams" = 'fc sète olympique de marseille' | wikisql |
CREATE TABLE table_17625 (
"Municipality" text,
"Population" real,
"Police officers" real,
"Residents per officer" real,
"Total costs (2005)" text,
"Cost per capita" text,
"Case burden" real,
"Crime rate per 1,000 people" real,
"Police force" text
)
-- Using valid SQLite, answer th... | SELECT "Police force" FROM table_17625 WHERE "Population" = '17000' | wikisql |
CREATE TABLE table_29196086_4 (
original_air_date VARCHAR,
written_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- on how many days did the episode written by harold hayes jr. & craig s. phillips originally air
| SELECT COUNT(original_air_date) FROM table_29196086_4 WHERE written_by = "Harold Hayes Jr. & Craig S. Phillips" | sql_create_context |
CREATE TABLE table_name_58 (
attendance INTEGER,
time VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the lowest attendance for the game that had a time of 3:31 and was before game 7?
| SELECT MIN(attendance) FROM table_name_58 WHERE time = "3:31" AND game < 7 | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "7454" AND lab."CATEGORY" = "Chemistry" | mimicsql_data |
CREATE TABLE table_10427 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of laps where time/retired is +2 laps and the grid number is bigger than 1... | SELECT SUM("Laps") FROM table_10427 WHERE "Time/Retired" = '+2 laps' AND "Grid" > '18' | wikisql |
CREATE TABLE table_20570 (
"Year ended" text,
"Revenue (S$m)" text,
"Expenditure (S$m)" text,
"Operating profit (S$m)" text,
"Profit before taxation (S$m)" text,
"Profit attributable to equity holders (S$m)" text,
"EPS after tax \u2013 diluted (cents)" text
)
-- Using valid SQLite, answer ... | SELECT "Operating profit (S$m)" FROM table_20570 WHERE "Expenditure (S$m)" = '12,127.8' | wikisql |
CREATE TABLE table_27627 (
"Letters" text,
"Organization" text,
"Nickname" text,
"Founding Date" text,
"Founding University" text,
"Type" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what type of organization is sigma phi omega?
| SELECT "Type" FROM table_27627 WHERE "Organization" = 'Sigma Phi Omega' | wikisql |
CREATE TABLE table_49216 (
"Year" real,
"Team" text,
"Co-Drivers" text,
"Class" text,
"Laps" real,
"Pos." text,
"Class Pos." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the year of the finish with the class pos of 6th and laps sm... | SELECT SUM("Year") FROM table_49216 WHERE "Class Pos." = '6th' AND "Laps" < '317' | 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 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.ZZYSGH = '87598615' AND mzjzjlb.JZKSRQ BETWEEN '2005-03-01' AND '2011-02-19' | css |
CREATE TABLE table_name_16 (
name_of_deity VARCHAR,
name_of_the_river VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the diety for the river of sone?
| SELECT name_of_deity FROM table_name_16 WHERE name_of_the_river = "sone" | sql_create_context |
CREATE TABLE fgwyjzb (
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 gwyjzb.MED_SER_ORG_NO FROM gwyjzb WHERE gwyjzb.PERSON_ID = '29514886' GROUP BY gwyjzb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC UNION SELECT fgwyjzb.MED_SER_ORG_NO FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '29514886' GROUP BY fgwyjzb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC | css |
CREATE TABLE table_name_26 (
score_final INTEGER,
rank_final VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which the lowest Score-Fina has a Rank-Final of 7 and a Year larger than 2009?
| SELECT MIN(score_final) FROM table_name_26 WHERE rank_final = 7 AND year > 2009 | sql_create_context |
CREATE TABLE table_name_16 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the 2005 with 2007 of sf
| SELECT 2005 FROM table_name_16 WHERE 2007 = "sf" | sql_create_context |
CREATE TABLE person (
name text,
age number,
city text,
gender text,
job text
)
CREATE TABLE personfriend (
name text,
friend text,
year number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is average age for different job title?
| SELECT AVG(age), job FROM person GROUP BY job | spider |
CREATE TABLE campuses (
campus VARCHAR,
LOCATION VARCHAR,
county VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the name of the campuses that is in Northridge, Los Angeles or in San Francisco, San Francisco.
| SELECT campus FROM campuses WHERE LOCATION = "Northridge" AND county = "Los Angeles" UNION SELECT campus FROM campuses WHERE LOCATION = "San Francisco" AND county = "San Francisco" | sql_create_context |
CREATE TABLE table_name_70 (
entrant VARCHAR,
rounds VARCHAR,
constructor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the entrant in round 16 were Ferrari was the constructor?
| SELECT entrant FROM table_name_70 WHERE rounds = "16" AND constructor = "ferrari" | sql_create_context |
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 jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_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 mzjzj... | css |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_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(25... | SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID DESC | nvbench |
CREATE TABLE table_58131 (
"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 did the away team score when playing agains... | SELECT "Away team score" FROM table_58131 WHERE "Home team" = 'fitzroy' | wikisql |
CREATE TABLE table_name_50 (
date VARCHAR,
discipline VARCHAR,
season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date of Super G in the 2010 season?
| SELECT date FROM table_name_50 WHERE discipline = "super g" AND season = 2010 | sql_create_context |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT microbiologyevents.hadm_id FROM microbiologyevents WHERE microbiologyevents.spec_type_desc = 'peritoneal fluid' AND DATETIME(microbiologyevents.charttime) >= DATETIME(CURRENT_TIME(), '-5 year')) | mimic_iii |
CREATE TABLE table_1213511_6 (
position VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position does Jim Johnston play?
| SELECT position FROM table_1213511_6 WHERE player = "Jim Johnston" | sql_create_context |
CREATE TABLE table_name_76 (
date VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Date has a Score of 6 1, 6 2?
| SELECT date FROM table_name_76 WHERE score = "6–1, 6–2" | sql_create_context |
CREATE TABLE table_18807 (
"Rank by average" real,
"Competition finish" real,
"Couple" text,
"Total" real,
"Number of dances" real,
"Average" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- tell the competitions where the mean is 1
| SELECT "Average" FROM table_18807 WHERE "Number of dances" = '1' | wikisql |
CREATE TABLE table_16946 (
"Date" text,
"Tournament" text,
"Location" text,
"Purse( $ )" real,
"Winner" text,
"Score" text,
"1st Prize( $ )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the location where tournament is raley's senio... | SELECT "Location" FROM table_16946 WHERE "Tournament" = 'Raley''s Senior Gold Rush' | wikisql |
CREATE TABLE table_35759 (
"Date" text,
"Venue" text,
"Opponents" text,
"Score" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Score of 2-1, and a Competition of pl, and a Date of december 22, 2006 had what opponents?
| SELECT "Opponents" FROM table_35759 WHERE "Score" = '2-1' AND "Competition" = 'pl' AND "Date" = 'december 22, 2006' | wikisql |
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.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB W... | css |
CREATE TABLE table_37865 (
"orbit" text,
"center-to-center distance" text,
"altitude above the Earth's surface" text,
"Orbital period" text,
"specific orbital energy" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- altitude above the Earth's surface ... | SELECT "Orbital period" FROM table_37865 WHERE "altitude above the Earth's surface" = '500 to 39,900 km' | wikisql |
CREATE TABLE table_17039232_3 (
replaced_by VARCHAR,
date_of_vacancy VARCHAR,
position_in_table VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the replaced by where date of vacancy is 31 december 2008 where position in table is 1st
| SELECT replaced_by FROM table_17039232_3 WHERE date_of_vacancy = "31 December 2008" AND position_in_table = "1st" | sql_create_context |
CREATE TABLE table_48160 (
"Year" real,
"Winner" text,
"Jockey" text,
"Trainer" text,
"Owner" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Time, when Jockey is John Velazquez, and when Trainer is Todd A. Pletcher?
| SELECT "Time" FROM table_48160 WHERE "Jockey" = 'john velazquez' AND "Trainer" = 'todd a. pletcher' | wikisql |
CREATE TABLE table_11615 (
"Rank" real,
"Movie" text,
"Year" real,
"Studio(s)" text,
"Opening Weekend Net Gross" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the Total number of Opening Weekend Net Gross that occured after the year 2012 wit... | SELECT COUNT("Opening Weekend Net Gross") FROM table_11615 WHERE "Year" > '2012' AND "Rank" = '1' | wikisql |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
va... | 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 = 30614) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents... | mimic_iii |
CREATE TABLE table_875 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who had ... | SELECT "High rebounds" FROM table_875 WHERE "Score" = 'W 111–92 (OT)' | wikisql |
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 jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE locations (
LOCAT... | SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY SUM(DEPARTMENT_ID) | nvbench |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.long_title = "Endoscopic excision or destruction of lesion or tissue of stomach" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.