instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_2 (
region VARCHAR,
label VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which region had a label of Central Station?
| SELECT region FROM table_name_2 WHERE label = "central station" | 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,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "DIVORCED" AND lab.itemid = "51274" | mimicsql_data |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.dob_year < "2121" | mimicsql_data |
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 * FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '2507652' AND t_kc21.IN_HOSP_DATE BETWEEN '2011-06-26' AND '2011-10-09' EXCEPT SELECT * FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '2507652' AND t_kc21.IN_HOSP_DATE BETWEEN '2011-06-26' AND '2011-10-09' AND t_kc21.MED_ORG_DEPT_CD = '02592' | css |
CREATE TABLE table_name_89 (
declination___j2000__ VARCHAR,
ngc_number VARCHAR,
object_type VARCHAR,
constellation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the declination of the spiral galaxy Pegasus with 7337 NGC
| SELECT declination___j2000__ FROM table_name_89 WHERE object_type = "spiral galaxy" AND constellation = "pegasus" AND ngc_number = "7337" | sql_create_context |
CREATE TABLE table_28921 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the incumbent in Virginia 3?
| SELECT "Incumbent" FROM table_28921 WHERE "District" = 'Virginia 3' | wikisql |
CREATE TABLE table_name_39 (
primary_conference VARCHAR,
team_nickname VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What primary conference does the team nicknamed Phoenix belongs to?
| SELECT primary_conference FROM table_name_39 WHERE team_nickname = "phoenix" | sql_create_context |
CREATE TABLE table_50120 (
"Points" real,
"Score" text,
"Premiers" text,
"Runners Up" text,
"Details" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the total sum of points scored by the Brisbane Broncos?
| SELECT SUM("Points") FROM table_50120 WHERE "Premiers" = 'brisbane broncos' | wikisql |
CREATE TABLE table_204_988 (
id number,
"responsible minister(s)" text,
"crown entities" text,
"monitoring department(s)" text,
"category / type" text,
"empowering legislation" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the empowerin... | SELECT "empowering legislation" FROM table_204_988 WHERE "responsible minister(s)" = 'broadcasting' AND "category / type" = 'ace' | squall |
CREATE TABLE table_name_72 (
latitude INTEGER,
water__sqmi_ VARCHAR,
county VARCHAR,
land___sqmi__ VARCHAR,
pop__2010_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Cass county has 0.008 Water (sqmi), less than 35.874 Land (sqmi), more than 35 P... | SELECT AVG(latitude) FROM table_name_72 WHERE land___sqmi__ < 35.874 AND pop__2010_ > 35 AND county = "cass" AND water__sqmi_ = 0.008 | sql_create_context |
CREATE TABLE zzmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON 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 = jyjgzbb.YLJGDM AND jybgb.BGD... | 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 * FROM hz_info JOIN zyjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND person_info_hz_i... | css |
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 Headquarter, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY AVG(Price) DESC | nvbench |
CREATE TABLE table_100518_1 (
weapon VARCHAR,
direction VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the weapons used by guardians for the direction East?
| SELECT weapon FROM table_100518_1 WHERE direction = "East" | sql_create_context |
CREATE TABLE table_204_939 (
id number,
"year" number,
"chassis" text,
"engine" text,
"start" text,
"finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- in what year did the buick engine start in 1st ?
| SELECT "year" FROM table_204_939 WHERE "engine" = 'buick' AND "start" = 1 | squall |
CREATE TABLE table_name_8 (
away_team VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is listed as the Away team for the Home team of the Bristol Rovers?
| SELECT away_team FROM table_name_8 WHERE home_team = "bristol rovers" | sql_create_context |
CREATE TABLE table_2501754_3 (
original_airdate VARCHAR,
prod_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the 1st air date for the episode with a iceb786e production code.
| SELECT original_airdate FROM table_2501754_3 WHERE prod_code = "ICEB786E" | sql_create_context |
CREATE TABLE table_name_59 (
opened VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the opened for spain
| SELECT opened FROM table_name_59 WHERE country = "spain" | sql_create_context |
CREATE TABLE table_name_39 (
airing_date VARCHAR,
number_of_episodes VARCHAR,
genre VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Airing date has a Number of episodes larger than 20, and a Genre of modern drama?
| SELECT airing_date FROM table_name_39 WHERE number_of_episodes > 20 AND genre = "modern drama" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "OVERDOSE" AND prescriptions.route = "TP" | mimicsql_data |
CREATE TABLE zzmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | SELECT COUNT(zzmzjzjlb.ZZYSGH) FROM hz_info JOIN zzmzjzjlb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE hz_info.RYBH = '78228979' AND zzmzjzjlb.JZKSRQ BETWEEN '2002-10-08' AND '2016-07-03' UNION SELECT COUNT(fzzmzjzjlb.ZZYSGH) FROM hz_info JOIN fzzmzjzjlb ON h... | css |
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 WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.diagnosis = "UPPER GI BLEED" | mimicsql_data |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "2065" AND diagnoses.short_title = "Int inf clstrdium dfcile" | mimicsql_data |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
sc... | SELECT DISTINCT program_course.category FROM course, program_course WHERE course.department = 'MKT' AND course.number = 750 AND program_course.course_id = course.course_id | advising |
CREATE TABLE table_792 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were the candidates when the winner was first elected in 1910?
| SELECT "Candidates" FROM table_792 WHERE "First elected" = '1910' | wikisql |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE offering_instructor (
offering_ins... | SELECT DISTINCT semester.semester, semester.year FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.number = 278 AND course_offering.semester = semester.semester_id AND instructor.name LIKE '%Samuel Epstein%' AND offering_instructor.inst... | advising |
CREATE TABLE table_180802_3 (
planet VARCHAR,
transcription VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which planet has the transcription of wan suk?
| SELECT planet FROM table_180802_3 WHERE transcription = "wan suk" | sql_create_context |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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.JZ... | css |
CREATE TABLE table_63109 (
"Round" text,
"Date" text,
"Against" text,
"Score AUFC \u2013 Away" text,
"Attendance" real,
"Weekday" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date has an against of pohang steelers?
| SELECT "Date" FROM table_63109 WHERE "Against" = 'pohang steelers' | wikisql |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count num... | SELECT u.Id AS "user_link", number_of_answers = COUNT(*), total_score = SUM(p.Score) FROM Users AS u JOIN Posts AS p ON p.OwnerUserId = u.Id JOIN Posts AS pp ON p.ParentId = pp.Id JOIN PostTags AS pt ON pt.PostId = pp.Id JOIN Tags AS t ON t.Id = pt.TagId WHERE t.TagName LIKE '%clojure%' AND p.CreationDate > (CURRENT_TI... | sede |
CREATE TABLE table_name_75 (
against INTEGER,
ballarat_fl VARCHAR,
wins VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest against that has bacchus marsh as a ballarat fl, with wins less than 1?
| SELECT MIN(against) FROM table_name_75 WHERE ballarat_fl = "bacchus marsh" AND wins < 1 | sql_create_context |
CREATE TABLE table_72121 (
"Rd" real,
"Name" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning driver" text,
"Winning team" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the races that johnny rutherford has wo... | SELECT "Name" FROM table_72121 WHERE "Winning driver" = 'Johnny Rutherford' | wikisql |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT 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.MED_SER_ORG_NO = '6823656' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2008-09-28' AND '2011-05-10' | css |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
... | SELECT TagName, COUNT(*) AS UpVotes FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id AND VoteTypeId = 2 WHERE Posts.OwnerUserId = @UserId AND YEAR(Posts.CreationDate) = @Year GROUP BY TagName ORDER BY UpVotes DESC ... | sede |
CREATE TABLE table_31676 (
"Cellist" text,
"Orchestra" text,
"Conductor" text,
"Record Company" text,
"Year of Recording" real,
"Format" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the oldest year that the Royal Philharmonic Orchestra... | SELECT MIN("Year of Recording") FROM table_31676 WHERE "Orchestra" = 'royal philharmonic orchestra' AND "Record Company" = 'decca records' | wikisql |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT MIN(MED_AMOUT), MAX(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE MED_SER_ORG_NO = '2100333' AND OUT_DIAG_DIS_NM = '牙体缺损') | css |
CREATE TABLE table_22786 (
"Match no." real,
"Match Type" text,
"Team Europe" text,
"Score" text,
"Team USA" text,
"Progressive Total" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score at the end of the match number 4?
| SELECT "Score" FROM table_22786 WHERE "Match no." = '4' | wikisql |
CREATE TABLE table_name_5 (
state VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what state is the Thomas Assembly Center located?
| SELECT state FROM table_name_5 WHERE venue = "thomas assembly center" | sql_create_context |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE diagnoses_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 = 10811)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp mean'... | mimic_iii |
CREATE TABLE repair_assignment (
technician_id int,
repair_ID int,
Machine_ID int
)
CREATE TABLE machine (
Machine_ID int,
Making_Year int,
Class text,
Team text,
Machine_series text,
value_points real,
quality_rank int
)
CREATE TABLE technician (
technician_id real,
Na... | SELECT Name, COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_id = T2.technician_id GROUP BY T2.Name | nvbench |
CREATE TABLE table_65083 (
"City of license /Market" text,
"Station" text,
"Channel ( TV / RF )" text,
"Owned Since" real,
"Affiliation" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What station was owned since 2011, and a channel (tv/rf) of 27?
| SELECT "Station" FROM table_65083 WHERE "Owned Since" = '2011' AND "Channel ( TV / RF )" = '27' | wikisql |
CREATE TABLE locations (
country_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- display the country ID and number of cities for each country.
| SELECT country_id, COUNT(*) FROM locations GROUP BY country_id | sql_create_context |
CREATE TABLE table_67935 (
"Tournament" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the 2012 result associated with a... | SELECT "2012" FROM table_67935 WHERE "2007" = '2r' AND "2009" = '1r' | wikisql |
CREATE TABLE table_58958 (
"Season" text,
"League" text,
"Teams" text,
"Home" text,
"Away" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team played in the Bundesliga league with an Away record of 2-1?
| SELECT "Teams" FROM table_58958 WHERE "League" = 'bundesliga' AND "Away" = '2-1' | wikisql |
CREATE TABLE table_name_39 (
ihsaa_class VARCHAR,
school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the IHSAA Class when the school is Seymour?
| SELECT ihsaa_class FROM table_name_39 WHERE school = "seymour" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "62" AND diagnoses.short_title = "Choledochlith NOS w obst" | mimicsql_data |
CREATE TABLE table_name_99 (
position VARCHAR,
team_from VARCHAR,
pick__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Position has a Team from of ottawa 67's, and a Pick # smaller than 47?
| SELECT position FROM table_name_99 WHERE team_from = "ottawa 67's" AND pick__number < 47 | sql_create_context |
CREATE TABLE table_6563 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- on january 7 what is the record?
| SELECT "Record" FROM table_6563 WHERE "Date" = 'january 7' | wikisql |
CREATE TABLE table_204_108 (
id number,
"typ" text,
"construction time" text,
"cylinders" text,
"capacity" text,
"power" text,
"top speed" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which typ -lrb- s -rrb- had the longest construction ti... | SELECT "typ" FROM table_204_108 ORDER BY "construction time" - "construction time" DESC LIMIT 1 | squall |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | (SELECT mzjzjlb.YLJGDM 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 = '赵芳荃') UNION (SELECT zyjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = h... | css |
CREATE TABLE table_29599 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"First Star" text,
"Decision" text,
"Location" text,
"Attendance" real,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Wh... | SELECT "Record" FROM table_29599 WHERE "First Star" = 'J. Oduya' | wikisql |
CREATE TABLE technician (
Name VARCHAR,
technician_id VARCHAR
)
CREATE TABLE repair_assignment (
Name VARCHAR,
technician_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the names of technicians who have not been assigned to repair machines.
| SELECT Name FROM technician WHERE NOT technician_id IN (SELECT technician_id FROM repair_assignment) | sql_create_context |
CREATE TABLE table_name_52 (
crowd INTEGER,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the largest crowd of a game where Collingwood was the away team?
| SELECT MAX(crowd) FROM table_name_52 WHERE away_team = "collingwood" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "SINGLE" AND procedures.long_title = "Transfusion of other serum" | mimicsql_data |
CREATE TABLE table_55518 (
"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.
-- In Western Oval, what was the away team score?
| SELECT "Away team score" FROM table_55518 WHERE "Venue" = 'western oval' | wikisql |
CREATE TABLE pitStops (
raceId INTEGER,
driverId INTEGER,
stop INTEGER,
lap INTEGER,
time TEXT,
duration TEXT,
milliseconds INTEGER
)
CREATE TABLE seasons (
year INTEGER,
url TEXT
)
CREATE TABLE circuits (
circuitId INTEGER,
circuitRef TEXT,
name TEXT,
location TEXT... | SELECT name, COUNT(name) FROM constructors AS T1 JOIN constructorStandings AS T2 ON T1.constructorId = T2.constructorId WHERE T1.nationality = "Japanese" AND T2.points > 5 GROUP BY name ORDER BY name | nvbench |
CREATE TABLE table_15608800_2 (
number_at_pyewipe INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most number of pyewipe
| SELECT MAX(number_at_pyewipe) FROM table_15608800_2 | sql_create_context |
CREATE TABLE table_69907 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which catalog was published on December 19, 2001?
| SELECT "Catalog" FROM table_69907 WHERE "Date" = 'december 19, 2001' | wikisql |
CREATE TABLE table_204_449 (
id number,
"no" number,
"episode" text,
"title" text,
"original airdate" text,
"viewers" number,
"nightly\nrank" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many episodes had a nightly rank of 11 ?
| SELECT COUNT("title") FROM table_204_449 WHERE "nightly\nrank" = 11 | squall |
CREATE TABLE table_203_398 (
id number,
"year" number,
"vidhan sabha" text,
"members of legislative assembly" text,
"winning party" text,
"nearest contesting party" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- was there an election in 1980 or ... | SELECT "year" FROM table_203_398 WHERE "year" IN (1980, 1982) | squall |
CREATE TABLE table_39623 (
"School" text,
"Mascot" text,
"Location" text,
"Enrollment" real,
"IHSAA Class" text,
"IHSAA Football Class" text,
"# / County" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What school has the greyhounds as masco... | SELECT "School" FROM table_39623 WHERE "Mascot" = 'greyhounds' | wikisql |
CREATE TABLE table_76092 (
"Season" real,
"Episodes" real,
"Season Premiere" text,
"Season Finale" text,
"DVD Release Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which season had fewer than 13 episodes and aired its season finale on Februar... | SELECT COUNT("Season") FROM table_76092 WHERE "Episodes" < '13' AND "Season Finale" = 'february 20, 2011' | wikisql |
CREATE TABLE table_75141 (
"Player" text,
"Position" text,
"Date of Birth (Age)" text,
"Caps" real,
"Club/province" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Caps does the Club/province Munster, position of lock and Mick O'Driscoll hav... | SELECT COUNT("Caps") FROM table_75141 WHERE "Club/province" = 'munster' AND "Position" = 'lock' AND "Player" = 'mick o''driscoll' | wikisql |
CREATE TABLE table_61553 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the to par of the player with a 72-71-65-69=277 score?
| SELECT "To par" FROM table_61553 WHERE "Score" = '72-71-65-69=277' | wikisql |
CREATE TABLE table_7607 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Home has a Tie no of 6?
| SELECT "Home team" FROM table_7607 WHERE "Tie no" = '6' | wikisql |
CREATE TABLE table_79555 (
"Date" text,
"Location" text,
"Lineup" text,
"Assist/pass" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Lineup that has an Assist/pass of carli lloyd,a Co... | SELECT "Lineup" FROM table_79555 WHERE "Assist/pass" = 'carli lloyd' AND "Competition" = '2010 concacaf world cup qualifying – group stage' | wikisql |
CREATE TABLE table_52898 (
"Evaluation average (From February 2011)" real,
"Evaluation average (From April 2009)" text,
"Evaluation average (Before April 2009)" text,
"% of negative evaluations" text,
"Submitting schedule on time" text,
"Punctuality/Attendance issues" text,
"Peak lessons tau... | SELECT "Evaluation average (Before April 2009)" FROM table_52898 WHERE "% of negative evaluations" = '0.8%' AND "Evaluation average (From April 2009)" = '4.2' | 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... | SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 20 AND 29) AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-2 yea... | eicu |
CREATE TABLE table_76779 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Stadium" text,
"Record" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHEN has a Result of w 23 17?
| SELECT "Date" FROM table_76779 WHERE "Result" = 'w 23–17' | wikisql |
CREATE TABLE table_name_24 (
date VARCHAR,
opponent VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was there a game in which the opponent was the Detroit Tigers, and the attendance was 38,639?
| SELECT date FROM table_name_24 WHERE opponent = "detroit tigers" AND attendance = "38,639" | sql_create_context |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
... | SELECT DATALENGTH(Body) AS length, Id AS "post_link", Score AS Votes, Body AS Contents, Tags FROM Posts WHERE NOT Body IS NULL AND (('##OnlyQuestions:int?0##' = 0 AND PostTypeId = 2) OR PostTypeId = 1) ORDER BY length LIMIT 10 | sede |
CREATE TABLE table_35401 (
"Region" text,
"Employment ( salaries & wages)" text,
"Self employed" text,
"Investment income" text,
"Working tax credit" text,
"State pensions" text,
"Occupational pensions" text,
"Disability benefits" text,
"Other social security benefits" text,
"Oth... | SELECT "Self employed" FROM table_35401 WHERE "Investment income" = '2%' AND "Other income sources" = '3%' AND "Employment ( salaries & wages)" = '71%' | wikisql |
CREATE TABLE table_68044 (
"School" text,
"Team" text,
"Division Record" text,
"Overall Record" text,
"Season Outcome" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Senators' division record?
| SELECT "Division Record" FROM table_68044 WHERE "Team" = 'senators' | 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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '61785002' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE table_name_45 (
studio_s_ VARCHAR,
director VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Studio of the Film directed by Paul Greengrass?
| SELECT studio_s_ FROM table_name_45 WHERE director = "paul greengrass" | sql_create_context |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
... | 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 WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'LOS ANGELES' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OR... | atis |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%uzb%' OR UPPER(Location) LIKE '%uzb' ORDER BY Reputation DESC LIMIT 200 | sede |
CREATE TABLE table_name_94 (
score VARCHAR,
to_par VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For the match in which player David Frost scored a To Par of +7, what was the final score?
| SELECT score FROM table_name_94 WHERE to_par = "+7" AND player = "david frost" | sql_create_context |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE diagnoses_icd (
... | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'popliteal synovial cyst') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 81871) AND STRFTIME('%y', dia... | mimic_iii |
CREATE TABLE table_204_354 (
id number,
"opus" text,
"title" text,
"genre" text,
"sub\u00addivisions" text,
"libretto" text,
"composition" text,
"premiere date" text,
"place, theatre" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- wh... | SELECT COUNT("title") FROM table_204_354 WHERE "genre" = 'oper' | squall |
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "45" AND prescriptions.drug = "MethylPREDNISolone Sodium Succ" | mimicsql_data |
CREATE TABLE table_178381_1 (
sub_parish__sokn_ VARCHAR,
location_of_the_church VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the sub-parish (sokn) of Eikefjord?
| SELECT sub_parish__sokn_ FROM table_178381_1 WHERE location_of_the_church = "Eikefjord" | sql_create_context |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABL... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'long-term use of i... | mimic_iii |
CREATE TABLE table_name_19 (
number_in_series INTEGER,
production_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the series number that has a production code of 50021 50025?
| SELECT MAX(number_in_series) FROM table_name_19 WHERE production_code = "50021–50025" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Gastrointest hemorr NOS" AND prescriptions.route = "IV DRIP" | mimicsql_data |
CREATE TABLE table_5543 (
"Tournament" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which 2010 stat featured the tournament of the Olympic Games?
| SELECT "2010" FROM table_5543 WHERE "Tournament" = 'olympic games' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "DESI30O" AND lab.fluid = "Joint Fluid" | mimicsql_data |
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 zyjzjlb (
CYBQDM text,
CYBQMC... | SELECT zyjzjlb.ZYZDBM, zyjzjlb.ZYZDMC FROM person_info JOIN hz_info JOIN zyjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_... | css |
CREATE TABLE table_name_76 (
_number_of_airlines VARCHAR,
distance__km_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Airlines have a total distance of 705 (km)?
| SELECT COUNT(_number_of_airlines) FROM table_name_76 WHERE distance__km_ = 705 | sql_create_context |
CREATE TABLE table_name_19 (
car_model VARCHAR,
engine VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Car Model has the Engine of Ford 6.0 V8?
| SELECT car_model FROM table_name_19 WHERE engine = "ford 6.0 v8" | sql_create_context |
CREATE TABLE table_name_11 (
position_in_table VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the position in table when the team is hartlepool united?
| SELECT position_in_table FROM table_name_11 WHERE team = "hartlepool united" | sql_create_context |
CREATE TABLE table_66308 (
"Year" real,
"Game" text,
"Genre" text,
"Platform(s)" text,
"Developer(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the developers for demon's souls?
| SELECT "Developer(s)" FROM table_66308 WHERE "Game" = 'demon''s souls' | wikisql |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT All_Road, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent | nvbench |
CREATE TABLE table_name_40 (
tyre VARCHAR,
engine_† VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the tyre for the peugeot a20 engine?
| SELECT tyre FROM table_name_40 WHERE engine_† = "peugeot a20" | sql_create_context |
CREATE TABLE table_23508196_5 (
type_of_aircraft VARCHAR,
number_of_crews VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the aircraft for 21 crews?
| SELECT type_of_aircraft FROM table_23508196_5 WHERE number_of_crews = "21" | sql_create_context |
CREATE TABLE table_66845 (
"Sunday" text,
"Monday" text,
"Tuesday" text,
"Wednesday" text,
"Thursday" text,
"Friday" text,
"Saturday" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Wednesday has a Monday of getsuy bi?
| SELECT "Wednesday" FROM table_66845 WHERE "Monday" = '月曜日 getsuyōbi' | wikisql |
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Coun... | SELECT Time, ID FROM swimmer ORDER BY Time | nvbench |
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 ... | SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 74159) AND prescriptions.drug = 'cosyntropin' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRF... | mimic_iii |
CREATE TABLE table_58179 (
"Entrant" text,
"Constructor" text,
"Chassis" text,
"Engine" text,
"Tyre" text,
"Driver" text,
"Rounds" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the rounds for stanley brm
| SELECT "Rounds" FROM table_58179 WHERE "Entrant" = 'stanley brm' | wikisql |
CREATE TABLE table_79089 (
"Year" real,
"Gold" text,
"Silver" text,
"Bronze" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE SILVER WITH A YEAR OF 1962?
| SELECT "Silver" FROM table_79089 WHERE "Year" = '1962' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.