instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT jyjgzbb.JYZBLSH FROM 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 jyb... | css |
CREATE TABLE table_52761 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average laps that had a time/retired of +5 laps?
| SELECT AVG("Laps") FROM table_52761 WHERE "Time/Retired" = '+5 laps' | wikisql |
CREATE TABLE table_name_2 (
seasons VARCHAR,
coach VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many seasons did Pat Chambers coach?
| SELECT COUNT(seasons) FROM table_name_2 WHERE coach = "pat chambers" | sql_create_context |
CREATE TABLE table_name_82 (
fa_trophy INTEGER,
league VARCHAR,
total VARCHAR,
fa_cup VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many FA Trophies had a total of 27, 2 FA cups, and a league larger than 24?
| SELECT SUM(fa_trophy) FROM table_name_82 WHERE total = 27 AND fa_cup = 2 AND league > 24 | sql_create_context |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConce... | SELECT SUM(CASE Votes.VoteTypeId WHEN 2 THEN 1 ELSE 0 END) - SUM(CASE Votes.VoteTypeId WHEN 3 THEN 1 ELSE 0 END) AS score, Users.DisplayName FROM Posts INNER JOIN Users ON Users.Id = Posts.OwnerUserId INNER JOIN Votes ON Votes.PostId = Posts.Id INNER JOIN PostTags ON PostTags.PostId = Posts.Id INNER JOIN Tags ON Tags.I... | sede |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
Dup... | SELECT p.OwnerUserId AS "user_link", c.PostId AS "post_link", p.Score, p.CreationDate AS "posted", c.CreationDate AS "commented", c.Score, c.Id AS "comment_link" FROM Comments AS c RIGHT OUTER JOIN Posts AS p ON c.PostId = p.Id WHERE c.UserId = '##UserID##' AND p.OwnerUserId = '##OtherUserID:int?22656##' | sede |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
... | SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid =... | eicu |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
Acc... | WITH questiontypeweek AS (SELECT Id, DATEDIFF(wk, CreationDate, GETDATE()) AS week, (CASE WHEN AcceptedAnswerId IS NULL THEN 1 ELSE (CASE WHEN ClosedDate IS NULL THEN 2 ELSE 3 END) END) AS type FROM Posts AS p WHERE PostTypeId = 1) SELECT a.week, a.accepted, b.closed, c."open" FROM (SELECT COUNT(*) AS accepted, week FR... | sede |
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 Affiliation, SUM(Enrollment) FROM university WHERE Founded > 1850 GROUP BY Affiliation | nvbench |
CREATE TABLE table_54977 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the home team where Trail Blazers were the visitor?
| SELECT "Home" FROM table_54977 WHERE "Visitor" = 'trail blazers' | wikisql |
CREATE TABLE table_1940012_2 (
winning_score VARCHAR,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the winning score in the Sybase Classic tournament?
| SELECT winning_score FROM table_1940012_2 WHERE tournament = "Sybase Classic" | sql_create_context |
CREATE TABLE table_68426 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest number of points for the Modena Team Spa after 1991?
| SELECT MAX("Points") FROM table_68426 WHERE "Entrant" = 'modena team spa' AND "Year" > '1991' | 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 T1.Code, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder | nvbench |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT Team_Name, ACC_Percent FROM basketball_match | nvbench |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE cost (
ro... | SELECT COUNT(*) > 0 FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24268) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND outputevents.itemid IN (SELECT... | mimic_iii |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTas... | SELECT CAST((SELECT COUNT(1) FROM Posts AS p JOIN Users AS u ON p.OwnerUserId = u.Id WHERE CAST(TIME_TO_STR(p.CreationDate, '%Y%m%d') AS TEXT(30)) = CAST(TIME_TO_STR(u.CreationDate, '%Y%m%d') AS TEXT(30))) AS FLOAT) / CAST((SELECT COUNT(1) FROM Posts) AS FLOAT) * 100.0 | sede |
CREATE TABLE table_42402 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"Facility ID" real,
"ERP W" real,
"Height m ( ft )" text,
"Class" text,
"FCC info" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which city has a... | SELECT "City of license" FROM table_42402 WHERE "Facility ID" > '150833' | wikisql |
CREATE TABLE table_77153 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of the pick from texas a&i college with a round greater than 1?
| SELECT SUM("Pick") FROM table_77153 WHERE "College" = 'texas a&i' AND "Round" > '1' | wikisql |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_... | SELECT patients.gender FROM patients WHERE patients.subject_id = 68641 | mimic_iii |
CREATE TABLE table_name_66 (
specific_impulse__s_ INTEGER,
sfc_in_lb__lbf·h_ VARCHAR,
effective_exhaust_velocity__m_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the average specific impulse for engines that have a SFC in lb/(lbf h) of 7.95, ... | SELECT AVG(specific_impulse__s_) FROM table_name_66 WHERE sfc_in_lb__lbf·h_ = 7.95 AND effective_exhaust_velocity__m_s_ > 4 OFFSET 423 | sql_create_context |
CREATE TABLE table_name_62 (
status VARCHAR,
issn VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the status for a journal with the ISSN of 0149-1830?
| SELECT status FROM table_name_62 WHERE issn = "0149-1830" | sql_create_context |
CREATE TABLE table_name_59 (
team_sites VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the team sites entry for Microsoft Sharepoint?
| SELECT team_sites FROM table_name_59 WHERE name = "microsoft sharepoint" | sql_create_context |
CREATE TABLE table_name_54 (
starts INTEGER,
yards INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the average number of starts Michael Henig had in a year when he had more than 1201 yards?
| SELECT AVG(starts) FROM table_name_54 WHERE yards > 1201 | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "REHAB/DISTINCT PART HOSP" AND procedures.short_title = "Closed biopsy of tongue" | mimicsql_data |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
row_id number,
itemid ... | SELECT COUNT(*) > 0 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 = 18223)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'd10w' AN... | mimic_iii |
CREATE TABLE table_46662 (
"Country" text,
"Preliminary" real,
"Interview" real,
"Swimsuit" real,
"Evening Gown" real,
"Average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of Preliminary scores where the interview score is 9.... | SELECT SUM("Preliminary") FROM table_46662 WHERE "Interview" = '9.654' AND "Average" < '9.733' | wikisql |
CREATE TABLE table_204_763 (
id number,
"county" text,
"km" number,
"intersecting road" text,
"notes" text,
"coordinates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the last intersecting road ?
| SELECT "intersecting road" FROM table_204_763 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar... | SELECT DISTINCT flight_id FROM flight WHERE (((flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 23 AND DATE_DAYalias0.month_number = 4 AND DATE_DAYalias0.year = 1991)) AND to... | atis |
CREATE TABLE table_204_704 (
id number,
"province" text,
"map #" number,
"iso 3166-2:af" text,
"centers" text,
"population" number,
"area (km2)" number,
"language" text,
"notes" text,
"u.n. region" text
)
-- Using valid SQLite, answer the following questions for the tables prov... | SELECT "province" FROM table_204_704 ORDER BY "population" LIMIT 1 | squall |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY ACC_Road | nvbench |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_re... | 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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ... | atis |
CREATE TABLE table_32884 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the time/retired for a grid larger than 11, laps larger than 41, and nick heidfeld?
| SELECT "Time/Retired" FROM table_32884 WHERE "Grid" > '11' AND "Laps" > '41' AND "Driver" = 'nick heidfeld' | wikisql |
CREATE TABLE table_49169 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What place is Ben Hogan?
| SELECT "Place" FROM table_49169 WHERE "Player" = 'ben hogan' | wikisql |
CREATE TABLE table_79376 (
"Rank" real,
"Athlete" text,
"Country" text,
"Time" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is listed in notes for the athlete, lassi karonen?
| SELECT "Notes" FROM table_79376 WHERE "Athlete" = 'lassi karonen' | wikisql |
CREATE TABLE table_18566 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What candidate is associated with the Georgia 4 district?
| SELECT "Candidates" FROM table_18566 WHERE "District" = 'Georgia 4' | wikisql |
CREATE TABLE table_name_52 (
crowd INTEGER,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the largest crowd at Lake Oval?
| SELECT MAX(crowd) FROM table_name_52 WHERE venue = "lake oval" | sql_create_context |
CREATE TABLE table_23492454_1 (
directed_by VARCHAR,
written_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who directed the episode written by Shonda Rhimes?
| SELECT directed_by FROM table_23492454_1 WHERE written_by = "Shonda Rhimes" | sql_create_context |
CREATE TABLE table_182410_10 (
digital_terrestrial_channel VARCHAR,
channel VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many digital terrestrial channels are there for channel 4?
| SELECT COUNT(digital_terrestrial_channel) FROM table_182410_10 WHERE channel = "channel 4" | sql_create_context |
CREATE TABLE table_40594 (
"Sanderstead" text,
"Selsdon" text,
"Coombe Road" text,
"Bingham Road" text,
"Woodside" text,
"Elmers End" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Elmers End with a 09:54 Bingham Road?
| SELECT "Elmers End" FROM table_40594 WHERE "Bingham Road" = '09:54' | wikisql |
CREATE TABLE table_18018248_2 (
games_played INTEGER,
loses VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the least amount of games played with 21 losses?
| SELECT MIN(games_played) FROM table_18018248_2 WHERE loses = 21 | sql_create_context |
CREATE TABLE table_name_26 (
accompaniment VARCHAR,
title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the accompaniment when the title is stormy seas blues?
| SELECT accompaniment FROM table_name_26 WHERE title = "stormy seas blues" | sql_create_context |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE... | SELECT * FROM TagSynonyms WHERE TargetTagName = '##MasterTagName##' ORDER BY ApprovalDate, AutoRenameCount DESC | sede |
CREATE TABLE district (
District_ID int,
District_name text,
Headquartered_City text,
City_Population real,
City_Area real
)
CREATE TABLE store (
Store_ID int,
Store_Name text,
Type text,
Area_size real,
Number_of_product_category real,
Ranking int
)
CREATE TABLE store_dist... | SELECT District_name, City_Population FROM district WHERE City_Population BETWEEN 200000 AND 2000000 ORDER BY City_Population | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2058" AND lab.fluid = "Cerebrospinal Fluid (CSF)" | mimicsql_data |
CREATE TABLE table_61459 (
"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 club does John Westin play for?
| SELECT "College/junior/club team (league)" FROM table_61459 WHERE "Player" = 'john westin' | wikisql |
CREATE TABLE table_61601 (
"Location" text,
"Partner" text,
"Construction Start" text,
"Inauguration Date" text,
"Population Served" real,
"Design flow (LPM)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Construction Start has an Inaugura... | SELECT "Construction Start" FROM table_61601 WHERE "Inauguration Date" = '2010 june' | wikisql |
CREATE TABLE table_name_96 (
grid VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the grid when the driver was Mark Webber?
| SELECT grid FROM table_name_96 WHERE driver = "mark webber" | sql_create_context |
CREATE TABLE table_57898 (
"Player" text,
"Nationality" text,
"Position" text,
"Years for Jazz" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the nationality of the player from Duke?
| SELECT "Nationality" FROM table_57898 WHERE "School/Club Team" = 'duke' | wikisql |
CREATE TABLE table_name_76 (
result VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the Result listed that has a Date of June 12, 1997?
| SELECT result FROM table_name_76 WHERE date = "june 12, 1997" | sql_create_context |
CREATE TABLE table_11642 (
"Round" text,
"Player" text,
"Position" text,
"Team" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What college has the Chicago Stags?
| SELECT "College" FROM table_11642 WHERE "Team" = 'chicago stags' | wikisql |
CREATE TABLE table_73211 (
"Shareholder" text,
"s A share" real,
"s B share" real,
"Percent of capital" text,
"Percent of votes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What shareholder has 2.55 percent of votes?
| SELECT "Shareholder" FROM table_73211 WHERE "Percent of votes" = '2.55' | 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_DIRE_CD text,
MED_DIRE_NM text,... | SELECT COUNT(t_kc21.IN_DIAG_DIS_CD) FROM t_kc21 WHERE t_kc21.PERSON_NM = '喻哲茂' AND t_kc21.IN_HOSP_DATE BETWEEN '2004-07-05' AND '2017-04-20' | css |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | SELECT (((SELECT CAST(COUNT(*) AS FLOAT) FROM Users WHERE Reputation > 10000) / (SELECT CAST(COUNT(*) AS FLOAT) FROM Users WHERE LastAccessDate > GETUTCDATE() - '##ActiveInLastXDays##' AND Reputation > '##RepThreshold##' AND (UpVotes + DownVotes) > 0)) * 100) AS PercentageOver10k, (((SELECT CAST(COUNT(*) AS FLOAT) FROM... | sede |
CREATE TABLE table_name_33 (
total VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Davis Love III's total?
| SELECT total FROM table_name_33 WHERE player = "davis love iii" | sql_create_context |
CREATE TABLE table_name_22 (
first_elected VARCHAR,
committee VARCHAR,
counties_represented VARCHAR,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of First Elected that has counties represented of Anne Arundel, Dist... | SELECT COUNT(first_elected) FROM table_name_22 WHERE counties_represented = "anne arundel" AND district = "30" AND committee = "ways and means" | sql_create_context |
CREATE TABLE table_name_93 (
date VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date when the Twins had a record of 44-37?
| SELECT date FROM table_name_93 WHERE record = "44-37" | 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 * 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 hz_info.YLJGDM = '7783092' AND NOT zyjzjlb.CYKSMC LIKE '%胸外%' | css |
CREATE TABLE table_204_647 (
id number,
"year" number,
"film" text,
"role" text,
"language" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the actor 's first film ?
| SELECT "film" FROM table_204_647 ORDER BY "year" LIMIT 1 | squall |
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 diagnoses (
... | SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.expire_flag = "1" | mimicsql_data |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'abscess drainage procedure - percutaneou... | eicu |
CREATE TABLE table_204_226 (
id number,
"municipality/communes" text,
"coalition for the citizen" text,
"coalition for the future" text,
"other/independent" text,
"winning party/coalition" text,
"voter turnout" text
)
-- Using valid SQLite, answer the following questions for the tables pro... | SELECT COUNT(*) FROM table_204_226 WHERE "winning party/coalition" = 'coalition for the future' | squall |
CREATE TABLE Elimination (
Elimination_ID text,
Wrestler_ID text,
Team text,
Eliminated_By text,
Elimination_Move text,
Time text
)
CREATE TABLE wrestler (
Wrestler_ID int,
Name text,
Reign text,
Days_held text,
Location text,
Event text
)
-- Using valid SQLite, answer... | SELECT Team, COUNT(*) FROM Elimination GROUP BY Team ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_9659 (
"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 Away team has a Home team of walsall?
| SELECT "Away team" FROM table_9659 WHERE "Home team" = 'walsall' | 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 COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '68819999' AND t_kc22.STA_DATE BETWEEN '2001-08-16' AND '2006-10-01' AND t_kc22.SOC_SRT_DIRE_NM = '盐酸美金刚口服溶液' | css |
CREATE TABLE table_name_15 (
record VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was their record on week 11?
| SELECT record FROM table_name_15 WHERE week = 11 | sql_create_context |
CREATE TABLE Products (
Product_ID INTEGER,
Product_Type_Code CHAR(15),
Product_Name VARCHAR(255),
Product_Price DECIMAL(20,4)
)
CREATE TABLE Channels (
Channel_ID INTEGER,
Other_Details VARCHAR(255)
)
CREATE TABLE Events (
Event_ID INTEGER,
Address_ID INTEGER,
Channel_ID INTEGER,
... | SELECT Product_Name, COUNT(*) FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_39592 (
"Season" real,
"Overall" real,
"Slalom" text,
"Giant Slalom" real,
"Super G" real,
"Downhill" text,
"Combined" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest overall score prior to 1992 with a do... | SELECT MIN("Overall") FROM table_39592 WHERE "Downhill" = '1' AND "Season" < '1992' | wikisql |
CREATE TABLE table_75573 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the location of the match with an event of ... | SELECT "Location" FROM table_75573 WHERE "Event" = 'ecc 8: comeback' | wikisql |
CREATE TABLE table_test_3 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"severe_hemodynamic_instability" bool,
"consent" bool,
"hemoglobin_a1c_hba1c" float,
"metallic_implants" bool,
"allergy_to_aspirin" bool,
"creatinine_clearance_cl" float,
"post_menopausal" bool,... | SELECT * FROM table_test_3 WHERE cardiogenic_shock = 1 OR severe_hemodynamic_instability = 1 | criteria2sql |
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TE... | SELECT Winery, COUNT(Winery) FROM wine WHERE Price > 100 GROUP BY Winery ORDER BY Winery DESC | nvbench |
CREATE TABLE table_8658 (
"Size" real,
"Lg. Dia." real,
"Sm. Dia." real,
"Length" real,
"Taper (in/ft)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest Taper (in/ft), when Size is 8?
| SELECT MAX("Taper (in/ft)") FROM table_8658 WHERE "Size" = '8' | wikisql |
CREATE TABLE table_13180 (
"7:00 am" text,
"7:30 am" text,
"8:00 am" text,
"9:00 am" text,
"10:00 am" text,
"11:00 am" text,
"noon" text,
"12:30 pm" text,
"1:00 pm" text,
"1:30 pm" text,
"2:00 pm" text,
"3:00 pm" text,
"4:30 pm" text,
"5:00 pm" text,
"6:30 pm"... | SELECT "11:00 am" FROM table_13180 WHERE "12:30 pm" = 'local programs' | wikisql |
CREATE TABLE table_8521 (
"Player" text,
"Position" text,
"Premier League" real,
"FA Cup" real,
"League Cup" real,
"UEFA Cup" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the premier league number when the position is... | SELECT COUNT("Premier League") FROM table_8521 WHERE "Position" = 'forward' AND "Total" > '22' | wikisql |
CREATE TABLE table_74404 (
"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 t... | SELECT "Team" FROM table_74404 WHERE "Date" = 'January 19' | wikisql |
CREATE TABLE table_9947 (
"Place" text,
"Athlete" text,
"Points" text,
"Score" text,
"500 m" text,
"1500 m" text,
"5000 m" text,
"10000 m" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which athlete had 17 points and a 1500 m of 3?
| SELECT "Athlete" FROM table_9947 WHERE "Points" = '17' AND "1500 m" = '3' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)... | SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-1459')) AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(),... | eicu |
CREATE TABLE Suppliers (
supplier_id INTEGER,
supplier_name VARCHAR(80),
supplier_phone VARCHAR(80)
)
CREATE TABLE Department_Store_Chain (
dept_store_chain_id INTEGER,
dept_store_chain_name VARCHAR(80)
)
CREATE TABLE Departments (
department_id INTEGER,
dept_store_id INTEGER,
departme... | SELECT product_type_code, AVG(product_price) FROM Products GROUP BY product_type_code ORDER BY AVG(product_price) | nvbench |
CREATE TABLE table_name_45 (
opponent VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the Opponent on January 16?
| SELECT opponent FROM table_name_45 WHERE date = "january 16" | sql_create_context |
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 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 DESC | nvbench |
CREATE TABLE table_43577 (
"Date" text,
"Home team" text,
"Score" text,
"Away team" text,
"Venue" text,
"Box Score" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team has theoir home games in the venue of gold coast conv... | SELECT "Home team" FROM table_43577 WHERE "Venue" = 'gold coast convention centre' | wikisql |
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.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T2.Headquarter | 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 COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 9964 AND STRFTIME('%y', admissions.admittime) = '2105' | mimic_iii |
CREATE TABLE table_34482 (
"Game" real,
"October" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Game has a Record of 4 2 1, and Points larger than 9?
| SELECT SUM("Game") FROM table_34482 WHERE "Record" = '4–2–1' AND "Points" > '9' | wikisql |
CREATE TABLE table_42483 (
"Milepost" real,
"Name of the tunnel" text,
"Length" text,
"Maximum Height" text,
"Minimum Height" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the minimum Height of the Little Switzerland Tunnel?
| SELECT "Minimum Height" FROM table_42483 WHERE "Name of the tunnel" = 'little switzerland tunnel' | wikisql |
CREATE TABLE table_1341395_36 (
district VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what district was the incumbent Steve Chabot?
| SELECT district FROM table_1341395_36 WHERE incumbent = "Steve Chabot" | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
... | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = '100 ml glass cont : iopamidol 61 % iv soln') | eicu |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "BARI2/450L" | mimicsql_data |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(MANAGER_ID) DESC | nvbench |
CREATE TABLE table_name_34 (
total INTEGER,
year_s__won VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What total average has 1988 has the year (s) won?
| SELECT AVG(total) FROM table_name_34 WHERE year_s__won = "1988" | sql_create_context |
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(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-16123')) AND microlab.culturesite = 'urine, voided specimen' AND STRFTIME(... | eicu |
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_CLINIC_ID, t_kc21.PERSON_ID, t_kc21.PERSON_NM, t_kc21.IDENTITY_CARD, t_kc21.PERSON_SEX, t_kc21.PERSON_AGE FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc24.MED_AMOUT = (SELECT t_kc24.MED_AMOUT FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID = '09954947689') | css |
CREATE TABLE participants (
participant_id number,
participant_type_code text,
participant_details text
)
CREATE TABLE events (
event_id number,
service_id number,
event_details text
)
CREATE TABLE participants_in_events (
event_id number,
participant_id number
)
CREATE TABLE services... | SELECT T3.service_id, T4.service_type_code FROM participants AS T1 JOIN participants_in_events AS T2 ON T1.participant_id = T2.participant_id JOIN events AS T3 ON T2.event_id = T3.event_id JOIN services AS T4 ON T3.service_id = T4.service_id GROUP BY T3.service_id ORDER BY COUNT(*) LIMIT 1 | spider |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
... | SELECT JZLX FROM jybgb WHERE BGDH = '09816653147' | css |
CREATE TABLE table_name_49 (
nhl_team VARCHAR,
pick__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which NHL team got pick 89?
| SELECT nhl_team FROM table_name_49 WHERE pick__number = "89" | sql_create_context |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT School_ID, ACC_Percent FROM basketball_match GROUP BY ACC_Home | nvbench |
CREATE TABLE table_name_15 (
year INTEGER,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average year for Ponce, Puerto Rico events?
| SELECT AVG(year) FROM table_name_15 WHERE venue = "ponce, puerto rico" | sql_create_context |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score num... | SELECT Users.DisplayName, SUM(Score) AS Score FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Users ON Posts.OwnerUserId = Users.Id WHERE Posts.CommunityOwnedDate IS NULL AND Tags.TagName = 'algorithm' GROUP BY Users.DisplayName ORDER BY Score DE... | sede |
CREATE TABLE table_44696 (
"Solution" text,
"Other Name" text,
"[Na + ](mmol/L)" real,
"[Cl - ](mmol/L)" real,
"[Glucose](mmol/L)" real,
"[Glucose](mg/dl)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest glucose(mg/dl) with a ... | SELECT MAX("[Glucose](mg/dl)") FROM table_44696 WHERE "Solution" = '2/3d & 1/3s' AND "[Glucose](mmol/L)" < '185' | wikisql |
CREATE TABLE table_6960 (
"Date" text,
"Title" text,
"Director" text,
"Producer" text,
"Production Cost" text,
"Singapore Gross" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the title of the film that had a production cost of $850,000?... | SELECT "Title" FROM table_6960 WHERE "Production Cost" = '$850,000' | wikisql |
CREATE TABLE table_32757 (
"Name" text,
"Release date" text,
"Latest version" text,
"Status support" text,
"Source model" text,
"Architecture" text,
"Target market" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which of the Latest version w... | SELECT "Latest version" FROM table_32757 WHERE "Release date" = '1987-12-09' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.