instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_94 (
finish VARCHAR,
player VARCHAR,
total VARCHAR,
to_par VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what place did Nick Faldo, who had more than 284 points and a to par score of +5, finish?
| SELECT finish FROM table_name_94 WHERE total > 284 AND to_par = "+5" AND player = "nick faldo" | sql_create_context |
CREATE TABLE candidate (
Candidate_ID VARCHAR,
oppose_rate VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the id of the candidate who got the lowest oppose rate.
| SELECT Candidate_ID FROM candidate ORDER BY oppose_rate LIMIT 1 | sql_create_context |
CREATE TABLE Part_Faults (
part_fault_id INTEGER,
part_id INTEGER,
fault_short_name VARCHAR(20),
fault_description VARCHAR(255),
other_fault_details VARCHAR(255)
)
CREATE TABLE Staff (
staff_id INTEGER,
staff_name VARCHAR(255),
gender VARCHAR(1),
other_staff_details VARCHAR(255)
)
... | SELECT fault_short_name, COUNT(fault_short_name) FROM Part_Faults AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.part_fault_id = T2.part_fault_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY skill_description, fault_short_name ORDER BY fault_short_name | nvbench |
CREATE TABLE table_180802_3 (
transcription VARCHAR,
sanskrit_word VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the transcription of the sanskrit word chandra?
| SELECT transcription FROM table_180802_3 WHERE sanskrit_word = "Chandra" | sql_create_context |
CREATE TABLE table_11916083_1 (
mintage__bu_ VARCHAR,
_clarification_needed_ VARCHAR,
artist VARCHAR,
issue_price__proof_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the mintage (bu) with the artist Royal Canadian Mint Staff and has an iss... | SELECT mintage__bu_ AS "_clarification_needed_" FROM table_11916083_1 WHERE artist = "Royal Canadian Mint Staff" AND issue_price__proof_ = "$54.95" | sql_create_context |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM tex... | SELECT * FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i... | css |
CREATE TABLE weather (
date TEXT,
max_temperature_f INTEGER,
mean_temperature_f INTEGER,
min_temperature_f INTEGER,
max_dew_point_f INTEGER,
mean_dew_point_f INTEGER,
min_dew_point_f INTEGER,
max_humidity INTEGER,
mean_humidity INTEGER,
min_humidity INTEGER,
max_sea_level_pre... | SELECT date, COUNT(date) FROM weather ORDER BY COUNT(date) DESC | nvbench |
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(UniqueId), WeekStart FROM (SELECT Posts.Id AS UniqueId, DATEADD(week, DATEDIFF(day, '20000109', CreationDate) / 7, '20000109') AS WeekStart FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.Id = PostTags.PostId WHERE Tags.TagName = @Tag AND (Posts.Body LIKE @Searchstring O... | sede |
CREATE TABLE table_name_52 (
tie_no VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the tie number that has Portsmouth Home team
| SELECT tie_no FROM table_name_52 WHERE home_team = "portsmouth" | sql_create_context |
CREATE TABLE table_60415 (
"Knight" text,
"Weapon/item" text,
"External weapon" text,
"Shield animal" text,
"Cart" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What cart has a serpent shield animal?
| SELECT "Cart" FROM table_60415 WHERE "Shield animal" = 'serpent' | wikisql |
CREATE TABLE table_13476 (
"Class" text,
"Wheel arrangement" text,
"Fleet number(s)" text,
"Manufacturer" text,
"Serial numbers" text,
"Year made" text,
"Quantity made" text,
"Quantity preserved" text
)
-- Using valid SQLite, answer the following questions for the tables provided above... | SELECT "Quantity made" FROM table_13476 WHERE "Quantity preserved" = '4-6-0 — ooooo — ten-wheeler' | wikisql |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insuranc... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE STRFTIME('%y', procedures_icd.charttime) = '2100' GROUP BY procedures_icd.icd9_code) AS t1 ... | mimic_iii |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
h... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 191... | mimic_iii |
CREATE TABLE table_name_92 (
award VARCHAR,
role VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which award was given for the role of Elphaba in 2009?
| SELECT award FROM table_name_92 WHERE role = "elphaba" AND year = "2009" | sql_create_context |
CREATE TABLE table_76719 (
"Newspaper/Magazine" text,
"Type" text,
"Language" text,
"Headquarter" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Headquarter, when Newspaper/Magazine is Al-Ayyam?
| SELECT "Headquarter" FROM table_76719 WHERE "Newspaper/Magazine" = 'al-ayyam' | wikisql |
CREATE TABLE table_58653 (
"Date" text,
"Time" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Total" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Score when the set 3 is 26 28?
| SELECT "Score" FROM table_58653 WHERE "Set 3" = '26–28' | 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 PostNoticeTypes (
Id... | SELECT CreationDate, Id AS "post_link" FROM Posts AS p WHERE OwnerDisplayName = '##Name:string##' ORDER BY CreationDate | sede |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiolo... | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 51577 AND STRFTIME('%y', admissions.admittime) <= '2104' | mimic_iii |
CREATE TABLE table_name_8 (
drawn INTEGER,
played INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the largest drawn that has a played less than 38?
| SELECT MAX(drawn) FROM table_name_8 WHERE played < 38 | sql_create_context |
CREATE TABLE table_25180 (
"Conference" text,
"Regular Season Winner" text,
"Conference Player of the Year" text,
"Conference Tournament" text,
"Tournament Venue (City)" text,
"Tournament Winner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Ho... | SELECT COUNT("Tournament Venue (City)") FROM table_25180 WHERE "Tournament Winner" = 'Temple' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "NEWBORN" AND demographic.dod_year <= "2112.0" | mimicsql_data |
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 MIN(MED_AMOUT), MAX(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE MED_SER_ORG_NO = '6439728' AND IN_DIAG_DIS_NM = '颅脑外伤所致的精神障碍') | css |
CREATE TABLE table_61292 (
"Week 1" text,
"Week 2" text,
"Week 3" text,
"Week 4" text,
"Week 5" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is week 1 if week 3 is Natasha Budhi?
| SELECT "Week 1" FROM table_61292 WHERE "Week 3" = 'natasha budhi' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
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 t... | SELECT * FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '67921466' AND hz_info.YLJGDM = '0629805' AND zyjzjlb.CYKSMC LIKE '%化疗%' | css |
CREATE TABLE table_49891 (
"Round" real,
"Pick #" real,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What college was the draft pick from who plays center position?
| SELECT "College" FROM table_49891 WHERE "Position" = 'center' | wikisql |
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.
-- Visualize a bar chart fo... | SELECT Name, COUNT(*) FROM Projects AS T1 JOIN AssignedTo AS T2 ON T1.Code = T2.Project GROUP BY T1.Name | nvbench |
CREATE TABLE table_name_59 (
pick__number INTEGER,
college VARCHAR,
overall VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Picks have a College of tennessee, and an Overall smaller than 270?
| SELECT SUM(pick__number) FROM table_name_59 WHERE college = "tennessee" AND overall < 270 | sql_create_context |
CREATE TABLE table_name_28 (
pole_position VARCHAR,
race VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Pole Position of the Brazilian Grand Prix race?
| SELECT pole_position FROM table_name_28 WHERE race = "brazilian grand prix" | sql_create_context |
CREATE TABLE table_9451 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Home Team, when Date is 18 February 1956, and when Tie No is 3?
| SELECT "Home team" FROM table_9451 WHERE "Date" = '18 february 1956' AND "Tie no" = '3' | wikisql |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous... | SELECT Posts.Id AS "post_link" FROM Posts INNER JOIN PostTags ON PostTags.PostId = Posts.Id INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE Tags.TagName = '##Tag:string##' AND Posts.CreationDate > DATEADD(year, -1, GETDATE()) | sede |
CREATE TABLE table_7899 (
"Week" real,
"Date" text,
"TV Time" text,
"Opponent" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many weeks has the opponent been san francisco 49ers?
| SELECT COUNT("Week") FROM table_7899 WHERE "Opponent" = 'san francisco 49ers' | wikisql |
CREATE TABLE table_name_20 (
date_of_birth__age_ VARCHAR,
position VARCHAR,
caps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the lock with 10 caps born?
| SELECT date_of_birth__age_ FROM table_name_20 WHERE position = "lock" AND caps = 10 | sql_create_context |
CREATE TABLE table_62553 (
"Year" real,
"Milan \u2013 San Remo" text,
"Tour of Flanders" text,
"Paris\u2013Roubaix" text,
"Li\u00e8ge\u2013Bastogne\u2013Li\u00e8ge" text,
"Giro di Lombardia" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which G... | SELECT "Giro di Lombardia" FROM table_62553 WHERE "Paris\u2013Roubaix" = 'servais knaven ( ned )' | wikisql |
CREATE TABLE table_204_308 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- country with the most bronze medals .
| SELECT "nation" FROM table_204_308 ORDER BY "bronze" DESC LIMIT 1 | squall |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARC... | SELECT city_code, COUNT(*) FROM Student GROUP BY city_code | nvbench |
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "1882" AND lab.itemid = "51482" | mimicsql_data |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
sy... | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-79544' AND patient.hospitaldischargetime IS NULL)) | eicu |
CREATE TABLE table_44341 (
"Team" text,
"Tries for" text,
"Tries against" text,
"Try diff" text,
"Points for" text,
"Points against" text,
"Points diff" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team has +119 Points diff?
| SELECT "Team" FROM table_44341 WHERE "Points diff" = '+119' | wikisql |
CREATE TABLE table_34781 (
"County" text,
"Monument name" text,
"Year built" real,
"City or Town" text,
"Latitude" text,
"Longitude" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What County has a Longitude of 85 45 43 w?
| SELECT "County" FROM table_34781 WHERE "Longitude" = '85°45′43″w' | wikisql |
CREATE TABLE table_name_61 (
home_team VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the home team in week 1?
| SELECT home_team FROM table_name_61 WHERE week = "1" | sql_create_context |
CREATE TABLE table_31208 (
"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.
-- When l... | SELECT "High points" FROM table_31208 WHERE "Team" = 'La Salle' | wikisql |
CREATE TABLE table_name_48 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What 1953 has 2 as a 1949, and 3 as 1952?
| SELECT 1953 FROM table_name_48 WHERE 1949 = "2" AND 1952 = "3" | sql_create_context |
CREATE TABLE table_name_58 (
country VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country does Tiger Woods come from?
| SELECT country FROM table_name_58 WHERE player = "tiger woods" | sql_create_context |
CREATE TABLE table_train_96 (
"id" int,
"gender" string,
"elevated_creatinine" float,
"diabetic" string,
"cerebrovascular_disease" bool,
"moca_score" int,
"parkinsonism" bool,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- diabe... | SELECT * FROM table_train_96 WHERE diabetic = 'i' OR diabetic = 'ii' | criteria2sql |
CREATE TABLE table_77402 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of Score, when Country is 'United States', and when Player is 'Lee Trevino'?
| SELECT COUNT("Score") FROM table_77402 WHERE "Country" = 'united states' AND "Player" = 'lee trevino' | wikisql |
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,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHIL... | atis |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense... | SELECT Id, Score FROM Posts WHERE Score >= 10 AND (Title LIKE '%date%' OR Title LIKE '%Date%' OR Title LIKE '%time%' OR Title LIKE '%Time%') AND Tags LIKE '%python%' ORDER BY CreationDate DESC LIMIT 100 | sede |
CREATE TABLE table_21198 (
"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 w... | SELECT "Score" FROM table_21198 WHERE "Game" = '15' | wikisql |
CREATE TABLE repair (
repair_ID int,
name text,
Launch_Date text,
Notes text
)
CREATE TABLE repair_assignment (
technician_id int,
repair_ID int,
Machine_ID int
)
CREATE TABLE machine (
Machine_ID int,
Making_Year int,
Class text,
Team text,
Machine_series text,
val... | SELECT Name, COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_id = T2.technician_id GROUP BY T2.Name | nvbench |
CREATE TABLE table_8761 (
"Rider" text,
"Bike" text,
"Laps" real,
"Time" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Grid has Laps smaller than 22, and a Bike of honda cbr1000rr, and a Rider of luca morelli?
| SELECT MIN("Grid") FROM table_8761 WHERE "Laps" < '22' AND "Bike" = 'honda cbr1000rr' AND "Rider" = 'luca morelli' | wikisql |
CREATE TABLE table_name_54 (
number VARCHAR,
acquisition_via VARCHAR,
school_club_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What number has an acquisition via the Rookie Draft, and is part of a School/club team at Cal State Fullerton?
| SELECT number FROM table_name_54 WHERE acquisition_via = "rookie draft" AND school_club_team = "cal state fullerton" | sql_create_context |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
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... | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | nvbench |
CREATE TABLE table_60066 (
"Club" text,
"Head Coach" text,
"City" text,
"Stadium" text,
"2003\u20132004 season" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What club does Manuel Fernandes coach?
| SELECT "Club" FROM table_60066 WHERE "Head Coach" = 'manuel fernandes' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE prescriptions (
... | SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 30 AND 39) GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 <= 5 | mimic_iii |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate tim... | SELECT Id, DisplayName, EmailHash FROM Users WHERE EmailHash = '5e7308ff7122df9ebbee7b52956a2ea3' LIMIT 50 | sede |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
... | SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'venous cath nec') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 16088) AND DATETIME(procedures_... | mimic_iii |
CREATE TABLE table_73254 (
"Locale" text,
"Skip" text,
"W" real,
"L" real,
"PF" real,
"PA" real,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends" real,
"Stolen Ends" real,
"Shot Pct." real
)
-- Using valid SQLite, answer the following questions for the tables provided above.... | SELECT MAX("Blank Ends") FROM table_73254 WHERE "Locale" = 'Prince Edward Island' | wikisql |
CREATE TABLE table_7829 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the game result on November 29, 1959?
| SELECT "Result" FROM table_7829 WHERE "Date" = 'november 29, 1959' | wikisql |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25... | SELECT CITY, COUNT(CITY) FROM locations GROUP BY CITY ORDER BY CITY | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.days_stay > "7" | mimicsql_data |
CREATE TABLE table_50731 (
"BR No." text,
"Lot No." real,
"Date" real,
"Built at" text,
"Boiler type" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year is the date when the boiler type is forward topfeed, the built at is Crewe, and lot number... | SELECT COUNT("Date") FROM table_50731 WHERE "Boiler type" = 'forward topfeed' AND "Built at" = 'crewe' AND "Lot No." < '187' | wikisql |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT COUNT(*) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '李勇锐' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2006-04-06' AND '2018-05-21' AND t_kc24.MED_AMOUT <= 10 | css |
CREATE TABLE table_25063 (
"Name" text,
"#" real,
"Position" text,
"Height" text,
"Weight" real,
"Year" text,
"Home Town" text,
"High School" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many height entries are there for players fr... | SELECT COUNT("Height") FROM table_25063 WHERE "High School" = 'Bayside' | wikisql |
CREATE TABLE table_204_796 (
id number,
"network name" text,
"flagship" text,
"programming type" text,
"owner" text,
"affiliates" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who has the most number of affiliates ?
| SELECT "network name" FROM table_204_796 ORDER BY "affiliates" DESC LIMIT 1 | squall |
CREATE TABLE artist (
Artist_ID int,
Artist text,
Age int,
Famous_Title text,
Famous_Release_date text
)
CREATE TABLE volume (
Volume_ID int,
Volume_Issue text,
Issue_Date text,
Weeks_on_Top real,
Song text,
Artist_ID int
)
CREATE TABLE music_festival (
ID int,
Musi... | SELECT Category, COUNT(*) FROM music_festival GROUP BY Category ORDER BY Category DESC | nvbench |
CREATE TABLE table_name_63 (
player VARCHAR,
to_par VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which united states player had a To par of 12?
| SELECT player FROM table_name_63 WHERE to_par = 12 AND country = "united states" | sql_create_context |
CREATE TABLE table_203_651 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what are the number of times she came in 2nd position for the european championships... | SELECT COUNT(*) FROM table_203_651 WHERE "position" = 2 AND "competition" = 'european championships' | squall |
CREATE TABLE table_33995 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which is the lowest round to have a pick of 12 and position of linebacker?
| SELECT MIN("Round") FROM table_33995 WHERE "Pick #" = '12' AND "Position" = 'linebacker' | 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 person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_inf... | css |
CREATE TABLE Documents_to_be_Destroyed (
Document_ID INTEGER,
Destruction_Authorised_by_Employee_ID INTEGER,
Destroyed_by_Employee_ID INTEGER,
Planned_Destruction_Date DATETIME,
Actual_Destruction_Date DATETIME,
Other_Details VARCHAR(255)
)
CREATE TABLE Employees (
Employee_ID INTEGER,
... | SELECT Calendar_Date, COUNT(Calendar_Date) FROM Ref_Calendar | nvbench |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.short_title = "Ath ext ntv art gngrene" | mimicsql_data |
CREATE TABLE table_12513 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Raiders points" real,
"Opponents" real,
"First Downs" real,
"Record" text,
"Streak" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided abov... | SELECT "Streak" FROM table_12513 WHERE "Game" > '8' AND "Date" = 'nov 22' | wikisql |
CREATE TABLE table_203_102 (
id number,
"event" text,
"performance" text,
"athlete" text,
"nation" text,
"place" text,
"date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many records were set in beijing ?
| SELECT COUNT(*) FROM table_203_102 WHERE "place" = 'beijing' | squall |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost numb... | SELECT patients.gender FROM patients WHERE patients.subject_id = 55027 | mimic_iii |
CREATE TABLE table_name_4 (
gold INTEGER,
bronze VARCHAR,
total VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What nation won the fewest gold medals while being in Rank 1, with a total of 37 medals and more than 7 bronze medals?
| SELECT MIN(gold) FROM table_name_4 WHERE total = 37 AND rank = "1" AND bronze > 7 | sql_create_context |
CREATE TABLE table_203_691 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"attendance" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who would the next opponent be after week 4 ?
| SELECT "opponent" FROM table_203_691 WHERE "week" = 4 + 1 | squall |
CREATE TABLE hz_info_mzjzjlb (
JZLSH number,
YLJGDM number,
mzjzjlb_id number
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ tim... | SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jy... | css |
CREATE TABLE book_club (
book_club_id int,
Year int,
Author_or_Editor text,
Book_Title text,
Publisher text,
Category text,
Result text
)
CREATE TABLE culture_company (
Company_name text,
Type text,
Incorporated_in text,
Group_Equity_Shareholding real,
book_club_id text,... | SELECT Category, COUNT(*) FROM book_club GROUP BY Category | nvbench |
CREATE TABLE table_5596 (
"Date Released" text,
"Institute" text,
"Socialist" text,
"Social Democratic" text,
"Green-Communist" text,
"Left Bloc" text,
"People's Party" text,
"Lead" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the... | SELECT "Lead" FROM table_5596 WHERE "Left Bloc" = '8.4%' | wikisql |
CREATE TABLE table_9840 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the visitor on April 2?
| SELECT "Visitor" FROM table_9840 WHERE "Date" = 'april 2' | wikisql |
CREATE TABLE table_name_22 (
college VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what college has paul seiler as a player?
| SELECT college FROM table_name_22 WHERE player = "paul seiler" | sql_create_context |
CREATE TABLE table_name_57 (
issue_price__bu_ VARCHAR,
_clarification_needed_ VARCHAR,
mintage__proof_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's listed as the Issue Price (BU) [Clarification Needed] with a Mintage (Proof) of 29,586?
| SELECT issue_price__bu_ AS "_clarification_needed_" FROM table_name_57 WHERE mintage__proof_ = "29,586" | sql_create_context |
CREATE TABLE table_19995378_1 (
no_in_season VARCHAR,
us_viewers__millions_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many episodes with different series numbers were seen by 8.69 people in the US?
| SELECT COUNT(no_in_season) FROM table_19995378_1 WHERE us_viewers__millions_ = "8.69" | sql_create_context |
CREATE TABLE table_name_88 (
bronze VARCHAR,
gold VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much Bronze has a Gold larger than 0, and a Total smaller than 1?
| SELECT COUNT(bronze) FROM table_name_88 WHERE gold > 0 AND total < 1 | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Radical neck dissection, unilateral" | mimicsql_data |
CREATE TABLE people (
People_ID int,
Name text,
Country text,
Is_Male text,
Age int
)
CREATE TABLE wedding (
Church_ID int,
Male_ID int,
Female_ID int,
Year int
)
CREATE TABLE church (
Church_ID int,
Name text,
Organized_by text,
Open_Date int,
Continuation_of t... | SELECT Country, COUNT(*) FROM people GROUP BY Country | nvbench |
CREATE TABLE domain_keyword (
did int,
kid int
)
CREATE TABLE cite (
cited int,
citing int
)
CREATE TABLE publication (
abstract varchar,
cid int,
citation_num int,
jid int,
pid int,
reference_num int,
title varchar,
year int
)
CREATE TABLE domain (
did int,
na... | SELECT publication.title FROM domain, domain_publication, publication WHERE domain.did = domain_publication.did AND domain.name = 'Databases' AND publication.pid = domain_publication.pid ORDER BY publication.citation_num DESC LIMIT 1 | academic |
CREATE TABLE member (
member_id text,
name text,
nationality text,
role text
)
CREATE TABLE performance (
performance_id number,
date text,
host text,
location text,
attendance number
)
CREATE TABLE member_attendance (
member_id number,
performance_id number,
num_of_pie... | SELECT name FROM member WHERE NOT member_id IN (SELECT member_id FROM member_attendance) | spider |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
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,
... | SELECT BGDH FROM jybgb WHERE JZLSH = '18286029694' AND NOT KSMC LIKE '%产后%' | css |
CREATE TABLE table_13456 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the least total number of medals when the bronze medals is 1, and Czech Republic (CZ... | SELECT MIN("Total") FROM table_13456 WHERE "Bronze" = '1' AND "Nation" = 'czech republic (cze)' | wikisql |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
Last... | SELECT DATE(p.CreationDate) AS PostDate, COUNT(p.Id) AS Posts, (SELECT COUNT(b.Id) / 100 FROM Badges AS b WHERE b.UserId = u.Id AND b.Date <= DATE(p.CreationDate)) AS BadgesEarned FROM Posts AS p, Users AS u WHERE u.Id = @UserId AND p.OwnerUserId = u.Id GROUP BY DATE(p.CreationDate), u.Id ORDER BY DATE(p.CreationDate) | sede |
CREATE TABLE table_32303 (
"Round" real,
"Overall" real,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many rounds have an Overall larger than 17, and a Position of quarterback?
| SELECT COUNT("Round") FROM table_32303 WHERE "Overall" > '17' AND "Position" = 'quarterback' | wikisql |
CREATE TABLE complaints (
complaint_id number,
product_id number,
customer_id number,
complaint_outcome_code text,
complaint_status_code text,
complaint_type_code text,
date_complaint_raised time,
date_complaint_closed time,
staff_id number
)
CREATE TABLE customers (
customer_id... | SELECT email_address, phone_number FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM complaints) | spider |
CREATE TABLE table_66438 (
"Date" text,
"Tournament" text,
"Surface" text,
"Partnering" text,
"Opponents in the final" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Surface has a score of 7-5, 5-7, 6-3?
| SELECT "Surface" FROM table_66438 WHERE "Score" = '7-5, 5-7, 6-3' | wikisql |
CREATE TABLE table_64276 (
"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.
-- Which round did the bout that led to a 1-0 record e... | SELECT "Round" FROM table_64276 WHERE "Record" = '1-0' | wikisql |
CREATE TABLE table_27260 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F.L." real,
"Podiums" real,
"Points" text,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what were his po... | SELECT "Points" FROM table_27260 WHERE "Position" = '8th' | wikisql |
CREATE TABLE products (
product_id text,
product_name text,
product_price number,
product_description text,
other_product_service_details text
)
CREATE TABLE customers (
customer_id text,
address_id number,
customer_name text,
customer_phone text,
customer_email_address text,
... | SELECT T1.service_type_description FROM ref_service_types AS T1 JOIN services AS T2 ON T1.service_type_code = T2.service_type_code WHERE T2.product_price > 100 | spider |
CREATE TABLE table_18140 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the incumbent of Florida 9?
| SELECT "Incumbent" FROM table_18140 WHERE "District" = 'Florida 9' | 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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "V4511" AND lab.fluid = "Other Body Fluid" | mimicsql_data |
CREATE TABLE table_name_85 (
record VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record when the score was 11-10?
| SELECT record FROM table_name_85 WHERE score = "11-10" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.