context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_31689 (
"Place" real,
"Title" text,
"Units sold in Japan" text,
"Units sold in the UK" text,
"Units sold in the US" text,
"Total units sold" real
) | How many units were sold in the US of the game that sold 346,000 units in japan? | SELECT "Units sold in the US" FROM table_31689 WHERE "Units sold in Japan" = '346,000' | wikisql |
CREATE TABLE table_11354111_3 (
night_rank VARCHAR,
rating VARCHAR
) | what's the night rank with rating of 6.2 | SELECT night_rank FROM table_11354111_3 WHERE rating = "6.2" | sql_create_context |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 编号为23981403团伙成员有哪些药是其最常开的排一下序? | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '23981403' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC | css |
CREATE TABLE table_name_26 (
opponent VARCHAR,
save VARCHAR
) | Who was the Opponent when the Save was || 36,388 ||15-7||? | SELECT opponent FROM table_name_26 WHERE save = "|| 36,388 ||15-7||" | sql_create_context |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 编号为93699422590的病人在治病期间购买的药品的定价上限金额高于5808.74元的一共有哪些药品? | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '93699422590' AND t_kc22.UP_LIMIT_AMO > 5808.74 | css |
CREATE TABLE table_name_32 (
save VARCHAR,
opponent VARCHAR,
loss VARCHAR
) | Who earned the save in the game against the Sinon Bulls when Jeriome Robertson took the loss? | SELECT save FROM table_name_32 WHERE opponent = "sinon bulls" AND loss = "jeriome robertson" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | give me the number of patients whose ethnicity is unknown/not specified and diagnoses long title is mitral valve insufficiency and aortic valve insufficiency? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "UNKNOWN/NOT SPECIFIED" AND diagnoses.long_title = "Mitral valve insufficiency and aortic valve insufficiency" | mimicsql_data |
CREATE TABLE table_204_620 (
id number,
"title" text,
"year" number,
"language" text,
"role" text,
"notes" text
) | what is the total years on the chart | SELECT COUNT(DISTINCT "year") FROM table_204_620 | squall |
CREATE TABLE table_name_41 (
gp_gs VARCHAR,
effic VARCHAR,
avg_g VARCHAR
) | How many gp-gs have 121.70 as an effic and an avg/g less than 218.7? | SELECT COUNT(gp_gs) FROM table_name_41 WHERE effic = "121.70" AND avg_g < 218.7 | sql_create_context |
CREATE TABLE table_73135 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | Name the number of party for richard l. hanna (r) 53.1% mike arcuri (d) 46.9% | SELECT COUNT("Party") FROM table_73135 WHERE "Candidates" = 'Richard L. Hanna (R) 53.1% Mike Arcuri (D) 46.9%' | wikisql |
CREATE TABLE table_203_721 (
id number,
"school" text,
"location" text,
"control" text,
"type" text,
"enrollment" number,
"founded" number
) | which school had the largest enrollment ? | SELECT "school" FROM table_203_721 ORDER BY "enrollment" DESC LIMIT 1 | squall |
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Reviewer (
rID int,
name text
) | Please tell me the total star ratings of each movie title using a bar chart. | SELECT title, SUM(stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY title | nvbench |
CREATE TABLE table_75227 (
"Year" real,
"Class" text,
"Team" text,
"Machine" text,
"Points" real,
"Rank" text,
"Wins" real
) | Which year had a team of Aprilia and a rank of 4th? | SELECT "Year" FROM table_75227 WHERE "Team" = 'aprilia' AND "Rank" = '4th' | wikisql |
CREATE TABLE table_37480 (
"Date" text,
"City" text,
"Result" text,
"Score" text,
"Competition" text
) | Which City has a Date of june 9, 1976? | SELECT "City" FROM table_37480 WHERE "Date" = 'june 9, 1976' | wikisql |
CREATE TABLE procedures (
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
)
... | give me the number of patients whose insurance is self pay and diagnoses long title is other disorders of the pituitary and other syndromes of diencephalohypophyseal origin? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Self Pay" AND diagnoses.long_title = "Other disorders of the pituitary and other syndromes of diencephalohypophyseal origin" | mimicsql_data |
CREATE TABLE table_2562572_2 (
population__2011_ VARCHAR,
population__2002_ VARCHAR
) | What is the number of 2011 populations having a 2002 population of 29449? | SELECT COUNT(population__2011_) FROM table_2562572_2 WHERE population__2002_ = 29449 | sql_create_context |
CREATE TABLE table_535 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
) | What is the name of the episode that Richard Thorpe directed? | SELECT "Title" FROM table_535 WHERE "Directed by" = 'Richard Thorpe' | wikisql |
CREATE TABLE table_8664 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game site" text
) | What was the result of the week that was a bye before week 6? | SELECT "Result" FROM table_8664 WHERE "Week" < '6' AND "Game site" = 'bye' | wikisql |
CREATE TABLE table_name_41 (
discoverer_s_ VARCHAR,
aphelion__au_ VARCHAR,
year_discovered VARCHAR
) | Who was the discoverer of the object with an Aphelion above 97 in 2004? | SELECT discoverer_s_ FROM table_name_41 WHERE aphelion__au_ > 97 AND year_discovered = 2004 | sql_create_context |
CREATE TABLE table_name_96 (
score VARCHAR,
away_team VARCHAR
) | What was the score of the match played against away team Arsenal? | SELECT score FROM table_name_96 WHERE away_team = "arsenal" | sql_create_context |
CREATE TABLE wedding (
Church_ID int,
Male_ID int,
Female_ID int,
Year int
)
CREATE TABLE church (
Church_ID int,
Name text,
Organized_by text,
Open_Date int,
Continuation_of text
)
CREATE TABLE people (
People_ID int,
Name text,
Country text,
Is_Male text,
Age ... | Show all countries and the number of people from each country with a bar chart, rank bar in asc order. | SELECT Country, COUNT(*) FROM people GROUP BY Country ORDER BY Country | nvbench |
CREATE TABLE table_204_981 (
id number,
"ep#" number,
"title" text,
"broadcast date" text,
"written by" text,
"directed by" text
) | title of the episode that came before the one directed by bob balaban | SELECT "title" FROM table_204_981 WHERE "ep#" = (SELECT "ep#" FROM table_204_981 WHERE "directed by" = 'bob balaban') - 1 | squall |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_typ... | did patient 162 get tested in the po2 lab in 04/last year? | SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'po2') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 162) AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'sta... | mimic_iii |
CREATE TABLE table_6468 (
"English name" text,
"Bulgarian name" text,
"Bulgarian name ( Transliteration )" text,
"Old Bulgarian Names" text,
"Old Bulgarian name (Transliteration)" text,
"Old Bulgarian name - Meaning" text
) | What's the Bulgarian word for september? | SELECT "Bulgarian name" FROM table_6468 WHERE "English name" = 'september' | wikisql |
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... | Search all the question post by tag name. | SELECT * FROM Posts JOIN PostTags ON PostTags.PostId = Posts.Id JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName LIKE 'refactoring' OR Tags.TagName LIKE 'design-patterns' OR Tags.TagName LIKE 'anti-patterns' OR Tags.TagName LIKE 'code-cleanup' OR Tags.TagName LIKE 'architecture' OR Tags.TagName LIKE 'software-d... | sede |
CREATE TABLE table_name_91 (
venue VARCHAR,
year VARCHAR
) | What venue hosted the 2003 event? | SELECT venue FROM table_name_91 WHERE year = 2003 | sql_create_context |
CREATE TABLE Documents_to_be_Destroyed (
Document_ID INTEGER,
Destruction_Authorised_by_Employee_ID INTEGER,
Destroyed_by_Employee_ID INTEGER,
Planned_Destruction_Date DATETIME,
Actual_Destruction_Date DATETIME,
Other_Details VARCHAR(255)
)
CREATE TABLE Roles (
Role_Code CHAR(15),
Role_... | Return a histogram on what is the code of each role and the number of employees in each role?, and show in ascending by the Y-axis please. | SELECT Role_Code, COUNT(*) FROM Employees GROUP BY Role_Code ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_25227 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Name the high assists for december 9 | SELECT "High assists" FROM table_25227 WHERE "Date" = 'December 9' | wikisql |
CREATE TABLE table_name_56 (
ticket_price_s_ VARCHAR,
date_s_ VARCHAR
) | What was the ticket price on September 16, 1986? | SELECT ticket_price_s_ FROM table_name_56 WHERE date_s_ = "september 16, 1986" | sql_create_context |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABL... | Bizarre question stats by Tag. | WITH TaggedPosts(PostId) AS (SELECT pt.PostId AS PostId FROM PostTags AS pt INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE t.TagName LIKE '%' + '##tag:string##' + '%' GROUP BY pt.PostId) SELECT Id AS "post_link", * FROM Posts WHERE Id IN (SELECT PostId FROM TaggedPosts) AND PostTypeId = 1 AND AnswerCount = 0 AND NOT Acc... | sede |
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE equipment_sequence (
aircr... | what is the earliest flight between PITTSBURGH and DENVER that serves BREAKFAST | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight, food_service WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code AND food_se... | atis |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
... | what is the total amount of per iv flush: upper arm l 20 gauge that patient 017-30730 had received? | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-30730')) AND intakeoutput.celllabel = 'per i... | eicu |
CREATE TABLE table_63612 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( \u00a3 )" text
) | Which Score has a To par of +1 in sweden? | SELECT "Score" FROM table_63612 WHERE "To par" = '+1' AND "Country" = 'sweden' | wikisql |
CREATE TABLE accelerator_compatible_browser (
accelerator_id int,
browser_id int,
compatible_since_year int
)
CREATE TABLE Web_client_accelerator (
id int,
name text,
Operating_system text,
Client text,
Connection text
)
CREATE TABLE browser (
id int,
name text,
market_shar... | Draw a bar chart of operating system versus the total number, list from low to high by the X-axis. | SELECT Operating_system, COUNT(*) FROM Web_client_accelerator GROUP BY Operating_system ORDER BY Operating_system | nvbench |
CREATE TABLE table_name_59 (
points INTEGER,
rank VARCHAR,
wins VARCHAR
) | What is the total of the points for wins under 6 and a rank of 2nd? | SELECT SUM(points) FROM table_name_59 WHERE rank = "2nd" AND wins < 6 | sql_create_context |
CREATE TABLE table_3335 (
"Settlement" text,
"Cyrillic Name Other Names" text,
"Type" text,
"Population (2011)" real,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
) | Name the dominant religion 2002 for village banatski despotovac | SELECT "Dominant religion (2002)" FROM table_3335 WHERE "Type" = 'village' AND "Settlement" = 'Banatski Despotovac' | wikisql |
CREATE TABLE table_71284 (
"Year" real,
"Chassis" text,
"Engine" text,
"Start" text,
"Finish" text,
"Team" text
) | What position did team scandia finish when their engine was cosworth? | SELECT "Finish" FROM table_71284 WHERE "Engine" = 'cosworth' AND "Team" = 'team scandia' | wikisql |
CREATE TABLE table_26890 (
"Candidate" text,
"Background" text,
"Original team" text,
"Age" real,
"Hometown" text,
"Result" text
) | How many age figures for the player fired in week 6? | SELECT COUNT("Age") FROM table_26890 WHERE "Result" = 'Fired in week 6' | wikisql |
CREATE TABLE table_27730_9 (
ijekavian VARCHAR,
ikavian VARCHAR
) | What's the ijekavian translation of the ikavian word grijati? | SELECT ijekavian FROM table_27730_9 WHERE ikavian = "grijati" | sql_create_context |
CREATE TABLE table_name_19 (
record VARCHAR,
game VARCHAR,
score VARCHAR
) | What is the Record for a game less than 3 and the score was l 91 96 (ot)? | SELECT record FROM table_name_19 WHERE game < 3 AND score = "l 91–96 (ot)" | sql_create_context |
CREATE TABLE table_9283 (
"Date" text,
"Opponent" text,
"Score" text,
"Result" text,
"Record" text
) | Which Score has a Record of 5-4? | SELECT "Score" FROM table_9283 WHERE "Record" = '5-4' | 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... | 从06.11.28开始,截止到19.10.22,在参保人潘和正所有的结算里,10元以内小金额的结算次数总共有多少 | SELECT COUNT(*) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '潘和正' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2006-11-28' AND '2019-10-22' AND t_kc24.MED_AMOUT <= 10 UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE fgwyjzb.P... | css |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score num... | Top Users by Tag and Location. | SELECT u.Id AS "user_link", u.Location, COUNT(a.Id) AS xCount, SUM(a.Score) AS xSum FROM Posts AS a JOIN Posts AS q ON a.ParentId = q.Id JOIN Users AS u ON a.OwnerUserId = u.Id WHERE a.PostTypeId = '2' AND (@Empty = 0 OR u.Location IS NULL) AND (@Empty = 0 OR u.Location = '') AND LOWER(u.Location) LIKE '%' + @Location ... | sede |
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... | 零九年八月一日到一二年五月十二日的这段时间里,8225788医疗机构中哪5个科室消耗统筹金额最多 | SELECT gwyjzb.MED_ORG_DEPT_CD, gwyjzb.MED_ORG_DEPT_NM FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '8225788' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2009-08-01' AND '2012-05-12' GROUP BY gwyjzb.MED_ORG_DEPT_CD ORDER BY SUM(t_kc24.OVE_PAY) DESC LIMIT 5 UNION SELECT fgw... | css |
CREATE TABLE table_204_880 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
) | 51st position and 31st position were both obtained by this runner at which competition ? | SELECT "competition" FROM table_204_880 WHERE "position" = 51 | squall |
CREATE TABLE table_12651 (
"Perpetrator" text,
"Year" text,
"Location" text,
"Country" text,
"Killed" text
) | Which location is in the Belgian Congo Tanganyika? | SELECT "Location" FROM table_12651 WHERE "Country" = 'belgian congo tanganyika' | wikisql |
CREATE TABLE table_204_246 (
id number,
"department" text,
"total deputies" number,
"uninominal deputies" number,
"plurinominal deputies" number,
"special indigenous\nor campesino deputies" number,
"senators" number
) | are there more special indigenous or campesino deputies from cochabamba or chuquisaca ? | SELECT "department" FROM table_204_246 WHERE "department" IN ('cochabamba', 'chuquisaca') ORDER BY "special indigenous\nor campesino deputies" DESC LIMIT 1 | squall |
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... | 卫星纬这位患者的204895指标在零一年四月三十日至零六年一月三十一日期间的情况 | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJG... | css |
CREATE TABLE table_5840 (
"Race" text,
"Length" text,
"Class" text,
"Circuit" text,
"Date" text
) | On which date was the GT class at Monterey Sports Car Grand Prix? | SELECT "Date" FROM table_5840 WHERE "Class" = 'gt' AND "Race" = 'monterey sports car grand prix' | wikisql |
CREATE TABLE table_75126 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | What was the tries against when they had 32 tries for? | SELECT "Tries against" FROM table_75126 WHERE "Tries for" = '32' | wikisql |
CREATE TABLE table_34152 (
"Round" text,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team (League)" text
) | What round was matt brait? | SELECT "Round" FROM table_34152 WHERE "Player" = 'matt brait' | wikisql |
CREATE TABLE table_28171 (
"No." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
) | Who directed the episode that had a production code of 2j5457? | SELECT "Directed by" FROM table_28171 WHERE "Production code" = '2J5457' | wikisql |
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 area (
course_id int,
area varchar
)
CREATE TABLE gsi (
course_offeri... | Are the classes that I took considered software classes ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN student_record ON student_record.course_id = course.course_id INNER JOIN area ON student_record.course_id = area.course_id WHERE area.area LIKE '%software%' AND student_record.student_id = 1 | advising |
CREATE TABLE table_2513 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 5" real,
"Top 10" real,
"Poles" real,
"Avg. Start" text,
"Avg. Finish" text,
"Winnings" text,
"Position" text,
"Team(s)" text
) | With an average finish of 29.0, what was the average start? | SELECT "Avg. Start" FROM table_2513 WHERE "Avg. Finish" = '29.0' | wikisql |
CREATE TABLE table_1648 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Name the high assists for houston | SELECT "High assists" FROM table_1648 WHERE "Team" = 'Houston' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
c... | calculate the number of patients staying in ward 664 since 5 years ago. | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 664 AND DATETIME(patient.unitadmittime) >= DATETIME(CURRENT_TIME(), '-5 year') | eicu |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewTaskStates (
Id number,
Na... | Questions with a specific tag at first revision and without that tag now. | SELECT Posts.Id AS "post_link", Posts.Tags, PostInits.Text AS "initial_tags", Posts.CreationDate FROM Posts INNER JOIN (SELECT PostId, Text FROM PostHistory WHERE PostHistoryTypeId = 3 AND Text LIKE '%##Tag##%') AS PostInits ON Posts.Id = PostInits.PostId WHERE NOT Posts.Tags LIKE '%##Tag##%' AND (DATEDIFF(month, Posts... | sede |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | what was the last time until 50 months ago patient 28966 had the minimum hemoglobin value? | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28966) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'hemoglobin') AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(), '-50... | mimic_iii |
CREATE TABLE table_48636 (
"Title" text,
"Writer" text,
"Format" text,
"Company" text,
"release date" text
) | What is the release date of the album written by Goss, James James Goss under Audiogo? | SELECT "release date" FROM table_48636 WHERE "Writer" = 'goss, james james goss' AND "Company" = 'audiogo' | wikisql |
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_seaso... | A bar chart showing the average of capacity of cinemas open for each year, order by the y-axis in descending. | SELECT Openning_year, AVG(Capacity) FROM cinema GROUP BY Openning_year ORDER BY AVG(Capacity) DESC | nvbench |
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... | 在04年11月24日到16年1月8期间,患者52511497被开出药品107476384共有几次? | SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '52511497' AND t_kc22.STA_DATE BETWEEN '2004-11-24' AND '2016-01-08' AND t_kc22.SOC_SRT_DIRE_CD = '107476384' | css |
CREATE TABLE procedures (
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
)
... | what is age and primary disease of subject id 2560? | SELECT demographic.age, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE table_name_31 (
date VARCHAR,
week VARCHAR,
record VARCHAR
) | On what Date prior to Week 14 was the Record 7-1? | SELECT date FROM table_name_31 WHERE week < 14 AND record = "7-1" | sql_create_context |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,... | are there any flights from BOSTON to SAN FRANCISCO which stop in DENVER | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND CIT... | atis |
CREATE TABLE table_204_415 (
id number,
"season" text,
"tier" number,
"division" text,
"place" text
) | in season 1996/97 was the place above or below 10th ? | SELECT (SELECT "place" FROM table_204_415 WHERE "season" = '1996/97') < 10 | squall |
CREATE TABLE table_name_4 (
player VARCHAR,
score VARCHAR
) | Which player scored 71? | SELECT player FROM table_name_4 WHERE score = 71 | sql_create_context |
CREATE TABLE table_7910 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" text,
"Competition" text,
"Man of the Match" text
) | What is the Date of the Competition with Man of the Match Ollie Bronnimann? | SELECT "Date" FROM table_7910 WHERE "Man of the Match" = 'ollie bronnimann' | wikisql |
CREATE TABLE table_name_16 (
home_team VARCHAR,
away_team VARCHAR
) | Who is the home team when the away team is newcastle united? | SELECT home_team FROM table_name_16 WHERE away_team = "newcastle united" | sql_create_context |
CREATE TABLE table_25190 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
) | How many games were played on May 11? | SELECT COUNT("Game") FROM table_25190 WHERE "Date" = 'May 11' | wikisql |
CREATE TABLE table_name_90 (
developer_s_ VARCHAR,
year VARCHAR
) | Which Developer(s) has a Year of 2010? | SELECT developer_s_ FROM table_name_90 WHERE year = 2010 | sql_create_context |
CREATE TABLE table_name_65 (
episode INTEGER,
segment_c VARCHAR
) | What is the highest episode of Wood Flutes segment c? | SELECT MAX(episode) FROM table_name_65 WHERE segment_c = "wood flutes" | sql_create_context |
CREATE TABLE table_47286 (
"Tournament" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | What is the 2010 value with a 1r in 2012 and an A in 2005? | SELECT "2010" FROM table_47286 WHERE "2012" = '1r' AND "2005" = 'a' | wikisql |
CREATE TABLE table_22723 (
"Rank" real,
"Metropolitan Statistical Area" text,
"Total Population (2010)" real,
"Indian American Population (2010)" real,
"% Indian American" text,
"Asian American Population (2010)" real,
"% Asian American" text,
"Combined Statistical Area" text
) | Name the % asian american for 23526 | SELECT "% Asian American" FROM table_22723 WHERE "Indian American Population (2010)" = '23526' | wikisql |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_... | how many prescriptions was prescribed in 2105 for albuterol-ipratropium? | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'albuterol-ipratropium' AND STRFTIME('%y', prescriptions.startdate) = '2105' | mimic_iii |
CREATE TABLE Students_in_Detention (
student_id INTEGER,
detention_id INTEGER,
incident_id INTEGER
)
CREATE TABLE Ref_Address_Types (
address_type_code VARCHAR(15),
address_type_description VARCHAR(80)
)
CREATE TABLE Detention (
detention_id INTEGER,
detention_type_code VARCHAR(10),
te... | Find date_address_to and the amount of date_address_to , and group by attribute other_details and bin date_address_to by weekday, and visualize them by a bar chart. | SELECT date_address_to, COUNT(date_address_to) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE table_name_15 (
date VARCHAR,
away_team VARCHAR
) | WHAT IS THE DATE WITH AN AWAY TEAM OF BURTON ALBION? | SELECT date FROM table_name_15 WHERE away_team = "burton albion" | sql_create_context |
CREATE TABLE company (
Name VARCHAR,
Industry VARCHAR
) | Show the names of companies in the banking or retailing industry? | SELECT Name FROM company WHERE Industry = "Banking" OR Industry = "Retailing" | sql_create_context |
CREATE TABLE table_74069 (
"Player" text,
"Team" text,
"Matches" real,
"Runs" real,
"Average" text,
"Strike rate" text,
"Highest Score" text,
"100s" real,
"50s" real
) | If the team is Worcestershire and the Matched had were 5, what is the highest score? | SELECT "Highest Score" FROM table_74069 WHERE "Matches" = '5' AND "Team" = 'Worcestershire' | wikisql |
CREATE TABLE checking (
custid number,
balance number
)
CREATE TABLE accounts (
custid number,
name text
)
CREATE TABLE savings (
custid number,
balance number
) | Find the number of checking accounts for each account name. | SELECT COUNT(*), T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid GROUP BY T1.name | spider |
CREATE TABLE table_name_5 (
year INTEGER,
music_director_s_ VARCHAR
) | WHich Year has a Music director(s) of anu malik? | SELECT SUM(year) FROM table_name_5 WHERE music_director_s_ = "anu malik" | sql_create_context |
CREATE TABLE table_203_570 (
id number,
"#" number,
"title" text,
"tpb isbn" text,
"tpb release date" text,
"tpb page number" number,
"collected material" text
) | how long was the big ride ? | SELECT "tpb page number" FROM table_203_570 WHERE "title" = 'the big ride' | squall |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | How many white-russian ethnic background patients have other pulmonary insufficiency not elsewhere classfied diagnoses? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND diagnoses.long_title = "Other pulmonary insufficiency, not elsewhere classified" | mimicsql_data |
CREATE TABLE table_name_95 (
silver INTEGER,
nation VARCHAR,
total VARCHAR
) | What is the lowest amount of silver medals Iceland, who has less than 87 medals, has? | SELECT MIN(silver) FROM table_name_95 WHERE nation = "iceland" AND total < 87 | sql_create_context |
CREATE TABLE table_38402 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | What is the smallest number of wins for a top-25 value greater than 5 and more than 38 cuts? | SELECT MIN("Wins") FROM table_38402 WHERE "Top-25" > '5' AND "Cuts made" > '38' | wikisql |
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,
... | 在01年12月15日到06年8月16日期间,药品4859的开药量在骨伤是多少? | SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.MED_ORG_DEPT_NM = '创伤骨科' AND t_kc22.STA_DATE BETWEEN '2001-12-15' AND '2006-08-16' AND t_kc22.SOC_SRT_DIRE_CD = '4859' | css |
CREATE TABLE table_name_62 (
nominated_work VARCHAR,
year INTEGER
) | What was the Nominated Work earlier than 2003? | SELECT nominated_work FROM table_name_62 WHERE year < 2003 | sql_create_context |
CREATE TABLE table_13825 (
"Brand" text,
"Model" text,
"Type" text,
"Modem" text,
"Storage" text,
"CPU speed" text,
"CPU chip" text
) | What is the type of the RCA RW-2110, which has 2 MB of storage and a v.90 modem? | SELECT "Type" FROM table_13825 WHERE "Modem" = 'v.90' AND "Storage" = '2 mb' AND "Brand" = 'rca' AND "Model" = 'rw-2110' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... | what are the total hospital expenses for patient 016-2639 last year? | SELECT SUM(cost.cost) FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-2639') AND DATETIME(cost.chargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') | eicu |
CREATE TABLE table_79314 (
"Area" text,
"State/ Province" text,
"CSA/CMA 2009 population" real,
"Projected 2025 population" text,
"Projected increase 2009-2025" text
) | What's the projected population of IN-MI? | SELECT "Projected 2025 population" FROM table_79314 WHERE "State/ Province" = 'in-mi' | wikisql |
CREATE TABLE table_23722304_2 (
bore__mm_ VARCHAR,
vehicle_code VARCHAR
) | what is the bore where the vehicle code is t214? | SELECT bore__mm_ FROM table_23722304_2 WHERE vehicle_code = "T214" | sql_create_context |
CREATE TABLE table_name_87 (
player VARCHAR,
total VARCHAR
) | What player has a total of 297? | SELECT player FROM table_name_87 WHERE total = 297 | sql_create_context |
CREATE TABLE table_name_31 (
vehicle_flight__number VARCHAR,
pilot VARCHAR,
velocity__km_h_ VARCHAR
) | What Vehicle Flight # has Pilot Peterson and Velocity (km/h) of 649? | SELECT vehicle_flight__number FROM table_name_31 WHERE pilot = "peterson" AND velocity__km_h_ = 649 | sql_create_context |
CREATE TABLE captain (
CLASS VARCHAR,
age INTEGER
) | What are the average and minimum age of captains in different class? | SELECT AVG(age), MIN(age), CLASS FROM captain GROUP BY CLASS | sql_create_context |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM ... | 从00年2月1日开始06年5月3日结束患者89244700所有检验结果指标记录中的仪器编号以及名称都是啥吗? | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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 = jybgb_jyjgzbb.YLJGDM AN... | css |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
... | in this year, had patient 14054 receive a procedure? | SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14054) AND DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | mimic_iii |
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 diagnosis (
diagn... | what is the maximum yearly number of patients who suffer from s/p aneurysm resection/repair since 4 years ago? | SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 's/p aneurysm resection/repair' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY STRFTIME('%y', diagnosis.diagnosistime)) AS t1 | eicu |
CREATE TABLE table_name_65 (
driver VARCHAR,
points VARCHAR,
grid VARCHAR
) | What driver has over 19 points and a grid of over 2? | SELECT driver FROM table_name_65 WHERE points > 19 AND grid > 2 | sql_create_context |
CREATE TABLE table_name_43 (
word__number INTEGER,
subframe__number INTEGER
) | What is the total word count with a subframe count greater than 3? | SELECT SUM(word__number) FROM table_name_43 WHERE subframe__number > 3 | sql_create_context |
CREATE TABLE table_27495117_3 (
manner_of_departure VARCHAR,
outgoing_manager VARCHAR
) | How many teams had an outgoing manager of antonio g mez | SELECT COUNT(manner_of_departure) FROM table_27495117_3 WHERE outgoing_manager = "Antonio Gómez" | sql_create_context |
CREATE TABLE Catalogs (
catalog_id INTEGER,
catalog_name VARCHAR(50),
catalog_publisher VARCHAR(80),
date_of_publication DATETIME,
date_of_latest_revision DATETIME
)
CREATE TABLE Catalog_Contents (
catalog_entry_id INTEGER,
catalog_level_number INTEGER,
parent_entry_id INTEGER,
prev... | Which attribute definitions have attribute value 0? Give me the number of attributes in each attribute name, and I want to display the number of attribute name in descending order. | SELECT attribute_name, COUNT(attribute_name) FROM Attribute_Definitions AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.attribute_id = t2.attribute_id WHERE t2.attribute_value = 0 GROUP BY attribute_name ORDER BY COUNT(attribute_name) DESC | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.