instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE Products (
Product_ID VARCHAR(100),
Product_Name VARCHAR(255),
Product_Price DECIMAL(20,4),
Product_Description VARCHAR(255),
Other_Product_Service_Details VARCHAR(255)
)
CREATE TABLE Drama_Workshop_Groups (
Workshop_Group_ID INTEGER,
Address_ID INTEGER,
Currency_Code CHAR(... | SELECT Planned_Delivery_Date, COUNT(Planned_Delivery_Date) FROM Bookings ORDER BY Planned_Delivery_Date DESC | nvbench |
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 procedures (
... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.diagnosis = "ST-SEGMENT ELEVATION MYOCARDIAL INFARCTION\CARDIAC CATH" | mimicsql_data |
CREATE TABLE TOURIST_ATTRACTIONS (
Name VARCHAR,
How_to_Get_There VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the names of the tourist attractions that can be accessed by bus?
| SELECT Name FROM TOURIST_ATTRACTIONS WHERE How_to_Get_There = "bus" | sql_create_context |
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),
gender_mf VARCHAR(1),
address_line_1 VARCHAR(80)
)
CREATE TABLE Subject... | SELECT login_name, gender_mf FROM Course_Authors_and_Tutors ORDER BY personal_name | nvbench |
CREATE TABLE table_48059 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the round number when the record is 15 7 1?... | SELECT COUNT("Round") FROM table_48059 WHERE "Record" = '15–7–1' | wikisql |
CREATE TABLE table_name_8 (
result VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When David E. Finley was the incumbent what was the result?
| SELECT result FROM table_name_8 WHERE incumbent = "david e. finley" | sql_create_context |
CREATE TABLE table_65493 (
"Name" text,
"Position" text,
"League Apps" text,
"League Goals" real,
"FA Cup Apps" text,
"FA Cup Goals" real,
"League Cup Apps" real,
"League Cup Goals" real,
"Total Apps" text,
"Total Goals" real
)
-- Using valid SQLite, answer the following questi... | SELECT SUM("League Goals") FROM table_65493 WHERE "FA Cup Goals" > '0' | 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 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.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.age < "81" | mimicsql_data |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeri... | SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-11006')) ORDER BY treatment.treatmenttime LIMIT 1 | eicu |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number... | 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_name_59 (
surface VARCHAR,
opponent VARCHAR,
event VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Surface has an Opponent of rafael nadal, and an Event of 2?
| SELECT surface FROM table_name_59 WHERE opponent = "rafael nadal" AND NOT event = 2 | sql_create_context |
CREATE TABLE table_name_18 (
seats_in_hamburgische_bürgerschaft VARCHAR,
abbr VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE TOTAL NUMBER OF SEATS IN Hamburgische B rgerschaft WITH AN ABBR OF b ndnis 90 / die gr nen (gal)?
| SELECT COUNT(seats_in_hamburgische_bürgerschaft) FROM table_name_18 WHERE abbr = "bündnis 90 / die grünen (gal)" | sql_create_context |
CREATE TABLE table_1013129_8 (
nhl_team VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the NHL team that has Peter Strom?
| SELECT nhl_team FROM table_1013129_8 WHERE player = "Peter Strom" | sql_create_context |
CREATE TABLE table_name_42 (
home_team VARCHAR,
crowd INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which home team has a crowd larger than 25,000?
| SELECT home_team FROM table_name_42 WHERE crowd > 25 OFFSET 000 | sql_create_context |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswer... | SELECT Id, AcceptedAnswerId, ViewCount, Tags FROM Posts WHERE ViewCount > 10000 | sede |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
... | SELECT a.Id AS "post_link", a.CreationDate, CASE WHEN q.AcceptedAnswerId = a.Id THEN ' ' ELSE '' END AS Accepted, a.Score AS "answer_score" FROM Posts AS a INNER JOIN Posts AS q ON a.ParentId = q.Id WHERE a.OwnerUserId = '##AnswererId##' AND q.OwnerUserId = '##AskerId##' ORDER BY a.CreationDate DESC | sede |
CREATE TABLE table_34321 (
"Date" text,
"Episode" real,
"Performer 1" text,
"Performer 2" text,
"Performer 3" text,
"Performer 4" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of the episode numbers where chip esten is the 4th p... | SELECT SUM("Episode") FROM table_34321 WHERE "Performer 4" = 'chip esten' AND "Performer 2" = 'christopher smith' | wikisql |
CREATE TABLE table_62436 (
"Model" text,
"EIS -Final Prod. Year" text,
"# Eng." real,
"Maximum Metric MTOW" text,
"Outside Diameter, main passenger deck" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is # Eng., when Outside Diameter, Main Pass... | SELECT "# Eng." FROM table_62436 WHERE "Outside Diameter, main passenger deck" = 'inches (m)' AND "Maximum Metric MTOW" = '231.3 tons' | wikisql |
CREATE TABLE table_18914438_1 (
career VARCHAR,
matches VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the career duration of the bowler who played 60 matches?
| SELECT career FROM table_18914438_1 WHERE matches = 60 | sql_create_context |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId numb... | SELECT DATEADD(week, DATEDIFF(week, '2000-01-01 00:00:00', sampledate), '2000-01-01 00:00:00') AS sampleweek, MAX(queuesize) AS maxqueuesize, MIN(queuesize) AS minqueuesize FROM (SELECT ref.CreationDate AS sampledate, COUNT(*) AS queuesize FROM SuggestedEdits AS ref INNER JOIN SuggestedEdits AS s ON (s.CreationDate <= ... | sede |
CREATE TABLE table_1843 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provided abo... | SELECT "Directed by" FROM table_1843 WHERE "U.S. viewers (million)" = '3.93' | wikisql |
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 MAX(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-157753')) AND lab.labname = '-bands' AND STRFTIME('%y', lab.labresulttime) >= ... | eicu |
CREATE TABLE table_28244 (
"Metropolitan ring" text,
"Localities" real,
"Total" real,
"Jews and others 1" real,
"Thereof: Jews" real,
"Arabs" real,
"Population density (per km\u00b2)" text,
"Annual Population growth rate" text
)
-- Using valid SQLite, answer the following questions for... | SELECT MIN("Arabs") FROM table_28244 WHERE "Metropolitan ring" = 'Inner Ring 3' | wikisql |
CREATE TABLE table_69126 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of Money of the game that was played in the United States with Sam ... | SELECT SUM("Money ( $ )") FROM table_69126 WHERE "Country" = 'united states' AND "Player" = 'sam snead' | wikisql |
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE trip (
id INTEGER,
d... | SELECT date, COUNT(date) FROM weather WHERE zip_code = 94107 AND events <> "Fog" AND events <> "Rain" ORDER BY COUNT(date) | nvbench |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT AVG(t_kc21.MED_AMOUT) FROM t_kc21 WHERE t_kc21.MED_ORG_DEPT_CD = '662' AND t_kc21.IN_HOSP_DATE BETWEEN '2000-12-01' AND '2002-09-23' AND t_kc21.IN_DIAG_DIS_NM = '煤尘肺(炭末肺)' AND t_kc21.CLINIC_TYPE = '住院' | css |
CREATE TABLE table_24190 (
"Season" real,
"Season premiere" text,
"Season finale" text,
"TV Season" text,
"Rank" text,
"Viewers (in millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the rank that premiered september 25, 2001
| SELECT "Rank" FROM table_24190 WHERE "Season premiere" = 'September 25, 2001' | wikisql |
CREATE TABLE table_name_93 (
mintage INTEGER,
artist VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the fewest mintage from Dora de P dery-Hunt, and the year was before 2002?
| SELECT MIN(mintage) FROM table_name_93 WHERE artist = "dora de pédery-hunt" AND year < 2002 | 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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.diagnosis = "BLADDER CANCER/SDA" | mimicsql_data |
CREATE TABLE table_name_3 (
wheel_arrangement VARCHAR,
year_made VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which wheel arrangement made in year 1900?
| SELECT wheel_arrangement FROM table_name_3 WHERE year_made = "1900" | sql_create_context |
CREATE TABLE table_76856 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What i... | SELECT "Team" FROM table_76856 WHERE "High assists" = 'rashard lewis (4)' | wikisql |
CREATE TABLE table_name_64 (
tournament VARCHAR,
surface VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Tournament on May 24, 1992 played on a Clay Surface?
| SELECT tournament FROM table_name_64 WHERE surface = "clay" AND date = "may 24, 1992" | sql_create_context |
CREATE TABLE table_62250 (
"Year" text,
"Channel" text,
"Play-by-play" text,
"Color commentator(s)" text,
"Studio host" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was the play-by-play for Don Earle?
| SELECT "Year" FROM table_62250 WHERE "Play-by-play" = 'don earle' | wikisql |
CREATE TABLE table_name_23 (
week_1 VARCHAR,
week_3 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the girl on week 1 that was previous to week 3's Ava Hart?
| SELECT week_1 FROM table_name_23 WHERE week_3 = "ava hart" | sql_create_context |
CREATE TABLE table_1341604_11 (
party VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the party for jack thomas brinkley
| SELECT party FROM table_1341604_11 WHERE incumbent = "Jack Thomas Brinkley" | sql_create_context |
CREATE TABLE table_name_19 (
score VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score at game 31?
| SELECT score FROM table_name_19 WHERE game = 31 | 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 DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0 INNER JOIN course_prerequisite ON COURSE_0.course_id = course_prerequisite.pre_course_id INNER JOIN course AS COURSE_1 ON COURSE_1.course_id = course_prerequisite.course_id INNER JOIN course_offering ON COURSE_1.course_id = cour... | advising |
CREATE TABLE table_11206787_5 (
highest INTEGER,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest of ayr united?
| SELECT MIN(highest) FROM table_11206787_5 WHERE team = "Ayr United" | sql_create_context |
CREATE TABLE table_36010 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Gold medals for the country with a Rank of 1 and less than 2 Total medals?
| SELECT COUNT("Gold") FROM table_36010 WHERE "Rank" = '1' AND "Total" < '2' | wikisql |
CREATE TABLE table_71050 (
"Date" text,
"City" text,
"Event" text,
"Winner" text,
"Prize" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the Winner for the City of Loutraki?
| SELECT "Winner" FROM table_71050 WHERE "City" = 'loutraki' | wikisql |
CREATE TABLE table_54549 (
"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.
-- Which team has an away score of 15.9 (99)?
| SELECT "Away team" FROM table_54549 WHERE "Away team score" = '15.9 (99)' | wikisql |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '马晓霜' AND t_kc22.STA_DATE BETWEEN '2008-06-08' AND '2015-03-26' AND t_kc21.MED_SER_ORG_NO = '4875012' AND t_kc22.MED_INV_ITEM... | css |
CREATE TABLE table_name_83 (
draw INTEGER,
english_translation VARCHAR,
points VARCHAR,
place VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest draw number when there are more than 31 points, a rank greater than 6, and the English tr... | SELECT MAX(draw) FROM table_name_83 WHERE points > 31 AND place > 6 AND english_translation = "listen to me" | sql_create_context |
CREATE TABLE school_bus (
School_ID int,
Driver_ID int,
Years_Working int,
If_full_time bool
)
CREATE TABLE driver (
Driver_ID int,
Name text,
Party text,
Home_city text,
Age int
)
CREATE TABLE school (
School_ID int,
Grade text,
School text,
Location text,
Type... | SELECT Home_city, AVG(Age) FROM driver GROUP BY Home_city ORDER BY AVG(Age) | nvbench |
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 d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT diagnoses_icd.icd9_code FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83709 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime D... | mimic_iii |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date... | SELECT COUNT(Id) FROM Users | sede |
CREATE TABLE table_53332 (
"Player" text,
"Height" text,
"School" text,
"Hometown" text,
"College" text,
"NBA Draft" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the college for Alex Poythress?
| SELECT "College" FROM table_53332 WHERE "Player" = 'alex poythress' | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Hypospadias" AND lab.flag = "delta" | mimicsql_data |
CREATE TABLE guests (
guest_id number,
gender_code text,
guest_first_name text,
guest_last_name text,
date_of_birth time
)
CREATE TABLE apartment_facilities (
apt_id number,
facility_code text
)
CREATE TABLE apartment_buildings (
building_id number,
building_short_name text,
bu... | SELECT T2.apt_number FROM apartment_bookings AS T1 JOIN apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = "Confirmed" INTERSECT SELECT T2.apt_number FROM apartment_bookings AS T1 JOIN apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = "Provisional" | spider |
CREATE TABLE journal (
Journal_ID int,
Date text,
Theme text,
Sales int
)
CREATE TABLE journal_committee (
Editor_ID int,
Journal_ID int,
Work_Type text
)
CREATE TABLE editor (
Editor_ID int,
Name text,
Age real
)
-- Using valid SQLite, answer the following questions for the ... | SELECT Name, Age FROM editor ORDER BY Name DESC | nvbench |
CREATE TABLE people (
People_ID int,
Name text,
Age real,
Height real,
Hometown text
)
CREATE TABLE gymnast (
Gymnast_ID int,
Floor_Exercise_Points real,
Pommel_Horse_Points real,
Rings_Points real,
Vault_Points real,
Parallel_Bars_Points real,
Horizontal_Bar_Points real... | SELECT Hometown, COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_28064 (
"Player" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many extra points did Stanfield Wells make?
| SELECT COUNT("Extra points") FROM table_28064 WHERE "Player" = 'Stanfield Wells' | wikisql |
CREATE TABLE table_name_60 (
points VARCHAR,
goals_for VARCHAR,
wins VARCHAR,
club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of points of palam s cf, which has less than 21 wins and less than 40 goals?
| SELECT COUNT(points) FROM table_name_60 WHERE wins < 21 AND club = "palamós cf" AND goals_for < 40 | sql_create_context |
CREATE TABLE table_name_86 (
pick INTEGER,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest Pick, when Player is 'Todd Van Poppel'?
| SELECT MAX(pick) FROM table_name_86 WHERE player = "todd van poppel" | sql_create_context |
CREATE TABLE table_name_22 (
alvin_greene__d_ VARCHAR,
other VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the vote for Alvin Green when other was 9%?
| SELECT alvin_greene__d_ FROM table_name_22 WHERE other = "9%" | sql_create_context |
CREATE TABLE table_36518 (
"Result" text,
"Opponent" text,
"Method" text,
"Event" text,
"Date" text,
"Round" text,
"Time" text,
"Location" text,
"Rules" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where has a Rules of thai boxing,... | SELECT "Location" FROM table_36518 WHERE "Rules" = 'thai boxing' AND "Round" = 'n/a' AND "Opponent" = 'everton crawford' | wikisql |
CREATE TABLE table_name_9 (
majority VARCHAR,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many in the majority when Dan Sullivan won?
| SELECT COUNT(majority) FROM table_name_9 WHERE winner = "dan sullivan" | 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 prescription... | SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73713 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'phosphate') ORDER BY labevents.charttim... | mimic_iii |
CREATE TABLE table_40172 (
"Candidate" text,
"Votes" real,
"Percentage" text,
"Counties" real,
"Delegates" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of Counties when there were 701,761 votes and less than 57 delegates?
| SELECT SUM("Counties") FROM table_40172 WHERE "Votes" = '701,761' AND "Delegates" < '57' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
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,
... | SELECT COUNT(*) FROM mzjzjlb WHERE JZKSMC = '小儿心血管外科' AND JZKSRQ BETWEEN '2002-07-14' AND '2006-12-26' | css |
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 lab.label = "Prolactin" | mimicsql_data |
CREATE TABLE table_name_89 (
event VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What event had the opponent Ryan Bow?
| SELECT event FROM table_name_89 WHERE opponent = "ryan bow" | sql_create_context |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD ... | SELECT MIN(t_kc24.MED_AMOUT), MAX(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 = '0641138' AND t_kc21.OUT_DIAG_DIS_CD = 'N99.229') | css |
CREATE TABLE table_4759 (
"Couple" text,
"Score" text,
"Dance" text,
"Music" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the music of the team that was eliminated?
| SELECT "Music" FROM table_4759 WHERE "Result" = 'eliminated' | wikisql |
CREATE TABLE table_name_74 (
power__kw_ VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the power (kW) of Davao?
| SELECT power__kw_ FROM table_name_74 WHERE location = "davao" | sql_create_context |
CREATE TABLE table_name_86 (
score VARCHAR,
champion VARCHAR,
stadium VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score when the Vikings won the championship at Namyangju Stadium?
| SELECT score FROM table_name_86 WHERE champion = "vikings" AND stadium = "namyangju stadium" | sql_create_context |
CREATE TABLE table_name_29 (
margin_of_victory VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is south africa's margin of victory?
| SELECT margin_of_victory FROM table_name_29 WHERE country = "south africa" | sql_create_context |
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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
... | SELECT SALARY, MANAGER_ID FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE table_57518 (
"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.
-- What is the tie number when the away team is Lewes?
| SELECT "Tie no" FROM table_57518 WHERE "Away team" = 'lewes' | wikisql |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE ReviewTasks (
Id num... | SELECT Users.Id, DisplayName, Reputation, COUNT(Posts.Id) AS Answers, AVG(LN(0.5 * (((CAST(Score AS FLOAT) + 1.0) + 1.0) + ABS((CAST(Score AS FLOAT) + 1.0) - 1.0)))) * COUNT(Score) / (COUNT(Score) + 5) AS LogAverageAnswerScore FROM Posts INNER JOIN Users ON Users.Id = OwnerUserId WHERE PostTypeId = 2 GROUP BY Users.Id,... | sede |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '82617822' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED... | css |
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE field (
fieldid int... | SELECT DISTINCT COUNT(1) FROM author AS AUTHOR_0, author AS AUTHOR_1, writes AS WRITES_0, writes AS WRITES_1 WHERE AUTHOR_0.authorname = 'Ioannis Konstas' AND AUTHOR_1.authorname = 'Mirella Lapata' AND WRITES_0.authorid = AUTHOR_0.authorid AND WRITES_1.authorid = AUTHOR_1.authorid AND WRITES_1.paperid = WRITES_0.paperi... | scholar |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '蒋红叶' AND MED_SER_ORG_NO = '3289603' AND NOT OUT_DIAG_DIS_NM LIKE '%2%' | css |
CREATE TABLE table_name_23 (
transfer_fee VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the transfer fee for rory loy?
| SELECT transfer_fee FROM table_name_23 WHERE name = "rory loy" | sql_create_context |
CREATE TABLE table_name_84 (
score VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score when they had a 25-41-9 record?
| SELECT score FROM table_name_84 WHERE record = "25-41-9" | sql_create_context |
CREATE TABLE table_name_25 (
label VARCHAR,
date VARCHAR,
region VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Label of the September 19, 2008 release in Germany?
| SELECT label FROM table_name_25 WHERE date = "september 19, 2008" AND region = "germany" | 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 COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '03719303' AND t_kc22.STA_DATE BETWEEN '2000-12-03' AND '2020-11-15' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE table_24938621_3 (
production_code VARCHAR,
directed_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the title of the episode directed by Jesse Warn?
| SELECT production_code FROM table_24938621_3 WHERE directed_by = "Jesse Warn" | sql_create_context |
CREATE TABLE table_name_9 (
run_1 VARCHAR,
run_3 VARCHAR,
run_4 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the run 1 for the team with a run 3 of 1:21.4 and a run 4 of 1:23.0?
| SELECT run_1 FROM table_name_9 WHERE run_3 = "1:21.4" AND run_4 = "1:23.0" | sql_create_context |
CREATE TABLE table_train_229 (
"id" int,
"hemoglobin_a1c_hba1c" float,
"active_metabolic" bool,
"body_weight" float,
"hba1c" float,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- hba1c between 7 and 9 %
| SELECT * FROM table_train_229 WHERE hba1c >= 7 AND hemoglobin_a1c_hba1c <= 9 | criteria2sql |
CREATE TABLE table_name_15 (
surface VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what surface was the opponent Michael Berrer?
| SELECT surface FROM table_name_15 WHERE opponent = "michael berrer" | sql_create_context |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
... | SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 <= 5 | mimic_iii |
CREATE TABLE table_204_195 (
id number,
"team" text,
"home city" text,
"stadium" text,
"capacity" number,
"last season" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what amount of people , at most , can begin arena hold ?
| SELECT "capacity" FROM table_204_195 WHERE "stadium" = 'begin arena' | squall |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,... | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '008-24610')) AND lab.labname = 'platelets x 1000' AND DATETIME(lab.labresulttime, '... | eicu |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE out... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT diagnoses_icd.icd9_code FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19412) AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '... | mimic_iii |
CREATE TABLE table_11452830_2 (
game_site VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where was the game played when the team's record was 1-3?
| SELECT game_site FROM table_11452830_2 WHERE record = "1-3" | sql_create_context |
CREATE TABLE table_64642 (
"Name" text,
"Nickname" text,
"Location" text,
"Home ground(s)" text,
"Coach" text,
"Captain" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the Nickname listed for the Name of University Cricket Club?
| SELECT "Nickname" FROM table_64642 WHERE "Name" = 'university cricket club' | wikisql |
CREATE TABLE table_38326 (
"Event" text,
"Round" text,
"Result" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Round of first had what opponent?
| SELECT "Opponent" FROM table_38326 WHERE "Round" = 'first' | wikisql |
CREATE TABLE table_9794 (
"Actor" text,
"Role" text,
"Status" text,
"Number Of Episodes" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Number Of Episodes, when Status is '2001 - 2003, 2005 - 2009'?
| SELECT "Number Of Episodes" FROM table_9794 WHERE "Status" = '2001 - 2003, 2005 - 2009' | wikisql |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Name DESC | nvbench |
CREATE TABLE table_name_37 (
chassis VARCHAR,
year VARCHAR,
points VARCHAR,
entrant VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Chassis has more than 0 points, an Entrant of Scuderia Ferrari, and was later than 1952?
| SELECT chassis FROM table_name_37 WHERE points > 0 AND entrant = "scuderia ferrari" AND year > 1952 | sql_create_context |
CREATE TABLE table_15808 (
"Name" text,
"Starting Point" text,
"Terminus" text,
"Operates" text,
"Direction" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the starting point of the route that has its terminus at Ecat/Rosa Park Transit Cente... | SELECT "Starting Point" FROM table_15808 WHERE "Terminus" = 'ecat/rosa park transit center' | wikisql |
CREATE TABLE table_name_15 (
time VARCHAR,
event VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Time has an Event of call to arms i?
| SELECT time FROM table_name_15 WHERE event = "call to arms i" | sql_create_context |
CREATE TABLE table_68104 (
"Election" text,
"1st Member" text,
"1st Party" text,
"2nd Member" text,
"2nd Party" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the election year with henry wyndham as 2nd member and walter barttelot as 1st?
| SELECT "Election" FROM table_68104 WHERE "2nd Member" = 'henry wyndham' AND "1st Member" = 'walter barttelot' | wikisql |
CREATE TABLE table_27918 (
"meas. num" real,
"passed" text,
"YES votes" real,
"NO votes" real,
"% YES" text,
"Const. Amd.?" text,
"type" text,
"description" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the largest number of yes... | SELECT MAX("YES votes") FROM table_27918 WHERE "NO votes" = '61307' | wikisql |
CREATE TABLE table_10018 (
"Rank" text,
"Team" text,
"Athletes" text,
"Run 1" text,
"Run 2" text,
"Run 3" text,
"Run 4" text,
"Final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Run 1, when Team is 'Italy (ITA) Italy I'?
| SELECT "Run 1" FROM table_10018 WHERE "Team" = 'italy (ita) italy i' | wikisql |
CREATE TABLE table_1672976_6 (
winner VARCHAR,
challenge_leader VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won the game where the Challenge Leader is ACC (2-1)?
| SELECT winner FROM table_1672976_6 WHERE challenge_leader = "ACC (2-1)" | sql_create_context |
CREATE TABLE table_name_11 (
wins INTEGER,
against VARCHAR,
losses VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the average Wins that has the Against of 1132, and the Losses smaller than 7?
| SELECT AVG(wins) FROM table_name_11 WHERE against = 1132 AND losses < 7 | sql_create_context |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
... | SELECT (SELECT 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 = 28443) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_i... | mimic_iii |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-16572')) AND intakeoutput.cellpath LIKE '%intake%' AND D... | eicu |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.