instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_26180 (
"Neighbourhood" text,
"% 0-19" text,
"% 20-39" text,
"% 40-59" text,
"% 60-74" text,
"% 75 +" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is every value for % 20-39 if % 0-19 is 21,11%?
| SELECT "% 20-39" FROM table_26180 WHERE "% 0-19" = '21,11%' | wikisql |
CREATE TABLE table_name_13 (
home_captain VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the Home captain that played at the venue Oval?
| SELECT home_captain FROM table_name_13 WHERE venue = "oval" | sql_create_context |
CREATE TABLE table_204_133 (
id number,
"school year" text,
"class a" text,
"class aa" text,
"class aaa" text,
"class aaaa" text,
"class aaaaa" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which school won class a in the season previous to... | SELECT "class a" FROM table_204_133 WHERE id = (SELECT id FROM table_204_133 WHERE "school year" = '1999-2000') - 1 | squall |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number... | SELECT AVG(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18866)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'hear... | mimic_iii |
CREATE TABLE table_23915973_1 (
power_kw VARCHAR,
frequency VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many power kw have a frequency of 93.7 mhz?
| SELECT COUNT(power_kw) FROM table_23915973_1 WHERE frequency = "93.7 MHz" | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
... | SELECT COUNT(*) FROM treatment WHERE treatment.treatmentname = 'antihypertensive drug - hydralazine' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') | eicu |
CREATE TABLE table_26301697_2 (
age INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most age
| SELECT MAX(age) FROM table_26301697_2 | sql_create_context |
CREATE TABLE table_name_19 (
home_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the home team at junction oval?
| SELECT home_team AS score FROM table_name_19 WHERE venue = "junction oval" | sql_create_context |
CREATE TABLE party (
party_name VARCHAR,
party_id VARCHAR
)
CREATE TABLE Member (
party_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show all party names and the number of members in each party.
| SELECT T2.party_name, COUNT(*) FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id | sql_create_context |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'GEOSCI' AND course.number = 321 AND semester.semester = 'Spring' AND semester.semester_id = course_offering.semester AND semester.year = 2000 | advising |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT * FROM 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.RYBH = '67921466' AND hz_info.YLJGDM = '0629805' AND zyjzjlb.CYKSMC LIKE '%化疗%' | css |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
... | 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 = 'SEATTLE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SALT L... | atis |
CREATE TABLE table_19897294_8 (
family_families VARCHAR,
no_overall VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the family for uk31
| SELECT family_families FROM table_19897294_8 WHERE no_overall = "UK31" | 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 Team_ID, ACC_Percent FROM basketball_match GROUP BY All_Games | nvbench |
CREATE TABLE table_21159 (
"Municipality" text,
"Income Class" text,
"District" text,
"Population (2010)" real,
"Area (km\u00b2)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the population where municipality is san jacinto?
| SELECT "Population (2010)" FROM table_21159 WHERE "Municipality" = 'San Jacinto' | wikisql |
CREATE TABLE table_204_139 (
id number,
"community" text,
"airport name" text,
"type" text,
"coordinates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many airports are there in the townsville community ?
| SELECT COUNT("airport name") FROM table_204_139 WHERE "community" = 'townsville' | squall |
CREATE TABLE table_23696862_6 (
wsop_bracelets INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest amount of WSOP bracelets anyone had?
| SELECT MIN(wsop_bracelets) FROM table_23696862_6 | sql_create_context |
CREATE TABLE table_name_72 (
date VARCHAR,
leading_scorer VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date was Leo Mainoldi (24) the leading scorer?
| SELECT date FROM table_name_72 WHERE leading_scorer = "leo mainoldi (24)" | sql_create_context |
CREATE TABLE table_46532 (
"Date" text,
"City" text,
"Country" text,
"Venue" text,
"Tickets available since" text,
"Attendance" real,
"Comment" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What city had tickets available since March 28, 20... | SELECT "City" FROM table_46532 WHERE "Tickets available since" = 'march 28, 2008' AND "Date" = 'september 4, 2009' | wikisql |
CREATE TABLE table_6917 (
"Season" text,
"Games" real,
"Lost" real,
"Tied" real,
"Points" real,
"Goals for" real,
"Goals against" real,
"Coach" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the points average when the tied is gr... | SELECT AVG("Points") FROM table_6917 WHERE "Tied" > '8' AND "Games" < '82' AND "Coach" = 'bryan mclay † morris lallo ‡ gerry moore ‡' AND "Goals against" > '322' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2144" AND diagnoses.long_title = "Dementia in conditions classified elsewhere without behavioral disturbance" | mimicsql_data |
CREATE TABLE party_host (
Party_ID int,
Host_ID int,
Is_Main_in_Charge bool
)
CREATE TABLE party (
Party_ID int,
Party_Theme text,
Location text,
First_year text,
Last_year text,
Number_of_hosts int
)
CREATE TABLE host (
Host_ID int,
Name text,
Nationality text,
Age... | SELECT Nationality, COUNT(*) FROM host GROUP BY Nationality ORDER BY Nationality | nvbench |
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare, food_service WHERE (((DATE_DAY_1.day_number = 24 AND DATE_D... | atis |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT mzjzjlb.ZZYSGH, mzjzjlb.QTJZYSGH FROM mzjzjlb WHERE mzjzjlb.JZLSH = '11994027078' | css |
CREATE TABLE table_name_66 (
lost VARCHAR,
period VARCHAR,
managed VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many lost when the number managed is over 2 and the period is from 12 november 2012 27 november 2012?
| SELECT COUNT(lost) FROM table_name_66 WHERE period = "12 november 2012 – 27 november 2012" AND managed > 2 | sql_create_context |
CREATE TABLE table_name_10 (
translation VARCHAR,
unit VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which translation had a unit of Uncia?
| SELECT translation FROM table_name_10 WHERE unit = "uncia" | sql_create_context |
CREATE TABLE table_50407 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Pick has a Round larger than 17, and a Name of gene stewart?
| SELECT COUNT("Pick") FROM table_50407 WHERE "Round" > '17' AND "Name" = 'gene stewart' | wikisql |
CREATE TABLE table_68249 (
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest number of silver medals that Ireland earned when they scored less than 3 bronze medals an... | SELECT MAX("Silver") FROM table_68249 WHERE "Bronze" < '3' AND "Gold" < '1' AND "Total" = '1' AND "Nation" = 'ireland' | wikisql |
CREATE TABLE table_67197 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the grid for the rider who rides a Suzuki and has the time of +1:01.894?
| SELECT MAX("Grid") FROM table_67197 WHERE "Manufacturer" = 'suzuki' AND "Time/Retired" = '+1:01.894' | wikisql |
CREATE TABLE dorm (
dorm_name VARCHAR,
student_capacity INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the name of dorms that can accommodate more than 300 students.
| SELECT dorm_name FROM dorm WHERE student_capacity > 300 | sql_create_context |
CREATE TABLE table_name_95 (
result VARCHAR,
event VARCHAR,
method VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result for the 2012 ibjjf world jiu-jitsu championships event when the method was points (4 x 0)?
| SELECT result FROM table_name_95 WHERE event = "2012 ibjjf world jiu-jitsu championships" AND method = "points (4 x 0)" | sql_create_context |
CREATE TABLE table_52776 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which format was under the London Records label?
| SELECT "Format" FROM table_52776 WHERE "Label" = 'london records' | wikisql |
CREATE TABLE table_13933 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Points" real,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest poles of team c... | SELECT MIN("Poles") FROM table_13933 WHERE "Position" = 'nc' AND "Team" = 'comtec racing' | wikisql |
CREATE TABLE table_72411 (
"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.
-- Which party has a first elected number bigger than 1939.0?
| SELECT "Party" FROM table_72411 WHERE "First elected" > '1939.0' | wikisql |
CREATE TABLE table_name_77 (
date VARCHAR,
competition VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date has the competition of uefa euro 2012 qualifying?
| SELECT date FROM table_name_77 WHERE competition = "uefa euro 2012 qualifying" | sql_create_context |
CREATE TABLE table_203_129 (
id number,
"finalist" text,
"age" number,
"from" text,
"dress colour" text,
"status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the total number of finalists ?
| SELECT COUNT("finalist") FROM table_203_129 | squall |
CREATE TABLE table_71800 (
"Result" text,
"Date" text,
"Race" text,
"Venue" text,
"Group" text,
"Distance" text,
"Weight (kg)" real,
"Jockey" text,
"Winner/2nd" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In which races did the jo... | SELECT "Race" FROM table_71800 WHERE "Weight (kg)" < '55.5' | wikisql |
CREATE TABLE table_36609 (
"Rank" real,
"Country" text,
"1st place" real,
"2nd place" real,
"3rd place" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest Rank of Denmark County with a Total smaller than 1?
| SELECT MIN("Rank") FROM table_36609 WHERE "Country" = 'denmark' AND "Total" < '1' | wikisql |
CREATE TABLE table_name_94 (
venue VARCHAR,
score VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the venue when the score is 1 goal, and the date is August 27, 1980?
| SELECT venue FROM table_name_94 WHERE score = "1 goal" AND date = "august 27, 1980" | sql_create_context |
CREATE TABLE table_name_89 (
position VARCHAR,
no_s_ VARCHAR,
years_for_rockets VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the position for number 11 and years on the rockets for 1989-95
| SELECT position FROM table_name_89 WHERE no_s_ = "11" AND years_for_rockets = "1989-95" | sql_create_context |
CREATE TABLE table_76777 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of the pick of the lw position player?
| SELECT SUM("Pick") FROM table_76777 WHERE "Position" = 'lw' | 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 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 WHERE demographic.diagnosis = "ANGIOEDEMA" AND demographic.dod_year <= "2155.0" | mimicsql_data |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Manufacturer | nvbench |
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 All_Games, ACC_Percent FROM basketball_match | nvbench |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
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,
JO... | SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE table_name_58 (
winner VARCHAR,
finalist VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the winner of fc gr n-wei wolfen?
| SELECT winner FROM table_name_58 WHERE finalist = "fc grün-weiß wolfen" | sql_create_context |
CREATE TABLE table_name_58 (
finish VARCHAR,
year_s__won VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Finish, when Year(s) Won is '1962 , 1967'?
| SELECT finish FROM table_name_58 WHERE year_s__won = "1962 , 1967" | sql_create_context |
CREATE TABLE table_204_383 (
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.
-- which country had the highest total ?
| SELECT "nation" FROM table_204_383 ORDER BY "total" DESC LIMIT 1 | squall |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | 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.JZZDBM = 'H11.754' AND jyjgzbb.JCZBDM = '816429' UNION SELECT jyjgzbb.CKZF... | css |
CREATE TABLE table_63187 (
"City of license" text,
"Identifier" text,
"Frequency" text,
"Power" text,
"Class" text,
"RECNet" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the frequency when the identifier is cbf-fm-14 having a class of A... | SELECT "Frequency" FROM table_63187 WHERE "Class" = 'a' AND "Identifier" = 'cbf-fm-14' | wikisql |
CREATE TABLE table_61764 (
"7:30 am" text,
"8:00 am" text,
"9:00 am" text,
"11:00 am" text,
"noon" text,
"12:30 pm" text,
"1:00 pm" text,
"1:30 pm" text,
"2:00 pm" text,
"3:00 pm" text,
"3:30 pm" text,
"5:00 pm" text,
"6:30 pm" text
)
-- Using valid SQLite, answer t... | SELECT "9:00 am" FROM table_61764 WHERE "6:30 pm" = 'local programs' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
h... | SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 31243 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_proce... | mimic_iii |
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 SUM(t_kc22.AMOUNT) FROM t_kc22 JOIN mzb ON mzb.MED_ORG_DEPT_CD = t_kc22.MED_CLINIC_ID WHERE mzb.PERSON_NM = '01949589' AND t_kc22.STA_DATE BETWEEN '2005-03-23' AND '2014-10-28' AND t_kc22.MED_INV_ITEM_TYPE = '手术费' | css |
CREATE TABLE head (
head_id VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which head's name has the substring 'Ha'? List the id and name.
| SELECT head_id, name FROM head WHERE name LIKE '%Ha%' | sql_create_context |
CREATE TABLE table_name_34 (
college VARCHAR,
round VARCHAR,
pick__number VARCHAR,
overall VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which college has a Pick # 1, Overall more than one, and Round is 7?
| SELECT college FROM table_name_34 WHERE pick__number = 1 AND overall > 1 AND round = 7 | sql_create_context |
CREATE TABLE Rooms (
decor VARCHAR,
basePrice INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the number of rooms with price higher than 120 for different decor.
| SELECT decor, COUNT(*) FROM Rooms WHERE basePrice > 120 GROUP BY decor | sql_create_context |
CREATE TABLE table_15048 (
"Film" text,
"Director(s)" text,
"Producer(s)" text,
"Writer(s)" text,
"Recipient" text,
"Date" text,
"Award" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What movie won with a date of 12/11/03
| SELECT "Recipient" FROM table_15048 WHERE "Date" = '12/11/03' | wikisql |
CREATE TABLE table_6635 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Incumbent has a District of massachusetts 8?
| SELECT "Incumbent" FROM table_6635 WHERE "District" = 'massachusetts 8' | wikisql |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
E... | SELECT Tags.TagName, COUNT(PostTags.TagId) AS no FROM PostTags, Tags WHERE Tags.Id = PostTags.TagId AND TagName = 'argentina' OR Tags.Id = PostTags.TagId AND TagName = 'venezuela' OR Tags.Id = PostTags.TagId AND TagName = 'brazil' OR Tags.Id = PostTags.TagId AND TagName = 'chile' OR Tags.Id = PostTags.TagId AND TagName... | sede |
CREATE TABLE table_name_58 (
player VARCHAR,
pick VARCHAR,
college VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Player, when Pick is less than 161, and when College is 'Auburn University'?
| SELECT player FROM table_name_58 WHERE pick < 161 AND college = "auburn university" | sql_create_context |
CREATE TABLE table_name_93 (
brazil_scorers VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Brazil scorers have a 1-1 Score?
| SELECT brazil_scorers FROM table_name_93 WHERE score = "1-1" | sql_create_context |
CREATE TABLE table_37379 (
"Year" real,
"Senator" text,
"Party" text,
"State" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the sum of the year in rhode island
| SELECT SUM("Year") FROM table_37379 WHERE "State" = 'rhode island' | wikisql |
CREATE TABLE table_name_31 (
goal_gain INTEGER,
game INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team with a Game smaller than 18 has the lowest Goal Gain?
| SELECT MIN(goal_gain) FROM table_name_31 WHERE game < 18 | 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 diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime ti... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) 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 = 3125) AND icustays.outtime IS NULL) A... | mimic_iii |
CREATE TABLE table_15428 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team 2 has a 2nd leg of 0-2?
| SELECT "Team 2" FROM table_15428 WHERE "2nd leg" = '0-2' | wikisql |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT * FROM t_kc21 WHERE PERSON_ID = '98735350' AND MED_SER_ORG_NO = '5087372' AND MED_ORG_DEPT_NM LIKE '%脑外%' | css |
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_seaso... | SELECT Openning_year, SUM(Capacity) FROM cinema | nvbench |
CREATE TABLE table_203_221 (
id number,
"name" text,
"nationality" text,
"matches played" number,
"goals scored" number,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many more goals did archie thompson score than billy celeski ?
| SELECT (SELECT "goals scored" FROM table_203_221 WHERE "name" = 'archie thompson') - (SELECT "goals scored" FROM table_203_221 WHERE "name" = 'billy celeski') | squall |
CREATE TABLE table_2554479_2 (
tests_won_by_australia VARCHAR,
series VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of tests won by australia for series 10
| SELECT COUNT(tests_won_by_australia) FROM table_2554479_2 WHERE series = 10 | sql_create_context |
CREATE TABLE table_name_73 (
total_matches INTEGER,
points__percentage VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In 2007, what is the average total matches with points % larger than 33.3?
| SELECT AVG(total_matches) FROM table_name_73 WHERE points__percentage > 33.3 AND year = "2007" | sql_create_context |
CREATE TABLE table_11497980_1 (
torque_nm VARCHAR,
gcm__kg__technical_capacity VARCHAR,
engine_make_capacity VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the engine make/capacity is MWM 6.10 TCA-EURO III (Turbo Intercooler) and GVM (kg) Technical Ca... | SELECT torque_nm AS @rpm FROM table_11497980_1 WHERE gcm__kg__technical_capacity = "23000" AND engine_make_capacity = "MWM 6.10 TCA-EURO III (Turbo Intercooler)" | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.discharge_location = "HOME HEALTH CARE" | mimicsql_data |
CREATE TABLE table_29363 (
"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.
-- Name the ... | SELECT "Outgoing manager" FROM table_29363 WHERE "Manner of departure" = 'Mutual consent' AND "Position in table" = '16th' | wikisql |
CREATE TABLE table_name_63 (
state VARCHAR,
title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the state where the title is listed as count?
| SELECT state FROM table_name_63 WHERE title = "count" | sql_create_context |
CREATE TABLE table_name_91 (
score VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the final score for the game on May 4?
| SELECT score FROM table_name_91 WHERE date = "may 4" | sql_create_context |
CREATE TABLE table_1342233_11 (
party VARCHAR,
candidates VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which party is associated with the candidate Albert Sidney Camp (D) unopposed?
| SELECT COUNT(party) FROM table_1342233_11 WHERE candidates = "Albert Sidney Camp (D) Unopposed" | sql_create_context |
CREATE TABLE table_28135 (
"Episode" real,
"Air Date" text,
"Team Swash" text,
"Team guest captain" text,
"Team Coxy" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many entries are shown for an air date when the team guest captain was stephen k... | SELECT COUNT("Air Date") FROM table_28135 WHERE "Team guest captain" = 'Stephen K Amos' | wikisql |
CREATE TABLE table_69333 (
"Outcome" text,
"Date" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score in the final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the score in the final for runner-up and hard surface... | SELECT "Score in the final" FROM table_69333 WHERE "Outcome" = 'runner-up' AND "Surface" = 'hard' AND "Opponents in the final" = 'michaël llodra nenad zimonjić' | wikisql |
CREATE TABLE table_test_5 (
"id" int,
"systemic_lupus_erythematosus" bool,
"anemia" bool,
"gender" string,
"pregnancy_or_lactation" bool,
"serum_potassium" float,
"hemoglobin_a1c_hba1c" float,
"heart_disease" bool,
"renal_disease" bool,
"creatinine_clearance_cl" float,
"estim... | SELECT * FROM table_test_5 WHERE heart_disease = 1 | criteria2sql |
CREATE TABLE table_203_397 (
id number,
"series" text,
"launch date" text,
"finale date" text,
"days" number,
"housemates" number,
"winner" text,
"main presenter" text,
"grand prize" text,
"liveshow\naudience\nmillions" number
)
-- Using valid SQLite, answer the following quest... | SELECT "winner" FROM table_203_397 WHERE "launch date" < (SELECT "launch date" FROM table_203_397 WHERE "winner" = 'flavio montrucchio') ORDER BY "launch date" DESC LIMIT 1 | squall |
CREATE TABLE table_name_83 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2001 tournament with a 2005 4r?
| SELECT 2001 FROM table_name_83 WHERE 2005 = "4r" | sql_create_context |
CREATE TABLE table_name_2 (
rider_2 VARCHAR,
city VARCHAR,
horse_1 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the second rider when papayero raced as Horse 1 in the city of rancagua?
| SELECT rider_2 FROM table_name_2 WHERE city = "rancagua" AND horse_1 = "papayero" | sql_create_context |
CREATE TABLE table_11653 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date when the home team was Essendo... | SELECT "Date" FROM table_11653 WHERE "Home team" = 'essendon' | wikisql |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime tim... | SELECT AVG(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 = 26995)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab... | mimic_iii |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | SELECT c.CreationDate, c.Id AS "comment_link" FROM Comments AS c WHERE c.UserId = '##UserId##' AND c.Score = 0 ORDER BY c.CreationDate DESC | sede |
CREATE TABLE table_name_72 (
to_par VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the to par for mathew goggin?
| SELECT to_par FROM table_name_72 WHERE player = "mathew goggin" | 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 demographic.days_stay, lab.label FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Francis Baseler" | mimicsql_data |
CREATE TABLE table_name_74 (
laps INTEGER,
rider VARCHAR,
grid VARCHAR,
bike VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the average Laps for grid larger than 12 and bikes of ducati 999rs for dean ellison
| SELECT AVG(laps) FROM table_name_74 WHERE grid > 12 AND bike = "ducati 999rs" AND rider = "dean ellison" | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "36" AND prescriptions.route = "TP" | mimicsql_data |
CREATE TABLE table_49259 (
"Date" text,
"Home team" text,
"Score" text,
"Away team" text,
"Venue" text,
"Box Score" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the home team venue for the New Zealand Breakers?
| SELECT "Venue" FROM table_49259 WHERE "Home team" = 'new zealand breakers' | wikisql |
CREATE TABLE table_name_76 (
number_of_households INTEGER,
median_family_income VARCHAR,
population VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of households in the county with median income of $65,240 and population greater than 74... | SELECT SUM(number_of_households) FROM table_name_76 WHERE median_family_income = "$65,240" AND population > 744 OFFSET 344 | sql_create_context |
CREATE TABLE Subjects (
subject_id INTEGER,
subject_name VARCHAR(120)
)
CREATE TABLE Course_Authors_and_Tutors (
author_id INTEGER,
author_tutor_ATB VARCHAR(3),
login_name VARCHAR(40),
password VARCHAR(40),
personal_name VARCHAR(80),
middle_name VARCHAR(80),
family_name VARCHAR(80),... | SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment ORDER BY COUNT(date_of_completion) | nvbench |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | SELECT COUNT(*) AS "number_of_questions" FROM Posts WHERE PostTypeId = 1 AND Title LIKE '%Jon Skeet%' OR Title LIKE '%Jon-Skeet%' OR Title LIKE '%Skeet%' | sede |
CREATE TABLE table_43991 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the sum of Score that has the Place of t5, and the Country of united states, and the Player... | SELECT SUM("Score") FROM table_43991 WHERE "Place" = 't5' AND "Country" = 'united states' AND "Player" = 'jeff maggert' | wikisql |
CREATE TABLE table_20181270_3 (
landesliga_süd VARCHAR,
bayernliga VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the landesliga sud for sg quelle f rth
| SELECT landesliga_süd FROM table_20181270_3 WHERE bayernliga = "SG Quelle Fürth" | sql_create_context |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester i... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course_offering.semester < (SELECT SEMESTERalias0.semester_id FROM semester AS SEMESTERalias0 WHERE SEMESTERalias0.semester = 'WN' AND SEMESTERalias0.year = 2016) AND course.course_id = cour... | advising |
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 jybgb.KSBM, jybgb.KSMC FROM hz_info JOIN wdmzjzjlb JOIN jybgb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '78828339' AND jybgb.BGRQ BETWEEN '2004-07-28... | css |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TAB... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'valve replacement < 7days' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-2 year')) AS ... | eicu |
CREATE TABLE table_train_245 (
"id" int,
"renal_disease" bool,
"diabetic" string,
"creatinine_clearance_cl" float,
"smoking" bool,
"kidney_disease" bool,
"body_mass_index_bmi" float,
"fasting_glucose" int,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for th... | SELECT * FROM table_train_245 WHERE body_mass_index_bmi > 27 AND body_mass_index_bmi < 43 | criteria2sql |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT DOSE_FORM, SPEC FROM t_kc22 WHERE MED_CLINIC_ID = '67901412182' AND SOC_SRT_DIRE_NM = '盐酸舍曲林片' | css |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.