instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_31 (
award VARCHAR,
result VARCHAR,
organisation VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the award for the Star Awards earlier than 2005 and the result is won?
| SELECT award FROM table_name_31 WHERE organisation = "star awards" AND year < 2005 AND result = "won" | sql_create_context |
CREATE TABLE table_name_49 (
record VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Record of the game on September 6?
| SELECT record FROM table_name_49 WHERE date = "september 6" | sql_create_context |
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
CREATE TABLE Lives_in (
stuid INTEGER,
do... | SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
... | SELECT TagName AS "tag", COUNT(p.Id) AS "#" FROM Posts AS p INNER JOIN PostTags AS pt ON p.Id = pt.PostId INNER JOIN Tags AS t ON pt.TagId = t.Id WHERE p.PostTypeId = 1 AND p.CreationDate > DATEADD(Month, -12, DATEADD(dd, DATEDIFF(dd, 0, GETDATE()), 0)) GROUP BY TagName | sede |
CREATE TABLE table_64229 (
"Year" real,
"Game" text,
"Genre" text,
"Platform(s)" text,
"Developer(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Game that came out before the year 2009 for the Playstation 3?
| SELECT "Game" FROM table_64229 WHERE "Platform(s)" = 'playstation 3' AND "Year" < '2009' | wikisql |
CREATE TABLE table_34556 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game Site" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which opponent was played on week 9?
| SELECT "Opponent" FROM table_34556 WHERE "Week" = '9' | wikisql |
CREATE TABLE table_name_42 (
text_symbol VARCHAR,
border VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which sign has a red border?
| SELECT text_symbol FROM table_name_42 WHERE border = "red" | sql_create_context |
CREATE TABLE table_261895_1 (
institution VARCHAR,
joined VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- in 1953, which of the institutions joined?
| SELECT institution FROM table_261895_1 WHERE joined = "1953" | sql_create_context |
CREATE TABLE table_15532 (
"Year" real,
"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 Country of origin for the film directed by George Miller?
| SELECT "Country" FROM table_15532 WHERE "Director" = 'george miller' | wikisql |
CREATE TABLE table_204_314 (
id number,
"pos" number,
"team" text,
"played" number,
"won" number,
"draw" number,
"lost" number,
"goals for" number,
"goals against" number,
"goal difference" number,
"points" number,
"notes" text
)
-- Using valid SQLite, answer the follow... | SELECT "team" FROM table_204_314 WHERE id = (SELECT id FROM table_204_314 WHERE "team" = 'ks') - 1 | squall |
CREATE TABLE table_2562572_35 (
dominant_religion__2002_ VARCHAR,
type VARCHAR,
settlement VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the dominant religion 2002 for village banatski despotovac
| SELECT dominant_religion__2002_ FROM table_2562572_35 WHERE type = "village" AND settlement = "Banatski Despotovac" | sql_create_context |
CREATE TABLE table_15981 (
"Pick" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team is Keith Mccambridge on?
| SELECT "College/junior/club team" FROM table_15981 WHERE "Player" = 'Keith McCambridge' | wikisql |
CREATE TABLE table_name_40 (
player VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Player's Score is 69-68-66-70=273?
| SELECT player FROM table_name_40 WHERE score = 69 - 68 - 66 - 70 = 273 | sql_create_context |
CREATE TABLE table_20350118_1 (
obama_number VARCHAR,
obama_percentage VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many different results were there for the number of votes fro Obama in the county where he got 27.8% of the votes?
| SELECT COUNT(obama_number) FROM table_20350118_1 WHERE obama_percentage = "27.8%" | sql_create_context |
CREATE TABLE table_name_21 (
silver INTEGER,
rank VARCHAR,
gold VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the amount of silver for rank 11 having less than 0 gold?
| SELECT MIN(silver) FROM table_name_21 WHERE rank = "11" AND gold < 0 | sql_create_context |
CREATE TABLE table_name_5 (
crowd INTEGER,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Lowest Crowd, when Home Team is Brisbane Lions?
| SELECT MIN(crowd) FROM table_name_5 WHERE home_team = "brisbane lions" | sql_create_context |
CREATE TABLE table_204_34 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the difference in gold between algeria and cameroon ?
| SELECT (SELECT "gold" FROM table_204_34 WHERE "nation" = 'algeria') - (SELECT "gold" FROM table_204_34 WHERE "nation" = 'cameroon') | squall |
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 zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '钱艳芳' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2015-09-20') | css |
CREATE TABLE table_14448 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- With a Try... | SELECT "Tries against" FROM table_14448 WHERE "Try bonus" = '8' | 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 t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'stroke - hemorrhagic stroke' AND DATETIM... | eicu |
CREATE TABLE table_name_38 (
gold VARCHAR,
bronze VARCHAR,
silver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much Gold has a Bronze larger than 1, and a Silver larger than 2?
| SELECT COUNT(gold) FROM table_name_38 WHERE bronze > 1 AND silver > 2 | sql_create_context |
CREATE TABLE table_21796261_4 (
date VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the game on Taylor Field played?
| SELECT date FROM table_21796261_4 WHERE location = "Taylor Field" | sql_create_context |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_20... | SELECT meter_600, meter_100 FROM swimmer | nvbench |
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 hz_info JOIN mzjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND person_in... | css |
CREATE TABLE table_43843 (
"School" text,
"Location" text,
"Founded" real,
"Affiliation" text,
"Nickname" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What school has the nickname of Cardinals?
| SELECT MIN("Founded") FROM table_43843 WHERE "Nickname" = 'cardinals' | wikisql |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE txmzjzjlb (
HXPLC number,
HZX... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZ... | css |
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 COUNT(*) FROM mzb WHERE mzb.MED_TYPE = '2484766' AND mzb.IN_HOSP_DAYS BETWEEN '2003-05-25' AND '2014-06-18' | css |
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 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '004-64091' AND patient.wardid = 236 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1 | eicu |
CREATE TABLE zyb (
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '2892777' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.AMOUNT) DESC LIMIT 22 UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.ME... | css |
CREATE TABLE table_name_42 (
score VARCHAR,
to_par VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When curtis strange had a to par +1, what was his score?
| SELECT score FROM table_name_42 WHERE to_par = "+1" AND player = "curtis strange" | sql_create_context |
CREATE TABLE table_29871617_1 (
coreceptor VARCHAR,
chromosomal_location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the coreceptors of the chromosomes in that location 11q22.2-q22.3?
| SELECT coreceptor FROM table_29871617_1 WHERE chromosomal_location = "11q22.2-q22.3" | 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.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDSM = '由于使用酒精引起的精神病性障碍' AND jyjgzbb.JCZBDM = '172184' UNION SELECT jyjg... | css |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE participates_in (
stuid number,
actid number
)
CREATE TABLE faculty (
facid number,
lname text,
fname text,
rank text,
... | SELECT COUNT(*) FROM faculty WHERE rank = "Professor" AND building = "NEB" | spider |
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_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '蒋新蕾' AND t_kc21.MED_SER_ORG_NO = '0734262' AND t_kc21.IN_HOSP_DATE BETWEEN '2010-12-29' AND '2012-06-26') | css |
CREATE TABLE table_34088 (
"Driver" text,
"Points" real,
"Season" real,
"Races" real,
"Percentage of possible points" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points have a percentage of possible points of 67.22%?
| SELECT SUM("Points") FROM table_34088 WHERE "Percentage of possible points" = '67.22%' | wikisql |
CREATE TABLE election (
election_id number,
counties_represented text,
district number,
delegate text,
party number,
first_elected number,
committee text
)
CREATE TABLE party (
party_id number,
year number,
party text,
governor text,
lieutenant_governor text,
comptro... | SELECT DISTINCT year FROM party WHERE governor = "Eliot Spitzer" | spider |
CREATE TABLE table_2933761_1 (
played_by VARCHAR,
occupation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who played the mathematics student?
| SELECT played_by FROM table_2933761_1 WHERE occupation = "Mathematics Student" | sql_create_context |
CREATE TABLE table_58630 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"Podiums" real,
"Points" real,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of Points with a ... | SELECT COUNT("Points") FROM table_58630 WHERE "Series" = 'italian formula renault 2.0' AND "Poles" < '0' | wikisql |
CREATE TABLE table_69929 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what tournament happened on may 2, 2011?
| SELECT "Tournament" FROM table_69929 WHERE "Date" = 'may 2, 2011' | wikisql |
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.days_stay) FROM demographic WHERE demographic.age >= "72" | mimicsql_data |
CREATE TABLE table_name_45 (
attendance INTEGER,
venue VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On 1 september 2007, at the Venue A, what was the average attendance?
| SELECT AVG(attendance) FROM table_name_45 WHERE venue = "a" AND date = "1 september 2007" | sql_create_context |
CREATE TABLE Nurse (
EmployeeID INTEGER,
Name VARCHAR(30),
Position VARCHAR(30),
Registered BOOLEAN,
SSN INTEGER
)
CREATE TABLE Room (
RoomNumber INTEGER,
RoomType VARCHAR(30),
BlockFloor INTEGER,
BlockCode INTEGER,
Unavailable BOOLEAN
)
CREATE TABLE Stay (
StayID INTEGER,
... | SELECT T1.Name, COUNT(*) FROM Physician AS T1 JOIN Patient AS T2 ON T1.EmployeeID = T2.PCP GROUP BY T1.EmployeeID ORDER BY T1.Name DESC | nvbench |
CREATE TABLE table_name_62 (
population__percentage_1971 VARCHAR,
population__percentage_1981 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For the group with 1.92% population in 1981, what was their percentage of the population in 1971?
| SELECT population__percentage_1971 FROM table_name_62 WHERE population__percentage_1981 = "1.92%" | sql_create_context |
CREATE TABLE table_name_54 (
jersey_number_s_ VARCHAR,
years VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the jersey number of the player from years 1986 1991 1997 1999?
| SELECT jersey_number_s_ FROM table_name_54 WHERE years = "1986 – 1991 1997 – 1999" | sql_create_context |
CREATE TABLE table_204_572 (
id number,
"rank" number,
"county" text,
"per capita\nincome" text,
"median\nhousehold\nincome" text,
"median\nfamily\nincome" text,
"population" number,
"number of\nhouseholds" number
)
-- Using valid SQLite, answer the following questions for the tables p... | SELECT "county" FROM table_204_572 WHERE id = 1 | squall |
CREATE TABLE table_name_40 (
attendance INTEGER,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of all attendance on November 17, 1961?
| SELECT SUM(attendance) FROM table_name_40 WHERE date = "november 17, 1961" | sql_create_context |
CREATE TABLE table_39995 (
"Gill" text,
"Latitude" text,
"Longitude" text,
"Diameter (km)" text,
"Diameter (mi)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What shows for the Diameter (km) when the Diameter (mi) is 8mi, and a Gill is e?
| SELECT "Diameter (km)" FROM table_39995 WHERE "Diameter (mi)" = '8mi' AND "Gill" = 'e' | wikisql |
CREATE TABLE company (
Company_ID int,
Rank int,
Company text,
Headquarters text,
Main_Industry text,
Sales_billion real,
Profits_billion real,
Assets_billion real,
Market_Value real
)
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_of_the_Year int
)
... | SELECT Company, COUNT(*) FROM station_company AS T1 JOIN company AS T2 ON T1.Company_ID = T2.Company_ID GROUP BY T1.Company_ID ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_2884 (
"Rank" real,
"Rider" text,
"Mon 24 Aug" text,
"Tues 25 Aug" text,
"Wed 26 Aug" text,
"Thurs 27 Aug" text,
"Fri 28 Aug" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is every rider on Monday August 24 at 21' 12... | SELECT "Rider" FROM table_2884 WHERE "Mon 24 Aug" = '21'' 12.02 106.781mph' | wikisql |
CREATE TABLE table_name_27 (
time VARCHAR,
rider VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What time did rider steve plater have?
| SELECT time FROM table_name_27 WHERE rider = "steve plater" | sql_create_context |
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 (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '2795059' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2013-04-20' AND '2016-08-16' GROUP B... | css |
CREATE TABLE player (
player_id number,
player text,
team text,
age number,
position text,
school_id number
)
CREATE TABLE school_details (
school_id number,
nickname text,
colors text,
league text,
class text,
division text
)
CREATE TABLE school_performance (
schoo... | SELECT COUNT(*) FROM school | spider |
CREATE TABLE fgwyjzb (
CLINIC_ID text,
CLINIC_TYPE 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,
... | SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '5648027' AND gwyjzb.IN_HOSP_DATE BETWEEN '2000-10-16' AND '2016-08-23' | css |
CREATE TABLE member (
Member_ID int,
Member_Name text,
Party_ID text,
In_office text
)
CREATE TABLE party_events (
Event_ID int,
Event_Name text,
Party_ID int,
Member_in_charge_ID int
)
CREATE TABLE region (
Region_ID int,
Region_name text,
Date text,
Label text,
Fo... | SELECT Party_name, COUNT(*) FROM member AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID ORDER BY Party_name DESC | nvbench |
CREATE TABLE table_name_17 (
road_team VARCHAR,
home_team VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Road team has a Home team of portland, and a Date of may 31?
| SELECT road_team FROM table_name_17 WHERE home_team = "portland" AND date = "may 31" | sql_create_context |
CREATE TABLE table_52782 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score of the friendly competition?
| SELECT "Score" FROM table_52782 WHERE "Competition" = 'friendly' | 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 WHERE demographic.days_stay > "5" | mimicsql_data |
CREATE TABLE table_name_13 (
frequency_mhz INTEGER,
city_of_license VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is average frequency MHZ when is in portales, new mexico?
| SELECT AVG(frequency_mhz) FROM table_name_13 WHERE city_of_license = "portales, new mexico" | sql_create_context |
CREATE TABLE table_name_90 (
profession VARCHAR,
city VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the profession of the housemate from Leskovac city?
| SELECT profession FROM table_name_90 WHERE city = "leskovac" | sql_create_context |
CREATE TABLE table_name_71 (
tyre VARCHAR,
circuit VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What tyre was used in the Zandvoort circuit?
| SELECT tyre FROM table_name_71 WHERE circuit = "zandvoort" | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime... | SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-47098') AND treatment.treatme... | eicu |
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.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Manufacturer DESC | nvbench |
CREATE TABLE table_13623 (
"School" text,
"Location" text,
"Mascot" text,
"Enrollment" real,
"IHSAA Class" text,
"# / County" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the location with enrollment of 316 and county is 68 Randolph?
| SELECT "Location" FROM table_13623 WHERE "# / County" = '68 randolph' AND "Enrollment" = '316' | wikisql |
CREATE TABLE table_80204 (
"Date" text,
"Home captain" text,
"Away captain" text,
"Venue" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Home Captain has Eng by 208 runs?
| SELECT "Home captain" FROM table_80204 WHERE "Result" = 'eng by 208 runs' | wikisql |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate ... | SELECT P.Title, P.Tags, P.ViewCount, P.Score, P.AnswerCount, P.CreationDate FROM Posts AS P WHERE (P.Title LIKE '%devices%') AND ((P.Tags LIKE '%android-testing%') OR (P.Tags LIKE '%robotium%') OR (P.Tags LIKE '%androidviewclient%') OR (P.Tags LIKE '%monkeyrunner%') OR (P.Tags LIKE '%android-espresso%') OR (P.Tags LIKE... | 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 prescriptions... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.icd9_code = "4271" | 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 COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT microlab.patientunitstayid FROM microlab WHERE microlab.culturesite = 'blood, venipuncture') | eicu |
CREATE TABLE table_name_28 (
to_par INTEGER,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the to par for the player with total of 155?
| SELECT AVG(to_par) FROM table_name_28 WHERE total = 155 | sql_create_context |
CREATE TABLE ref_document_types (
document_type_code text,
document_type_name text,
document_type_description text
)
CREATE TABLE documents_with_expenses (
document_id number,
budget_type_code text,
document_details text
)
CREATE TABLE statements (
statement_id number,
statement_detail... | SELECT project_id FROM documents GROUP BY project_id HAVING COUNT(*) >= 2 | spider |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_... | SELECT COUNT(*) > 0, program_course.workload FROM course, program_course WHERE course.department = 'ENVIRON' AND course.number = 426 AND program_course.course_id = course.course_id AND program_course.workload > 3 | advising |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE labevents (
row_id number,
... | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11914) ORDER BY procedures_icd.charttime LIMIT 1 | mimic_iii |
CREATE TABLE table_name_64 (
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is 2006-07 Season, when Team is 'KF Fush Kosova'?
| SELECT 2006 AS _07_season FROM table_name_64 WHERE team = "kf fushë kosova" | sql_create_context |
CREATE TABLE table_name_26 (
loss INTEGER,
gain VARCHAR,
long VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average Loss for the long of more than 12 with a name of opponents with a Gain larger than 1751?
| SELECT AVG(loss) FROM table_name_26 WHERE long > 12 AND name = "opponents" AND gain > 1751 | sql_create_context |
CREATE TABLE member (
card_number VARCHAR,
Hometown VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- list the card number of all members whose hometown address includes word 'Kentucky'.
| SELECT card_number FROM member WHERE Hometown LIKE "%Kentucky%" | sql_create_context |
CREATE TABLE table_37050 (
"Athlete" text,
"Country" text,
"Run 1" real,
"Run 2" real,
"Run 3" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the run 3 of the athlete with a run 1 more than 53.75 and a run 2 less than 52.91?
| SELECT SUM("Run 3") FROM table_37050 WHERE "Run 1" > '53.75' AND "Run 2" < '52.91' | 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 WHERE diagnoses.long_title = "Exceptionally large baby" | mimicsql_data |
CREATE TABLE table_name_67 (
institution VARCHAR,
chief_judge VARCHAR,
year VARCHAR,
award VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What institution won 2nd more recently than 2007 with Peter Agre as Chief Judge?
| SELECT institution FROM table_name_67 WHERE year > 2007 AND award = "2nd" AND chief_judge = "peter agre" | 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 CloseAsOffTopicReasonTypes (
Id number,
IsUniversal... | SELECT Posts.Id FROM Posts JOIN Votes ON Posts.Id = Votes.PostId WHERE Votes.UserId = 3379 AND Posts.PostTypeId = 1 | sede |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
... | SELECT Body, STR_POSITION('bcdf', 'a') AS test FROM Posts WHERE PostTypeId = 2 LIMIT 20 | sede |
CREATE TABLE table_2562572_53 (
settlement VARCHAR,
population__2011_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the settlement that had a population of 9443 in 2011?
| SELECT settlement FROM table_2562572_53 WHERE population__2011_ = 9443 | sql_create_context |
CREATE TABLE table_name_96 (
laps VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many laps were there in the race that netted the winner 19 points?
| SELECT laps FROM table_name_96 WHERE points = 19 | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "71" AND diagnoses.icd9_code = "2875" | mimicsql_data |
CREATE TABLE table_24608 (
"Season" text,
"Timeslot Times listed are Eastern time" text,
"Season premiere" text,
"Season finale" text,
"TV season" text,
"Ranking" real,
"Viewers (in millions of households)" text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT MIN("Ranking") FROM table_24608 WHERE "Viewers (in millions of households)" = '11.2' | wikisql |
CREATE TABLE table_name_51 (
tns_sofres_6_2_09 VARCHAR,
ipsos_6_3_09 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the TNS-Sofres when Ipsos was 27%?
| SELECT tns_sofres_6_2_09 FROM table_name_51 WHERE ipsos_6_3_09 = "27%" | sql_create_context |
CREATE TABLE table_29002641_1 (
into_service VARCHAR,
number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the into service for dh2
| SELECT into_service FROM table_29002641_1 WHERE number = "DH2" | sql_create_context |
CREATE TABLE table_204_143 (
id number,
"national park" text,
"region" text,
"land area (km2)" number,
"established" number,
"visitation (2009)" number,
"coordinates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the number of visi... | SELECT "visitation (2009)" FROM table_204_143 WHERE "national park" = 'hiidenportti' | squall |
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 demographic.days_stay, demographic.admittime FROM demographic WHERE demographic.subject_id = "14755" | mimicsql_data |
CREATE TABLE table_55490 (
"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.
-- How many points did the away team score when the... | SELECT "Away team score" FROM table_55490 WHERE "Home team score" = '16.14 (110)' | 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 * FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE person_info.XM = '孙咏歌' AND hz_info.YLJGDM = '0919539' AND NOT mzjzjlb.JZZDSM LIKE '%抽动%' | css |
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... | SELECT PostId AS "post_link", Body, Text, Comments.Score FROM Comments JOIN Posts ON Comments.PostId = Posts.Id WHERE UserId = @UserID AND Comments.Score >= 5 ORDER BY Score DESC | sede |
CREATE TABLE table_54520 (
"Species" text,
"Strain" text,
"Type" text,
"Base Pairs" real,
"Genes" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest number of genes in Rubrobacter Xylanophilus?
| SELECT MIN("Genes") FROM table_54520 WHERE "Species" = 'rubrobacter xylanophilus' | wikisql |
CREATE TABLE table_203_834 (
id number,
"rank" number,
"census subdivision" text,
"province" text,
"type" text,
"land area\n(km2, 2011)" number,
"population 2011" number,
"population 2006" number,
"population 2001" number,
"population 1996" number,
"change in % 2006-2011" num... | SELECT "census subdivision" FROM table_203_834 WHERE id = 1 | squall |
CREATE TABLE students_in_detention (
student_id number,
detention_id number,
incident_id number
)
CREATE TABLE student_addresses (
student_id number,
address_id number,
date_address_from time,
date_address_to time,
monthly_rental number,
other_details text
)
CREATE TABLE assessment... | SELECT last_name FROM teachers EXCEPT SELECT T1.last_name FROM teachers AS T1 JOIN detention AS T2 ON T1.teacher_id = T2.teacher_id | spider |
CREATE TABLE PROFESSOR (
EMP_NUM int,
DEPT_CODE varchar(10),
PROF_OFFICE varchar(50),
PROF_EXTENSION varchar(4),
PROF_HIGH_DEGREE varchar(5)
)
CREATE TABLE EMPLOYEE (
EMP_NUM int,
EMP_LNAME varchar(15),
EMP_FNAME varchar(12),
EMP_INITIAL varchar(1),
EMP_JOBCODE varchar(5),
E... | SELECT DEPT_CODE, SUM(STU_HRS) FROM STUDENT GROUP BY DEPT_CODE ORDER BY DEPT_CODE DESC | nvbench |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
... | SELECT t_kc21.OUT_DIAG_DOC_CD, t_kc21.OUT_DIAG_DOC_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '窦湛蓝' AND t_kc21.IN_HOSP_DATE BETWEEN '2004-12-07' AND '2017-09-13' GROUP BY t_kc21.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE zyjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
... | SELECT zyjybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN zyjybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '28348727' AND NOT zyjybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM ... | css |
CREATE TABLE table_16252 (
"Season" text,
"Series" text,
"Team Name" text,
"Races" real,
"Poles" real,
"Wins" real,
"Points" real,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the least number of poles?
| SELECT MIN("Poles") FROM table_16252 | wikisql |
CREATE TABLE table_31268 (
"Season" real,
"Apocalypstix" text,
"Denim Demons" text,
"Sake Tuyas" text,
"Toxic Shocks" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What place did the Sake Tuyas come in when the Denim Demons were 4th?
| SELECT "Sake Tuyas" FROM table_31268 WHERE "Denim Demons" = '4th' | wikisql |
CREATE TABLE table_name_53 (
result VARCHAR,
captain_1 VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Result has a Captain 1 of louis burger, and a Date of 30 october 2 november?
| SELECT result FROM table_name_53 WHERE captain_1 = "louis burger" AND date = "30 october–2 november" | sql_create_context |
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphr... | SELECT DISTINCT paper.paperid FROM paper, venue WHERE venue.venueid = paper.venueid AND venue.venuename = 'cvpr' | scholar |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.