instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_52253 (
"Race" text,
"Date" text,
"Location" text,
"Pole Position" text,
"Fastest Lap" text,
"Race Winner" text,
"Constructor" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the pole position fo... | SELECT "Pole Position" FROM table_52253 WHERE "Race" = 'belgian grand prix' | 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 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 WHERE demographic.insurance = "Medicare" AND diagnoses.short_title = "Neutropenia NOS" | mimicsql_data |
CREATE TABLE table_55675 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the time/retired with Laps of 47 and driver of ren arnoux
| SELECT "Time/Retired" FROM table_55675 WHERE "Laps" = '47' AND "Driver" = 'rené arnoux' | wikisql |
CREATE TABLE table_31661 (
"Date" text,
"Result" text,
"Opponent" text,
"Method" text,
"Round" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What resulted after 4 rounds with Ed Mahone?
| SELECT "Result" FROM table_31661 WHERE "Round" > '4' AND "Opponent" = 'ed mahone' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid ... | SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-44495')) AND microlab.culturesite = 'sputum, expectorated' AN... | eicu |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.admityear < "2194" | mimicsql_data |
CREATE TABLE table_16422 (
"Location" text,
"Monday" text,
"Tuesday" text,
"Wednesday" text,
"Thursday" text,
"Friday" text,
"Saturday" text,
"Sunday" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the tuesday time with location b... | SELECT "Tuesday" FROM table_16422 WHERE "Location" = 'Millhopper' | wikisql |
CREATE TABLE Transactions_Lots (
transaction_id INTEGER,
lot_id INTEGER
)
CREATE TABLE Lots (
lot_id INTEGER,
investor_id INTEGER,
lot_details VARCHAR(255)
)
CREATE TABLE Investors (
investor_id INTEGER,
Investor_details VARCHAR(255)
)
CREATE TABLE Ref_Transaction_Types (
transaction_... | SELECT lot_details, COUNT(lot_details) FROM Lots GROUP BY lot_details ORDER BY COUNT(lot_details) | nvbench |
CREATE TABLE table_204_641 (
id number,
"pos" text,
"no" number,
"driver" text,
"constructor" 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 difference i... | SELECT ABS((SELECT "points" FROM table_204_641 WHERE "driver" = 'chris amon') - (SELECT "points" FROM table_204_641 WHERE "driver" = 'jim clark')) | squall |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SNF" AND demographic.diagnosis = "UPPER GI BLEED" | mimicsql_data |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
Rejecti... | SELECT COUNT(*) AS Bounty_Num, SUM(Votes.BountyAmount) AS Bounty_Amt, Tags.TagName FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.Id = PostTags.PostId AND Posts.PostTypeId = 1 AND Posts.CreationDate >= DATEADD(day, -30, GETDATE()) AND Posts.CreationDate <= GETDATE() INNER JOIN Votes... | sede |
CREATE TABLE table_1500 (
"Finish" text,
"Race" text,
"Distance" text,
"Jockey" text,
"Time" text,
"Victory Margin (in lengths)" text,
"Runner up" text,
"Track" text,
"Surface" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided abo... | SELECT COUNT("Victory Margin (in lengths)") FROM table_1500 WHERE "Date" = '8/3/08' | wikisql |
CREATE TABLE table_name_60 (
year INTEGER,
chassis VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the earliest year with a mp4-17d chassis and less than 142 points.
| SELECT MIN(year) FROM table_name_60 WHERE chassis = "mp4-17d" AND points < 142 | sql_create_context |
CREATE TABLE table_name_16 (
regular_season_champion_s_ VARCHAR,
record VARCHAR,
tournament_champion VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Regular Season Champion(s) has a Record of 9 0, and a Tournament Champion of north carolina?
| SELECT regular_season_champion_s_ FROM table_name_16 WHERE record = "9–0" AND tournament_champion = "north carolina" | sql_create_context |
CREATE TABLE table_name_44 (
tickets_sold___available VARCHAR,
gross_revenue__2011_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many tickets were sold/available when the gross revenue (2011) was $366,916?
| SELECT tickets_sold___available FROM table_name_44 WHERE gross_revenue__2011_ = "$366,916" | sql_create_context |
CREATE TABLE table_name_74 (
place VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what place has score 66-74-68-73=281
| SELECT place FROM table_name_74 WHERE score = 66 - 74 - 68 - 73 = 281 | sql_create_context |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT T2.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name | nvbench |
CREATE TABLE table_16388478_4 (
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the home team score where the home team is Fremantle?
| SELECT home_team AS score FROM table_16388478_4 WHERE home_team = "Fremantle" | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicatio... | SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, 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 = 'antihyperlipidemic agent - hmg-coa reduc... | eicu |
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 * FROM qtb WHERE qtb.MED_SER_ORG_NO = '2646735' AND qtb.IN_HOSP_DATE BETWEEN '2003-09-28' AND '2008-10-10' AND qtb.PERSON_NM LIKE '冯%' UNION SELECT * FROM gyb WHERE gyb.MED_SER_ORG_NO = '2646735' AND gyb.IN_HOSP_DATE BETWEEN '2003-09-28' AND '2008-10-10' AND gyb.PERSON_NM LIKE '冯%' UNION SELECT * FROM zyb WHERE ... | css |
CREATE TABLE table_name_82 (
acquisition_via VARCHAR,
school_club_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which is the acquisition via that has a school or club team of state?
| SELECT acquisition_via FROM table_name_82 WHERE school_club_team = "state" | sql_create_context |
CREATE TABLE table_40981 (
"Rank" real,
"Name" text,
"Years" text,
"Matches" real,
"Goals" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Rank for Viktors Dobrecovs with less than 325 Matches?
| SELECT AVG("Rank") FROM table_40981 WHERE "Name" = 'viktors dobrecovs' AND "Matches" < '325' | wikisql |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total... | SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'department0' AND course.number BETWEEN 200 AND 200 + 100 AND semester.semester IN ('SP', 'SU', 'SS') AND semester.semester_i... | advising |
CREATE TABLE table_47383 (
"Name" text,
"Born-Died" text,
"Term start" text,
"Term end" text,
"Political Party" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Term Start date of the Progressive Party Prime Minister?
| SELECT "Term start" FROM table_47383 WHERE "Political Party" = 'progressive party' | wikisql |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | SELECT p.Id AS "post_link", p.CreationDate FROM Comments AS c JOIN Posts AS p ON c.PostId = p.Id JOIN PostTags AS pt ON pt.PostId = p.Id JOIN Tags AS t ON t.Id = pt.TagId WHERE c.Text LIKE '%possible duplicate%' AND p.ClosedDate IS NULL AND p.PostTypeId = 1 AND t.TagName = @Tag ORDER BY p.Id | sede |
CREATE TABLE table_66073 (
"Period" text,
"Internet Explorer" text,
"Firefox" text,
"Chrome" text,
"Safari" text,
"Opera" text,
"Other Mozilla" text,
"Mobile" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What percentage of users were u... | SELECT "Mobile" FROM table_66073 WHERE "Chrome" = '9.00%' | wikisql |
CREATE TABLE table_66747 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Time" text,
"Att." real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent with the time 3:59?
| SELECT "Opponent" FROM table_66747 WHERE "Time" = '3:59' | wikisql |
CREATE TABLE table_73724 (
"Stage" real,
"Winner" text,
"General Classification" text,
"Youth Classification" text,
"Mountains Classification" text,
"Sprint Classification" text,
"Most Courageous" text,
"Team Classification" text
)
-- Using valid SQLite, answer the following questions ... | SELECT "Team Classification" FROM table_73724 WHERE "General Classification" = 'Brett Lancaster' | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "79" AND lab.fluid = "Urine" | mimicsql_data |
CREATE TABLE table_42497 (
"Year" real,
"Winner" text,
"School" text,
"Position" text,
"Points" text,
"% of Points Possible" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the year of the winner from the army school, plays the halfback p... | SELECT SUM("Year") FROM table_42497 WHERE "School" = 'army' AND "Position" = 'halfback' AND "% of Points Possible" = '39.01%' | wikisql |
CREATE TABLE table_name_94 (
romaji_title VARCHAR,
japanese_title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which romaji title, has Japanese title of 3?
| SELECT romaji_title FROM table_name_94 WHERE japanese_title = "菊次郎とさき 3" | sql_create_context |
CREATE TABLE table_49456 (
"Year" real,
"Album" text,
"Artist" text,
"Song" text,
"Note" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which artist was 2003?
| SELECT "Artist" FROM table_49456 WHERE "Year" = '2003' | wikisql |
CREATE TABLE table_36337 (
"ISSN" text,
"Language" text,
"Country" text,
"Frequency" text,
"Publication range" text,
"Status" text,
"Document Type" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the language for a journal that has a ... | SELECT "Language" FROM table_36337 WHERE "Frequency" = '3 times per year' AND "ISSN" = '1136-7385' | wikisql |
CREATE TABLE table_name_14 (
tournament VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the tournament on august 17, 2008?
| SELECT tournament FROM table_name_14 WHERE date = "august 17, 2008" | sql_create_context |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
U... | SELECT Q.Id AS QId, Q.Title AS QTitle, Q.Body AS QBody, G.Id AS GId, G.Body AS GBody, Q.Score AS QScore, G.Score AS GScore, Q.ViewCount AS QViewCount, G.ViewCount AS GViewCount, Q.Tags AS QTags, G.Title AS GTitle FROM Posts AS G, (SELECT * FROM Posts WHERE ParentId IS NULL AND AnswerCount >= 5) AS Q WHERE G.ParentId = ... | sede |
CREATE TABLE table_25549 (
"Year" real,
"Dates" text,
"Champion" text,
"Country" text,
"Score" text,
"Margin of victory" text,
"Tournament location" text,
"Purse ( $ )" real,
"Winners share ($)" real
)
-- Using valid SQLite, answer the following questions for the tables provided ab... | SELECT MIN("Winners share ($)") FROM table_25549 WHERE "Champion" = 'Se Ri Pak (2)' | wikisql |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | SELECT COUNT(*) FROM zyjzjlb WHERE JZKSMC = '疼痛科' AND RYDJSJ BETWEEN '2001-04-12' AND '2007-07-20' | css |
CREATE TABLE table_name_35 (
call_sign VARCHAR,
frequency_mhz VARCHAR,
erp_w VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the call sign of the MHz Frequency less than 94.9 and an ERP W of 170?
| SELECT call_sign FROM table_name_35 WHERE frequency_mhz < 94.9 AND erp_w = 170 | sql_create_context |
CREATE TABLE table_name_39 (
michelle INTEGER,
discipline VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How did michelle do in archery?
| SELECT AVG(michelle) FROM table_name_39 WHERE discipline = "archery" | sql_create_context |
CREATE TABLE table_28498999_6 (
reset_points VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the number of pieces where the person is charley hoffman
| SELECT COUNT(reset_points) FROM table_28498999_6 WHERE player = "Charley Hoffman" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime t... | SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-85328')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutpu... | eicu |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperio... | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '018-20179' AND patient.hospitaladmitsource = 'operating room' AND DATETIME(patient.hospitaladmittime) >= DATETIME(CURRENT_TIME(), '-1 year') ORDER BY patient.hospitaladmittime LIMIT 1 | eicu |
CREATE TABLE table_name_28 (
to_par VARCHAR,
finish VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the finish was t31 what was the To par?
| SELECT to_par FROM table_name_28 WHERE finish = "t31" | sql_create_context |
CREATE TABLE table_204_775 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many gold and silver medals in total did china receive ?
| SELECT "gold" + "silver" FROM table_204_775 WHERE "nation" = 'china' | squall |
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 txmzjzjlb JOIN jybgb JOIN jyjgzbb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE txmzjzjlb.JZZDBM = 'Z80.670' AND jyjgzbb.JCZBDM = '849746' UNION SELECT jyjgzbb.CKZFWX... | css |
CREATE TABLE Courses (
course_id INTEGER,
author_id INTEGER,
subject_id INTEGER,
course_name VARCHAR(120),
course_description VARCHAR(255)
)
CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGER,
date_of_enrolment DATETIME,
date_o... | SELECT date_test_taken, COUNT(date_test_taken) FROM Student_Tests_Taken WHERE test_result = "Pass" ORDER BY date_test_taken | nvbench |
CREATE TABLE mzb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | SELECT 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 '2008-10-25' AND '2015-12-06' AND t_kc22.SELF_PAY_PRO < 0.73 UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_NM = '吕莹玉' AND t_k... | css |
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 COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '78775126' AND t_kc22.STA_DATE BETWEEN '2001-03-07' AND '2003-11-09' AND t_kc22.SOC_SRT_DIRE_CD = '109251736' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHE... | css |
CREATE TABLE table_52319 (
"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 is the score of the Home team of geelong?
| SELECT "Home team score" FROM table_52319 WHERE "Home team" = 'geelong' | wikisql |
CREATE TABLE table_name_32 (
number VARCHAR,
season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What number has 2002-2003 as the season?
| SELECT number FROM table_name_32 WHERE season = "2002-2003" | 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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Routine circumcision" AND prescriptions.drug_type = "ADDITIVE" | mimicsql_data |
CREATE TABLE table_59996 (
"Election" text,
"First member" text,
"First party" text,
"Second member" text,
"Second party" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the first party with second member Hon. Rowland Hill, in the 1857 electi... | SELECT "First party" FROM table_59996 WHERE "Second member" = 'hon. rowland hill' AND "Election" = '1857' | wikisql |
CREATE TABLE table_12094300_1 (
interview VARCHAR,
preliminaries VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the interview score when the preliminaries score is 8.400?
| SELECT interview FROM table_12094300_1 WHERE preliminaries = "8.400" | sql_create_context |
CREATE TABLE table_25061 (
"Name" text,
"#" real,
"Position" text,
"Height" text,
"Weight" real,
"Year" text,
"Home Town" text,
"High School" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many height entries are there for players fr... | SELECT COUNT("Height") FROM table_25061 WHERE "Home Town" = 'Lagos, Nigeria' | wikisql |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id... | WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id =... | sede |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | SELECT CYBQDM, CYBQMC, CYCWH FROM zyjzjlb WHERE JZLSH = '81766246008' | css |
CREATE TABLE table_name_10 (
date VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date is Hawthorn the home team?
| SELECT date FROM table_name_10 WHERE home_team = "hawthorn" | sql_create_context |
CREATE TABLE table_16519 (
"Team" text,
"Stadium" text,
"Capacity" real,
"Highest" real,
"Lowest" real,
"Average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest attendance that East End Park has ever had?
| SELECT MIN("Lowest") FROM table_16519 WHERE "Stadium" = 'East End Park' | wikisql |
CREATE TABLE table_20730 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many days was the away tea... | SELECT COUNT("Date") FROM table_20730 WHERE "Away team score" = '11.8 (74)' | wikisql |
CREATE TABLE table_name_60 (
rank INTEGER,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's jim colbert's highest rank?
| SELECT MAX(rank) FROM table_name_60 WHERE player = "jim colbert" | sql_create_context |
CREATE TABLE airports (
apid number,
name text,
city text,
country text,
x number,
y number,
elevation number,
iata text,
icao text
)
CREATE TABLE airlines (
alid number,
name text,
iata text,
icao text,
callsign text,
country text,
active text
)
CREATE ... | SELECT COUNT(*), country FROM airports GROUP BY country ORDER BY COUNT(*) DESC | spider |
CREATE TABLE table_name_94 (
partner VARCHAR,
score_in_final VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Partner has a Score in Final of 6 1, 6 2?
| SELECT partner FROM table_name_94 WHERE score_in_final = "6–1, 6–2" | sql_create_context |
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 demographic (
subject_id text,
hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "CAPE" AND demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" | mimicsql_data |
CREATE TABLE table_64018 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average number of golds for teams with 1 bronze, less than 3 silver, and a total... | SELECT AVG("Gold") FROM table_64018 WHERE "Bronze" = '1' AND "Total" > '2' AND "Silver" < '3' | wikisql |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT COUNT(*) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '韦新霁' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2005-11-27' AND '2012-04-21' AND t_kc24.MED_AMOUT <= 10 | css |
CREATE TABLE table_16341 (
"Model" text,
"RU" real,
"Max processors" text,
"Processor frequency" text,
"Max memory" text,
"Max disk capacity" text,
"GA Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What ga date do the models with 1.0,... | SELECT "GA Date" FROM table_16341 WHERE "Processor frequency" = '1.0, 1.2, 1.4GHz' | wikisql |
CREATE TABLE table_29046 (
"Date" text,
"Time" text,
"Visiting team" text,
"Home team" text,
"Site" text,
"Broadcast" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result in the game broadc... | SELECT "Result" FROM table_29046 WHERE "Broadcast" = 'Big East Network' | wikisql |
CREATE TABLE table_38173 (
"Tournament" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which tournament had a 2009 result of 1R?
| SELECT "Tournament" FROM table_38173 WHERE "2009" = '1r' | wikisql |
CREATE TABLE table_203_521 (
id number,
"year" number,
"division" number,
"league" text,
"regular season" text,
"playoffs" text,
"open cup" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the only year that did not qualify appears und... | SELECT "year" FROM table_203_521 WHERE "playoffs" = 'did not qualify' | squall |
CREATE TABLE table_7779 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What competition took place in a year later than 2009 with team notes?
| SELECT "Competition" FROM table_7779 WHERE "Year" > '2009' AND "Notes" = 'team' | 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 t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '3974649' AND t_kc22.SOC_SRT_DIRE_CD = '165044266-n' | css |
CREATE TABLE table_name_64 (
race INTEGER,
flap VARCHAR,
podium VARCHAR,
pole VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many races had 4 podiums, 5 poles and more than 3 Flaps?
| SELECT SUM(race) FROM table_name_64 WHERE podium = 4 AND pole = 5 AND flap > 3 | 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 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_NM = '戚玉树' 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_CLIN... | css |
CREATE TABLE table_74416 (
"Name" text,
"Country" text,
"Years" text,
"Games" real,
"Minutes" real,
"Conceded" real,
"Shutouts" real,
"Int. caps" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest overall amount of shutout... | SELECT MIN("Shutouts") FROM table_74416 | wikisql |
CREATE TABLE table_name_41 (
previous_conference VARCHAR,
school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The school of Portage was in what conference previous?
| SELECT previous_conference FROM table_name_41 WHERE school = "portage" | sql_create_context |
CREATE TABLE table_name_12 (
channel INTEGER,
aspect VARCHAR,
psip_short_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the highest Channel with an Aspect of 4:3, and a PSIP Short Name of ibc-tv?
| SELECT MAX(channel) FROM table_name_12 WHERE aspect = "4:3" AND psip_short_name = "ibc-tv" | sql_create_context |
CREATE TABLE table_65125 (
"Player" text,
"Int'l Debut" text,
"Year" text,
"Cross Code Debut" text,
"Date" text,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year did Coenraad Breytenbach have their Int'l Debut?
| SELECT "Year" FROM table_65125 WHERE "Player" = 'coenraad breytenbach' | wikisql |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostsWithDe... | SELECT p.Id AS "post_link", LENGTH(p.Body) AS "length", p.Score AS "score" FROM Users AS u JOIN Posts AS p ON p.OwnerUserId = u.Id WHERE u.Id = '##UserId##' ORDER BY 'score', 'length' DESC | sede |
CREATE TABLE table_38292 (
"Pos." real,
"Car #" real,
"Driver" text,
"Make" text,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Car numbers have a Driver of erik darnell, and a Pos smaller than 2?
| SELECT COUNT("Car #") FROM table_38292 WHERE "Driver" = 'erik darnell' AND "Pos." < '2' | wikisql |
CREATE TABLE Accounts (
Account_ID INTEGER,
Statement_ID INTEGER,
Account_Details VARCHAR(255)
)
CREATE TABLE Statements (
Statement_ID INTEGER,
Statement_Details VARCHAR(255)
)
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Typ... | SELECT Statement_Details, COUNT(Statement_Details) FROM Accounts AS T1 JOIN Statements AS T2 ON T1.Statement_ID = T2.Statement_ID GROUP BY Statement_Details ORDER BY COUNT(Statement_Details) | nvbench |
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 zyjzjlb (
YLJGDM text,
JZLSH ... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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 = jy... | css |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,... | SELECT COUNT(P2.Id) AS "numquestions" FROM Posts AS P JOIN Posts AS P2 ON (P2.Id = P.ParentId) JOIN Posts AS P3 ON (P3.ParentId = P2.Id) WHERE P.Score > 1 AND P.PostTypeId = 2 AND P2.PostTypeId = 1 AND P3.PostTypeId = 2 AND P.Score > P3.Score AND P2.AcceptedAnswerId = P3.Id AND P2.CreationDate BETWEEN '2012-10-01' AND ... | sede |
CREATE TABLE table_12834315_5 (
name VARCHAR,
barrel_profile VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What models have an a2 barrel profile?
| SELECT name FROM table_12834315_5 WHERE barrel_profile = "A2" | 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 WHERE demographic.diagnosis = "OVERDOSE" AND demographic.dod_year <= "2168.0" | mimicsql_data |
CREATE TABLE table_36553 (
"Year" real,
"Title" text,
"Format" text,
"Label" text,
"Catalogno" text,
"Remark" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What catalogno was in 1971 and had a remark of #27 us?
| SELECT "Catalogno" FROM table_36553 WHERE "Year" = '1971' AND "Remark" = '#27 us' | wikisql |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | SELECT c.Id AS "comment_link", u.Id AS "user_link" FROM Comments AS c JOIN Users AS u ON (u.Id = UserId) WHERE LENGTH(Text) = 600 | sede |
CREATE TABLE table_26173063_2 (
× VARCHAR,
faisaly VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is x when faisaly is 0-0?
| SELECT × FROM table_26173063_2 WHERE faisaly = "0-0" | sql_create_context |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid 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 = 19428)) AND DATETIME(inputevents_cv.... | mimic_iii |
CREATE TABLE table_24786958_2 (
attendance INTEGER,
game_site VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people attended the game at Jahn-sportpark?
| SELECT MIN(attendance) FROM table_24786958_2 WHERE game_site = "Jahn-Sportpark" | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2182" AND prescriptions.route = "INHALATION" | mimicsql_data |
CREATE TABLE table_40464 (
"Rank by average" text,
"Place" text,
"Perfect 40s" text,
"Total" text,
"Number of dances" text,
"Season" text,
"Average" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the place in season 8 with a rank by... | SELECT "Place" FROM table_40464 WHERE "Season" = '8' AND "Rank by average" = '139' | wikisql |
CREATE TABLE table_19475 (
"Date Released" text,
"Polling institute" text,
"Socialist" text,
"Social Democratic" text,
"Peoples Party" text,
"Green-Communist" text,
"Left Bloc" text,
"Lead" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- ... | SELECT "Date Released" FROM table_19475 WHERE "Green-Communist" = '8.9%' | wikisql |
CREATE TABLE table_name_67 (
bob_dole VARCHAR,
george_hw_bush VARCHAR,
pat_robertson VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When George H.W. Bush had 81%, and Pat Robertson had 9%, what did Bob Dole have?
| SELECT bob_dole FROM table_name_67 WHERE george_hw_bush = "81%" AND pat_robertson = "9%" | sql_create_context |
CREATE TABLE table_31873 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want the score for 30 april 1977
| SELECT "Score" FROM table_31873 WHERE "Date" = '30 april 1977' | wikisql |
CREATE TABLE table_204_228 (
id number,
"year" number,
"title" text,
"credit" text,
"role" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which was released in 2011 , undefeated or freakonomics ?
| SELECT "title" FROM table_204_228 WHERE "title" IN ('undefeated', 'freakonomics') AND "year" = 2011 | squall |
CREATE TABLE table_name_11 (
team VARCHAR,
year VARCHAR,
versus VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what team played against zimbabwe in 1999?
| SELECT team FROM table_name_11 WHERE year = 1999 AND versus = "zimbabwe" | sql_create_context |
CREATE TABLE table_43402 (
"Nation" text,
"Skip" text,
"Third" text,
"Second" text,
"Lead" text,
"Alternate" text,
"Club" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Skip for Germany?
| SELECT "Skip" FROM table_43402 WHERE "Nation" = 'germany' | wikisql |
CREATE TABLE table_7750 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of Gold, when Total is less than 1?
| SELECT SUM("Gold") FROM table_7750 WHERE "Total" < '1' | wikisql |
CREATE TABLE table_69574 (
"Player" text,
"Country" text,
"Year(s) Won" text,
"Total" real,
"To par" text,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest total with a t12 finish?
| SELECT MAX("Total") FROM table_69574 WHERE "Finish" = 't12' | wikisql |
CREATE TABLE table_12454 (
"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 is the result week 1?
| SELECT "Result" FROM table_12454 WHERE "Week" = '1' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.