instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
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 lab (
subject_id text,
hadm_id text,
... | SELECT diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Alice Nixon" | mimicsql_data |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY... | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID | nvbench |
CREATE TABLE table_16594 (
"Finishing position" text,
"Points awarded (Platinum)" real,
"Points awarded (Gold)" real,
"Points awarded (Silver)" real,
"Points awarded (Satellite)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many platinum point... | SELECT "Points awarded (Platinum)" FROM table_16594 WHERE "Points awarded (Gold)" = '9' | wikisql |
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 * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGD... | css |
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 = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATL... | atis |
CREATE TABLE table_name_3 (
nationality VARCHAR,
lane INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What nationality is the swimmer that is in the lane that is less than 2?
| SELECT nationality FROM table_name_3 WHERE lane < 2 | sql_create_context |
CREATE TABLE table_name_89 (
wickets INTEGER,
average VARCHAR,
matches VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the highest wickets when the matches is less than 5, player is jim laker and average is more than 52.44?
| SELECT MAX(wickets) FROM table_name_89 WHERE matches < 5 AND player = "jim laker" AND average > 52.44 | sql_create_context |
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_... | 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 = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATL... | atis |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId n... | SELECT ROW_NUMBER() OVER (ORDER BY COUNT(v.Id) DESC) AS "#", MAX(u.DisplayName) AS UserName, COUNT(v.Id) AS TotalScore, MAX(u.Reputation) AS Reputation FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND v.VoteTypeId = ... | sede |
CREATE TABLE table_73348 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the name of the episode that was directed by ... | SELECT "Title" FROM table_73348 WHERE "Directed by" = 'Mary Harron' | wikisql |
CREATE TABLE customer (
cust_id text,
cust_name text,
acc_type text,
acc_bal number,
no_of_loans number,
credit_score number,
branch_id number,
state text
)
CREATE TABLE bank (
branch_id number,
bname text,
no_of_customers number,
city text,
state text
)
CREATE TABL... | SELECT T1.bname, T1.city FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id WHERE T2.loan_type = 'Business' | spider |
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE swimme... | SELECT meter_200, COUNT(meter_200) FROM swimmer GROUP BY meter_200 ORDER BY COUNT(meter_200) | nvbench |
CREATE TABLE mzb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | SELECT * FROM qtb WHERE qtb.MED_SER_ORG_NO = '1054385' AND qtb.IN_HOSP_DATE BETWEEN '2003-03-19' AND '2008-05-29' UNION SELECT * FROM gyb WHERE gyb.MED_SER_ORG_NO = '1054385' AND gyb.IN_HOSP_DATE BETWEEN '2003-03-19' AND '2008-05-29' UNION SELECT * FROM zyb WHERE zyb.MED_SER_ORG_NO = '1054385' AND zyb.IN_HOSP_DATE BETW... | css |
CREATE TABLE table_70832 (
"Name" text,
"Frequency" text,
"Language" text,
"City" text,
"Website" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the frequency of the newspaper, el diario de nuevo laredo in the city of nuevo laredo ?
| SELECT "Frequency" FROM table_70832 WHERE "City" = 'nuevo laredo' AND "Name" = 'el diario de nuevo laredo' | 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 WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.diagnosis = "MESENTERIC ISCHEMIA" | mimicsql_data |
CREATE TABLE table_191105_3 (
first_aired VARCHAR,
subject VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If skeletal system is the subject when was it first aired?
| SELECT first_aired FROM table_191105_3 WHERE subject = "Skeletal system" | sql_create_context |
CREATE TABLE table_6707 (
"Date" text,
"Opponent#" text,
"Site" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent in the game that was attended by 42,000 people?
| SELECT "Opponent#" FROM table_6707 WHERE "Attendance" = '42,000' | wikisql |
CREATE TABLE table_19715 (
"Rank" real,
"Name" text,
"Nationality" text,
"Total points" text,
"Oberstdorf (Rk)" text,
"Ga-Pa (Rk)" text,
"Bhofen#1 (Rk)" text,
"Bhofen#2 (Rk)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Bh... | SELECT "Bhofen#2 (Rk)" FROM table_19715 WHERE "Ga-Pa (Rk)" = '233.4 (16)' | wikisql |
CREATE TABLE table_12384 (
"Year" real,
"Gold" text,
"Silver" text,
"Bronze" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Notes, when Gold is 'Thierry Gueorgiou', when Year is before 2008, and when Bronze is 'Valentin Novikov... | SELECT "Notes" FROM table_12384 WHERE "Gold" = 'thierry gueorgiou' AND "Year" < '2008' AND "Bronze" = 'valentin novikov' | wikisql |
CREATE TABLE table_name_20 (
year INTEGER,
entrant VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest year team tyrrell earned more than 14 points?
| SELECT MAX(year) FROM table_name_20 WHERE entrant = "team tyrrell" AND points > 14 | sql_create_context |
CREATE TABLE table_10021158_3 (
best_finish VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the best finish was T69, how many people came in 2nd?
| SELECT 2 AS nd FROM table_10021158_3 WHERE best_finish = "T69" | sql_create_context |
CREATE TABLE table_2147588_3 (
reason_for_change VARCHAR,
date_of_successors_formal_installation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the reason for change in staff in formal installations on March 15, 1865?
| SELECT reason_for_change FROM table_2147588_3 WHERE date_of_successors_formal_installation = "March 15, 1865" | sql_create_context |
CREATE TABLE train (
id int,
train_number int,
name text,
origin text,
destination text,
time text,
interval text
)
CREATE TABLE route (
train_id int,
station_id int
)
CREATE TABLE station (
id int,
network_name text,
services text,
local_authority text
)
CREATE TA... | SELECT name, COUNT(name) FROM train GROUP BY name ORDER BY COUNT(name) | nvbench |
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 q.Id AS "post_link", q.CommentCount + COALESCE(SUM(a.CommentCount), 0) FROM Posts AS q LEFT OUTER JOIN Posts AS a ON q.Id = a.ParentId GROUP BY q.Id, q.CommentCount ORDER BY q.CommentCount + COALESCE(SUM(a.CommentCount), 0) DESC LIMIT 100 | sede |
CREATE TABLE table_name_57 (
pick__number VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many pick numbers did Matt Marquess have?
| SELECT COUNT(pick__number) FROM table_name_57 WHERE player = "matt marquess" | sql_create_context |
CREATE TABLE table_77430 (
"Date" text,
"Round" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real,
"Scorers" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the result of round R3?
| SELECT "Result" FROM table_77430 WHERE "Round" = 'r3' | wikisql |
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_ca... | SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY COUNT(*) | nvbench |
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2073" AND lab.flag = "delta" | mimicsql_data |
CREATE TABLE table_18182 (
"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.
-- how many party with district being washington 7
| SELECT COUNT("Party") FROM table_18182 WHERE "District" = 'Washington 7' | wikisql |
CREATE TABLE table_name_57 (
points INTEGER,
played VARCHAR,
average VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Total points with 114 played and average of 0.982?
| SELECT SUM(points) FROM table_name_57 WHERE played = 114 AND average = 0.982 | sql_create_context |
CREATE TABLE table_43068 (
"Position" text,
"Jersey #" real,
"Name" text,
"Height (cm)" real,
"Weight (kg)" real,
"Birthdate" text,
"Birthplace" text,
"1990\u20131991 Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Posit... | SELECT "Position" FROM table_43068 WHERE "Birthplace" = 'toledo, ohio' | wikisql |
CREATE TABLE table_12528 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What district has a democratic party?
| SELECT "District" FROM table_12528 WHERE "Party" = 'democratic' | wikisql |
CREATE TABLE table_name_38 (
length_overall VARCHAR,
designation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the overall length with a designation of s-8ko?
| SELECT length_overall FROM table_name_38 WHERE designation = "s-8ko" | sql_create_context |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
... | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'rheumatoid arthritis')) AND DATETIME(cost.chargetime) >= DATETI... | mimic_iii |
CREATE TABLE table_name_25 (
score_points VARCHAR,
rank_points VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- With a total of 11, and 10 rank points, what are the score points?
| SELECT score_points FROM table_name_25 WHERE rank_points = "10" AND total = "11" | sql_create_context |
CREATE TABLE table_14790 (
"Name" text,
"Rank" real,
"Out of" real,
"Source" text,
"Notes" text,
"Year" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest rank that has fao as a source and an out greater than 50, with dietary cal... | SELECT MAX("Rank") FROM table_14790 WHERE "Source" = 'fao' AND "Out of" > '50' AND "Name" = 'dietary calorie intake' | wikisql |
CREATE TABLE table_name_89 (
result VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Marion Buisson with a 4.00 of o had what result?
| SELECT result FROM table_name_89 WHERE 400 = "o" AND name = "marion buisson" | sql_create_context |
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE paper (
paperid int,
title... | SELECT DISTINCT COUNT(cite.citingpaperid), WRITES_1.authorid FROM author, cite, writes AS WRITES_0, writes AS WRITES_1 WHERE author.authorname = 'Daniel A Reed' AND WRITES_0.authorid = author.authorid AND WRITES_0.paperid = cite.citedpaperid AND WRITES_1.paperid = cite.citingpaperid GROUP BY WRITES_1.authorid ORDER BY ... | scholar |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE c... | SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9297) AND NOT transfers.wardid IS NULL AND DATETIME(transfers.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY transfers.intime LIMIT 1 | mimic_iii |
CREATE TABLE table_name_82 (
time VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What time is it for the southern home team?
| SELECT time FROM table_name_82 WHERE home_team = "southern" | sql_create_context |
CREATE TABLE table_name_68 (
attendance INTEGER,
loss VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many attended the game that was a Loss of k. gross (1-1)?
| SELECT MAX(attendance) FROM table_name_68 WHERE loss = "k. gross (1-1)" | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtim... | SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'drug overdose- general') AS t1 GROUP BY t1.uniquepid HAVING MIN(... | eicu |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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,
... | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '27439695' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 8781.25) | css |
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 jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDBM = 'Q06.940' AND hz_info.RYB... | css |
CREATE TABLE table_8195 (
"Date" text,
"Home" text,
"Score" text,
"Away" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was the game with fewer than 6650 in attendance, that finished 0:1?
| SELECT "Date" FROM table_8195 WHERE "Attendance" < '6650' AND "Score" = '0:1' | wikisql |
CREATE TABLE table_204_854 (
id number,
"#" number,
"wrestlers" text,
"reign" number,
"date" text,
"days\nheld" number,
"location" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many wrestlers do not have any notes ?
| SELECT COUNT("wrestlers") FROM table_204_854 WHERE "notes" IS NULL | squall |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId ... | SELECT Text FROM Comments WHERE Text LIKE '%XY %' LIMIT 10 | sede |
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.JCZBMC, jyjgzbb.JCZBJGDW, AVG(jyjgzbb.JCZBJGDL) FROM jyjgzbb JOIN jybgb_jyjgzbb JOIN jybgb ON jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JYZBLSH AND jybgb_jyjgzbb.jyjgzbb_id = jyjgzbb.jyjgzbb_id AND jybgb_jyjgzbb.YLJGDM = jybgb.YLJGDM WHERE jybgb.YLJGDM = '9758334' AND jyjgzbb.BGRQ BETWEEN '2005-03-27' AND '2009-07... | css |
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 = '3108353' AND zyjzjlb.JZKSMC LIKE '%感染%' | css |
CREATE TABLE table_name_23 (
power_output VARCHAR,
build_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which power output had a Build date of 1951 1956?
| SELECT power_output FROM table_name_23 WHERE build_date = "1951–1956" | sql_create_context |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT PHONE_NUMBER, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COMMISSION_PCT DESC | nvbench |
CREATE TABLE table_name_21 (
played INTEGER,
points INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest number played with more than 30 points?
| SELECT MIN(played) FROM table_name_21 WHERE points > 30 | sql_create_context |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnon... | SELECT Tags.TagName FROM Tags WHERE Tags.Count <= '##MaxOccurences##' AND NOT EXISTS(SELECT Id FROM TagSynonyms WHERE SourceTagName = Tags.TagName) | sede |
CREATE TABLE table_28645 (
"Rank by average" real,
"Place" real,
"Couple" text,
"Total points" text,
"Number of dances" real,
"Average" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many ranks by average for the couple Tana and Stuart?
| SELECT COUNT("Rank by average") FROM table_28645 WHERE "Couple" = 'Tana and Stuart' | wikisql |
CREATE TABLE table_name_77 (
margin_of_victory VARCHAR,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the margin of victory for the Mississippi Gulf Resort Classic?
| SELECT margin_of_victory FROM table_name_77 WHERE tournament = "mississippi gulf resort classic" | sql_create_context |
CREATE TABLE table_44952 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Away Team, when Home Team is Kangaroos,... | SELECT "Away team" FROM table_44952 WHERE "Home team" = 'kangaroos' AND "Away team score" = '9.11 (65)' | wikisql |
CREATE TABLE table_73298 (
"Team name" text,
"Races" real,
"Won" real,
"RR1 Pts." real,
"RR2 Pts." real,
"RR3 Pts." real,
"Total Pts." real,
"Ranking" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the races for the prada challenge
| SELECT "Races" FROM table_73298 WHERE "Team name" = 'Prada Challenge' | wikisql |
CREATE TABLE table_name_11 (
circuit VARCHAR,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the circuit that had an event cancelled?
| SELECT circuit FROM table_name_11 WHERE winner = "event cancelled" | sql_create_context |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE diagnoses_icd (
row_id numbe... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures ... | mimic_iii |
CREATE TABLE table_204_54 (
id number,
"pondicherry assembly" text,
"duration" text,
"name of m.l.a." text,
"party affiliation" text,
"election year" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- was it the dravida munnetra kazhagam party or ... | SELECT "party affiliation" FROM table_204_54 WHERE "pondicherry assembly" = 'second' | squall |
CREATE TABLE table_name_16 (
year INTEGER,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the average year that the venue was Bokskogens?
| SELECT AVG(year) FROM table_name_16 WHERE venue = "bokskogens" | sql_create_context |
CREATE TABLE table_66954 (
"Year" real,
"Team" text,
"Chassis" text,
"Engine" text,
"Rank" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which chassis scored 52 points?
| SELECT "Chassis" FROM table_66954 WHERE "Points" = '52' | wikisql |
CREATE TABLE table_60671 (
"Opposing Teams" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the lowest against on 27/03/1971?
| SELECT MIN("Against") FROM table_60671 WHERE "Date" = '27/03/1971' | wikisql |
CREATE TABLE table_30700 (
"Constellation" text,
"IAU abbreviation" text,
"Other abbreviation" text,
"Genitive" text,
"Family" text,
"Origin" text,
"Meaning" text,
"Brightest star" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is t... | SELECT "Other abbreviation" FROM table_30700 WHERE "Brightest star" = 'β Trianguli' | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Severe sepsis" AND prescriptions.route = "PB" | mimicsql_data |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number... | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-140336')) AND medication.drugname IN ('dextrose 50%', 'morphine inj', ... | eicu |
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 COUNT(*) FROM t_kc24 WHERE t_kc24.PERSON_ID = '91746547' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2006-04-17' AND '2016-04-16' AND t_kc24.MED_AMOUT <= 10 | css |
CREATE TABLE table_58123 (
"Title" text,
"Pages" text,
"First edition" text,
"Second edition" text,
"ISBN" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the ISBN of the book with a first edition in May 2011?
| SELECT "ISBN" FROM table_58123 WHERE "First edition" = 'may 2011' | wikisql |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number... | SELECT SUM(ViewCount) FROM Posts WHERE OwnerUserId = '##UserId##' | sede |
CREATE TABLE table_203_316 (
id number,
"party" text,
"diet representation\nrepresentatives" number,
"diet representation\ncouncillors" number,
"party leader(s)" text,
"comments" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what party has the ... | SELECT "party" FROM table_203_316 ORDER BY "diet representation\nrepresentatives" DESC LIMIT 1 | squall |
CREATE TABLE table_name_27 (
fs VARCHAR,
sp INTEGER,
name VARCHAR,
points VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the largest value for SP+FS with more than 164.56 points for Mitsuru Matsumura in a Rank greater than 1... | SELECT MAX(sp) + fs FROM table_name_27 WHERE points > 164.56 AND rank > 1 AND name = "mitsuru matsumura" | sql_create_context |
CREATE TABLE table_name_39 (
year INTEGER,
political_rights VARCHAR,
status VARCHAR,
civil_liberties VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the year average when not free was the status, and less than 7 was the civil liberties, and le... | SELECT AVG(year) FROM table_name_39 WHERE status = "not free" AND civil_liberties < 7 AND political_rights < 6 | sql_create_context |
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Faculty (
FacID INTEGER,
Lname... | SELECT Rank, COUNT(*) FROM Faculty GROUP BY Sex, Rank ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
... | SELECT UserId AS "user_link", UserDisplayName, COUNT(Id) FROM Comments WHERE CreationDate >= '##Date1?2019-01-01##' AND CreationDate <= '##Date2?2020-01-01##' GROUP BY UserId, UserDisplayName ORDER BY COUNT(Id) DESC LIMIT 100 | sede |
CREATE TABLE table_name_51 (
opponent VARCHAR,
game VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the opponent of the game with a game number less than 5 with a 2-0-0 record?
| SELECT opponent FROM table_name_51 WHERE game < 5 AND record = "2-0-0" | sql_create_context |
CREATE TABLE table_name_30 (
premiere VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the premiere of the show that had a rank of #7?
| SELECT premiere FROM table_name_30 WHERE rank = "#7" | sql_create_context |
CREATE TABLE table_55142 (
"Title" text,
"Publisher" text,
"First Year" text,
"Last Year" text,
"Genre" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did the comic which came out in 1982 end?
| SELECT "Last Year" FROM table_55142 WHERE "First Year" = '1982' | wikisql |
CREATE TABLE table_name_32 (
joint_music_award VARCHAR,
total VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Joint Music Awards are there when the Total is larger than 18, in a Year after 2007?
| SELECT joint_music_award FROM table_name_32 WHERE total > 18 AND year > 2007 | sql_create_context |
CREATE TABLE table_name_37 (
school VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What School did Player Billy Owens attend?
| SELECT school FROM table_name_37 WHERE player = "billy owens" | sql_create_context |
CREATE TABLE table_80122 (
"Title" text,
"Year" real,
"Developer" text,
"Publisher" text,
"Platform" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which title has a year prior to 2008 and xbox 360 as the platform?
| SELECT "Title" FROM table_80122 WHERE "Year" < '2008' AND "Platform" = 'xbox 360' | wikisql |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_c... | SELECT DISTINCT airline.airline_code FROM airline, 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_na... | atis |
CREATE TABLE table_78232 (
"State" text,
"Interview" real,
"Swimsuit" real,
"Evening Gown" real,
"Average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest average of the contestant from Texas with an evening gown larger than 8.875... | SELECT MAX("Average") FROM table_78232 WHERE "State" = 'texas' AND "Evening Gown" > '8.875' | wikisql |
CREATE TABLE visitors (
tourist_id number,
tourist_details text
)
CREATE TABLE visits (
visit_id number,
tourist_attraction_id number,
tourist_id number,
visit_date time,
visit_details text
)
CREATE TABLE locations (
location_id number,
location_name text,
address text,
oth... | SELECT T1.name FROM tourist_attractions AS T1 JOIN visitors AS T2 JOIN visits AS T3 ON T1.tourist_attraction_id = T3.tourist_attraction_id AND T2.tourist_id = T3.tourist_id WHERE T2.tourist_details = "Vincent" INTERSECT SELECT T1.name FROM tourist_attractions AS T1 JOIN visitors AS T2 JOIN visits AS T3 ON T1.tourist_at... | spider |
CREATE TABLE table_21761882_4 (
location VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the location for when the opponent was @ roughriders?
| SELECT location FROM table_21761882_4 WHERE opponent = "@ Roughriders" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | SELECT COUNT(*) FROM txmzjzjlb WHERE txmzjzjlb.JZKSMC = '小儿肿瘤科' AND txmzjzjlb.JZKSRQ BETWEEN '2014-10-06' AND '2018-12-28' UNION SELECT COUNT(*) FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZKSMC = '小儿肿瘤科' AND ftxmzjzjlb.JZKSRQ BETWEEN '2014-10-06' AND '2018-12-28' | css |
CREATE TABLE table_name_20 (
time VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record time at the Nascar Camping World Truck Series?
| SELECT time FROM table_name_20 WHERE record = "nascar camping world truck series" | sql_create_context |
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 ACC_Road, COUNT(ACC_Road) FROM basketball_match GROUP BY ACC_Road ORDER BY COUNT(ACC_Road) DESC | nvbench |
CREATE TABLE table_46244 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what Date was the Home team Detroit Red Wings with a Record of 10 41 6?
| SELECT "Date" FROM table_46244 WHERE "Home" = 'detroit red wings' AND "Record" = '10–41–6' | wikisql |
CREATE TABLE table_204_861 (
id number,
"tie no" number,
"home team" text,
"score" text,
"away team" text,
"date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was the home team in the game on the top of the table ?
| SELECT "home team" FROM table_204_861 WHERE id = 1 | squall |
CREATE TABLE table_name_49 (
event VARCHAR,
competition VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Event has 5th Position in the European Championships Competition?
| SELECT event FROM table_name_49 WHERE competition = "european championships" AND position = "5th" | sql_create_context |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype tex... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age >= 60) AND DATETIME(labevents.charttime, 'start o... | mimic_iii |
CREATE TABLE table_73449 (
"No." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"Viewers (in millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List all who wrote for produ... | SELECT "Written by" FROM table_73449 WHERE "Production code" = '1ARK07' | wikisql |
CREATE TABLE table_7535 (
"Position" text,
"Name" text,
"Height (cm)" real,
"Weight (kg)" real,
"Birthdate" text,
"Birthplace" text,
"Previous Club/Team" text,
"NHL rights, if any" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where was... | SELECT "Birthplace" FROM table_7535 WHERE "Birthdate" = 'march 21, 1979' | wikisql |
CREATE TABLE school_bus (
School_ID int,
Driver_ID int,
Years_Working int,
If_full_time bool
)
CREATE TABLE driver (
Driver_ID int,
Name text,
Party text,
Home_city text,
Age int
)
CREATE TABLE school (
School_ID int,
Grade text,
School text,
Location text,
Type... | SELECT Name, Age FROM driver ORDER BY Name DESC | nvbench |
CREATE TABLE table_68612 (
"Year" text,
"English title" text,
"Original title" text,
"Country" text,
"Director" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the original title of Madame Rosa?
| SELECT "Original title" FROM table_68612 WHERE "English title" = 'madame rosa' | wikisql |
CREATE TABLE table_33590 (
"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.
-- When did South Melbourne play as the away team?
| SELECT "Date" FROM table_33590 WHERE "Away team" = 'south melbourne' | wikisql |
CREATE TABLE table_50362 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which of the Res., has Ryan Scheepe as an opponent?
| SELECT "Res." FROM table_50362 WHERE "Opponent" = 'ryan scheepe' | wikisql |
CREATE TABLE table_name_69 (
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 1st prize at the U.S. Open?
| SELECT 1 AS st_prize___$__ FROM table_name_69 WHERE tournament = "u.s. open" | sql_create_context |
CREATE TABLE table_203_505 (
id number,
"number" number,
"event" text,
"type" text,
"matthew" text,
"mark" text,
"luke" text,
"john" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what event comes before luke 1:26 -38 ?
| SELECT "event" FROM table_203_505 WHERE id = (SELECT id FROM table_203_505 WHERE "luke" = 'luke 01:26-38') - 1 | squall |
CREATE TABLE table_1840433_2 (
number_of_editions VARCHAR,
most_wins_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many editions have a most wins value of Franco Marvulli (4)?
| SELECT COUNT(number_of_editions) FROM table_1840433_2 WHERE most_wins_by = "Franco Marvulli (4)" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.