instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId num... | SELECT * FROM Posts WHERE Id < 50000 AND Score >= 5 AND NOT Tags IS NULL | sede |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Removal of T-tube, other bile duct tube, or liver tube" AND lab.fluid = "Ascites" | mimicsql_data |
CREATE TABLE film_market_estimation (
Year VARCHAR,
Market_ID VARCHAR
)
CREATE TABLE market (
Country VARCHAR,
Market_ID VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Please list the countries and years of film market estimations.
| SELECT T2.Country, T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID | 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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2158.0" AND prescriptions.drug = "Hydralazine HCl" | mimicsql_data |
CREATE TABLE table_95 (
"Season" real,
"Driver" text,
"Team" text,
"Engine" text,
"Poles" real,
"Wins" real,
"Podiums" real,
"Points" text,
"Margin of defeat" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which podiums did the alfa ... | SELECT "Podiums" FROM table_95 WHERE "Team" = 'Alfa Romeo' | wikisql |
CREATE TABLE table_73237 (
"Type of aphasia" text,
"Repetition" text,
"Naming" text,
"Auditory comprehension" text,
"Fluency" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the naming for fluent and poor comprehension
| SELECT "Naming" FROM table_73237 WHERE "Fluency" = 'fluent' AND "Auditory comprehension" = 'poor' | wikisql |
CREATE TABLE category (
category_id TINYINT UNSIGNED,
name VARCHAR(25),
last_update TIMESTAMP
)
CREATE TABLE film_actor (
actor_id SMALLINT UNSIGNED,
film_id SMALLINT UNSIGNED,
last_update TIMESTAMP
)
CREATE TABLE address (
address_id SMALLINT UNSIGNED,
address VARCHAR(50),
address... | SELECT payment_date, COUNT(payment_date) FROM payment WHERE amount > 10 UNION SELECT T1.payment_date FROM payment AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Elsa' ORDER BY COUNT(payment_date) | nvbench |
CREATE TABLE table_20414 (
"Episode Number" real,
"Air Date" text,
"Guest Host" text,
"Musical Guest (Song performed)" text,
"Who knows the most about the guest host? panelists" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name who knows the most ... | SELECT "Who knows the most about the guest host? panelists" FROM table_20414 WHERE "Episode Number" = '5' | wikisql |
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 aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufac... | 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 = 'BALTIMORE' AND flight.departure_time < 800 AND flight.to_airport = AIRPORT_SERVICE_1.airp... | atis |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate n... | SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '021-95970' AND patient.hospitaladmitsource = 'emergency department' AND patient.hospitaldischargetime IS NULL | eicu |
CREATE TABLE table_train_218 (
"id" int,
"plasma_glucose_concentration" int,
"c_peptide_level" float,
"body_weight" float,
"diabetic" string,
"single_antigen_b_sab" int,
"low_density_lipoprotein_ldl_cholesterol" int,
"body_mass_index_bmi" float,
"triglyceride_tg" float,
"NOUSE" f... | SELECT * FROM table_train_218 WHERE diabetic = 'i' AND c_peptide_level < 200 AND (plasma_glucose_concentration >= 60 AND plasma_glucose_concentration <= 250) | criteria2sql |
CREATE TABLE table_63195 (
"Artist" text,
"Album" text,
"Track(s)" text,
"Date" text,
"Label" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Track(s) is on 18 november 1985?
| SELECT "Track(s)" FROM table_63195 WHERE "Date" = '18 november 1985' | wikisql |
CREATE TABLE table_7241 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date of the 4 strokes margin of victory?
| SELECT "Date" FROM table_7241 WHERE "Margin of victory" = '4 strokes' | wikisql |
CREATE TABLE table_75792 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the winning score for the runner-up Ernie Els?
| SELECT "Winning score" FROM table_75792 WHERE "Runner(s)-up" = 'ernie els' | wikisql |
CREATE TABLE table_name_1 (
attendance VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the attendance for the game where the away team was Stockport County?
| SELECT attendance FROM table_name_1 WHERE away_team = "stockport county" | sql_create_context |
CREATE TABLE table_name_43 (
height VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Height has a Player of mike bibby?
| SELECT height FROM table_name_43 WHERE player = "mike bibby" | sql_create_context |
CREATE TABLE table_77464 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Attendance" real,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Score of the game with a Record of 31 37 9?
| SELECT "Score" FROM table_77464 WHERE "Record" = '31–37–9' | wikisql |
CREATE TABLE table_16543 (
"Year" real,
"Title" text,
"Format" text,
"Studio" text,
"Release Date" text,
"Copyright Information" text,
"Catalog Number" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- where title is am/pm callanetics , what ar... | SELECT "Copyright Information" FROM table_16543 WHERE "Title" = 'AM/PM Callanetics' | wikisql |
CREATE TABLE table_203_254 (
id number,
"position" number,
"team" text,
"points" number,
"played" number,
"won" number,
"drawn" number,
"lost" number,
"for" number,
"against" number,
"difference" number
)
-- Using valid SQLite, answer the following questions for the tables ... | SELECT "team" FROM table_203_254 WHERE "points" <= 5 | squall |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuo... | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'viral warts nos') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 87733) AND DATETIME(diagnoses_icd.cha... | mimic_iii |
CREATE TABLE table_1341453_44 (
first_elected INTEGER,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was Bob Clement first elected?
| SELECT MIN(first_elected) FROM table_1341453_44 WHERE incumbent = "Bob Clement" | sql_create_context |
CREATE TABLE Customer_Payments (
customer_id INTEGER,
datetime_payment DATETIME,
payment_method_code VARCHAR(10),
amount_payment DOUBLE
)
CREATE TABLE Staff (
staff_id INTEGER,
staff_address_id INTEGER,
nickname VARCHAR(80),
first_name VARCHAR(80),
middle_name VARCHAR(80),
last_... | SELECT customer_status_code, COUNT(*) FROM Customers GROUP BY customer_status_code | nvbench |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod... | SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'mch') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age = (SE... | mimic_iii |
CREATE TABLE table_name_7 (
grid INTEGER,
rider VARCHAR,
laps VARCHAR,
bike VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average Grid, when Laps is less than 24, when Bike is 'Honda CBR1000RR', and when Rider is 'Jason Pridmore'?
| SELECT AVG(grid) FROM table_name_7 WHERE laps < 24 AND bike = "honda cbr1000rr" AND rider = "jason pridmore" | sql_create_context |
CREATE TABLE table_8592 (
"Track Name" text,
"Location" text,
"Length" text,
"Sanction" text,
"Program" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the length of the track located in Taylorville, Illinois?
| SELECT "Length" FROM table_8592 WHERE "Location" = 'taylorville, illinois' | wikisql |
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,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "89" AND demographic.days_stay > "34" | mimicsql_data |
CREATE TABLE table_204_277 (
id number,
"region" text,
"country" text,
"location" text,
"size (m)" text,
"payload (metric tonnes)" text,
"degrees of freedom" number,
"x horiz disp (mm)" number,
"y horiz disp (mm)" number,
"z vert disp (mm)" number,
"x horiz vel (mm/s)" number... | SELECT "size (m)" FROM table_204_277 WHERE "country" = 'algeria' | squall |
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 | nvbench |
CREATE TABLE employment (
Company_ID int,
People_ID int,
Year_working int
)
CREATE TABLE company (
Company_ID real,
Name text,
Headquarters text,
Industry text,
Sales_in_Billion real,
Profits_in_Billion real,
Assets_in_Billion real,
Market_Value_in_Billion real
)
CREATE TAB... | SELECT Industry, COUNT(Industry) FROM company GROUP BY Industry ORDER BY Industry | nvbench |
CREATE TABLE table_name_99 (
winning_driver VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won the race on 24 August?
| SELECT winning_driver FROM table_name_99 WHERE date = "24 august" | sql_create_context |
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 text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.icd9_code = "4576" | mimicsql_data |
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 ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Users.Id AS "user_link", Reputation, Location FROM Users, Badges WHERE LOWER(Users.Location) LIKE LOWER('%##CountryName##%') AND Users.Id = Badges.UserId AND Badges.Class = 2 AND Badges.TagBased = 1 AND LOWER(Badges.Name) = LOWER('##TagName##') ORDER BY Reputa... | sede |
CREATE TABLE table_15017024_2 (
college VARCHAR,
pick VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many colleges did the player picked 57 attend?
| SELECT COUNT(college) FROM table_15017024_2 WHERE pick = 57 | sql_create_context |
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,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2065" AND lab.itemid = "51516" | mimicsql_data |
CREATE TABLE Apartments (
apt_id INTEGER,
building_id INTEGER,
apt_type_code CHAR(15),
apt_number CHAR(10),
bathroom_count INTEGER,
bedroom_count INTEGER,
room_count CHAR(5)
)
CREATE TABLE View_Unit_Status (
apt_id INTEGER,
apt_booking_id INTEGER,
status_date DATETIME,
avail... | SELECT booking_end_date, COUNT(booking_end_date) FROM Apartment_Bookings GROUP BY booking_end_date ORDER BY booking_end_date | nvbench |
CREATE TABLE table_46954 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What place is Nolan Henke in?
| SELECT "Place" FROM table_46954 WHERE "Player" = 'nolan henke' | wikisql |
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, da... | atis |
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 zyjzjlb.RZBQDM, zyjzjlb.RZBQMC, zyjzjlb.RYCWH FROM zyjzjlb WHERE zyjzjlb.JZLSH = '49376399892' | css |
CREATE TABLE table_203_104 (
id number,
"athlete" text,
"nation" text,
"olympics" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many more silver medals did gillis graf... | SELECT (SELECT "silver" FROM table_203_104 WHERE "athlete" = 'gillis grafstrom') - (SELECT "silver" FROM table_203_104 WHERE "athlete" = 'sonja henie') | squall |
CREATE TABLE table_4995 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the sum of attendance of week 11
| SELECT SUM("Attendance") FROM table_4995 WHERE "Week" = '11' | wikisql |
CREATE TABLE table_name_40 (
year INTEGER,
director VARCHAR,
english_title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the submission Year of the Film The Dark Side of the Moon directed by Erik Clausen?
| SELECT SUM(year) FROM table_name_40 WHERE director = "erik clausen" AND english_title = "the dark side of the moon" | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREAT... | SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-3372') AND STRFTIME('%y', patient.unitadmittime) = '2101' | eicu |
CREATE TABLE table_7251 (
"Week #" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Song choice when Elaine Paige was the Original artist?
| SELECT "Song choice" FROM table_7251 WHERE "Original artist" = 'elaine paige' | wikisql |
CREATE TABLE media_types (
id INTEGER,
name VARCHAR(120)
)
CREATE TABLE customers (
id INTEGER,
first_name VARCHAR(40),
last_name VARCHAR(20),
company VARCHAR(80),
address VARCHAR(70),
city VARCHAR(40),
state VARCHAR(40),
country VARCHAR(40),
postal_code VARCHAR(10),
pho... | SELECT name, COUNT(name) FROM playlists GROUP BY name | nvbench |
CREATE TABLE field (
fieldid int
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
C... | SELECT DISTINCT paper.paperid FROM dataset, paper, paperdataset WHERE dataset.datasetname = 'ImageNet' AND paperdataset.datasetid = dataset.datasetid AND paper.paperid = paperdataset.paperid AND paper.year = 2014 | scholar |
CREATE TABLE table_name_15 (
week VARCHAR,
date VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In which week was the game played on October 12, 1975 and the crowd was larger than 44,043?
| SELECT COUNT(week) FROM table_name_15 WHERE date = "october 12, 1975" AND attendance > 44 OFFSET 043 | sql_create_context |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE voting_record (
stuid number,
registration_date text,
election_cycle text,
president_vote number,
vice_president_vote number... | SELECT DISTINCT T1.major FROM student AS T1 JOIN voting_record AS T2 ON T1.stuid = T2.treasurer_vote | spider |
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 Name, COUNT(Name) FROM Products WHERE Price <= 200 GROUP BY Name | nvbench |
CREATE TABLE table_name_95 (
rank INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest rank of the 2009 xbox?
| SELECT MAX(rank) FROM table_name_95 WHERE 2009 = "xbox" | sql_create_context |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '谢颖然' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 6128.49) | css |
CREATE TABLE table_name_26 (
player VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What player plays the position of small forward?
| SELECT player FROM table_name_26 WHERE position = "small forward" | sql_create_context |
CREATE TABLE table_27208814_1 (
original_airdate VARCHAR,
writer VARCHAR,
director VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the original airdate for robin mukherjee and margy kinmonth
| SELECT original_airdate FROM table_27208814_1 WHERE writer = "Robin Mukherjee" AND director = "Margy Kinmonth" | sql_create_context |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.ins... | advising |
CREATE TABLE table_name_30 (
competition VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what competition was the score reported as 12.8 (80) - 8.7 (55)?
| SELECT competition FROM table_name_30 WHERE score = "12.8 (80) - 8.7 (55)" | sql_create_context |
CREATE TABLE table_79030 (
"Shooter" text,
"Event" text,
"Rank points" text,
"Score points" text,
"Total" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- With Olympic Bronze Medalist as the total what are the score points?
| SELECT "Score points" FROM table_79030 WHERE "Total" = 'olympic bronze medalist' | wikisql |
CREATE TABLE table_74532 (
"Place" real,
"Rider" text,
"Country" text,
"Machine" text,
"Speed" text,
"Time" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which places have points larger than 10?
| SELECT MIN("Points") FROM table_74532 WHERE "Place" > '10' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text,
person_info_CSD text,
person_info_CSRQ time,
person_info_GJDM text,
person_info_GJMC text,
person_info_JGDM text,
person_info_JGMC text,
person_info_MZDM text,
person_info_MZMC text,
person_info_XBDM ... | SELECT jybgb.BBCJBW FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.person_info_XM = '韩安和' AND jybgb.BGRQ BETWEEN '2011-03-21' AND '2019-12-12... | css |
CREATE TABLE table_name_25 (
score VARCHAR,
att VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score for the matchup having attendance of 354?
| SELECT score FROM table_name_25 WHERE att = 354 | sql_create_context |
CREATE TABLE table_name_86 (
drawn INTEGER,
played VARCHAR,
diff VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the maximum number of draws when the diff is smaller than 186, points are fewer than 12 and games played fewer tha... | SELECT MAX(drawn) FROM table_name_86 WHERE diff < 186 AND points < 12 AND played < 6 | sql_create_context |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE patients (
row_id number,
subject_id num... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN... | mimic_iii |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimme... | SELECT Nationality, SUM(meter_100) FROM swimmer GROUP BY Nationality ORDER BY Nationality DESC | nvbench |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose... | SELECT AVG(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'blood in stool') AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-6 year') GROUP BY... | mimic_iii |
CREATE TABLE table_name_13 (
h_a_n VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which H/A/N has a score of 105* ?
| SELECT h_a_n FROM table_name_13 WHERE score = "105*♠" | sql_create_context |
CREATE TABLE table_27201 (
"#" real,
"Episode" text,
"Air Date" text,
"Timeslot (EST)" text,
"Rating" text,
"Share" real,
"18-49 (Rating/Share)" text,
"Viewers (m)" text,
"Weekly Rank (#)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT MAX("Share") FROM table_27201 WHERE "Episode" = 'Sins of the Father' | wikisql |
CREATE TABLE table_60599 (
"Title" text,
"Lyricist(s)" text,
"Composer(s)" text,
"Arranger(s)" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the lyricist for composer Haewon Park?
| SELECT "Lyricist(s)" FROM table_60599 WHERE "Composer(s)" = 'haewon park' | wikisql |
CREATE TABLE table_name_44 (
distance VARCHAR,
speed VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How far did the pilot go when averaging 124.1km/h?
| SELECT distance FROM table_name_44 WHERE speed = "124.1km/h" | sql_create_context |
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.Manufacturer, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter | nvbench |
CREATE TABLE table_22170 (
"Greek Designation" text,
"Collegiate Institution" text,
"Charter Date" text,
"Status" text,
"City" text,
"U.S. State/District" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how mnay greek designation in tampa
| SELECT COUNT("Greek Designation") FROM table_22170 WHERE "City" = 'Tampa' | wikisql |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
res... | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'FORT WORTH' AND ground_service.city_code = city.city_code | atis |
CREATE TABLE table_13355 (
"Heat" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Russia's time with a heat higher than 3?
| SELECT "Time" FROM table_13355 WHERE "Nationality" = 'russia' AND "Heat" > '3' | wikisql |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_... | SELECT COUNT(DISTINCT course_prerequisite.course_id), course.department, course.name, course.number FROM course, course_offering, course_prerequisite, semester WHERE course.course_id = course_offering.course_id AND course.course_id = course_prerequisite.pre_course_id AND course.department = 'EECS' AND semester.semester... | advising |
CREATE TABLE table_16086 (
"Year" real,
"Games" real,
"Games started" real,
"Completions" real,
"Attempts" real,
"Completion %" text,
"Yards" real,
"Yards/Attempt" text,
"Touchdowns" real,
"Interceptions" real,
"Rating" text
)
-- Using valid SQLite, answer the following que... | SELECT "Completions" FROM table_16086 WHERE "Games started" = '12' | wikisql |
CREATE TABLE table_13138 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the player for England when the to par is 7?
| SELECT "Player" FROM table_13138 WHERE "To par" = '7' AND "Country" = 'england' | wikisql |
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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "F" AND prescriptions.drug = "Nitroglycerin" | mimicsql_data |
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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | 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 = "Troponin T" | mimicsql_data |
CREATE TABLE table_name_40 (
earnings___$__ VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What amount of earnings does Tiger Woods have?
| SELECT earnings___$__ FROM table_name_40 WHERE player = "tiger woods" | sql_create_context |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE code_description (
code varchar,
description text
)
C... | SELECT DISTINCT COUNT(*), flight.airline_code FROM fare, fare_basis, flight, flight_fare WHERE fare_basis.class_type = 'BUSINESS' AND fare.fare_basis_code = fare_basis.fare_basis_code AND flight_fare.fare_id = fare.fare_id AND flight.flight_id = flight_fare.flight_id GROUP BY flight.airline_code | atis |
CREATE TABLE table_11674683_2 (
average VARCHAR,
delegate VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the average for spain delegate
| SELECT average FROM table_11674683_2 WHERE delegate = "Spain" | sql_create_context |
CREATE TABLE Customers (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many customers do we have?
| SELECT COUNT(*) FROM Customers | sql_create_context |
CREATE TABLE table_1425958_1 (
name VARCHAR,
_percentage_change VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where was there a change of 6.5%?
| SELECT name FROM table_1425958_1 WHERE _percentage_change = "6.5" | sql_create_context |
CREATE TABLE Skills (
skill_id INTEGER,
skill_code VARCHAR(20),
skill_description VARCHAR(255)
)
CREATE TABLE Maintenance_Engineers (
engineer_id INTEGER,
company_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
other_details VARCHAR(255)
)
CREATE TABLE Skills_Required_To_Fix... | SELECT skill_description, COUNT(skill_description) FROM Maintenance_Engineers AS T1 JOIN Engineer_Skills AS T2 ON T1.engineer_id = T2.engineer_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY other_details, skill_description | nvbench |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Na... | SELECT p.Id, Score, Title, 'http://movies.stackexchange.com/questions/' + CAST(p.Id AS TEXT(10)) AS link, CreationDate FROM Posts AS p WHERE DeletionDate IS NULL AND ClosedDate IS NULL AND Tags LIKE '%identify%' AND AcceptedAnswerId IS NULL AND Score > 2 ORDER BY Score DESC | sede |
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 microlab (
microl... | SELECT COUNT(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-1337')) AND microlab.culturesite = 'urine, catheter specimen' AND DATETIME(mic... | eicu |
CREATE TABLE table_name_88 (
deputy VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the Deputy when the Name was elizabeth black?
| SELECT deputy FROM table_name_88 WHERE name = "elizabeth black" | sql_create_context |
CREATE TABLE AssignedTo (
Scientist int,
Project char(4)
)
CREATE TABLE Projects (
Code Char(4),
Name Char(50),
Hours int
)
CREATE TABLE Scientists (
SSN int,
Name Char(30)
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what are the names of pr... | SELECT Name, COUNT(*) FROM Projects AS T1 JOIN AssignedTo AS T2 ON T1.Code = T2.Project WHERE T1.Hours > 300 GROUP BY T1.Name ORDER BY COUNT(*) | nvbench |
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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.diagnosis = "ANGIOEDEMA" | mimicsql_data |
CREATE TABLE table_8525 (
"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 lowest grid for Roberto Rolfo with more than 26 laps?
| SELECT MIN("Grid") FROM table_8525 WHERE "Rider" = 'roberto rolfo' AND "Laps" > '26' | wikisql |
CREATE TABLE table_57977 (
"Team" text,
"Games Played" real,
"Wins" real,
"Losses" real,
"Ties" real,
"Goals For" real,
"Goals Against" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total wins with less than 21 goals taken?
| SELECT SUM("Wins") FROM table_57977 WHERE "Goals Against" < '21' | wikisql |
CREATE TABLE table_18786 (
"City of license/Market" text,
"Station" text,
"Channel TV ( DT )" text,
"Years owned" text,
"Current Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which station has a license in Fort Collins, Colorado?
| SELECT "Station" FROM table_18786 WHERE "City of license/Market" = 'Fort Collins, Colorado' | wikisql |
CREATE TABLE table_2353 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Boilermakers points" real,
"Opponents" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What game number had a record of 3-1?
| SELECT "Game" FROM table_2353 WHERE "Record" = '3-1' | wikisql |
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 DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id | advising |
CREATE TABLE table_name_63 (
result VARCHAR,
award VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result for the Bafta Tv award?
| SELECT result FROM table_name_63 WHERE award = "bafta tv award" | sql_create_context |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | SELECT jybgb.BGRGH, jybgb.BGRXM FROM jybgb WHERE jybgb.BGDH = '74581993759' | css |
CREATE TABLE item (
i_id number,
title text
)
CREATE TABLE trust (
source_u_id number,
target_u_id number,
trust number
)
CREATE TABLE review (
a_id number,
u_id number,
i_id number,
rating number,
rank number
)
CREATE TABLE useracct (
u_id number,
name text
)
-- Usi... | SELECT T1.name, AVG(T2.rating) FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id GROUP BY T2.u_id | spider |
CREATE TABLE table_name_65 (
elmers_end VARCHAR,
bingham_road VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Elmers End with a 09:54 Bingham Road?
| SELECT elmers_end FROM table_name_65 WHERE bingham_road = "09:54" | sql_create_context |
CREATE TABLE table_29899 (
"Game" real,
"Date" text,
"Team" 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.
-- What i... | SELECT "Date" FROM table_29899 WHERE "High points" = 'LaMarcus Aldridge (36)' | wikisql |
CREATE TABLE table_name_79 (
score VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score of the match on July 29, 1990?
| SELECT score FROM table_name_79 WHERE date = "july 29, 1990" | sql_create_context |
CREATE TABLE table_1147705_1 (
engine_type VARCHAR,
model VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many have are model 2.4 awd?
| SELECT COUNT(engine_type) FROM table_1147705_1 WHERE model = "2.4 AWD" | sql_create_context |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description... | SELECT 'Hello' | sede |
CREATE TABLE table_54281 (
"IWCR No." text,
"Name" text,
"Wheel arrangement" text,
"SR No." text,
"Year made" real,
"Year withdrawn" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which SR number had a wheel arrangement of 0-6-0t, the year made ... | SELECT "SR No." FROM table_54281 WHERE "Wheel arrangement" = '0-6-0t' AND "Year made" > '1874' AND "Year withdrawn" = '1963' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.