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_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '7434409' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_NM | css |
CREATE TABLE table_35904 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what Date was Patty Sheehan Runner(s)-up?
| SELECT "Date" FROM table_35904 WHERE "Runner(s)-up" = 'patty sheehan' | wikisql |
CREATE TABLE table_61785 (
"Rider" text,
"Bike" text,
"Laps" real,
"Time" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the minimum grid when there was more than 22 laps?
| SELECT MIN("Grid") FROM table_61785 WHERE "Laps" > '22' | wikisql |
CREATE TABLE table_name_14 (
gold INTEGER,
total INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of Gold, when Total is less than 1?
| SELECT SUM(gold) FROM table_name_14 WHERE total < 1 | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM t... | SELECT COUNT(*) FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '彭馨欣' AND mzjzjlb.JZKSRQ BETWEEN '2007-04-24' AND '2014-10-25' AND mzjzjlb.YLJGDM = '4381298' | css |
CREATE TABLE table_622 (
"Leg" text,
"Stage" text,
"Time (EEST)" text,
"Name" text,
"Length" text,
"Winner" text,
"Time" text,
"Avg. spd." text,
"Rally leader" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of leg ... | SELECT COUNT("Leg") FROM table_622 WHERE "Stage" = 'SS17' | wikisql |
CREATE TABLE table_19948664_1 (
index__year_ VARCHAR,
author___editor___source VARCHAR,
ranking_la__2_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What index was created by the United Nations (UNDP) and reached 2nd place in the LA Ranking?
| SELECT index__year_ FROM table_19948664_1 WHERE author___editor___source = "United Nations (UNDP)" AND ranking_la__2_ = "2nd" | sql_create_context |
CREATE TABLE submission (
Submission_ID int,
Scores real,
Author text,
College text
)
CREATE TABLE Acceptance (
Submission_ID int,
Workshop_ID int,
Result text
)
CREATE TABLE workshop (
Workshop_ID int,
Date text,
Venue text,
Name text
)
-- Using valid SQLite, answer the ... | SELECT Venue, COUNT(Venue) FROM workshop GROUP BY Venue | nvbench |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
... | SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.charttime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id... | mimic_iii |
CREATE TABLE table_name_66 (
date VARCHAR,
versus VARCHAR,
wicket VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date of the game against South Africa and 2nd wickets?
| SELECT date FROM table_name_66 WHERE versus = "south africa" AND wicket = "2nd" | sql_create_context |
CREATE TABLE table_55464 (
"Class" text,
"Wheels" text,
"Date" text,
"Builder" text,
"No. Built" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Builder has a Class of Terrier?
| SELECT "Builder" FROM table_55464 WHERE "Class" = 'terrier' | wikisql |
CREATE TABLE table_204_865 (
id number,
"date" text,
"tournament" text,
"winner" text,
"purse ($)" number,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was the previous tournament winner before andres romero at the september 29 sal... | SELECT "winner" FROM table_204_865 WHERE "date" < (SELECT "date" FROM table_204_865 WHERE "winner" = 'andres romero') ORDER BY "date" DESC LIMIT 1 | squall |
CREATE TABLE table_74960 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Score has an Opponent of melanie south?
| SELECT "Score" FROM table_74960 WHERE "Opponent" = 'melanie south' | wikisql |
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
... | SELECT DISTINCT course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 101 OR course.number = 510) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ... | advising |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT T2.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name | nvbench |
CREATE TABLE table_name_84 (
album VARCHAR,
label VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Album has a Label of tumbleweed 1014?
| SELECT album FROM table_name_84 WHERE label = "tumbleweed 1014" | sql_create_context |
CREATE TABLE table_name_51 (
name VARCHAR,
round VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which name had more than 5 rounds and was a defensive end?
| SELECT name FROM table_name_51 WHERE round > 5 AND position = "defensive end" | sql_create_context |
CREATE TABLE table_name_58 (
away_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What did the away team score at corio oval?
| SELECT away_team AS score FROM table_name_58 WHERE venue = "corio oval" | 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 jyjgzbb (
BGDH text,
BGRQ tim... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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... | css |
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 COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT microlab.patientunitstayid FROM microlab WHERE microlab.culturesite = 'blood, venipuncture' AND STRFTIME('%y', microlab.culturetakentime) = '2104') | eicu |
CREATE TABLE table_27700530_15 (
series VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the series record at after game 3?
| SELECT series FROM table_27700530_15 WHERE game = 3 | sql_create_context |
CREATE TABLE table_17532 (
"Number" real,
"Name" text,
"Titles" text,
"Date" text,
"Opponent" text,
"Result" text,
"Defenses" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many opponents fought on 1982-12-03?
| SELECT COUNT("Opponent") FROM table_17532 WHERE "Date" = '1982-12-03' | wikisql |
CREATE TABLE table_38458 (
"Model" text,
"Min. capacity (mAh)" text,
"Typ. capacity (mAh)" text,
"Capacity after first day" text,
"After 1 year" text,
"After 2 years" text,
"After 3 years" text,
"After 5 years" text
)
-- Using valid SQLite, answer the following questions for the tables... | SELECT "After 1 year" FROM table_38458 WHERE "After 3 years" = '80%' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.dob_year < "2074" | mimicsql_data |
CREATE TABLE table_17861265_1 (
written_by VARCHAR,
us_viewers__million_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the episode writer when the viewers reached 3.03 million in the US?
| SELECT written_by FROM table_17861265_1 WHERE us_viewers__million_ = "3.03" | sql_create_context |
CREATE TABLE table_65576 (
"School" text,
"Location" text,
"Mascot" text,
"Size" real,
"IHSAA Class" text,
"IHSAA Football Class" text,
"County" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the IHSAA class of the school with less t... | SELECT "IHSAA Class" FROM table_65576 WHERE "Size" < '400' AND "Mascot" = 'tigers' | wikisql |
CREATE TABLE table_63314 (
"School" text,
"Location" text,
"Mascot" text,
"Enrollment" real,
"IHSAA Class" text,
"# / County" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What school is in Ligonier?
| SELECT "School" FROM table_63314 WHERE "Location" = 'ligonier' | wikisql |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE p... | SELECT DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday, semester.semester, semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND c... | advising |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "10" AND prescriptions.drug = "Tacrolimus" | mimicsql_data |
CREATE TABLE table_44519 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team (League)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Nationality, when College/Junior/Club Team (League) is 'Guelph St... | SELECT "Nationality" FROM table_44519 WHERE "College/Junior/Club Team (League)" = 'guelph storm ( ohl )' | wikisql |
CREATE TABLE table_name_4 (
player VARCHAR,
club_province VARCHAR,
caps VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Ulster player has fewer than 49 caps and plays the wing position?
| SELECT player FROM table_name_4 WHERE caps < 49 AND position = "wing" AND club_province = "ulster" | sql_create_context |
CREATE TABLE table_77252 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the margin of victory when the runner-up is amy alcott and the winning s... | SELECT "Margin of victory" FROM table_77252 WHERE "Runner(s)-up" = 'amy alcott' AND "Winning score" = '–9 (72-68-67=207)' | wikisql |
CREATE TABLE table_17325937_8 (
high_assists VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many assists were made in the game against San Antonio?
| SELECT COUNT(high_assists) FROM table_17325937_8 WHERE team = "San Antonio" | sql_create_context |
CREATE TABLE table_204_634 (
id number,
"tour" number,
"official title" text,
"venue" text,
"city" text,
"date\nstart" text,
"date\nfinish" text,
"prize money\nusd" number,
"report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how ... | SELECT COUNT("official title") FROM table_204_634 WHERE "date\nstart" = 1 | squall |
CREATE TABLE table_name_27 (
away_team VARCHAR,
tie_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which away team that had a tie of 7?
| SELECT away_team FROM table_name_27 WHERE tie_no = "7" | sql_create_context |
CREATE TABLE table_37723 (
"Season" text,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"Points" text,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the fewest number of wins when he has 3 poles... | SELECT MIN("Wins") FROM table_37723 WHERE "Poles" = '3' AND "Season" = '2010' | wikisql |
CREATE TABLE wrestler (
Wrestler_ID int,
Name text,
Reign text,
Days_held text,
Location text,
Event text
)
CREATE TABLE Elimination (
Elimination_ID text,
Wrestler_ID text,
Team text,
Eliminated_By text,
Elimination_Move text,
Time text
)
-- Using valid SQLite, answer... | SELECT Team, COUNT(*) FROM Elimination GROUP BY Team | nvbench |
CREATE TABLE table_name_15 (
no_7 VARCHAR,
no_4 VARCHAR,
no_10 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is No. 7, when No. 4 is Madison, and when No. 10 is Amelia?
| SELECT no_7 FROM table_name_15 WHERE no_4 = "madison" AND no_10 = "amelia" | sql_create_context |
CREATE TABLE field (
fieldid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid ... | SELECT DISTINCT COUNT(paper.paperid), paper.year FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'semantic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid GROUP BY paper.year ORDER BY paper.year DESC | scholar |
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
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.expire_flag = "0" AND lab.label = "CK-MB Index" | mimicsql_data |
CREATE TABLE table_50880 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest Grid with a time of +1:19.905, and less than 20 laps?
| SELECT MAX("Grid") FROM table_50880 WHERE "Time" = '+1:19.905' AND "Laps" < '20' | wikisql |
CREATE TABLE table_204_639 (
id number,
"poll company" text,
"source" text,
"publication date" text,
"psuv" number,
"opposition" number,
"undecided" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many different poll companies are repre... | SELECT COUNT(DISTINCT "poll company") FROM table_204_639 | squall |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversa... | SELECT a.UserId AS "user_link", COUNT(a.PostId) AS "Count", a.UserId AS "UserId" FROM PostHistory AS a INNER JOIN Posts AS b ON a.PostId = b.Id WHERE a.PostHistoryTypeId = 5 AND b.CreationDate < '2018-01-01' AND a.CreationDate >= '2017-01-01' GROUP BY a.UserId ORDER BY COUNT(a.PostId) DESC | sede |
CREATE TABLE table_name_2 (
_m__best_ VARCHAR,
_fairest VARCHAR,
president VARCHAR,
_m__coach VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the (M) Best & Fairest when ray kaduck was president and richard keane was coach?
| SELECT _m__best_ & _fairest FROM table_name_2 WHERE president = "ray kaduck" AND _m__coach = "richard keane" | sql_create_context |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAd... | SELECT YearBadges.Y, NumBadges, NumQuestions, CAST(NumQuestions AS FLOAT) / CAST(NumBadges AS FLOAT) AS Ratio FROM (SELECT COUNT(Id) AS NumBadges, YEAR(Date) AS Y FROM Badges AS B WHERE B.TagBased = 1 AND B.Name = '##TagName##' AND B.Class = '##BadgeClass##' GROUP BY YEAR(Date)) AS YearBadges INNER JOIN (SELECT COUNT(P... | sede |
CREATE TABLE table_66164 (
"Rank:" real,
"Premier:" text,
"Party:" text,
"Assumed Office:" text,
"Left Office:" text,
"TOTAL Time in Office:" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the premier when the assumed office is 14 april ... | SELECT "Premier:" FROM table_66164 WHERE "Assumed Office:" = '14 april 1894' | wikisql |
CREATE TABLE table_44113 (
"Year" real,
"Regional GVA" real,
"Agriculture" real,
"Industry" real,
"Services" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average Services, when Year is greater than 2003, when Industry is greater than 1... | SELECT AVG("Services") FROM table_44113 WHERE "Year" > '2003' AND "Industry" > '1,465' AND "Regional GVA" > '9,432' | wikisql |
CREATE TABLE ref_service_types (
service_type_code text,
parent_service_type_code text,
service_type_description text
)
CREATE TABLE performers (
performer_id number,
address_id number,
customer_name text,
customer_phone text,
customer_email_address text,
other_details text
)
CREAT... | SELECT product_name, AVG(product_price) FROM products GROUP BY product_name | spider |
CREATE TABLE table_22815568_6 (
status VARCHAR,
poverty_rate VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the status if the poverty rate is 11.4%?
| SELECT status FROM table_22815568_6 WHERE poverty_rate = "11.4%" | sql_create_context |
CREATE TABLE table_1889 (
"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.
-- Name who directed ... | SELECT "Directed by" FROM table_1889 WHERE "U.S. viewers (million)" = '4.22' | wikisql |
CREATE TABLE table_5625 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Round has a Method of decision (unanimous), and an Event of ufc... | SELECT "Round" FROM table_5625 WHERE "Method" = 'decision (unanimous)' AND "Event" = 'ufc 145' | wikisql |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT * FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jy... | css |
CREATE TABLE table_name_87 (
goals VARCHAR,
apps VARCHAR,
club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many goals did he score with under 26 appearances for werder bremen?
| SELECT COUNT(goals) FROM table_name_87 WHERE apps < 26 AND club = "werder bremen" | sql_create_context |
CREATE TABLE table_39732 (
"Code" text,
"Years" text,
"Displacement (bore x stroke)/Type" text,
"Power@rpm" text,
"torque@rpm" text,
"Compression (:1)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Code of 1.6 duratec ti-vct, and a Power@rpm of... | SELECT "torque@rpm" FROM table_39732 WHERE "Code" = '1.6 duratec ti-vct' AND "Power@rpm" = 'ps (kw; hp)@6000' | wikisql |
CREATE TABLE table_42157 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Points" text,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Wins in the Year with more than 16 Races?
| SELECT "Wins" FROM table_42157 WHERE "Races" > '16' | wikisql |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTask... | SELECT COUNT(*) FROM Users WHERE LOWER(Location) LIKE '%brazil' OR LOWER(Location) LIKE '%brasil' | sede |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number... | SELECT DISTINCT flight.flight_id FROM airport, flight WHERE airport.airport_code = 'DAL' AND flight.from_airport = airport.airport_code | atis |
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.short_title = "Personality disorder NOS" | mimicsql_data |
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
)
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT Flag, COUNT(*) FROM Ship GROUP BY Flag ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalpe... | SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-146673') AND STRFTIME('%y', patient.unitadmittime) = '2105' | eicu |
CREATE TABLE table_name_36 (
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2007 value with 1r in 2009 and 2r in 2011 at the Tournament of Wimbledon?
| SELECT 2007 FROM table_name_36 WHERE 2009 = "1r" AND 2011 = "2r" AND tournament = "wimbledon" | sql_create_context |
CREATE TABLE table_name_58 (
starts INTEGER,
money_list_rank VARCHAR,
top_25 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average number of starts when the money list rank is 108 and the rank in the top 25 is greater than 4?
| SELECT AVG(starts) FROM table_name_58 WHERE money_list_rank = "108" AND top_25 > 4 | sql_create_context |
CREATE TABLE table_name_47 (
mccain_number INTEGER,
obama_number VARCHAR,
others_percentage VARCHAR,
mccain_percentage VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest number of votes for McCain in a county that voted 1.6% for other... | SELECT MAX(mccain_number) FROM table_name_47 WHERE others_percentage = "1.6%" AND mccain_percentage = "40.5%" AND obama_number < 256 OFFSET 299 | sql_create_context |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number... | SELECT u.Id AS "user_link", MAX(b.Name) AS "One of the gold badges they have", COUNT(*) AS "Number of gold badges" FROM Users AS u INNER JOIN Badges AS b ON b.UserId = u.Id WHERE b.Class = 1 AND TagBased = 1 GROUP BY u.Id ORDER BY 'Number of gold badges' DESC | sede |
CREATE TABLE table_name_61 (
total INTEGER,
finish VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest total with a t12 finish?
| SELECT MAX(total) FROM table_name_61 WHERE finish = "t12" | 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 SUM(t_kc24.MED_AMOUT) 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 '2007-01-10' AND '2011-12-26' | css |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT wdmzjzjlb.ZYZDBM, wdmzjzjlb.ZYZDMC FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '32686638' UNION SELECT bdmzjzjlb.ZYZDBM, bdmzjzjlb.ZYZDMC FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjlb.YLJGDM AND hz... | css |
CREATE TABLE table_name_1 (
to_par VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many to par for Greg Norman?
| SELECT to_par FROM table_name_1 WHERE player = "greg norman" | sql_create_context |
CREATE TABLE table_23248940_9 (
high_assists VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who did the most high assists during the game played on February 6?
| SELECT high_assists FROM table_23248940_9 WHERE date = "February 6" | sql_create_context |
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM tex... | SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '冯勇军' AND NOT zyjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ >= '2019-11-18') | css |
CREATE TABLE table_51289 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the laps are 31 and the constructor was honda, what's the sum of all grid values?
| SELECT SUM("Grid") FROM table_51289 WHERE "Constructor" = 'honda' AND "Laps" = '31' | wikisql |
CREATE TABLE table_29126507_1 (
date VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did Fitzroy play as the home team?
| SELECT date FROM table_29126507_1 WHERE home_team = "Fitzroy" | sql_create_context |
CREATE TABLE broadcast (
channel_id number,
program_id number,
time_of_day text
)
CREATE TABLE channel (
channel_id number,
name text,
owner text,
share_in_percent number,
rating_in_percent number
)
CREATE TABLE broadcast_share (
channel_id number,
program_id number,
date t... | SELECT name FROM program ORDER BY launch | spider |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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,
... | 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_ID = '70820807' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费' | css |
CREATE TABLE table_48285 (
"Athlete" text,
"Event" text,
"Swim (1.5km)" text,
"Trans 1" text,
"Bike (40km)" text,
"Trans 2" text,
"Run (10km)" text,
"Total Time" text,
"Rank" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How long di... | SELECT "Trans 1" FROM table_48285 WHERE "Total Time" = '2:00:40.20' | wikisql |
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
... | SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'RCCORE' AND course.number = 104 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering... | advising |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,... | SELECT zzmzjzjlb.JZZTDM, zzmzjzjlb.JZZTMC FROM zzmzjzjlb WHERE zzmzjzjlb.JZLSH = '47624266393' UNION SELECT fzzmzjzjlb.JZZTDM, fzzmzjzjlb.JZZTMC FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZLSH = '47624266393' | css |
CREATE TABLE table_65157 (
"Rank" real,
"Athlete" text,
"Country" text,
"Time" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which athlete had a rank of 6 and notes of sc/d?
| SELECT "Athlete" FROM table_65157 WHERE "Notes" = 'sc/d' AND "Rank" = '6' | wikisql |
CREATE TABLE table_26397277_3 (
brand__to_ VARCHAR,
pick__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the brand for pick number 15
| SELECT brand__to_ FROM table_26397277_3 WHERE pick__number = 15 | sql_create_context |
CREATE TABLE table_name_33 (
school_year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is 02-03, when School Year is % Learning In Latvian?
| SELECT 02 AS _03 FROM table_name_33 WHERE school_year = "% learning in latvian" | sql_create_context |
CREATE TABLE table_name_85 (
score VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score of the game attended by 25,034?
| SELECT score FROM table_name_85 WHERE attendance = "25,034" | sql_create_context |
CREATE TABLE table_1204 (
"No" real,
"Date" text,
"Round" text,
"Circuit" text,
"Pole Position" text,
"Fastest Lap" text,
"Race Winner" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people won in No. 12
| SELECT COUNT("Race Winner") FROM table_1204 WHERE "No" = '12' | wikisql |
CREATE TABLE movie (
movie_id int,
Title text,
Year int,
Director text,
Budget_million real,
Gross_worldwide int
)
CREATE TABLE book_club (
book_club_id int,
Year int,
Author_or_Editor text,
Book_Title text,
Publisher text,
Category text,
Result text
)
CREATE TABLE ... | SELECT Director, COUNT(Director) FROM movie WHERE Year = 1999 OR Year = 2000 GROUP BY Director ORDER BY COUNT(Director) DESC | nvbench |
CREATE TABLE table_name_5 (
tyre VARCHAR,
race VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Tyre for the united states grand prix?
| SELECT tyre FROM table_name_5 WHERE race = "united states grand prix" | sql_create_context |
CREATE TABLE table_name_87 (
loser VARCHAR,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the loser of the fight against antonio silva?
| SELECT loser FROM table_name_87 WHERE winner = "antonio silva" | sql_create_context |
CREATE TABLE table_70363 (
"Rank" text,
"Margin" text,
"Club" text,
"Opponent" text,
"Year" text,
"Round" text,
"Venue" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which round has a margin of 178?
| SELECT "Round" FROM table_70363 WHERE "Margin" = '178' | wikisql |
CREATE TABLE table_68028 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score on 6 February 2008?
| SELECT "Score" FROM table_68028 WHERE "Date" = '6 february 2008' | wikisql |
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 jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz... | css |
CREATE TABLE table_4692 (
"Played" real,
"Lost" real,
"Drawn" real,
"Tries" real,
"Points" real,
"% Won" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many tries for the player whose number is greater than 2 and losses are smaller than 0?
| SELECT COUNT("Tries") FROM table_4692 WHERE "Played" > '2' AND "Lost" < '0' | wikisql |
CREATE TABLE table_22914 (
"Fiscal year" real,
"2-car sets" real,
"3-car sets" real,
"4-car sets" real,
"6-car sets" real,
"8-car sets" real,
"Total vehicles" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the 4 car sets for 6 car sets ... | SELECT MIN("4-car sets") FROM table_22914 WHERE "6-car sets" = '44' | wikisql |
CREATE TABLE table_29728596_2 (
competition VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the competitions when the away team was fk kozara gradiska?
| SELECT competition FROM table_29728596_2 WHERE away_team = "FK Kozara Gradiska" | sql_create_context |
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_season int,
Title text,
Directed_by text,
Original_air_date text,
Production_code text
)
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE schedule... | SELECT Location, COUNT(*) FROM cinema GROUP BY Location ORDER BY Location | nvbench |
CREATE TABLE table_name_98 (
surface VARCHAR,
semifinalists VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Surface has a Semifinalist of stefan edberg thomas muster?
| SELECT surface FROM table_name_98 WHERE semifinalists = "stefan edberg thomas muster" | sql_create_context |
CREATE TABLE table_name_32 (
winner VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who won on 29 may?
| SELECT winner FROM table_name_32 WHERE date = "29 may" | sql_create_context |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
h... | SELECT MAX(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23436) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND inputevents_... | mimic_iii |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(2... | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY HIRE_DATE | nvbench |
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.long_title = "Combined right and left heart cardiac catheterization" | mimicsql_data |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
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... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', icustays.intime)) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28447) AND icustays.outtime IS NULL | mimic_iii |
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 gwyjzb.MED_ORG_DEPT_NM, AVG(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 = '3519389' GROUP BY gwyjzb.MED_ORG_DEPT_NM UNION SELECT fgwyjzb.MED_ORG_DEPT_NM, AVG(t_kc24.OVE_PAY) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINI... | css |
CREATE TABLE table_204_143 (
id number,
"national park" text,
"region" text,
"land area (km2)" number,
"established" number,
"visitation (2009)" number,
"coordinates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which of finland 's nationa... | SELECT "national park" FROM table_204_143 ORDER BY "visitation (2009)" LIMIT 1 | squall |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.