instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_22291 (
"Departure" text,
"Going to" text,
"Calling at" text,
"Arrival" text,
"Operator" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the arrival time of the train that departed at 18.16?
| SELECT "Arrival" FROM table_22291 WHERE "Departure" = '18.16' | wikisql |
CREATE TABLE table_15927 (
"County" text,
"English name" text,
"Irish name" text,
"Population" real,
"Irish speakers" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the population for County Mayo with the English Name Carrowteige?
| SELECT "Population" FROM table_15927 WHERE "County" = 'County Mayo' AND "English name" = 'Carrowteige' | wikisql |
CREATE TABLE table_23248869_8 (
high_assists VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had the high assists when the score was l 85 118 (ot)
| SELECT high_assists FROM table_23248869_8 WHERE score = "L 85–118 (OT)" | sql_create_context |
CREATE TABLE table_name_26 (
class VARCHAR,
part_4 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the class for Geholfen Gedroschen in part 4?
| SELECT class FROM table_name_26 WHERE part_4 = "geholfen gedroschen" | sql_create_context |
CREATE TABLE table_21256 (
"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
)
-- Using valid SQLite, answer the following questions for the tables prov... | SELECT "Winnings" FROM table_21256 WHERE "Poles" = '0' AND "Position" = '14th' | wikisql |
CREATE TABLE table_67706 (
"Years" text,
"Coach" text,
"Seasons" real,
"Wins" real,
"Losses" real,
"Ties" text,
"Pct." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the winning percent of Notre Dame in 1905?
| SELECT "Pct." FROM table_67706 WHERE "Years" = '1905' | wikisql |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text... | SELECT COUNT(p.Id) AS usage, TagName FROM Posts AS p INNER JOIN PostTags AS pt ON pt.PostId = p.Id INNER JOIN Tags AS t ON pt.TagId = t.Id GROUP BY TagName HAVING COUNT(p.Id) > 10000 ORDER BY usage DESC | sede |
CREATE TABLE table_2383498_4 (
first_year_in_qld_cup VARCHAR,
home_ground VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is every value for first year in QLD Cup if home ground is Corbett Park, Crosby Park, Lang Park, ANZ Stadium?
| SELECT first_year_in_qld_cup FROM table_2383498_4 WHERE home_ground = "Corbett Park, Crosby Park, Lang Park, ANZ Stadium" | sql_create_context |
CREATE TABLE table_name_71 (
away_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the away team's score at windy hill?
| SELECT away_team AS score FROM table_name_71 WHERE venue = "windy hill" | sql_create_context |
CREATE TABLE table_45360 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Record, when Event is 'Independent Event', and when Method i... | SELECT "Record" FROM table_45360 WHERE "Event" = 'independent event' AND "Method" = 'submission (peruvian necktie)' | wikisql |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following questions for the... | SELECT Code, Price FROM Products WHERE Price BETWEEN 60 AND 120 | nvbench |
CREATE TABLE table_name_39 (
country VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country is Paul Lawrie from?
| SELECT country FROM table_name_39 WHERE player = "paul lawrie" | sql_create_context |
CREATE TABLE table_26564 (
"DVD Name" text,
"Ep #" text,
"Region 1 (US)" text,
"Region 1 (CAN)" text,
"Region 2 (UK)" text,
"Region 2 (Germany)" text,
"Region 4 (Australia)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the region 2... | SELECT "Region 2 (UK)" FROM table_26564 WHERE "Region 4 (Australia)" = 'July 31, 2008' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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... | SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND ... | css |
CREATE TABLE table_name_51 (
player VARCHAR,
country VARCHAR,
place VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player from United States is in place of t6?
| SELECT player FROM table_name_51 WHERE country = "united states" AND place = "t6" | sql_create_context |
CREATE TABLE table_29752 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who ha... | SELECT "High points" FROM table_29752 WHERE "Game" = '81' | wikisql |
CREATE TABLE Ref_Hotel_Star_Ratings (
star_rating_code CHAR(15),
star_rating_description VARCHAR(80)
)
CREATE TABLE Street_Markets (
Market_ID INTEGER,
Market_Details VARCHAR(255)
)
CREATE TABLE Tourist_Attraction_Features (
Tourist_Attraction_ID INTEGER,
Feature_ID INTEGER
)
CREATE TABLE Loc... | SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID ORDER BY T1.Tourist_Attraction_ID | nvbench |
CREATE TABLE table_31879 (
"Played in" text,
"Matches" text,
"Lost" text,
"Drawn" text,
"Points for" text,
"Points against" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The 51 points against, how many are for?
| SELECT "Points for" FROM table_31879 WHERE "Points against" = '51' | wikisql |
CREATE TABLE table_26454128_9 (
points VARCHAR,
athlete VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the point value(s) for when the athlete was Barney Berlinger?
| SELECT points FROM table_26454128_9 WHERE athlete = "Barney Berlinger" | sql_create_context |
CREATE TABLE table_56766 (
"Grade" text,
"Points" real,
"Sit-up (reps)" text,
"Standing Broad Jump (cm)" text,
"Chin-up (reps)" text,
"Shuttle Run (sec)" text,
"2.4km Run (min:sec)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What grade w... | SELECT "Grade" FROM table_56766 WHERE "2.4km Run (min:sec)" = '13:01-13:40' | wikisql |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number... | SELECT t.TagName, COUNT(DISTINCT p.OwnerUserId) AS Users FROM Users AS u, Posts AS p, PostTags AS pt, Tags AS t WHERE p.OwnerUserId = u.Id AND p.PostTypeId = 2 AND p.Score > 0 AND pt.PostId = p.ParentId AND t.Id = pt.TagId AND (t.TagName = 'c' OR t.TagName = 'java' OR t.TagName = 'mysql' OR t.TagName = 'c#') GROUP BY t... | sede |
CREATE TABLE table_34396 (
"Date" text,
"Tournament" text,
"Location" text,
"Winner" text,
"Score" text,
"1st prize ( $ )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score of the Tournament named danny thomas memphis classic?
| SELECT "Score" FROM table_34396 WHERE "Tournament" = 'danny thomas memphis classic' | wikisql |
CREATE TABLE table_2989 (
"Year" real,
"Kentucky Derby" real,
"The Preakness Stakes" text,
"Kentucky Oaks" text,
"Belmont Stakes" text,
"Travers Stakes" text,
"Breeders Cup Saturday" text,
"Breeders Cup Friday" text
)
-- Using valid SQLite, answer the following questions for the tables... | SELECT "Travers Stakes" FROM table_2989 WHERE "Year" = '1977' | wikisql |
CREATE TABLE table_15476 (
"Heat" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the nationality with less than 9 heat, and a time of 1:01.87?
| SELECT "Nationality" FROM table_15476 WHERE "Heat" < '9' AND "Time" = '1:01.87' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND procedures.short_title = "Chordae tendineae ops" | mimicsql_data |
CREATE TABLE table_32593 (
"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.
-- What day is essendon the home team?
| SELECT "Date" FROM table_32593 WHERE "Home team" = 'essendon' | wikisql |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | SELECT * FROM VoteTypes | sede |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2097" AND lab.flag = "delta" | mimicsql_data |
CREATE TABLE table_name_65 (
year INTEGER,
rank VARCHAR,
floors VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the earliest year with rank 20 and less than 60 floors?
| SELECT MIN(year) FROM table_name_65 WHERE rank = 20 AND floors < 60 | sql_create_context |
CREATE TABLE table_16188 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is t... | SELECT "Date of vacancy" FROM table_16188 WHERE "Date of appointment" = '28 November 2007' AND "Replaced by" = 'Alex McLeish' | wikisql |
CREATE TABLE table_39767 (
"Season" text,
"1st Place" text,
"2nd Place" text,
"3rd Place" text,
"4th Place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which season had a 3rd place of CSKA Moscow and 1st place of Panathinaikos?
| SELECT "Season" FROM table_39767 WHERE "3rd Place" = 'cska moscow' AND "1st Place" = 'panathinaikos' | wikisql |
CREATE TABLE table_77035 (
"Athlete" text,
"Event" text,
"100 m" real,
"400 m" real,
"110H" real,
"1500 m" text,
"Final" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the 100m that the 110H was less than 14.52 and the 400m was more... | SELECT AVG("100 m") FROM table_77035 WHERE "110H" < '14.52' AND "400 m" > '47.3' | wikisql |
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 prescriptions (
subject_id text,
hadm_id... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Other closed [endoscopic] biopsy of biliary duct or sphincter of Oddi" AND lab."CATEGORY" = "Hematology" | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT demographic.diagnosis FROM demographic WHERE demographic.name = "Orville Ford" | mimicsql_data |
CREATE TABLE table_name_69 (
interregnum_ended VARCHAR,
count_palatine_of_saxony VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Interregnum ended for Count Palatine of Saxony of john george ii, elector of saxony?
| SELECT interregnum_ended FROM table_name_69 WHERE count_palatine_of_saxony = "john george ii, elector of saxony" | 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... | SELECT TIME_TO_STR(p.CreationDate, '%W'), COUNT(p.Id) AS post_cnt FROM PostTags AS t INNER JOIN Posts AS p ON p.Id = t.PostId WHERE t.TagId = (SELECT Id FROM Tags WHERE TagName = 'mysql') AND p.PostTypeId = 1 GROUP BY TIME_TO_STR(p.CreationDate, '%W') | sede |
CREATE TABLE table_14638077_2 (
circuit VARCHAR,
rnd VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the circuit with rnd being 5
| SELECT circuit FROM table_14638077_2 WHERE rnd = 5 | sql_create_context |
CREATE TABLE table_33246 (
"Rank" text,
"State" text,
"Population" real,
"Area (km\u00b2)" real,
"Density" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The state of Aguascalientes has an area (km ) larger than 151,571 and a density greater than 80... | SELECT "Rank" FROM table_33246 WHERE "Area (km\u00b2)" > '151,571' AND "Density" > '80.9' AND "State" = 'aguascalientes' | wikisql |
CREATE TABLE table_45948 (
"Ethnicity" text,
"Islam" text,
"Christianity" text,
"Judaism" text,
"Buddhism" text,
"Other" text,
"Atheism" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the value of other religions associated with athe... | SELECT "Other" FROM table_45948 WHERE "Atheism" = '1.86%' | wikisql |
CREATE TABLE table_name_75 (
dist__f_ VARCHAR,
race VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Dist (f) has a Race of irish derby?
| SELECT dist__f_ FROM table_name_75 WHERE race = "irish derby" | sql_create_context |
CREATE TABLE player (
pid number,
pname text,
ycard text,
hs number
)
CREATE TABLE college (
cname text,
state text,
enr number
)
CREATE TABLE tryout (
pid number,
cname text,
ppos text,
decision text
)
-- Using valid SQLite, answer the following questions for the tables ... | SELECT T1.pname FROM player AS T1 JOIN tryout AS T2 ON T1.pid = T2.pid ORDER BY T1.pname | spider |
CREATE TABLE table_name_55 (
driver VARCHAR,
grid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which driver had a grid number of 18?
| SELECT driver FROM table_name_55 WHERE grid = "18" | sql_create_context |
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 COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.JZKSBM = '97321' AND wdmzjzjlb.JZKSRQ BETWEEN '2018-02-23' AND '2021-07-20' UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.JZKSBM = '97321' AND bdmzjzjlb.JZKSRQ BETWEEN '2018-02-23' AND '2021-07-20' | css |
CREATE TABLE table_77121 (
"Day 1" text,
"Day 2" text,
"Day 3" text,
"Day 4" text,
"Day 5" text,
"Wednesday" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the day 3 when day 4 is fr.?
| SELECT "Day 3" FROM table_77121 WHERE "Day 4" = 'fr.' | wikisql |
CREATE TABLE table_203_241 (
id number,
"name" text,
"founded" number,
"defunct" number,
"country" text,
"publisher" text,
"topics" text,
"external link" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which magazine was founded the earli... | SELECT "name" FROM table_203_241 WHERE "founded" = (SELECT MIN("founded") FROM table_203_241) | squall |
CREATE TABLE Allergy_type (
allergytype VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which allergy type has least number of allergies?
| SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY COUNT(*) LIMIT 1 | sql_create_context |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25... | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
CREATE TABLE table_2849 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is... | SELECT "Record" FROM table_2849 WHERE "Location Attendance" = 'Arco Arena 17361' | wikisql |
CREATE TABLE table_25215 (
"Year" text,
"Date" text,
"Driver" text,
"Team" text,
"Manufacturer" text,
"Laps" text,
"Miles (km)" text,
"Race Time" text,
"Average Speed (mph)" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided abov... | SELECT "Manufacturer" FROM table_25215 WHERE "Year" = '1990' | wikisql |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program (
program_id int,
name v... | SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.start_time > '21:00' AND course.course_id = course_offering.course_id AND course.department = 'IOE' AND course.number = 990 AND semester.semester = 'WN' AND s... | advising |
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.gender = "F" AND demographic.diagnosis = "LEFT INTERNAL JUGULAR VEIN THROMBOSIS;LEFT ARM EDEMA" | mimicsql_data |
CREATE TABLE jybgb_jyjgzbb (
JYZBLSH number,
YLJGDM text,
jyjgzbb_id number
)
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 nu... | SELECT jyjgzbb.JYZBLSH 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 AND jybgb.BGD... | css |
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 COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'zolpidem 5 mg tab' AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) | eicu |
CREATE TABLE mzjzjlb_jybgb (
YLJGDM_MZJZJLB text,
BGDH number,
YLJGDM number
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW te... | SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb 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 = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_... | css |
CREATE TABLE table_name_75 (
rank_points VARCHAR,
total VARCHAR,
event VARCHAR,
score_points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Rank points which have an Event of wc beijing, and Score points of 13, and a Total of 18?
| SELECT rank_points FROM table_name_75 WHERE event = "wc beijing" AND score_points = "13" AND total = "18" | sql_create_context |
CREATE TABLE table_3290 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Podiums" real,
"Points" text,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the ea... | SELECT MIN("Season") FROM table_3290 | wikisql |
CREATE TABLE table_63919 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Silver medals did the Nation with 10 or more Bronze receive?
| SELECT MIN("Silver") FROM table_63919 WHERE "Bronze" > '10' | wikisql |
CREATE TABLE table_71916 (
"Year" real,
"Winner" text,
"Jockey" text,
"Trainer" text,
"Owner" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was owner Michael E. Pegram's last win?
| SELECT MAX("Year") FROM table_71916 WHERE "Owner" = 'michael e. pegram' | wikisql |
CREATE TABLE table_41404 (
"Rank" real,
"Name" text,
"Team" text,
"Games" real,
"Rebounds" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Rebounds did Maccabi Tel Aviv Team get after Game 6?
| SELECT COUNT("Rebounds") FROM table_41404 WHERE "Team" = 'maccabi tel aviv' AND "Games" > '6' | 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 instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREA... | SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE ((SEM... | 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 T1.Price, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder | nvbench |
CREATE TABLE table_3743 (
"Version" text,
"Codename" text,
"Edition" text,
"Code Base" text,
"Compatible repository" text,
"Default desktop environment" text,
"Release date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the compatib... | SELECT "Compatible repository" FROM table_3743 WHERE "Version" = 'Old version, no longer supported: 9' AND "Default desktop environment" = 'LXDE' | wikisql |
CREATE TABLE table_name_11 (
final VARCHAR,
no5 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the final result of the team that has Simara as No.5?
| SELECT final FROM table_name_11 WHERE no5 = "simara" | sql_create_context |
CREATE TABLE CMI_Cross_References (
cmi_cross_ref_id INTEGER,
master_customer_id INTEGER,
source_system_code CHAR(15)
)
CREATE TABLE Electoral_Register (
electoral_register_id INTEGER,
cmi_cross_ref_id INTEGER
)
CREATE TABLE Customer_Master_Index (
master_customer_id INTEGER,
cmi_details V... | SELECT council_tax_id, cmi_cross_ref_id FROM Parking_Fines | nvbench |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBase... | SELECT COUNT(Id) AS "#" FROM Posts WHERE PostTypeId = 1 AND CreationDate > DATEADD(Month, -12, DATEADD(dd, DATEDIFF(dd, 0, GETDATE()), 0)) | sede |
CREATE TABLE table_32878 (
"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.
-- Who was the home team for the Essendon away team... | SELECT "Home team score" FROM table_32878 WHERE "Crowd" > '13,500' AND "Away team" = 'essendon' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.age < "49" | mimicsql_data |
CREATE TABLE table_6950 (
"Nation" text,
"Skip" text,
"Third" text,
"Second" text,
"Lead" text,
"Alternate" text,
"Club" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Yumie Hayashi was third for which club?
| SELECT "Club" FROM table_6950 WHERE "Third" = 'yumie hayashi' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2110" AND procedures.icd9_code = "4105" | mimicsql_data |
CREATE TABLE table_name_67 (
meet VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the meet when the date is 3 august 2012?
| SELECT meet FROM table_name_67 WHERE date = "3 august 2012" | sql_create_context |
CREATE TABLE table_80372 (
"2002/ 03" text,
"2004/ 05" text,
"2006/ 07" text,
"2007/ 08" text,
"2008/ 09" text,
"2009/ 10" text,
"2010/ 11" text,
"2011/ 12" text,
"2012/ 13" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the 201... | SELECT "2010/ 11" FROM table_80372 WHERE "2004/ 05" = 'not held' AND "2011/ 12" = 'non-ranking' | 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 MED_EXP_DET_ID FROM t_kc22 WHERE MED_CLINIC_ID = '84484149004' AND (REMOTE_SETTLE_FLG = '异地1' OR REMOTE_SETTLE_FLG = '异地2') | css |
CREATE TABLE table_50728 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Loris Capirossi's time?
| SELECT "Time" FROM table_50728 WHERE "Rider" = 'loris capirossi' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.icd9_code = "252" | mimicsql_data |
CREATE TABLE table_name_55 (
date VARCHAR,
home VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of the game when St. Louis was the home team?
| SELECT date FROM table_name_55 WHERE home = "st. louis" | sql_create_context |
CREATE TABLE table_name_60 (
high_assists VARCHAR,
game INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- With the game that was less than 16 what was the high assists?
| SELECT high_assists FROM table_name_60 WHERE game < 16 | sql_create_context |
CREATE TABLE order_items (
product_id VARCHAR,
order_quantity INTEGER
)
CREATE TABLE products (
product_details VARCHAR,
product_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the name and ID of the product whose total order quantity is the ... | SELECT t2.product_details, t2.product_id FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id ORDER BY SUM(t1.order_quantity) LIMIT 1 | sql_create_context |
CREATE TABLE table_name_56 (
gold INTEGER,
total VARCHAR,
rank VARCHAR,
bronze VARCHAR,
silver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average gold medals for countries with more than 0 bronze, more than 0 silver, rank over 2 a... | SELECT AVG(gold) FROM table_name_56 WHERE bronze > 0 AND silver > 0 AND rank > 2 AND total > 3 | sql_create_context |
CREATE TABLE table_204_105 (
id number,
"#" number,
"name" text,
"height" text,
"weight (lbs.)" number,
"position" text,
"class" text,
"hometown" text,
"previous team(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who weighs the ... | SELECT "name" FROM table_204_105 ORDER BY "weight (lbs.)" DESC LIMIT 1 | squall |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_... | SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE ((SEM... | advising |
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_seaso... | SELECT Openning_year, AVG(Capacity) FROM cinema GROUP BY Openning_year ORDER BY AVG(Capacity) DESC | nvbench |
CREATE TABLE table_25913 (
"Episode" text,
"First broadcast" text,
"Seans team" text,
"Daves team" text,
"Scores" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which episode has boy george and lee mack on dave's team?
| SELECT "Episode" FROM table_25913 WHERE "Daves team" = 'Boy George and Lee Mack' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE lab (
labid number,
pa... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE DATETIME(patient.hospitaladmittime) <= DATETIME(CURRENT_TIME(), '-1 year') | eicu |
CREATE TABLE table_57760 (
"Tournament" 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 is the 2006 value with 3r in 2007?
| SELECT "2006" FROM table_57760 WHERE "2007" = '3r' | wikisql |
CREATE TABLE table_name_16 (
film_or_television_series_or_miniseries VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the film, television series, or miniseries with a nomination in 2001?
| SELECT film_or_television_series_or_miniseries FROM table_name_16 WHERE year = 2001 | sql_create_context |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT 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 table_204_240 (
id number,
"name" text,
"current use" text,
"completed" text,
"namesake" text,
"info" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which building was the first completed ?
| SELECT "name" FROM table_204_240 ORDER BY "completed" LIMIT 1 | squall |
CREATE TABLE table_36128 (
"Game" real,
"December" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the score for December of 30?
| SELECT "Score" FROM table_36128 WHERE "December" = '30' | wikisql |
CREATE TABLE table_name_20 (
lost INTEGER,
points VARCHAR,
drawn VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many losses have points less than 3, with a drawn greater than 0?
| SELECT SUM(lost) FROM table_name_20 WHERE points < 3 AND drawn > 0 | sql_create_context |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | SELECT * FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.person_info_XM = '姜新蕾' AND hz_info.YLJGDM = '4680590' AND zyjzjlb.CYKSMC LIKE '%免疫病%' | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | SELECT demographic.dob, demographic.ethnicity FROM demographic WHERE demographic.name = "Jerry Deberry" | mimicsql_data |
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
depa... | 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, fare, fare_basis, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKLAND' AND fare_basis.economy = 'YES' AND fare.fare_basi... | atis |
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "MORP2-4" AND lab."CATEGORY" = "Hematology" | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.dod_year < "2111.0" | mimicsql_data |
CREATE TABLE table_75323 (
"Player" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of all the touchdowns when the player had more than 0 extra points and less... | SELECT SUM("Touchdowns") FROM table_75323 WHERE "Extra points" > '0' AND "Field goals" < '0' | wikisql |
CREATE TABLE table_45134 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest laps that has a manufacturer of yamaha, and a time/retired of +1:08.312, and a g... | SELECT MIN("Laps") FROM table_45134 WHERE "Manufacturer" = 'yamaha' AND "Time/Retired" = '+1:08.312' AND "Grid" < '20' | wikisql |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | SELECT PostTypes.Name, ((SUM(Posts.Score) * 1.0) / COUNT(Posts.Score)) FROM Posts INNER JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId GROUP BY PostTypes.Name | sede |
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 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 station (
name VARCHAR,
long VARCHAR,
id VARCHAR
)
CREATE TABLE trip (
duration INTEGER,
start_station_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For each station, return its longitude and the average duration of trips that s... | SELECT T1.name, T1.long, AVG(T2.duration) FROM station AS T1 JOIN trip AS T2 ON T1.id = T2.start_station_id GROUP BY T2.start_station_id | sql_create_context |
CREATE TABLE table_1531 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Points difference" text,
"Points" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many losses ... | SELECT "Lost" FROM table_1531 WHERE "Points for" = '539' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.