instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_40294 (
"Week #" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" real,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which original artist had 5 as their order #?
| SELECT "Original artist" FROM table_40294 WHERE "Order #" = '5' | wikisql |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE chartevents (
row_id number,
subject_i... | 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 = 20603)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rate' AND d... | mimic_iii |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREA... | SELECT DISTINCT flight_id FROM flight WHERE (((departure_time > 1800 AND flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 23 AND DATE_DAYalias0.month_number = 4 AND DATE_DAYa... | atis |
CREATE TABLE table_4832 (
"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.
-- How many people are in the crowd in south melbour... | SELECT COUNT("Crowd") FROM table_4832 WHERE "Home team" = 'south melbourne' | wikisql |
CREATE TABLE table_3823 (
"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.
-- Name the n... | SELECT COUNT("Team") FROM table_3823 WHERE "Position in table" = '19th' | wikisql |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%saarbr%cken%' AND Reputation >= 1000 ORDER BY Reputation DESC | sede |
CREATE TABLE table_name_54 (
predecessor VARCHAR,
date VARCHAR,
district VARCHAR,
congress VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What predecessor has a district less than 11, 68th as the Congress, and may 1, 1923 as the date?
| SELECT predecessor FROM table_name_54 WHERE district < 11 AND congress = "68th" AND date = "may 1, 1923" | sql_create_context |
CREATE TABLE table_name_13 (
car_no VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What car number had 24 points?
| SELECT car_no FROM table_name_13 WHERE points = "24" | 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.insurance = "Medicare" AND lab.label = "Atypical Lymphocytes" | mimicsql_data |
CREATE TABLE table_name_72 (
term_end VARCHAR,
governments VARCHAR,
minister VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did the term end for the term that had government 27 and Minister Tzachi Hanegbi?
| SELECT term_end FROM table_name_72 WHERE governments = "27" AND minister = "tzachi hanegbi" | sql_create_context |
CREATE TABLE table_14834801_1 (
mandate VARCHAR,
list_pct VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the mandate for list pct 12.39%
| SELECT mandate FROM table_14834801_1 WHERE list_pct = "12.39%" | 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 * FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jy... | css |
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 qtb.MED_ORG_DEPT_CD, qtb.OUT_DIAG_DIS_CD, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '9593496' GROUP BY qtb.MED_ORG_DEPT_CD, qtb.OUT_DIAG_DIS_CD UNION SELECT gyb.MED_ORG_DEPT_CD, gyb.OUT_DIAG_DIS_CD, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '9593496' GROUP BY gyb.MED_ORG_DEPT_CD, gyb.... | css |
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 ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users ORDER BY Reputation DESC LIMIT 300 | sede |
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 (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'obesity') AS t1) - (SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.di... | eicu |
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 SUM(t_kc24.OVE_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '7494699' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2006-02-11' AND '2009-08-18' UNION SELECT SUM(t_kc24.OVE_PAY) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE fgwyj... | css |
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
... | SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM semester INNER JOIN course_offering ON semester.semester_id = course_o... | advising |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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,
C... | SELECT t_kc21.OUT_DIAG_DOC_CD, t_kc21.OUT_DIAG_DOC_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '58160776' GROUP BY t_kc21.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC | css |
CREATE TABLE table_name_10 (
rank INTEGER,
nation VARCHAR,
gold VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the rank that when Serbia is the nation, and gold is larger than 0?
| SELECT SUM(rank) FROM table_name_10 WHERE nation = "serbia" AND gold > 0 | sql_create_context |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
... | SELECT SUM(Reputation) / COUNT(Id) AS "average_rep", COUNT(Id) AS "number_of_users" FROM Users | sede |
CREATE TABLE table_name_84 (
city VARCHAR,
school VARCHAR,
ihsaa_football_class VARCHAR,
enrollment VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which city is Lawrenceburg school, with an IHSAA football class of aaa and less than 676 enrollments, l... | SELECT city FROM table_name_84 WHERE ihsaa_football_class = "aaa" AND enrollment < 676 AND school = "lawrenceburg" | sql_create_context |
CREATE TABLE table_4167 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who wrote the epis... | SELECT "Written by" FROM table_4167 WHERE "Title" = 'There Goes the Neighborhood' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TA... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'anemia') AS t1 JOIN (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medi... | eicu |
CREATE TABLE table_72609 (
"Episode #" text,
"Country" text,
"City" text,
"Martial Art/Style" text,
"Masters" text,
"Original Airdate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which masters fought in hapkido style?
| SELECT "Masters" FROM table_72609 WHERE "Martial Art/Style" = 'Hapkido' | wikisql |
CREATE TABLE table_name_13 (
studio VARCHAR,
title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which studio did The Oregon Trail?
| SELECT studio FROM table_name_13 WHERE title = "the oregon trail" | sql_create_context |
CREATE TABLE table_name_63 (
recorded VARCHAR,
time VARCHAR,
song_title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date recorded for I Want to Be Free with a length of 2:12?
| SELECT recorded FROM table_name_63 WHERE time = "2:12" AND song_title = "i want to be free" | sql_create_context |
CREATE TABLE customer_addresses (
customer_id number,
address_id number,
date_address_from time,
address_type text,
date_address_to time
)
CREATE TABLE products (
product_id number,
product_details text
)
CREATE TABLE customer_contact_channels (
customer_id number,
channel_code tex... | SELECT payment_method FROM customers GROUP BY payment_method ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_48654 (
"Year" real,
"Date" text,
"Winner" text,
"Result" text,
"Loser" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the location on October 16?
| SELECT "Location" FROM table_48654 WHERE "Date" = 'october 16' | wikisql |
CREATE TABLE table_203_200 (
id number,
"region" text,
"seed" number,
"team" text,
"coach" text,
"finished" text,
"final opponent" text,
"score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- north carolina and unlv each made it to which... | SELECT "finished" FROM table_203_200 WHERE "team" = 'north carolina' | squall |
CREATE TABLE table_203_396 (
id number,
"year" number,
"domestic passengers" number,
"international passengers" number,
"total passengers" number,
"change" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many times was the total number of pas... | SELECT COUNT(*) FROM table_203_396 WHERE "total passengers" >= 800000 | squall |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE instructor (
instructo... | SELECT COUNT(*) = 0 FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_exams = 'N' AND program_course.category LIKE '%ULCS%' | advising |
CREATE TABLE table_43143 (
"Date" text,
"Time" text,
"Home" text,
"Away" text,
"Score" text,
"Ground" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date for the 130-56 game?
| SELECT "Date" FROM table_43143 WHERE "Score" = '130-56' | wikisql |
CREATE TABLE table_20093 (
"Name" text,
"Position" text,
"Number" real,
"School/Club Team" text,
"Season" text,
"Acquisition via" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many school/club teams have a player named Manuel Luis Quezon?
| SELECT COUNT("Number") FROM table_20093 WHERE "School/Club Team" = 'Manuel Luis Quezon' | wikisql |
CREATE TABLE table_62503 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year did the player with a total less than 300 and a to par of 9 have a win?
| SELECT "Year(s) won" FROM table_62503 WHERE "Total" < '300' AND "To par" = '9' | wikisql |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate tim... | SELECT A.* FROM Posts AS Q INNER JOIN Posts AS A ON (Q.AcceptedAnswerId = A.Id) WHERE A.PostTypeId = 1 | sede |
CREATE TABLE table_68961 (
"Episode" text,
"Song choice" text,
"Original artist" text,
"Order #" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What song was chosen for the episode with the top 8?
| SELECT "Song choice" FROM table_68961 WHERE "Episode" = 'top 8' | wikisql |
CREATE TABLE match_season (
season number,
player text,
position text,
country number,
team number,
draft_pick_number number,
draft_class text,
college text
)
CREATE TABLE team (
team_id number,
name text
)
CREATE TABLE player (
player_id number,
player text,
years_... | SELECT country_name, capital FROM country | spider |
CREATE TABLE table_61501 (
"Tournament" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
)
-- Using valid SQLite, answer the following qu... | SELECT "2011" FROM table_61501 WHERE "2010" = '2r' AND "2013" = 'w' | wikisql |
CREATE TABLE mzjzjlb_jybgb (
YLJGDM_MZJZJLB text,
BGDH number,
YLJGDM number
)
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 te... | SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGDH = '08512792066' | css |
CREATE TABLE Course (
CID VARCHAR(7),
CName VARCHAR(40),
Credits INTEGER,
Instructor INTEGER,
Days VARCHAR(5),
Hours VARCHAR(11),
DNO INTEGER
)
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1),
Phone INTEGER... | SELECT Days, AVG(Credits) FROM Course GROUP BY Days ORDER BY Credits | nvbench |
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 t1.drugname FROM (SELECT medication.drugname, COUNT(medication.drugstarttime) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022... | eicu |
CREATE TABLE table_53805 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text,
"Arena" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many attended the game against the sharks wit... | SELECT AVG("Attendance") FROM table_53805 WHERE "Points" > '86' AND "Opponent" = 'sharks' | wikisql |
CREATE TABLE table_49291 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Player has a To par of 1?
| SELECT "Player" FROM table_49291 WHERE "To par" = '–1' | 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 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.short_title = "Contr cerebr arteriogram" | mimicsql_data |
CREATE TABLE table_train_134 (
"id" int,
"mini_mental_state_examination_mmse" int,
"geriatric_depression_scale_gds" int,
"alzheimer_disease_ad" bool,
"rosen_modified_hachinski_ischemic_score" int,
"clinical_dementia_rating_cdr" float,
"NOUSE" float
)
-- Using valid SQLite, answer the follo... | SELECT * FROM table_train_134 WHERE clinical_dementia_rating_cdr >= 0.5 OR clinical_dementia_rating_cdr >= 0.5 | criteria2sql |
CREATE TABLE table_60412 (
"Year" real,
"Name of Tournament" text,
"Champions" text,
"Runners-up" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the Runners-up prior to 1990 when Ivan Lendl was Champion in the Seiko Super Ten... | SELECT "Runners-up" FROM table_60412 WHERE "Champions" = 'ivan lendl' AND "Name of Tournament" = 'seiko super tennis' AND "Year" < '1990' | wikisql |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT jybgb.SQKS, jybgb.SQKSMC FROM jybgb WHERE jybgb.BGDH = '46976563661' | css |
CREATE TABLE table_67160 (
"Date" text,
"Visiting team" text,
"Final score" text,
"Host team" text,
"Stadium" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date did the New York Giants play as a visiting team?
| SELECT "Date" FROM table_67160 WHERE "Visiting team" = 'new york giants' | wikisql |
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 SUM(t_kc22.AMOUNT) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '韦逸馨' AND t_kc22.t_kc21_CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2008-04-28' AND '2018-10-12' AND t_kc22.MED_INV_ITEM_TYPE = '手术费' | css |
CREATE TABLE farm (
Farm_ID int,
Year int,
Total_Horses real,
Working_Horses real,
Total_Cattle real,
Oxen real,
Bulls real,
Cows real,
Pigs real,
Sheep_and_Goats real
)
CREATE TABLE competition_record (
Competition_ID int,
Farm_ID int,
Rank int
)
CREATE TABLE city ... | SELECT Year, COUNT(Year) FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID ORDER BY COUNT(Year) DESC | nvbench |
CREATE TABLE gymnast (
gymnast_id number,
floor_exercise_points number,
pommel_horse_points number,
rings_points number,
vault_points number,
parallel_bars_points number,
horizontal_bar_points number,
total_points number
)
CREATE TABLE people (
people_id number,
name text,
a... | SELECT T2.hometown, COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.gymnast_id = T2.people_id GROUP BY T2.hometown | spider |
CREATE TABLE table_47312 (
"Year" text,
"Indians admitted" real,
"Pakistanis admitted" real,
"Sri Lankans admitted" real,
"Bangladeshis admitted" real,
"Nepalis admitted" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Sri Lankans were a... | SELECT SUM("Sri Lankans admitted") FROM table_47312 WHERE "Year" = '2004' AND "Nepalis admitted" > '594' | wikisql |
CREATE TABLE bank (
branch_ID int,
bname varchar(20),
no_of_customers int,
city varchar(10),
state varchar(20)
)
CREATE TABLE loan (
loan_ID varchar(3),
loan_type varchar(15),
cust_ID varchar(3),
branch_ID varchar(3),
amount int
)
CREATE TABLE customer (
cust_ID varchar(3),... | SELECT cust_name, acc_bal FROM customer WHERE cust_name LIKE '%a%' ORDER BY cust_name DESC | nvbench |
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.JYZBLSH FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.B... | css |
CREATE TABLE table_28020 (
"Agency" text,
"Route Number" text,
"North/East Terminal" text,
"South/West Terminal" text,
"More Information" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the route number for rincon valley
| SELECT "Route Number" FROM table_28020 WHERE "South/West Terminal" = 'Rincon Valley' | 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 * FROM (SELECT OwnerUserId AS id, MAX(Tags) AS tags FROM Posts WHERE CreationDate > '1/1/2015' AND LENGTH(Tags) > 0 GROUP BY OwnerUserId) AS x WHERE LENGTH(Tags) > 50 LIMIT 50000 | sede |
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 (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.drug_type = "MAIN" AND lab.label = "Reticulocyte Count, Manual" | mimicsql_data |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time... | SELECT DISTINCT medication.routeadmin FROM medication WHERE medication.drugname = 'k phos mono-sod phos di & mono 155-852-130 mg po tabs' | eicu |
CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE weather (
date TEXT,
max_temperature_f INTEGER,
mean_temperature_f INTEGER,
min_temperature_f INTEGER,
max_dew_point_f INTEGER,
... | SELECT city, MAX(lat) FROM station GROUP BY city ORDER BY MAX(lat) DESC | nvbench |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY... | SELECT FIRST_NAME, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COMMISSION_PCT DESC | nvbench |
CREATE TABLE basketball_match (
school_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many schools are in the basketball match?
| SELECT COUNT(DISTINCT school_id) FROM basketball_match | sql_create_context |
CREATE TABLE table_25773116_2 (
pole_position VARCHAR,
fastest_lap VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had pole position for the races in Braselton, Georgia where Victor Carbone had fastest lap?
| SELECT pole_position FROM table_25773116_2 WHERE fastest_lap = "Victor Carbone" AND location = "Braselton, Georgia" | sql_create_context |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
... | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'mal neo lower 3rd esoph')) AND DATETIME(cost.chargetime) <= DAT... | mimic_iii |
CREATE TABLE table_172 (
"Country/Region" text,
"Show Title" text,
"Languages" text,
"Host" text,
"Channel" text,
"Premiere" text,
"Seasons" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which premiere had languages in da... | SELECT "Premiere" FROM table_172 WHERE "Languages" = 'Danish' | wikisql |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE treatment (
treat... | SELECT DISTINCT medication.routeadmin FROM medication WHERE medication.drugname = 'potassium chloride 40 meq/100 ml iv piggy back 100 ml bag' | eicu |
CREATE TABLE table_name_82 (
channel VARCHAR,
studio_analysts VARCHAR,
play_by_play VARCHAR,
studio_host VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which channel will have play by play commentator Paul Sunderland, Studio Host Bill Macdonald and S... | SELECT channel FROM table_name_82 WHERE play_by_play = "paul sunderland" AND studio_host = "bill macdonald" AND studio_analysts = "jack haley" | sql_create_context |
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE writes (
paperid int,
... | SELECT DISTINCT cite.citedpaperid, COUNT(cite.citedpaperid) FROM author, cite, paper, writes WHERE author.authorname = 'ali farhadi' AND paper.paperid = cite.citedpaperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid GROUP BY cite.citedpaperid ORDER BY COUNT(cite.citedpaperid) DESC | scholar |
CREATE TABLE table_16859758_1 (
release_date VARCHAR,
title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was 'Tell You When' released?
| SELECT release_date FROM table_16859758_1 WHERE title = "Tell You When" | sql_create_context |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
... | SELECT p.Score AS "Score", SUM(CASE WHEN b.Id IS NULL THEN 1 ELSE 0 END) AS "Not Informed", SUM(CASE WHEN b.Id IS NULL THEN 0 ELSE 1 END) AS "Informed" FROM Posts AS p LEFT OUTER JOIN Badges AS b ON b.UserId = p.OwnerUserId AND b.Name = 'Informed' WHERE p.PostTypeId = 2 GROUP BY p.Score ORDER BY p.Score | sede |
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 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.PERSON_NM = '华鹏运' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费' | css |
CREATE TABLE table_64189 (
"2005/ 06" text,
"2006/ 07" text,
"2007/ 08" text,
"2009/ 10" text,
"2010/ 11" text,
"2011/ 12" text,
"2012/ 13" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which 2005/ 06 has a 2011/ 12 of ranking tournaments
| SELECT "2005/ 06" FROM table_64189 WHERE "2011/ 12" = 'ranking tournaments' | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2168" AND diagnoses.long_title = "Hepatitis, unspecified" | mimicsql_data |
CREATE TABLE table_name_6 (
dates VARCHAR,
rally_hq VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which dates have a Rally HQ of kingscliff?
| SELECT dates FROM table_name_6 WHERE rally_hq = "kingscliff" | sql_create_context |
CREATE TABLE table_name_50 (
date VARCHAR,
site VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date was the Site michigan stadium ann arbor, mi?
| SELECT date FROM table_name_50 WHERE site = "michigan stadium • ann arbor, mi" | sql_create_context |
CREATE TABLE table_12398 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score for Nick Faldo?
| SELECT AVG("Score") FROM table_12398 WHERE "Player" = 'nick faldo' | wikisql |
CREATE TABLE table_name_36 (
lost VARCHAR,
drawn INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many losses have draw values under 1?
| SELECT COUNT(lost) FROM table_name_36 WHERE drawn < 1 | sql_create_context |
CREATE TABLE table_name_60 (
series VARCHAR,
saturday VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what series did Alice Levine Jamie East give a presentation on Saturday?
| SELECT series FROM table_name_60 WHERE saturday = "alice levine jamie east" | sql_create_context |
CREATE TABLE table_10946 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want the lowest Grid for David Coulthard
| SELECT MIN("Grid") FROM table_10946 WHERE "Driver" = 'david coulthard' | wikisql |
CREATE TABLE table_203_496 (
id number,
"pos" number,
"country" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many more medals did italy win than the soviet union ?
| SELECT (SELECT "total" FROM table_203_496 WHERE "country" = 'italy') - (SELECT "total" FROM table_203_496 WHERE "country" = 'soviet union') | squall |
CREATE TABLE table_204_487 (
id number,
"home team" text,
"score" text,
"visiting team" text,
"location" text,
"venue" text,
"door" text,
"surface" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many teams won by a margin of two or m... | SELECT COUNT(*) FROM table_204_487 WHERE ABS("score" - "score") >= 2 | squall |
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 FROM course, program_course WHERE course.department LIKE '%THTREMUS%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id | advising |
CREATE TABLE table_name_43 (
year INTEGER,
entrant VARCHAR,
engine VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many years did Barclay Nordica Arrows BMW enter with Cosworth v8 engine?
| SELECT SUM(year) FROM table_name_43 WHERE entrant = "barclay nordica arrows bmw" AND engine = "cosworth v8" | sql_create_context |
CREATE TABLE table_name_36 (
goals INTEGER,
name VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many goals were there for Johan Cruyff when the rank's less than 3?
| SELECT SUM(goals) FROM table_name_36 WHERE name = "johan cruyff" AND rank < 3 | sql_create_context |
CREATE TABLE table_1342331_18 (
district VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What district has Riley Joseph Wilson as the incumbent?
| SELECT district FROM table_1342331_18 WHERE incumbent = "Riley Joseph Wilson" | sql_create_context |
CREATE TABLE table_name_33 (
number VARCHAR,
language VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Number has a Language listed as other?
| SELECT number FROM table_name_33 WHERE language = "other" | sql_create_context |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE has_amenity (
dormid number,
amenid number
)
CREATE TABLE dorm_amenity (
amenid number,
amenity_name text
)
CREATE TABLE dorm ... | SELECT dorm_name FROM dorm ORDER BY student_capacity DESC LIMIT 1 | spider |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
... | SELECT T1.Allergy, COUNT(T1.Allergy) FROM Allergy_Type AS T1 JOIN Has_Allergy AS T2 ON T1.Allergy = T2.Allergy JOIN Student AS T3 ON T3.StuID = T2.StuID WHERE T3.Fname = "Lisa" GROUP BY T1.Allergy ORDER BY T1.Allergy DESC | nvbench |
CREATE TABLE table_train_37 (
"id" int,
"severe_sepsis" bool,
"mechanical_ventilation" bool,
"surgery" bool,
"receiving_vasopressor" bool,
"sepsis" bool,
"organ_failure" bool,
"septic_shock" bool,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following question... | SELECT * FROM table_train_37 WHERE age < 18 | criteria2sql |
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 AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.days_stay = "4" | mimicsql_data |
CREATE TABLE table_name_36 (
score VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score on December 1?
| SELECT score FROM table_name_36 WHERE date = "december 1" | sql_create_context |
CREATE TABLE table_22951646_1 (
number_of_contestants INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most number of contestants
| SELECT MAX(number_of_contestants) FROM table_22951646_1 | sql_create_context |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text... | SELECT DISTINCT flight_id FROM flight WHERE (((departure_time < 900 AND flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 21 AND DATE_DAYalias0.month_number = 2 AND DATE_DAYal... | atis |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "ANGIOEDEMA" | mimicsql_data |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0... | SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY HIRE_DATE | nvbench |
CREATE TABLE table_204_946 (
id number,
"pos" number,
"no" number,
"driver" text,
"team" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- greg moore was from the same ... | SELECT "driver" FROM table_204_946 WHERE "pos" = 9 | squall |
CREATE TABLE table_46204 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Player, when Total is greater than 148, and when To Par is '12'?
| SELECT "Player" FROM table_46204 WHERE "Total" > '148' AND "To par" = '12' | wikisql |
CREATE TABLE table_66519 (
"Original NFL team" text,
"Player" text,
"Pos." text,
"College" text,
"Conf." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What conference did the player originally from the denver broncos play in?
| SELECT "Conf." FROM table_66519 WHERE "Original NFL team" = 'denver broncos' | wikisql |
CREATE TABLE table_4189 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Podiums" real,
"Points" real,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many poles ... | SELECT "Poles" FROM table_4189 WHERE "Series" = 'European F3 Open' | wikisql |
CREATE TABLE table_25751274_2 (
rank__night_ INTEGER,
rating VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest rank of an episode with a rating/share (18-49) of 1.3/4?
| SELECT MIN(rank__night_) FROM table_25751274_2 WHERE rating / SHARE(18 - 49) = 1.3 / 4 | sql_create_context |
CREATE TABLE table_name_80 (
round VARCHAR,
winning_driver VARCHAR,
circuit VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which round had a winning driver of Uwe Alzen, at the Sepang International circuit?
| SELECT round FROM table_name_80 WHERE winning_driver = "uwe alzen" AND circuit = "sepang international circuit" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.