instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_62346 (
"Perpetrator" text,
"Location" text,
"Country" text,
"Killed" real,
"Injured" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many kills did basobas, florentino have?
| SELECT MAX("Killed") FROM table_62346 WHERE "Perpetrator" = 'basobas, florentino' | wikisql |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | SELECT Tags.TagName AS "tag_name", COUNT(*) AS "number_of_associated_posts" FROM PostTags INNER JOIN Tags ON Tags.Id = PostTags.TagId WHERE PostTags.PostId IN (SELECT DISTINCT PostId FROM PostTags INNER JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName = '##TagName:string##') AND Tags.TagName != '##TagName:strin... | sede |
CREATE TABLE table_55212 (
"Number & Name" text,
"Description" text,
"Livery" text,
"Owner(s)" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What owner or owners have an operational description?
| SELECT "Owner(s)" FROM table_55212 WHERE "Description" = 'operational' | wikisql |
CREATE TABLE table_77201 (
"Draw" real,
"Artist" text,
"Song" text,
"Points" real,
"Place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the average draw for the song 'stop messin' around'?
| SELECT AVG("Draw") FROM table_77201 WHERE "Song" = 'stop messin'' around' | wikisql |
CREATE TABLE table_name_44 (
lner_class VARCHAR,
wa VARCHAR,
no_built VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What LINER class has a W.A. of 0-6-0st with a 2 No. Built?
| SELECT lner_class FROM table_name_44 WHERE wa = "0-6-0st" AND no_built = 2 | sql_create_context |
CREATE TABLE t_kc21 (
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 t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '18795530' AND t_kc21.MED_SER_ORG_NO = '0561875' AND NOT t_kc21.IN_DIAG_DIS_NM LIKE '%分裂%' | css |
CREATE TABLE Order_Items (
order_item_id INTEGER,
order_id INTEGER,
product_id INTEGER,
product_quantity VARCHAR(50),
other_order_item_details VARCHAR(255)
)
CREATE TABLE Invoice_Line_Items (
order_item_id INTEGER,
invoice_number INTEGER,
product_id INTEGER,
product_title VARCHAR(80... | SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts ORDER BY date_account_opened DESC | nvbench |
CREATE TABLE table_50251 (
"Institution" text,
"Location" text,
"Nickname" text,
"Enrollment" real,
"Established" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which institution has a nickname of Blue Hens?
| SELECT "Institution" FROM table_50251 WHERE "Nickname" = 'blue hens' | wikisql |
CREATE TABLE qtb (
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 qtb.IN_DIAG_DIS_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_NM = '马彭魄' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 9768.75) UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_NM = '马彭魄' AND gyb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLIN... | css |
CREATE TABLE table_name_74 (
drawn VARCHAR,
lost VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number drawn when 3 have been lost?
| SELECT drawn FROM table_name_74 WHERE lost = "3" | sql_create_context |
CREATE TABLE table_train_85 (
"id" int,
"mini_mental_state_examination_mmse" int,
"elevated_serum_phenylalanine" int,
"elevated_creatinine" float,
"renal_disease" bool,
"geriatric_depression_scale_gds" int,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the table... | SELECT * FROM table_train_85 WHERE elevated_serum_phenylalanine > 10 | criteria2sql |
CREATE TABLE table_68077 (
"Week" real,
"Date" text,
"Visiting Team" text,
"Final Score" text,
"Host Team" text,
"Stadium" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the visiting team on weeks under 12 and at Sports Authority Field a... | SELECT "Visiting Team" FROM table_68077 WHERE "Week" < '12' AND "Stadium" = 'sports authority field at mile high' | wikisql |
CREATE TABLE table_name_26 (
runner_s__up VARCHAR,
winning_score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Runner(s)-up has a Winning score of 8 (68-68-72-72=280)?
| SELECT runner_s__up FROM table_name_26 WHERE winning_score = –8(68 - 68 - 72 - 72 = 280) | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | SELECT demographic.days_stay FROM demographic WHERE demographic.name = "Troy Friedman" | mimicsql_data |
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 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 = "Arthropathy NOS-unspec" AND prescriptions.route = "PO/NG" | 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.drugname FROM (SELECT t2.drugname, 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 = 'cardiomyopathy - dilated' AND STRFTIME('%y', diagn... | eicu |
CREATE TABLE table_204_761 (
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.
-- only one team has won more than 10 bronze medals in the biathlon ... | SELECT "nation" FROM table_204_761 WHERE "bronze" > 10 | squall |
CREATE TABLE Guests (
guest_id INTEGER,
gender_code CHAR(1),
guest_first_name VARCHAR(80),
guest_last_name VARCHAR(80),
date_of_birth DATETIME
)
CREATE TABLE View_Unit_Status (
apt_id INTEGER,
apt_booking_id INTEGER,
status_date DATETIME,
available_yn BIT
)
CREATE TABLE Apartment_B... | SELECT booking_end_date, COUNT(booking_end_date) FROM Apartment_Bookings GROUP BY booking_end_date | nvbench |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
s... | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_... | mimic_iii |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE prescriptions (
row_id numbe... | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 85895) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'chloride') AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRE... | mimic_iii |
CREATE TABLE prereq (
course_id varchar(8),
prereq_id varchar(8)
)
CREATE TABLE advisor (
s_ID varchar(5),
i_ID varchar(5)
)
CREATE TABLE section (
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
building varchar(15),
room_number varchar(7),
... | SELECT T1.dept_name, COUNT(DISTINCT T2.ID) FROM department AS T1 JOIN student AS T2 ON T1.dept_name = T2.dept_name JOIN instructor AS T3 ON T1.dept_name = T3.dept_name | nvbench |
CREATE TABLE table_67822 (
"Stage" text,
"Route" text,
"Distance" text,
"Date" text,
"Winner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the date for mark cavendish
| SELECT "Date" FROM table_67822 WHERE "Winner" = 'mark cavendish' | wikisql |
CREATE TABLE table_1190 (
"Title (pages)" text,
"Spirou" real,
"Writer / Artist" text,
"1st publication, Belgium" text,
"Integrale" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least spirou
| SELECT MIN("Spirou") FROM table_1190 | wikisql |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
v... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, 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 = admissi... | mimic_iii |
CREATE TABLE table_name_55 (
overall INTEGER,
position VARCHAR,
pick VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the pick is under 28 and the position is k, what's the highest Overall pick?
| SELECT MAX(overall) FROM table_name_55 WHERE position = "k" AND pick < 28 | sql_create_context |
CREATE TABLE table_203_455 (
id number,
"round" number,
"#" number,
"player" text,
"nationality" text,
"college/junior/club team (league)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many players are from canada ?
| SELECT COUNT("player") FROM table_203_455 WHERE "nationality" = 'canada' | squall |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE patient (
uniquep... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ... | eicu |
CREATE TABLE table_name_51 (
points VARCHAR,
tries VARCHAR,
appearance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many times is tries 0 and appearance less than 0?
| SELECT COUNT(points) FROM table_name_51 WHERE tries = 0 AND appearance < 0 | sql_create_context |
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 AVG(demographic.age) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.days_stay = "13" | mimicsql_data |
CREATE TABLE table_10015132_2 (
player VARCHAR,
school_club_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many players were with the school or club team La Salle?
| SELECT COUNT(player) FROM table_10015132_2 WHERE school_club_team = "La Salle" | sql_create_context |
CREATE TABLE table_name_79 (
linkedin VARCHAR,
site VARCHAR,
myspace VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many linkedin have Facebook as the site, with a myspace less than 64?
| SELECT COUNT(linkedin) FROM table_name_79 WHERE site = "facebook" AND myspace < 64 | sql_create_context |
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 demographic (
subject_id text,
hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.age < "55" | mimicsql_data |
CREATE TABLE table_35982 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Top-5 is the lowest one that has Cuts made of 10, and Even... | SELECT MIN("Top-5") FROM table_35982 WHERE "Cuts made" = '10' AND "Events" > '10' | wikisql |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | SELECT rbin, COUNT(*) FROM (SELECT ROUND(CAST(q.Score AS FLOAT) / a.maxScore, 1) AS rbin FROM (SELECT ParentId, MAX(Score) AS maxScore FROM Posts WHERE PostTypeId = 2 GROUP BY ParentId) AS a JOIN Posts AS q ON q.Id = a.ParentId WHERE a.maxScore >= '##minTopAnswerScore?5##' AND q.Score >= '##minQuestionScore?0##') AS r ... | sede |
CREATE TABLE table_68280 (
"Representative" text,
"Title" text,
"Presentation of credentials" text,
"Termination of mission" text,
"Appointed by" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the termination of mission for appointed by of fran... | SELECT "Termination of mission" FROM table_68280 WHERE "Appointed by" = 'franklin pierce' | wikisql |
CREATE TABLE table_name_27 (
willingshain VARCHAR,
reimboldsh VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Willinghshain has Reimboldsh of 101?
| SELECT willingshain FROM table_name_27 WHERE reimboldsh = "101" | sql_create_context |
CREATE TABLE table_27902171_4 (
date VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What day did they play the phoenix suns?
| SELECT date FROM table_27902171_4 WHERE team = "Phoenix Suns" | sql_create_context |
CREATE TABLE table_54877 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team has an away score of 9.10 (64)?
| SELECT "Home team" FROM table_54877 WHERE "Away team score" = '9.10 (64)' | wikisql |
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 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 mzjzjlb.JZKSRQ BETWEEN '2001-09-03' AND '2020-09-18' AND mzjzjlb.YLJGDM = '2777621' | css |
CREATE TABLE table_name_40 (
draw INTEGER,
champs INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Draw is the lowest one that has Champs smaller than 0?
| SELECT MIN(draw) FROM table_name_40 WHERE champs < 0 | sql_create_context |
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 procedures.short_title, lab."CATEGORY" FROM procedures INNER JOIN lab ON procedures.hadm_id = lab.hadm_id WHERE procedures.subject_id = "2110" | mimicsql_data |
CREATE TABLE table_49888 (
"Race Name" text,
"Circuit" text,
"City/Location" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Winning team" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.... | SELECT "Winning team" FROM table_49888 WHERE "Pole position" = 'robby gordon' AND "Date" = 'june 11' | wikisql |
CREATE TABLE drivers (
driverid VARCHAR,
surname VARCHAR
)
CREATE TABLE races (
raceid VARCHAR
)
CREATE TABLE results (
driverid VARCHAR,
raceid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the id and surname of the driver who participat... | SELECT T1.driverid, T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_9416 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"Nationality" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many rounds have a position of C?
| SELECT COUNT("Round") FROM table_9416 WHERE "Position" = 'c' | wikisql |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B... | mimic_iii |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "NEWBORN" AND diagnoses.long_title = "Other specified disorders of skin" | mimicsql_data |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE transfers (
row_id number... | SELECT (SELECT SUM(inputevents_cv.amount) 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 = 782)) AND STRFTIME('%y-%m-%d', inputevents_cv.charttime) = '2103-03-04') - (SELECT... | mimic_iii |
CREATE TABLE table_19880 (
"Series Ep." text,
"Episode" real,
"Netflix" text,
"Segment A" text,
"Segment B" text,
"Segment C" text,
"Segment D" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the series episode where Segment B is popc... | SELECT "Series Ep." FROM table_19880 WHERE "Segment B" = 'Popcorn' | wikisql |
CREATE TABLE table_name_14 (
profits__billion_ INTEGER,
sales__billion_$_ VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the lowest Profits (billion $) which has a Sales (billion $) of 425.7, and a Rank larger than 4?
| SELECT MIN(profits__billion_) AS $_ FROM table_name_14 WHERE sales__billion_$_ = 425.7 AND rank > 4 | sql_create_context |
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight re... | SELECT Sex, AVG(Height) FROM people GROUP BY Sex ORDER BY AVG(Height) DESC | nvbench |
CREATE TABLE table_24399615_3 (
viewers VARCHAR,
airdate VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many entries are shown for viewers when the airdate was 26 november 2009?
| SELECT COUNT(viewers) FROM table_24399615_3 WHERE airdate = "26 November 2009" | sql_create_context |
CREATE TABLE table_1969577_3 (
enrollment INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the minimal enrollment of any of the schools?
| SELECT MIN(enrollment) FROM table_1969577_3 | sql_create_context |
CREATE TABLE table_name_34 (
opened INTEGER,
city VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the latest opened year of the team in Glasgow, Scotland?
| SELECT MAX(opened) FROM table_name_34 WHERE city = "glasgow, scotland" | sql_create_context |
CREATE TABLE table_name_43 (
score VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Score of the Game with a Record of 13 12?
| SELECT score FROM table_name_43 WHERE record = "13–12" | sql_create_context |
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER... | SELECT Sex, AVG(Age) FROM Student GROUP BY Sex | nvbench |
CREATE TABLE table_21421 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who repla... | SELECT "Replaced by" FROM table_21421 WHERE "Outgoing manager" = 'José Ángel Ziganda' | wikisql |
CREATE TABLE table_name_95 (
grid INTEGER,
constructor VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want the highest Grid for Toyota and jarno trulli
| SELECT MAX(grid) FROM table_name_95 WHERE constructor = "toyota" AND driver = "jarno trulli" | sql_create_context |
CREATE TABLE table_9112 (
"Title" text,
"Lyricist(s)" text,
"Composer(s)" text,
"Arranger(s)" text,
"Length" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Length, when the Title is 'The Way To Your Heart'?
| SELECT "Length" FROM table_9112 WHERE "Title" = 'the way to your heart' | wikisql |
CREATE TABLE table_name_58 (
date VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Date has Result of 86-87?
| SELECT date FROM table_name_58 WHERE result = "86-87" | sql_create_context |
CREATE TABLE table_56890 (
"Race" text,
"Circuit" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Constructor" text,
"Tyre" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the d... | SELECT "Date" FROM table_56890 WHERE "Circuit" = 'interlagos' | 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 MIN(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" | mimicsql_data |
CREATE TABLE table_65735 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Week has an Attendance larger than 65,070?
| SELECT MAX("Week") FROM table_65735 WHERE "Attendance" > '65,070' | wikisql |
CREATE TABLE table_8583 (
"DVD title" text,
"Season" text,
"Aspect ratio" text,
"Episode count" real,
"Time length" text,
"Release date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What title was release November 17, 2009 in a 16:9 aspect rat... | SELECT "DVD title" FROM table_8583 WHERE "Aspect ratio" = '16:9' AND "Release date" = 'november 17, 2009' | wikisql |
CREATE TABLE artist (
artist_id number,
name text,
country text,
year_join number,
age number
)
CREATE TABLE exhibition_record (
exhibition_id number,
date text,
attendance number
)
CREATE TABLE exhibition (
exhibition_id number,
year number,
theme text,
artist_id numbe... | SELECT name, age, country FROM artist ORDER BY year_join | spider |
CREATE TABLE table_71884 (
"Date" text,
"Visiting team" text,
"Final score" text,
"Host team" text,
"Stadium" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the Visiting team on december 20?
| SELECT "Visiting team" FROM table_71884 WHERE "Date" = 'december 20' | wikisql |
CREATE TABLE table_name_64 (
date VARCHAR,
opponent_in_final VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Date, when Opponent in Final is 'Guy Forget'?
| SELECT date FROM table_name_64 WHERE opponent_in_final = "guy forget" | sql_create_context |
CREATE TABLE table_4059 (
"Contestant" text,
"Age" real,
"Height" text,
"Starting BMI" text,
"Finale BMI" text,
"Reunion BMI" text,
"Start Weight" text,
"Finale Weight" text,
"Reunion Weight" text,
"lbs lost finale" text,
"lbs lost reunion" real
)
-- Using valid SQLite, ans... | SELECT "Reunion BMI" FROM table_4059 WHERE "Contestant" = 'Pinky' | wikisql |
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 t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '俞英卓' AND t_kc22.STA_DATE BETWEEN '2011-12-30' AND '2015-04-15' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' | css |
CREATE TABLE table_name_99 (
location VARCHAR,
round VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where's the location for the opponent James Zikic and 3 rounds?
| SELECT location FROM table_name_99 WHERE round = 3 AND opponent = "james zikic" | sql_create_context |
CREATE TABLE table_27898 (
"Settlement" text,
"Cyrillic Name" text,
"Type" text,
"Population (2011)" real,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the population of i... | SELECT COUNT("Population (2011)") FROM table_27898 WHERE "Cyrillic Name" = 'Сурдук' | wikisql |
CREATE TABLE table_2542 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Podiums" real,
"Points" text,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which position ... | SELECT "Position" FROM table_2542 WHERE "Podiums" = '9' | wikisql |
CREATE TABLE table_204_41 (
id number,
"rank" number,
"name" text,
"nationality" text,
"time" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is ranked at the top
| SELECT "name" FROM table_204_41 WHERE id = 1 | squall |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
... | SELECT DISTINCT num_enrolled FROM course WHERE department = 'EECS' AND number = 575 | advising |
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 demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Other disorders of the pituitary and other syndromes of diencephalohypophyseal origin" | mimicsql_data |
CREATE TABLE table_20551 (
"Vehicle" text,
"EPA rated All-electric range" text,
"EPA rated combined fuel economy" text,
"Alaska ( Juneau )" text,
"California (San Francisco)" text,
"Mid-Atlantic South (Washington, D.C.)" text,
"U.S. national average electric mix" text,
"Southeast (Atlant... | SELECT "Mid-Atlantic South (Washington, D.C.)" FROM table_20551 WHERE "Alaska ( Juneau )" = '90 g/mi (56 g/km)' AND "California (San Francisco)" = '110 g/mi (68 g/km)' | wikisql |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT gwyjzb.OUT_HOSP_DATE FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '57313257288' UNION SELECT fgwyjzb.OUT_HOSP_DATE FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '57313257288' | css |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "0" AND procedures.long_title = "Intravenous infusion of clofarabine" | mimicsql_data |
CREATE TABLE SportsInfo (
StuID INTEGER,
SportName VARCHAR(32),
HoursPerWeek INTEGER,
GamesPlayed INTEGER,
OnScholarship VARCHAR(1)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
... | SELECT LName, COUNT(LName) FROM SportsInfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.OnScholarship = 'Y' GROUP BY LName ORDER BY LName | nvbench |
CREATE TABLE table_168482_1 (
_percentage_of_popular_vote VARCHAR,
election VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many percentages are listed for the election in 1983?
| SELECT COUNT(_percentage_of_popular_vote) FROM table_168482_1 WHERE election = 1983 | sql_create_context |
CREATE TABLE table_name_91 (
retired VARCHAR,
notes VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was the aircraft retired when it was replaced by 737-300s?
| SELECT retired FROM table_name_91 WHERE notes = "replaced by 737-300s" | sql_create_context |
CREATE TABLE table_name_15 (
player VARCHAR,
to_par VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Player that has a To standard of 4?
| SELECT player FROM table_name_15 WHERE to_par = "–4" | sql_create_context |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON 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.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jyb... | css |
CREATE TABLE table_name_5 (
drawn VARCHAR,
points_1 VARCHAR,
lost VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much Drawn has Points 1 of 51, and a Lost larger than 5?
| SELECT COUNT(drawn) FROM table_name_5 WHERE points_1 = 51 AND lost > 5 | sql_create_context |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE S... | SELECT Users.Id, Users.Reputation, Badges.Date, Posts.Id AS PostId, Posts.CreationDate AS PostDate, Votes.VoteTypeId AS VoteId FROM Users LEFT JOIN Badges ON Users.Id = Badges.UserId LEFT JOIN Posts ON Users.Id = Posts.OwnerUserId LEFT JOIN Votes ON Posts.Id = Votes.PostId WHERE Badges.Name = 'Mortarboard' AND Votes.Vo... | sede |
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE key... | SELECT DISTINCT COUNT(paper.paperid), writes.authorid FROM keyphrase, paper, paperkeyphrase, writes WHERE keyphrase.keyphrasename = 'syntactic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.paperid = paper.paperid GROUP BY writes.authorid ORDER BY C... | scholar |
CREATE TABLE table_name_40 (
date VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date did week 6 occur?
| SELECT date FROM table_name_40 WHERE week = 6 | sql_create_context |
CREATE TABLE table_78505 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the driver richard attwood has a constructor of brm, what is the number of laps?
| SELECT "Laps" FROM table_78505 WHERE "Constructor" = 'brm' AND "Driver" = 'richard attwood' | wikisql |
CREATE TABLE temperature (
City_ID int,
Jan real,
Feb real,
Mar real,
Apr real,
Jun real,
Jul real,
Aug real,
Sep real,
Oct real,
Nov real,
Dec real
)
CREATE TABLE city (
City_ID int,
City text,
Hanzi text,
Hanyu_Pinyin text,
Regional_Population int,
... | SELECT Venue, COUNT(Venue) FROM match GROUP BY Venue ORDER BY Date DESC | nvbench |
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.label = "Mesothelial Cells" | mimicsql_data |
CREATE TABLE services (
service_type_code VARCHAR,
organization_id VARCHAR
)
CREATE TABLE organizations (
organization_id VARCHAR,
organization_details VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the distinct service types that are provid... | SELECT DISTINCT T1.service_type_code FROM services AS T1 JOIN organizations AS T2 ON T1.organization_id = T2.organization_id WHERE T2.organization_details = 'Denesik and Sons Party' | sql_create_context |
CREATE TABLE table_60692 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To Par" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Frank Moore's score?
| SELECT "Score" FROM table_60692 WHERE "Player" = 'frank moore' | wikisql |
CREATE TABLE table_name_61 (
date VARCHAR,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Date of the Ameritech Senior Open?
| SELECT date FROM table_name_61 WHERE tournament = "ameritech senior open" | sql_create_context |
CREATE TABLE pilot (
Name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List all pilot names in ascending alphabetical order.
| SELECT Name FROM pilot ORDER BY Name | sql_create_context |
CREATE TABLE table_18367 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which incumbent was first elected in 1964?
| SELECT "Incumbent" FROM table_18367 WHERE "First elected" = '1964' | wikisql |
CREATE TABLE table_2668243_22 (
party VARCHAR,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many 'Party' are in district south carolina 2?
| SELECT COUNT(party) FROM table_2668243_22 WHERE district = "South Carolina 2" | sql_create_context |
CREATE TABLE table_name_68 (
diff INTEGER,
drawn VARCHAR,
played VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest diff with drawn of 6 and play larger than 18?
| SELECT MAX(diff) FROM table_name_68 WHERE drawn = 6 AND played > 18 | sql_create_context |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number... | SELECT admissions.subject_id FROM admissions WHERE admissions.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 = 'ac alcoholic hepatitis') AND DATETIME(diagnoses_icd.charttime, 'start of y... | mimic_iii |
CREATE TABLE table_47652 (
"Year" real,
"Publication" text,
"Country" text,
"Accolade" text,
"Rank" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the average year for the accolade 100 greatest singles of all time?
| SELECT AVG("Year") FROM table_47652 WHERE "Accolade" = '100 greatest singles of all time' | wikisql |
CREATE TABLE table_45632 (
"Game" real,
"Date" text,
"Opponent" 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.
-- Wh... | SELECT "Record" FROM table_45632 WHERE "Date" = 'september 2' | wikisql |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Tags (
Id num... | SELECT * FROM Users WHERE UPPER(Location) = UPPER('##location##') AND Reputation > 100 | sede |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.