instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
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.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '81164300' AND t_kc22.t_kc21_MED_SER_ORG_NO = '3140285' AND t_kc22.t_kc21_IN_HOSP_DATE BETWEEN '2004-06-12' AND '2008-03-03') | css |
CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGER,
date_of_enrolment DATETIME,
date_of_completion DATETIME
)
CREATE TABLE Course_Authors_and_Tutors (
author_id INTEGER,
author_tutor_ATB VARCHAR(3),
login_name VARCHAR(40),
password... | SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass" GROUP BY date_of_enrolment ORDER BY date_of_enrolment | nvbench |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
Dup... | SELECT Count FROM Tags WHERE TagName = '##tagname:string##' | sede |
CREATE TABLE Purchases (
purchase_transaction_id INTEGER,
purchase_details VARCHAR(255)
)
CREATE TABLE Transactions_Lots (
transaction_id INTEGER,
lot_id INTEGER
)
CREATE TABLE Investors (
investor_id INTEGER,
Investor_details VARCHAR(255)
)
CREATE TABLE Lots (
lot_id INTEGER,
investo... | SELECT purchase_details, COUNT(purchase_details) FROM Purchases AS T1 JOIN Transactions AS T2 ON T1.purchase_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction > 10000 GROUP BY purchase_details | nvbench |
CREATE TABLE table_dev_49 (
"id" int,
"gender" string,
"systolic_blood_pressure_sbp" int,
"renal_disease" bool,
"diastolic_blood_pressure_dbp" int,
"high_density_lipoprotein_cholesterol_hdl_c" int,
"serum_creatinine" float,
"waist_circumference" int,
"triglyceride_tg" float,
"hyp... | SELECT * FROM table_dev_49 WHERE hypertension = 1 OR systolic_blood_pressure_sbp > 160 OR diastolic_blood_pressure_dbp > 100 | criteria2sql |
CREATE TABLE table_21152 (
"Season" real,
"Class" text,
"Motorcycle" text,
"Team" text,
"Races" real,
"Wins" real,
"Podiums" real,
"Poles" real,
"FLaps" real,
"Points" text,
"Placement" text
)
-- Using valid SQLite, answer the following questions for the tables provided abo... | SELECT "Motorcycle" FROM table_21152 WHERE "Season" = '2012' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "GUILLAIN BARRE SYNDROME" AND procedures.short_title = "Adm inhal nitric oxide" | mimicsql_data |
CREATE TABLE member (
member_id number,
card_number text,
name text,
hometown text,
level number
)
CREATE TABLE branch (
branch_id number,
name text,
open_year text,
address_road text,
city text,
membership_amount text
)
CREATE TABLE membership_register_branch (
member_... | SELECT card_number FROM member WHERE hometown LIKE "%Kentucky%" | spider |
CREATE TABLE table_43799 (
"Event" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many times is bronze 2 and gold more than 3?
| SELECT COUNT("Total") FROM table_43799 WHERE "Bronze" = '2' AND "Gold" > '3' | wikisql |
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 CHA_ITEM_LEV FROM t_kc22 WHERE MED_CLINIC_ID = '79356586001' AND SOC_SRT_DIRE_NM = '益心舒胶囊' | css |
CREATE TABLE table_79510 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what Date was the Attendance 73,405?
| SELECT "Date" FROM table_79510 WHERE "Attendance" = '73,405' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "M" AND procedures.icd9_code = "9755" | mimicsql_data |
CREATE TABLE field (
fieldid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE paperda... | SELECT DISTINCT COUNT(cite.citingpaperid) FROM author AS AUTHOR_0, author AS AUTHOR_1, cite, writes AS WRITES_0, writes AS WRITES_1 WHERE AUTHOR_0.authorname = 'dan klein' AND AUTHOR_1.authorname = 'michael i. jordan' AND WRITES_0.authorid = AUTHOR_0.authorid AND WRITES_0.paperid = cite.citedpaperid AND WRITES_1.author... | scholar |
CREATE TABLE table_48900 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Date has an Attendance of 54,626?
| SELECT "Date" FROM table_48900 WHERE "Attendance" = '54,626' | wikisql |
CREATE TABLE table_204_757 (
id number,
"state" text,
"interview" number,
"swimsuit" number,
"evening gown" number,
"average" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many state has an average under 8.5 ?
| SELECT COUNT("state") FROM table_204_757 WHERE "average" < 8.5 | squall |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
... | SELECT COUNT(DISTINCT course.course_id) FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.credits = 16 AND course.department = 'NEAREAST' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = '... | advising |
CREATE TABLE table_73683 (
"Season" real,
"MLS Regular Season" text,
"MLS Cup Playoffs" text,
"Lamar Hunt U.S. Open Cup" text,
"CONCACAF Champions Cup / CONCACAF Champions League" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the season wh... | SELECT "Season" FROM table_73683 WHERE "MLS Regular Season" = '6th, East (9-11-10)' | wikisql |
CREATE TABLE table_60891 (
"Team" text,
"Club home city" text,
"2006\u201307 Season" text,
"Stadium" text,
"Stadium capacity" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Stadium, when Stadium Capacity is '10,000', and when Team is 'KF Dri... | SELECT "Stadium" FROM table_60891 WHERE "Stadium capacity" = '10,000' AND "Team" = 'kf drita' | wikisql |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_40... | SELECT meter_400, ID FROM swimmer ORDER BY meter_400 | nvbench |
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 text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH ... | css |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | WITH fights AS (SELECT myAnswer.ParentId AS Question, myAnswer.Score AS MyScore, otherAnswer.Score AS OtherScore FROM Posts AS myAnswer INNER JOIN Posts AS otherAnswer ON otherAnswer.OwnerUserId = '##OtherId##' AND myAnswer.ParentId = otherAnswer.ParentId WHERE myAnswer.OwnerUserId = @UserId AND myAnswer.PostTypeId = 2... | sede |
CREATE TABLE table_55697 (
"D 41" text,
"D 42" text,
"D 43" text,
"D 44" text,
"D 45" text,
"D 46" text,
"D 47" text,
"R 53" text,
"R 52" text,
"R 51" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the D 41 for D 43 of d ... | SELECT "D 41" FROM table_55697 WHERE "D 43" = 'd 18' | wikisql |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
... | SELECT vdv.USER_ID AS "user_link", CAST(TIME_TO_STR(vdv.VOTE_DATE, '%b %d, %Y') AS TEXT(20)) AS "date_of_occurence", vdv.VOTE_COUNT AS "votes_per_post", COUNT(vdv.POST_ID) AS "posts_upvoted" FROM (SELECT COUNT(v.Id) AS VOTE_COUNT, p.Id AS POST_ID, p.OwnerUserId AS USER_ID, v.CreationDate AS VOTE_DATE FROM Votes AS v IN... | sede |
CREATE TABLE table_64528 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who repla... | SELECT "Replaced by" FROM table_64528 WHERE "Position in table" = '5th' | wikisql |
CREATE TABLE table_204_330 (
id number,
"finished" text,
"horse" text,
"jockey" text,
"trainer" text,
"owner" text,
"time / behind" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many horses finished the rase ?
| SELECT COUNT("horse") FROM table_204_330 | squall |
CREATE TABLE table_8339 (
"Name" text,
"Team" text,
"Qual 1" text,
"Qual 2" text,
"Best" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Qual 2, when Best is 1:27.976?
| SELECT "Qual 2" FROM table_8339 WHERE "Best" = '1:27.976' | wikisql |
CREATE TABLE table_204_552 (
id number,
"rank" number,
"cyclist" text,
"team" text,
"laps\ndown" number,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the last cyclist listed ?
| SELECT "cyclist" FROM table_204_552 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE table_name_14 (
medal VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Medal has a Name of alex obeyesekera?
| SELECT medal FROM table_name_14 WHERE name = "alex obeyesekera" | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.label = "Folate" | mimicsql_data |
CREATE TABLE table_12771 (
"Position" real,
"Club" text,
"Played" real,
"Points" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.... | SELECT SUM("Goal Difference") FROM table_12771 WHERE "Losses" < '9' AND "Draws" = '8' AND "Points" > '40' | wikisql |
CREATE TABLE table_67939 (
"Country" text,
"Player name" text,
"Period" text,
"Position" text,
"Matches" text,
"Goals" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the player name with matches of 51
| SELECT "Player name" FROM table_67939 WHERE "Matches" = '51' | wikisql |
CREATE TABLE table_name_54 (
title VARCHAR,
role VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what movie did John Wayne play the role of Chris Morrell?
| SELECT title FROM table_name_54 WHERE role = "chris morrell" | sql_create_context |
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '7821897' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 2 | css |
CREATE TABLE table_3343 (
"Settlement" text,
"Cyrillic Name" 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.
-- How many times is the settlem... | SELECT COUNT("Dominant religion (2002)") FROM table_3343 WHERE "Settlement" = 'Karlovčić' | wikisql |
CREATE TABLE table_train_252 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"fasting_plasma_glucose_fpg" float,
"hemoglobin_a1c_hba1c" float,
"hba1c" float,
"serum_creatinine" float,
"metformin" bool,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the f... | SELECT * FROM table_train_252 WHERE fasting_plasma_glucose_fpg <= 210 | criteria2sql |
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 TagName, Count FROM Tags ORDER BY Count DESC | sede |
CREATE TABLE table_19744915_3 (
skating_song VARCHAR,
couple VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- state the skating song of graeme & kristina
| SELECT skating_song FROM table_19744915_3 WHERE couple = "Graeme & Kristina" | sql_create_context |
CREATE TABLE table_1441 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the home team score when Brisbane lions... | SELECT "Home team score" FROM table_1441 WHERE "Home team" = 'Brisbane Lions' | wikisql |
CREATE TABLE table_name_22 (
outgoing_manager VARCHAR,
manner_of_departure VARCHAR,
date_of_vacancy VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the outgoing manager when the manner of departure is contract terminated and the date of vacancy is ... | SELECT outgoing_manager FROM table_name_22 WHERE manner_of_departure = "contract terminated" AND date_of_vacancy = "1 september 2008" | sql_create_context |
CREATE TABLE table_6835 (
"Season" text,
"League" text,
"Draw" real,
"Lost" real,
"Points" real,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Position has a League of southern league premier division, and a Season of 2004 05?
| SELECT "Position" FROM table_6835 WHERE "League" = 'southern league premier division' AND "Season" = '2004–05' | wikisql |
CREATE TABLE table_name_8 (
year VARCHAR,
team VARCHAR,
pos VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many years was Audi Sport Team Joest in 3rd position?
| SELECT COUNT(year) FROM table_name_8 WHERE team = "audi sport team joest" AND pos = "3rd" | sql_create_context |
CREATE TABLE table_66141 (
"Model number" text,
"sSpec number" text,
"Cores" text,
"Frequency" text,
"Turbo" text,
"L2 cache" text,
"L3 cache" text,
"GPU model" text,
"GPU frequency" text,
"Socket" text,
"I/O bus" text,
"Release date" text,
"Part number(s)" text,
... | SELECT "Model number" FROM table_66141 WHERE "Part number(s)" = 'cl8064701510101' | wikisql |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term... | SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE area.area LIKE '%softw... | advising |
CREATE TABLE table_78369 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What college did Matt Freeman go to?
| SELECT "College" FROM table_78369 WHERE "Player" = 'matt freeman' | wikisql |
CREATE TABLE playlist (
playlistid number,
name text
)
CREATE TABLE invoiceline (
invoicelineid number,
invoiceid number,
trackid number,
unitprice number,
quantity number
)
CREATE TABLE album (
albumid number,
title text,
artistid number
)
CREATE TABLE track (
trackid num... | SELECT firstname, lastname FROM employee WHERE city = "Calgary" | spider |
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 SUM(QTY), SUM(AMOUNT) FROM t_kc22 WHERE SOC_SRT_DIRE_CD = '786425119-f' AND STA_DATE BETWEEN '2006-03-14' AND '2021-06-12' | css |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE NOT admissions.dischtime IS NULL AND STRFTIME('%y', admissions.dischtime) <= '2101' | mimic_iii |
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.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND procedures.icd9_code = "8674" | mimicsql_data |
CREATE TABLE table_204_416 (
id number,
"chip" text,
"flash size" text,
"eeprom" number,
"sram" number,
"frequency\n[mhz]" number,
"package" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which chip has the fewest amount of eeprom ?
| SELECT "chip" FROM table_204_416 ORDER BY "eeprom" LIMIT 1 | squall |
CREATE TABLE table_63250 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which venue ended in a 3-0 result?
| SELECT "Venue" FROM table_63250 WHERE "Result" = '3-0' | 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.days_stay > "0" AND diagnoses.long_title = "Asthma, unspecified type, unspecified" | mimicsql_data |
CREATE TABLE table_26263954_1 (
revised_hepburn VARCHAR,
english VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many revised hepburn when english is roman characters
| SELECT revised_hepburn FROM table_26263954_1 WHERE english = "Roman characters" | sql_create_context |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE cours... | SELECT DISTINCT course.department, course.name, course.number, instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.name LIKE '%Livy%' AND NOT instructor.name LIKE '%Lindsay%' AND offering_instructor.instructor_id = instructor.instru... | advising |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_ID = '42924157' AND t_kc21.IN_HOSP_DATE BETWEEN '2004-08-09' AND '2009-02-15' GROUP BY t_kc21.MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE table_203_211 (
id number,
"pos." number,
"time" text,
"athlete" text,
"country" text,
"venue" text,
"date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what number of athletes had times that were below 12.40 ?
| SELECT COUNT("athlete") FROM table_203_211 WHERE "time" < 12.4 | squall |
CREATE TABLE table_75204 (
"Rank" real,
"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 total number of bronze medals of West Germany, which is ranked 2 and has less th... | SELECT COUNT("Bronze") FROM table_75204 WHERE "Rank" = '2' AND "Nation" = 'west germany' AND "Total" < '1' | wikisql |
CREATE TABLE table_2076490_1 (
enrollment__2005_ VARCHAR,
type VARCHAR,
school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the enrollment (2005) for baccalaureate colleges , for Granite State College?
| SELECT enrollment__2005_ FROM table_2076490_1 WHERE type = "Baccalaureate college" AND school = "Granite State College" | sql_create_context |
CREATE TABLE table_name_93 (
score VARCHAR,
surface VARCHAR,
championship VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Score when there was a hard surface and the Championship is new haven , usa?
| SELECT score FROM table_name_93 WHERE surface = "hard" AND championship = "new haven , usa" | sql_create_context |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE transfers (
row_id... | SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10855)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [dias... | mimic_iii |
CREATE TABLE table_204_740 (
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.
-- how many drivers were re... | SELECT COUNT("driver") FROM table_204_740 WHERE "pos" = 'ret' | squall |
CREATE TABLE table_17416221_1 (
provincial_capital VARCHAR,
population__2013_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the numbe of provincial captial where the population is 1162900?
| SELECT COUNT(provincial_capital) FROM table_17416221_1 WHERE population__2013_ = 1162900 | sql_create_context |
CREATE TABLE table_17450 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team does George Hulme play for?
| SELECT "College/junior/club team" FROM table_17450 WHERE "Player" = 'George Hulme' | wikisql |
CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGER,
date_of_enrolment DATETIME,
date_of_completion DATETIME
)
CREATE TABLE Subjects (
subject_id INTEGER,
subject_name VARCHAR(120)
)
CREATE TABLE Courses (
course_id INTEGER,
author... | SELECT date_test_taken, COUNT(date_test_taken) FROM Student_Tests_Taken WHERE test_result = "Pass" GROUP BY date_test_taken | nvbench |
CREATE TABLE table_202_244 (
id number,
"rank" number,
"title" text,
"studio" text,
"actors" text,
"gross" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which diane keaton film ranked higher ?
| SELECT "title" FROM table_202_244 WHERE "actors" = 'diane keaton' ORDER BY "rank" LIMIT 1 | squall |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT MED_DIRE_CD, MED_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '26488493176' AND SOC_SRT_DIRE_NM = '兰索拉唑肠溶片' | css |
CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptroller text,
Attorney_General text,
US_Senate text
)
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
Party int,
... | SELECT County_name, COUNT(County_name) FROM county AS T1 JOIN election AS T2 ON T1.County_Id = T2.District GROUP BY County_name | nvbench |
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 MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '47604076' AND MED_SER_ORG_NO = '9869396' AND OUT_DIAG_DIS_NM LIKE '%肝功能%' | css |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL v... | SELECT COUNTRY_NAME, COUNT(COUNTRY_NAME) FROM countries GROUP BY COUNTRY_NAME | nvbench |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE patient (
uniquep... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-61708... | eicu |
CREATE TABLE table_59221 (
"Physical property" text,
"Helium" text,
"Neon" text,
"Argon" text,
"Krypton" text,
"Xenon" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which Helium has a Argon of 189.6?
| SELECT "Helium" FROM table_59221 WHERE "Argon" = '−189.6' | wikisql |
CREATE TABLE table_name_84 (
away_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the away team at western oval?
| SELECT away_team AS score FROM table_name_84 WHERE venue = "western oval" | sql_create_context |
CREATE TABLE table_203_426 (
id number,
"year" number,
"title" text,
"peak chart positions\naus" number,
"peak chart positions\nnz" number,
"peak chart positions\nuk" number,
"album" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many pr... | SELECT COUNT(*) FROM table_203_426 WHERE "album" = 'promotional release' | squall |
CREATE TABLE table_name_60 (
opponent VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who's the opponent of the game with the record 64-51?
| SELECT opponent FROM table_name_60 WHERE record = "64-51" | sql_create_context |
CREATE TABLE table_14674 (
"Type" text,
"Fleet numbers" text,
"Quantity made" text,
"Date made" text,
"GSR Class" text,
"Inchicore Class" text,
"GSR Nos." text,
"Withdrawn" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the quan... | SELECT "Quantity made" FROM table_14674 WHERE "Inchicore Class" = 'j7' | wikisql |
CREATE TABLE table_70797 (
"Player" text,
"Height" real,
"Position" text,
"Year born" real,
"Current Club" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the height of the Forward who currently plays for the Toronto Raptors?
| SELECT "Height" FROM table_70797 WHERE "Position" = 'forward' AND "Current Club" = 'toronto raptors' | wikisql |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT SUM(t_kc24.PER_ACC_PAY) 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 '2009-03-25' AND '2012-04-22' | css |
CREATE TABLE table_name_18 (
country VARCHAR,
total VARCHAR,
year_s__won VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Country of the Player with a Total less than 153 and Year(s) won of 1984?
| SELECT country FROM table_name_18 WHERE total < 153 AND year_s__won = "1984" | sql_create_context |
CREATE TABLE table_name_4 (
authority VARCHAR,
roll VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which is the Authority that has a Roll of 70?
| SELECT authority FROM table_name_4 WHERE roll = "70" | sql_create_context |
CREATE TABLE table_15621965_3 (
years_in_orlando VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- During what years did Chris Corchiani play in Orlando?
| SELECT years_in_orlando FROM table_15621965_3 WHERE player = "Chris Corchiani" | sql_create_context |
CREATE TABLE table_name_4 (
player VARCHAR,
place VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the player who placed t10?
| SELECT player FROM table_name_4 WHERE place = "t10" | sql_create_context |
CREATE TABLE table_name_40 (
result VARCHAR,
competition VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score for the South American Championship dated December 13, 1925?
| SELECT result FROM table_name_40 WHERE competition = "south american championship" AND date = "december 13, 1925" | sql_create_context |
CREATE TABLE zzmzjzjlb (
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 zzmzjzjlb.ZZYSGH, zzmzjzjlb.QTJZYSGH FROM zzmzjzjlb WHERE zzmzjzjlb.JZLSH = '20851648462' UNION SELECT fzzmzjzjlb.ZZYSGH, fzzmzjzjlb.QTJZYSGH FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZLSH = '20851648462' | css |
CREATE TABLE table_name_20 (
country VARCHAR,
to_par VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country has a to par of e?
| SELECT country FROM table_name_20 WHERE to_par = "e" | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', medication.drugstarttime)) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-769... | eicu |
CREATE TABLE table_4007 (
"Institution" text,
"Location" text,
"Founded" real,
"Affiliation" text,
"Enrollment" real,
"Team Nickname" text,
"Primary conference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many affiliations does the Un... | SELECT COUNT("Affiliation") FROM table_4007 WHERE "Institution" = 'University of Toledo' | wikisql |
CREATE TABLE jybgb_jyjgzbb (
JYZBLSH number,
YLJGDM text,
jyjgzbb_id number
)
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH... | SELECT jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDW, AVG(jyjgzbb.JCZBJGDL) FROM jyjgzbb JOIN jybgb_jyjgzbb JOIN jybgb ON jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JYZBLSH AND jybgb_jyjgzbb.jyjgzbb_id = jyjgzbb.jyjgzbb_id AND jybgb_jyjgzbb.YLJGDM = jybgb.YLJGDM WHERE jybgb.YLJGDM = '1827360' AND jyjgzbb.BGRQ BETWEEN '2003-03-10' AND '2010-02... | css |
CREATE TABLE table_9174 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When has a Score of 0 1, and a Tie no of 3?
| SELECT "Date" FROM table_9174 WHERE "Score" = '0–1' AND "Tie no" = '3' | 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_kc24.t_kc21_IN_DIAG_DIS_CD, t_kc24.t_kc21_IN_DIAG_DIS_NM FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_ID = '55178621' AND t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 9322.98) | css |
CREATE TABLE mountain (
Mountain_ID int,
Name text,
Height real,
Prominence real,
Range text,
Country text
)
CREATE TABLE climber (
Climber_ID int,
Name text,
Country text,
Time text,
Points real,
Mountain_ID int
)
-- Using valid SQLite, answer the following questions ... | SELECT Country, COUNT(*) FROM climber GROUP BY Country | nvbench |
CREATE TABLE table_name_49 (
laps VARCHAR,
qual VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Len Sutton's total number of completed laps when his qualifying time was 142.653?
| SELECT COUNT(laps) FROM table_name_49 WHERE qual = "142.653" | sql_create_context |
CREATE TABLE table_name_86 (
points INTEGER,
engine_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points were awarded to the Ford DFZ 3.5 V8?
| SELECT SUM(points) FROM table_name_86 WHERE engine_s_ = "ford dfz 3.5 v8" | sql_create_context |
CREATE TABLE party (
Party_ID int,
Minister text,
Took_office text,
Left_office text,
Region_ID int,
Party_name text
)
CREATE TABLE region (
Region_ID int,
Region_name text,
Date text,
Label text,
Format text,
Catalogue text
)
CREATE TABLE member (
Member_ID int,
... | SELECT Party_name, COUNT(*) FROM member AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID | nvbench |
CREATE TABLE table_203_746 (
id number,
"date" text,
"opponent" text,
"score" text,
"leading scorer" text,
"attendance" number,
"record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- number of victories
| SELECT COUNT(*) FROM table_203_746 WHERE "score" > "score" | squall |
CREATE TABLE table_79271 (
"Lane" real,
"Athlete" text,
"Nationality" text,
"Time" text,
"React" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the athlete when react is 0.164?
| SELECT "Athlete" FROM table_79271 WHERE "React" = '0.164' | wikisql |
CREATE TABLE table_26027 (
"#" real,
"Airdate" text,
"Episode" text,
"Rating" text,
"Share" real,
"Rating/Share (18\u201349)" text,
"Viewers (millions)" text,
"Rank (Timeslot)" real,
"Rank (Night)" real
)
-- Using valid SQLite, answer the following questions for the tables provided... | SELECT "Viewers (millions)" FROM table_26027 WHERE "Episode" = 'Nanna Is Kickin'' Your Butt' | wikisql |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardi... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ... | mimic_iii |
CREATE TABLE table_name_67 (
points INTEGER,
lost VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest amount of points had a lost number of 2 when the position was less than 1?
| SELECT MIN(points) FROM table_name_67 WHERE lost = 2 AND position < 1 | sql_create_context |
CREATE TABLE table_name_78 (
number_ VARCHAR,
_name VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number & name of the livery in 1958?
| SELECT number_ & _name FROM table_name_78 WHERE date = "1958" | sql_create_context |
CREATE TABLE table_27781212_1 (
winnings VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many winnings does jeff gordon have?
| SELECT winnings FROM table_27781212_1 WHERE driver = "Jeff Gordon" | sql_create_context |
CREATE TABLE table_586 (
"Institution" text,
"Location" text,
"Nickname" text,
"Current Conference" text,
"Classification" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where is the University at Albany located?
| SELECT "Location" FROM table_586 WHERE "Institution" = 'University at Albany' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.