instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_54501 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which grid has a time/retired of +27.347?
| SELECT COUNT("Grid") FROM table_54501 WHERE "Time/Retired" = '+27.347' | wikisql |
CREATE TABLE table_name_73 (
record VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record on august 24?
| SELECT record FROM table_name_73 WHERE date = "august 24" | sql_create_context |
CREATE TABLE table_28512 (
"Institution" text,
"Location" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Nickname" text,
"Joined" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total number of nicknames for southwestern c... | SELECT COUNT("Nickname") FROM table_28512 WHERE "Institution" = 'Southwestern College' | wikisql |
CREATE TABLE table_26712 (
"Legion no and title" text,
"Main legion base" text,
"Emblem" text,
"Date founded/ founder" text,
"Date disband" text,
"Castra legionaria (legion bases) * = main base. Start date 31 BC if unspecified" text,
"Notes" text
)
-- Using valid SQLite, answer the followi... | SELECT "Date founded/ founder" FROM table_26712 WHERE "Emblem" = 'Hercules' | wikisql |
CREATE TABLE table_44187 (
"Club" text,
"Location" text,
"Stadium" text,
"Capacity" real,
"Manager" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Location of the Stadium where Job Dragtsma is Manager?
| SELECT "Location" FROM table_44187 WHERE "Manager" = 'job dragtsma' | wikisql |
CREATE TABLE On_Call (
Nurse INTEGER,
BlockFloor INTEGER,
BlockCode INTEGER,
OnCallStart DATETIME,
OnCallEnd DATETIME
)
CREATE TABLE Patient (
SSN INTEGER,
Name VARCHAR(30),
Address VARCHAR(30),
Phone VARCHAR(30),
InsuranceID INTEGER,
PCP INTEGER
)
CREATE TABLE Affiliated_W... | SELECT T1.Name, COUNT(*) FROM Physician AS T1 JOIN Patient AS T2 ON T1.EmployeeID = T2.PCP GROUP BY T1.EmployeeID ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_24240 (
"Nr." real,
"District" text,
"Former Name" text,
"Area ( ha )" real,
"Population (2005)" real,
"No. of villages" real,
"Density persons / ha" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many villages have a ... | SELECT COUNT("No. of villages") FROM table_24240 WHERE "Density persons / ha" = '5.5' | wikisql |
CREATE TABLE table_11677100_4 (
position VARCHAR,
school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many positions did the player from Spring High School play?
| SELECT COUNT(position) FROM table_11677100_4 WHERE school = "Spring High school" | sql_create_context |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | SELECT JYXMDM, JYXMMC FROM jybgb WHERE BGDH = '92525342038' | css |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following questions for the... | SELECT T2.Name, COUNT(*) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name | nvbench |
CREATE TABLE table_6582 (
"Celebrity" text,
"Famous for" text,
"Entered" text,
"Exited" text,
"Finished" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which celebrity was famous for finishing 9th?
| SELECT "Famous for" FROM table_6582 WHERE "Finished" = '9th' | wikisql |
CREATE TABLE table_16615 (
"Rank" real,
"Dismissals" real,
"Player" text,
"Nationality" text,
"Catches" real,
"Stumpings" real,
"Career Span" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the players whose rank is 2?
| SELECT "Player" FROM table_16615 WHERE "Rank" = '2' | wikisql |
CREATE TABLE table_27178 (
"Year" text,
"Amiga demo" text,
"PC demo" text,
"C64 demo" text,
"Amiga intro" text,
"PC intro" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What won best amiga demo when alto knallo (free electric band) won best pc ... | SELECT "Amiga demo" FROM table_27178 WHERE "PC demo" = 'Alto Knallo (Free Electric Band)' | wikisql |
CREATE TABLE table_36984 (
"Year" real,
"Class" text,
"Team" text,
"Points" real,
"Wins" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many wins for team nsu and over 2 points?
| SELECT AVG("Wins") FROM table_36984 WHERE "Team" = 'nsu' AND "Points" > '2' | wikisql |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
las... | SELECT AVG(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 86792) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'chloride') AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(), '-... | mimic_iii |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total... | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_co... | advising |
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 Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Lives_in (
stuid INTEGER,
do... | SELECT Fname, COUNT(Fname) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T3.dormid FROM Has_amenity AS T3 JOIN Dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge') GROUP BY Fname ORDER BY COUNT(Fname) | nvbench |
CREATE TABLE table_name_36 (
choreographer_s_ VARCHAR,
chosen_by VARCHAR,
style VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Choreographer(s), when Chosen is Mary Murphy, and when Style is Contemporary?
| SELECT choreographer_s_ FROM table_name_36 WHERE chosen_by = "mary murphy" AND style = "contemporary" | sql_create_context |
CREATE TABLE table_14460937_2 (
pos VARCHAR,
member_association VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many pos with member association being china pr
| SELECT COUNT(pos) FROM table_14460937_2 WHERE member_association = "China PR" | sql_create_context |
CREATE TABLE table_1682026_6 (
profits__billion_$_ VARCHAR,
company VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the profits in billions for Berkshire Hathaway?
| SELECT profits__billion_$_ FROM table_1682026_6 WHERE company = "Berkshire Hathaway" | sql_create_context |
CREATE TABLE table_name_26 (
place VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where was the score 67-71-70=208?
| SELECT place FROM table_name_26 WHERE score = 67 - 71 - 70 = 208 | sql_create_context |
CREATE TABLE table_name_83 (
caps INTEGER,
goals VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of caps for players with less than 9 goals ranked below 8?
| SELECT SUM(caps) FROM table_name_83 WHERE goals < 9 AND rank > 8 | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE cost (
r... | SELECT COUNT(DISTINCT t1.subject_id) 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_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'ventltr assoc pneu... | mimic_iii |
CREATE TABLE table_18598175_2 (
eliminated_by VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many player eliminated an opponent within the time frame of 32:32?
| SELECT COUNT(eliminated_by) FROM table_18598175_2 WHERE time = "32:32" | sql_create_context |
CREATE TABLE table_68844 (
"Round" real,
"Name" text,
"Position" text,
"School" text,
"Signed" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the position when signed is yes, round is less than 24 and name is charlie hough?
| SELECT "Position" FROM table_68844 WHERE "Signed" = 'yes' AND "Round" < '24' AND "Name" = 'charlie hough' | wikisql |
CREATE TABLE table_8451 (
"Outcome" text,
"Date" real,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was his first game on a clay surface where he scored 0 6,... | SELECT MIN("Date") FROM table_8451 WHERE "Surface" = 'clay' AND "Score" = '0–6, 3–6' | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "DIVORCED" AND lab.label = "Cholesterol, HDL" | mimicsql_data |
CREATE TABLE table_26361 (
"1 January 2010" text,
"DF" text,
"Adam Hinshelwood" text,
"Aldershot Town" text,
"Wycombe Wanderers" text,
"Undisclosed" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the undisclosed when Adam Hinshelwood is... | SELECT "Undisclosed" FROM table_26361 WHERE "Adam Hinshelwood" = 'Ricky Newman' | wikisql |
CREATE TABLE table_64087 (
"Game" real,
"Date" text,
"Opponents" text,
"Venue" text,
"Result" text,
"Score F\u2013A" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Venue of Game 41 with a Score F A of 1 2?
| SELECT "Venue" FROM table_64087 WHERE "Score F\u2013A" = '1–2' AND "Game" = '41' | wikisql |
CREATE TABLE table_18765 (
"Rank" real,
"Place" text,
"County" text,
"Per Capita Income" text,
"Median House- hold Income" text,
"Population" real,
"Number of Households" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the the place wi... | SELECT "Place" FROM table_18765 WHERE "Per Capita Income" = '$14,793' | wikisql |
CREATE TABLE table_name_24 (
equatorial_diameter VARCHAR,
body VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Equatorial diameter of the Body: Mars?
| SELECT equatorial_diameter FROM table_name_24 WHERE body = "mars" | sql_create_context |
CREATE TABLE performance (
Performance_ID real,
Date text,
Host text,
Location text,
Attendance int
)
CREATE TABLE member_attendance (
Member_ID int,
Performance_ID int,
Num_of_Pieces int
)
CREATE TABLE member (
Member_ID text,
Name text,
Nationality text,
Role text
)
... | SELECT Location, COUNT(Location) FROM performance GROUP BY Location ORDER BY Location DESC | nvbench |
CREATE TABLE table_30984 (
"Club" text,
"Outgoing Head Coach" text,
"Date of vacancy" text,
"Manner of departure" text,
"Incoming Head Coach" text,
"Date of appointment" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who are the outgoing head co... | SELECT "Outgoing Head Coach" FROM table_30984 WHERE "Manner of departure" = 'Gardening leave 1' | 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 demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND diagnoses.short_title = "Laryngotrach anomaly NEC" | mimicsql_data |
CREATE TABLE table_name_56 (
holding VARCHAR,
component VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the holding of the customers?
| SELECT holding FROM table_name_56 WHERE component = "customers" | sql_create_context |
CREATE TABLE table_name_64 (
attendance VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the attendance of the match with Carlisle united as the home team?
| SELECT attendance FROM table_name_64 WHERE home_team = "carlisle united" | sql_create_context |
CREATE TABLE table_name_71 (
number__map_ INTEGER,
area_in_km² VARCHAR,
population_canada_2011_census VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Number (map) is the lowest one that has a Area in km of 9.7, and a Population Canada 2011 Census la... | SELECT MIN(number__map_) FROM table_name_71 WHERE area_in_km² = 9.7 AND population_canada_2011_census > 66 OFFSET 158 | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "UPPER GI BLEED" AND demographic.dod_year <= "2126.0" | mimicsql_data |
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type 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 WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND C... | atis |
CREATE TABLE table_27797 (
"Municipality" text,
"No. of s Barangay" real,
"Area (km\u00b2)" text,
"Population (2007)" real,
"Population (2010)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of S Barangay for Paracale?
| SELECT "No. of s Barangay" FROM table_27797 WHERE "Municipality" = 'Paracale' | wikisql |
CREATE TABLE table_name_34 (
round INTEGER,
college VARCHAR,
pick VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the largest round of a pick smaller than 92 from Toledo University?
| SELECT MAX(round) FROM table_name_34 WHERE college = "toledo" AND pick < 92 | sql_create_context |
CREATE TABLE table_name_57 (
president VARCHAR,
c_span_2009 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the president when c-span 2009 is 21?
| SELECT president FROM table_name_57 WHERE c_span_2009 = "21" | sql_create_context |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY ... | SELECT LAST_NAME, DEPARTMENT_ID FROM employees ORDER BY DEPARTMENT_ID | nvbench |
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases INTEGER,
Drink TEXT
)
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE appellations (
No... | SELECT Year, COUNT(Year) FROM wine WHERE Price > 100 GROUP BY Grape ORDER BY Year | nvbench |
CREATE TABLE table_19233 (
"Team" text,
"Intercontinental" text,
"Recopa 1996" text,
"Supercopa 1996" text,
"CONMEBOL 1996" text,
"Copa Libertadores 1997" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the racing club where copa libertad... | SELECT "Copa Libertadores 1997" FROM table_19233 WHERE "Team" = 'Racing Club' | wikisql |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '水天心' AND hz_info.YLJGDM = '5751240' AND zyjzjlb.CYKSMC LIKE '%计生%' | css |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varc... | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY COUNT(JOB_ID) DESC | nvbench |
CREATE TABLE workshop (
Date VARCHAR,
Venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the date and venue of each workshop in ascending alphabetical order of the venue.
| SELECT Date, Venue FROM workshop ORDER BY Venue | sql_create_context |
CREATE TABLE table_44720 (
"Year" text,
"Winner" text,
"Country" text,
"Score" text,
"Runner(s)-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Country of the Championship with a Score of 293?
| SELECT "Country" FROM table_44720 WHERE "Score" = '293' | wikisql |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_fl... | 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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LOS ANGELES' AND flight.departure_time > 2226 AND flight.to_airport = AIRPORT_SERVICE_1.a... | atis |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | SELECT q.Id AS question_id, a.Id AS answer_id, q.Tags AS question_tags, q.OwnerUserId AS question_user_id, q.OwnerDisplayName AS question_user_name, a.OwnerUserId AS answer_user_id, a.OwnerDisplayName AS answer_user_name, a.Body AS answer_text, a.Score AS answer_score, q.Score AS question_score, q.ViewCount AS question... | sede |
CREATE TABLE table_name_42 (
purse__ INTEGER,
year INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much is the purse worth ( ) after 2012?
| SELECT SUM(purse__) AS ¥_ FROM table_name_42 WHERE year > 2012 | sql_create_context |
CREATE TABLE table_76931 (
"Rider" text,
"Bike" text,
"Laps" real,
"Time" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the most number of laps run by Ilario Dionisi?
| SELECT MAX("Laps") FROM table_76931 WHERE "Rider" = 'ilario dionisi' | wikisql |
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM tex... | SELECT MZBMLX, MZZDBM, MZZDMC FROM zyjzjlb WHERE JZLSH = '68168750267' | css |
CREATE TABLE table_20745444_1 (
date VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date when the record was 1-0?
| SELECT date FROM table_20745444_1 WHERE record = "1-0" | 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 prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "3" AND prescriptions.drug_type = "ADDITIVE" | mimicsql_data |
CREATE TABLE table_24540893_6 (
position VARCHAR,
school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many players attended SE missouri state?
| SELECT COUNT(position) FROM table_24540893_6 WHERE school = "SE Missouri State" | sql_create_context |
CREATE TABLE table_31106 (
"Rank 2011" real,
"Country" text,
"Production in 2011 (1,000 ton)" real,
"Share 2011" text,
"Rank 2010" real,
"Production in 2010 (1,000 ton)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When indonesia is the countr... | SELECT "Rank 2010" FROM table_31106 WHERE "Country" = 'Indonesia' | wikisql |
CREATE TABLE table_52312 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the years available at Bayview School, which has state authorit... | SELECT "Years" FROM table_52312 WHERE "Authority" = 'state' AND "Roll" > '333' AND "Name" = 'bayview school' | wikisql |
CREATE TABLE table_27303975_2 (
catalog_number VARCHAR,
release_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the catalog number for october 6, 1988
| SELECT catalog_number FROM table_27303975_2 WHERE release_date = "October 6, 1988" | sql_create_context |
CREATE TABLE table_name_31 (
name VARCHAR,
title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who held the title of Ruler?
| SELECT name FROM table_name_31 WHERE title = "ruler" | sql_create_context |
CREATE TABLE table_name_71 (
network VARCHAR,
year VARCHAR,
play_by_play VARCHAR,
color_commentator_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What network hosted Al Michaels, Dan Fouts and Dennis Miller in 2002?
| SELECT network FROM table_name_71 WHERE play_by_play = "al michaels" AND color_commentator_s_ = "dan fouts and dennis miller" AND year < 2002 | sql_create_context |
CREATE TABLE table_203_408 (
id number,
"rd." number,
"grand prix" text,
"date" text,
"location" text,
"pole position" text,
"fastest lap" text,
"winning driver" text,
"constructor" text,
"report" text
)
-- Using valid SQLite, answer the following questions for the tables provi... | SELECT COUNT(DISTINCT "rd.") FROM table_203_408 | squall |
CREATE TABLE table_name_87 (
uk_broadcast_date VARCHAR,
presenter VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the UK broadcast date of the episode with Ben Okri as the presenter?
| SELECT uk_broadcast_date FROM table_name_87 WHERE presenter = "ben okri" | sql_create_context |
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 PERSON_NM, PERSON_SEX, PERSON_AGE, IDENTITY_CARD FROM t_kc21 WHERE MED_CLINIC_ID = '75285494355' | css |
CREATE TABLE table_name_37 (
year INTEGER,
chassis VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the latest year for a Emeryson 1006 chassis with more than 0 points?
| SELECT MAX(year) FROM table_name_37 WHERE chassis = "emeryson 1006" AND points > 0 | sql_create_context |
CREATE TABLE table_32186 (
"Date" text,
"Epicenter" text,
"Magnitude" real,
"Fatalities" text,
"Name" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of Magnitude on february 12, 1953?
| SELECT SUM("Magnitude") FROM table_32186 WHERE "Date" = 'february 12, 1953' | wikisql |
CREATE TABLE Rooms (
bedType VARCHAR,
basePrice INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average base price of different bed type? List bed type and average base price.
| SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType | sql_create_context |
CREATE TABLE table_49600 (
"Building" text,
"Location" text,
"Height" text,
"Floors" real,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Location has Floors smaller than 27, and a Building of 150 elgin?
| SELECT "Location" FROM table_49600 WHERE "Floors" < '27' AND "Building" = '150 elgin' | wikisql |
CREATE TABLE table_25244412_1 (
state VARCHAR,
renewable_electricity__gw•h_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which states have renewable electricity equal to 9667 (gw h)?
| SELECT state FROM table_25244412_1 WHERE renewable_electricity__gw•h_ = 9667 | sql_create_context |
CREATE TABLE table_name_3 (
score VARCHAR,
competition VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Score of the 2008 Africa Cup of Nations Competition?
| SELECT score FROM table_name_3 WHERE competition = "2008 africa cup of nations" | sql_create_context |
CREATE TABLE table_79913 (
"Name" text,
"Street address" text,
"Years as tallest" text,
"Height feet / m" text,
"Floors" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the height of the Tides with less than 34 floors?
| SELECT "Height feet / m" FROM table_79913 WHERE "Floors" < '34' AND "Name" = 'the tides' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime t... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '015-59552' AND patient.hospitaldischargetime IS NULL | eicu |
CREATE TABLE table_name_46 (
away_team VARCHAR,
score VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Away team of the Merthyr Tydfil Home game with a Score of 1 1?
| SELECT away_team FROM table_name_46 WHERE score = "1–1" AND home_team = "merthyr tydfil" | sql_create_context |
CREATE TABLE participates_in (
stuid number,
actid number
)
CREATE TABLE faculty_participates_in (
facid number,
actid number
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABL... | SELECT DISTINCT T1.lname FROM faculty AS T1 JOIN faculty_participates_in AS T2 ON T1.facid = T2.facid JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' OR T3.activity_name = 'Kayaking' | spider |
CREATE TABLE table_name_29 (
attendance VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Attendance in the game against the New Orleans Saints?
| SELECT COUNT(attendance) FROM table_name_29 WHERE opponent = "new orleans saints" | sql_create_context |
CREATE TABLE table_51368 (
"Year" real,
"Property Taxes" text,
"Investment Earnings" text,
"Other Local Sources" text,
"State & Federal" text,
"Total Revenue" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were property taxes in a year when... | SELECT "Property Taxes" FROM table_51368 WHERE "Year" > '2002' AND "Total Revenue" = '$40,891,700' | wikisql |
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.SQRGH, jybgb.SQRXM FROM jybgb WHERE jybgb.BGDH = '51684992743' | css |
CREATE TABLE table_76503 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many laps did pere riba ride?
| SELECT SUM("Laps") FROM table_76503 WHERE "Rider" = 'pere riba' | wikisql |
CREATE TABLE table_name_52 (
race INTEGER,
location___state VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the first race in Launceston, Tasmania?
| SELECT MIN(race) FROM table_name_52 WHERE location___state = "launceston, tasmania" | sql_create_context |
CREATE TABLE table_49126 (
"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_49126 WHERE "Score" = '78-59' | wikisql |
CREATE TABLE table_54726 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the largest laps for Time/Retired of + 2 laps, and a Grid of 13?
| SELECT MAX("Laps") FROM table_54726 WHERE "Time/Retired" = '+ 2 laps' AND "Grid" = '13' | wikisql |
CREATE TABLE table_59474 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the home team that played against Aylesbury Vale?
| SELECT "Home team" FROM table_59474 WHERE "Away team" = 'aylesbury vale' | wikisql |
CREATE TABLE table_name_22 (
rank INTEGER,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who placed highest with a time of 1:47.70?
| SELECT MIN(rank) FROM table_name_22 WHERE time = "1:47.70" | sql_create_context |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
C... | SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '3006208' AND t_kc21.MED_ORG_DEPT_NM = '小儿肛肠外科') AND t_kc24.CLINIC_SLT_DATE BETWEEN '2020-05-01' AND '2020-11-26' | css |
CREATE TABLE table_name_43 (
country VARCHAR,
date VARCHAR,
catalog_nr VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country has the catalog nr of thr-048 in 2004?
| SELECT country FROM table_name_43 WHERE date = "2004" AND catalog_nr = "thr-048" | sql_create_context |
CREATE TABLE table_name_40 (
time_retired VARCHAR,
grid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the time/retired for grid 19?
| SELECT time_retired FROM table_name_40 WHERE grid = 19 | sql_create_context |
CREATE TABLE table_dev_59 (
"id" int,
"gender" string,
"st_elevation" int,
"tow_contiguous_limb" bool,
"body_weight" float,
"renal_disease" bool,
"estimated_glomerular_filtration_rate_egfr" int,
"two_contiguous_precordial_leads" bool,
"unprotected_left_main_stenosis" int,
"body_m... | SELECT * FROM table_dev_59 WHERE (gender = 'male' OR gender = 'female') AND (age >= 18 AND age < 75) | criteria2sql |
CREATE TABLE table_59517 (
"Opposing Teams" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date has an against of 7?
| SELECT "Date" FROM table_59517 WHERE "Against" = '7' | wikisql |
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 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 = 31880)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'hear... | mimic_iii |
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 SUM(t_kc22.AMOUNT) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '1161667' AND t_kc22.STA_DATE BETWEEN '2003-07-21' AND '2018-07-27' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT SUM(t_kc22.AMOUNT) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID ... | css |
CREATE TABLE table_1682026_7 (
rank INTEGER,
industry VARCHAR,
headquarters VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest rank of a company in the oil and gas industry headquartered in Netherlands?
| SELECT MAX(rank) FROM table_1682026_7 WHERE industry = "Oil and gas" AND headquarters = "Netherlands" | sql_create_context |
CREATE TABLE table_name_45 (
district VARCHAR,
reserved_for___sc___st__none_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What district shows reserved for (SC / ST /None) of total:?
| SELECT district FROM table_name_45 WHERE reserved_for___sc___st__none_ = "total:" | sql_create_context |
CREATE TABLE Student (
city_code VARCHAR,
LName VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which city does the student whose last name is 'Kim' live in?
| SELECT city_code FROM Student WHERE LName = "Kim" | sql_create_context |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | (SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = ... | css |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'oth cerv fusion ant/ant') AND DATETIME(procedures_ic... | mimic_iii |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND procedures.icd9_code = "8191" | mimicsql_data |
CREATE TABLE table_name_25 (
year INTEGER,
earnings__$_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year has earnings of $557,158?
| SELECT MAX(year) FROM table_name_25 WHERE earnings__$_ = "557,158" | sql_create_context |
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 First_year, COUNT(First_year) FROM party WHERE Party_Theme = "Spring" OR Party_Theme = "Teqnology" GROUP BY First_year | nvbench |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count num... | SELECT MONTH(CreationDate) AS month, YEAR(CreationDate) AS year, 1.0 * SUM(CASE WHEN LOWER(LEFT(Title, 2)) = 'wh' THEN 1 ELSE 0 END) / COUNT(*) AS wh, (SELECT 1.0 * SUM(Score) / COUNT(*) FROM Posts AS u WHERE MONTH(CreationDate) = MONTH(t.CreationDate) AND YEAR(CreationDate) = YEAR(t.CreationDate) AND LOWER(LEFT(Title,... | sede |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.