instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.person_info_XM = '韦宏放' AND hz_info.YLJGDM = '9529640' AND NOT mzjzjlb.JZKSMC LIKE '%补牙%' | css |
CREATE TABLE table_name_76 (
date VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Score of 2 3 ot on what date?
| SELECT date FROM table_name_76 WHERE score = "2–3 ot" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.diagnosis = "CHEST PAIN" AND demographic.admityear >= "2173" | mimicsql_data |
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 prescriptions (
subject_id text,
hadm_id... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.drug_type = "ADDITIVE" | mimicsql_data |
CREATE TABLE table_name_29 (
type VARCHAR,
locomotive_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What type is locomotive CTN 1364?
| SELECT type FROM table_name_29 WHERE locomotive_number = "ctn 1364" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | SELECT demographic.diagnosis, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Chandra Schulman" | mimicsql_data |
CREATE TABLE table_name_47 (
league VARCHAR,
games VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the league name that has a Games listing of 10?
| SELECT league FROM table_name_47 WHERE games = "10" | sql_create_context |
CREATE TABLE table_1939235_1 (
playoffs VARCHAR,
open_cup VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When it's the 2nd round of the open cup what is the playoffs?
| SELECT playoffs FROM table_1939235_1 WHERE open_cup = "2nd Round" | sql_create_context |
CREATE TABLE table_39197 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"Podiums" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the newest Season in which had 0 Podiums, and having 1 total of R... | SELECT MAX("Season") FROM table_39197 WHERE "Podiums" = '0' AND "Races" = '1' AND "Wins" > '0' | wikisql |
CREATE TABLE table_10884 (
"Result" text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Result has the Event, Strikeforce, and Method, Ko (double ro... | SELECT "Result" FROM table_10884 WHERE "Event" = 'strikeforce' AND "Method" = 'ko (double roundhouse kick)' | wikisql |
CREATE TABLE procedures_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 diagnoses_i... | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 59002 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) | mimic_iii |
CREATE TABLE table_name_55 (
american_labor_ticket VARCHAR,
socialist_ticket VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which American Labor candidate is running against the Socialist candidate Herman J. Hahn?
| SELECT american_labor_ticket FROM table_name_55 WHERE socialist_ticket = "herman j. hahn" | sql_create_context |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT SUM(t_kc24.MED_AMOUT), SUM(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '5215588' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-02-17' AND '2005-10-13' | css |
CREATE TABLE table_name_85 (
rank INTEGER,
name VARCHAR,
lane VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Meagen Nay's rank with a lane greater than 5?
| SELECT SUM(rank) FROM table_name_85 WHERE name = "meagen nay" AND lane > 5 | sql_create_context |
CREATE TABLE table_16586 (
"Country" text,
"Carbon dioxide emissions per year (10 6 Tons) (2006)" real,
"Percentage of global total" text,
"Avg. emission per km 2 of its land (tons)" real,
"Carbon dioxide emissions per year (Tons per person) (2007)" text
)
-- Using valid SQLite, answer the followi... | SELECT MAX("Avg. emission per km 2 of its land (tons)") FROM table_16586 WHERE "Country" = 'India' | wikisql |
CREATE TABLE table_204_622 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many times did piotr place 1st in the 4x400m relay ?
| SELECT COUNT(*) FROM table_204_622 WHERE "position" = 1 AND "event" = '4x400 m relay' | squall |
CREATE TABLE table_73384 (
"S No" real,
"Team (A)" text,
"Team (B)" text,
"Winner" text,
"Margin" text,
"Match Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many games were won by a margin of 131 runs?
| SELECT COUNT("Team (A)") FROM table_73384 WHERE "Margin" = '131 runs' | wikisql |
CREATE TABLE table_51131 (
"Institution" text,
"Location" text,
"Founded" real,
"Affiliation" text,
"Enrollment" real,
"Nickname" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the team nickname of university of wisconsin-platteville?
| SELECT "Nickname" FROM table_51131 WHERE "Institution" = 'university of wisconsin-platteville' | wikisql |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDa... | SELECT CreationDate, CASE VoteTypeId WHEN 1 THEN 'accept' WHEN 2 THEN 'up' WHEN 3 THEN 'down' END AS vote, PostId AS "post_link" FROM Votes WHERE VoteTypeId IN (1, 2, 3) AND PostId = '##postid:int?104612##' | sede |
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station_id INTEGER,
bike_id INTEGER,
subscription_type TEXT,
zip_code INTEGER
)
CREATE TABLE station (
id INTEG... | SELECT end_station_name, COUNT(end_station_name) FROM trip GROUP BY end_station_name ORDER BY id LIMIT 3 | nvbench |
CREATE TABLE table_43059 (
"Date" text,
"Cover model" text,
"Centerfold model" text,
"Interview subject" text,
"20 Questions" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the Centerfold model when O.J. Simpson was the Interview Subject?
| SELECT "Centerfold model" FROM table_43059 WHERE "Interview subject" = 'o.j. simpson' | wikisql |
CREATE TABLE Elimination (
Elimination_ID text,
Wrestler_ID text,
Team text,
Eliminated_By text,
Elimination_Move text,
Time text
)
CREATE TABLE wrestler (
Wrestler_ID int,
Name text,
Reign text,
Days_held text,
Location text,
Event text
)
-- Using valid SQLite, answer... | SELECT Team, COUNT(*) FROM Elimination GROUP BY Team | nvbench |
CREATE TABLE table_4155 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team drafted a player from Sweden?
| SELECT "NHL team" FROM table_4155 WHERE "Nationality" = 'Sweden' | wikisql |
CREATE TABLE table_name_37 (
election VARCHAR,
total_seats VARCHAR,
seats VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the total number of seats is under 144, and the seats won is 32, which election is this?
| SELECT election FROM table_name_37 WHERE total_seats < 144 AND seats = 32 | sql_create_context |
CREATE TABLE table_15829 (
"Ranking" real,
"Nationality" text,
"Name" text,
"Years" text,
"Goals" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had fewer goals than 4 during the years of 1996 13?
| SELECT MIN("Goals") FROM table_15829 WHERE "Ranking" < '4' AND "Years" = '1996–13' | wikisql |
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_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc21_t_kc22.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '52511910' AND t_kc21.MED_SER_ORG_NO = '4903807') ORDER BY t_kc22.UNIVALENT DESC LIMIT 1 | css |
CREATE TABLE camera_lens (
id int,
brand text,
name text,
focal_length_mm real,
max_aperture real
)
CREATE TABLE photos (
id int,
camera_lens_id int,
mountain_id int,
color text,
name text
)
CREATE TABLE mountain (
id int,
name text,
Height real,
Prominence real... | SELECT T1.name, COUNT(T1.name) FROM camera_lens AS T1 JOIN photos AS T2 ON T2.camera_lens_id = T1.id WHERE T1.brand = 'Sigma' OR T1.brand = 'Olympus' GROUP BY T1.name ORDER BY T1.name DESC | nvbench |
CREATE TABLE table_1825751_14 (
delegate VARCHAR,
pageant VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- where pageant is elite model look and year is bigger than 1993.0, who is the delegate?
| SELECT delegate FROM table_1825751_14 WHERE pageant = "Elite Model Look" AND year > 1993.0 | 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.BBCJBW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGD... | css |
CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE weather (
date TEXT,
... | SELECT date, SUM(cloud_cover) FROM weather | nvbench |
CREATE TABLE Guests (
guest_id INTEGER,
gender_code CHAR(1),
guest_first_name VARCHAR(80),
guest_last_name VARCHAR(80),
date_of_birth DATETIME
)
CREATE TABLE Apartments (
apt_id INTEGER,
building_id INTEGER,
apt_type_code CHAR(15),
apt_number CHAR(10),
bathroom_count INTEGER,
... | SELECT booking_end_date, COUNT(booking_end_date) FROM Apartment_Bookings ORDER BY COUNT(booking_end_date) DESC | nvbench |
CREATE TABLE table_24563 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 10" real,
"Poles" real,
"Avg. Start" text,
"Avg. Finish" text,
"Winnings" text,
"Position" text,
"Team(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Ho... | SELECT MAX("Wins") FROM table_24563 | wikisql |
CREATE TABLE table_name_94 (
rounds VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many rounds did Nil Montserrat drive in?
| SELECT rounds FROM table_name_94 WHERE driver = "nil montserrat" | sql_create_context |
CREATE TABLE table_40735 (
"Year" real,
"Chart" text,
"Track" text,
"Peak" real,
"Weeks on Chart" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest Peak with fewer than 8 Weeks on Chart?
| SELECT MIN("Peak") FROM table_40735 WHERE "Weeks on Chart" < '8' | wikisql |
CREATE TABLE table_203_137 (
id number,
"title" text,
"album details" text,
"peak chart positions\nus" number,
"peak chart positions\nus r&b" number,
"certifications" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what albume peaked higher on th... | SELECT "title" FROM table_203_137 WHERE "title" IN ('can-i-bus', '2000 b.c. (before can-i-bus)') ORDER BY "peak chart positions\nus" LIMIT 1 | squall |
CREATE TABLE table_name_66 (
overall INTEGER,
name VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Overall has a Name of bob anderson, and a Round smaller than 9?
| SELECT AVG(overall) FROM table_name_66 WHERE name = "bob anderson" AND round < 9 | sql_create_context |
CREATE TABLE Accounts (
Account_ID INTEGER,
Statement_ID INTEGER,
Account_Details VARCHAR(255)
)
CREATE TABLE Documents_with_Expenses (
Document_ID INTEGER,
Budget_Type_Code CHAR(15),
Document_Details VARCHAR(255)
)
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Documen... | SELECT Document_Type_Name, COUNT(Document_Type_Name) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Name ORDER BY COUNT(Document_Type_Name) DESC | nvbench |
CREATE TABLE table_name_94 (
away_team VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which away team goes against the home team Mauritius?
| SELECT away_team FROM table_name_94 WHERE home_team = "mauritius" | sql_create_context |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute respiratory failure' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-4 yea... | eicu |
CREATE TABLE table_12658 (
"Branding" text,
"Callsign" text,
"Frequency" text,
"Power (kW)" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the power at Baguio where the frequency is 102.3mhz?
| SELECT "Power (kW)" FROM table_12658 WHERE "Frequency" = '102.3mhz' AND "Location" = 'baguio' | wikisql |
CREATE TABLE table_name_14 (
constructor VARCHAR,
grid VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which constructor has a Grid smaller than 18, and a Driver of mika h kkinen?
| SELECT constructor FROM table_name_14 WHERE grid < 18 AND driver = "mika häkkinen" | sql_create_context |
CREATE TABLE table_33210 (
"Name" text,
"Team" text,
"Qual 1" text,
"Qual 2" text,
"Best" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who from Conquest Racing had the best time of 1:34.748 in Qual 1?
| SELECT "Best" FROM table_33210 WHERE "Team" = 'conquest racing' AND "Qual 1" = '1:34.748' | wikisql |
CREATE TABLE table_name_20 (
constructor VARCHAR,
country VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which constructor is from ITA with a rank less than 13?
| SELECT constructor FROM table_name_20 WHERE country = "ita" AND rank < 13 | sql_create_context |
CREATE TABLE table_203_793 (
id number,
"#" number,
"date" text,
"venue" text,
"opponent" text,
"score" text,
"result" text,
"competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total number of fifa world cup goals sc... | SELECT COUNT(*) FROM table_203_793 WHERE "competition" = '1982 fifa world cup' | squall |
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar... | 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 = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'D... | atis |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE Users (
Id number,
Reputation number,... | SELECT q.Id AS "post_link", q.CreationDate, COUNT(a.Id) AS answers, MAX(a.Score) AS max_score FROM Posts AS q LEFT JOIN Posts AS a ON a.ParentId = q.Id WHERE q.PostTypeId = 1 AND q.AcceptedAnswerId IS NULL AND q.Tags LIKE '%star-wars-legends%' AND q.DeletionDate IS NULL AND q.ClosedDate IS NULL GROUP BY q.Id, q.Creatio... | sede |
CREATE TABLE table_name_99 (
opponent VARCHAR,
type_of_game VARCHAR,
results¹ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which opponent played a 1990 wcq type of game, where the results were 0:0?
| SELECT opponent FROM table_name_99 WHERE type_of_game = "1990 wcq" AND results¹ = "0:0" | sql_create_context |
CREATE TABLE table_20217811_1 (
electorate VARCHAR,
united_future VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the electoraate for united future being 4.47%
| SELECT electorate FROM table_20217811_1 WHERE united_future = "4.47%" | sql_create_context |
CREATE TABLE table_52973 (
"Goalkeeper" text,
"Goals" real,
"Matches" real,
"Average" real,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For averages of 1.58 and matches under 38, what is the average number of goals?
| SELECT AVG("Goals") FROM table_52973 WHERE "Average" = '1.58' AND "Matches" < '38' | wikisql |
CREATE TABLE table_76385 (
"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.
-- Which ... | SELECT "Date" FROM table_76385 WHERE "Game" = '35' | wikisql |
CREATE TABLE manufacturer (
Manufacturer_ID int,
Open_Year real,
Name text,
Num_of_Factories int,
Num_of_Shops int
)
CREATE TABLE furniture (
Furniture_ID int,
Name text,
Num_of_Component int,
Market_Rate real
)
CREATE TABLE furniture_manufacte (
Manufacturer_ID int,
Furnit... | SELECT Name, Market_Rate FROM furniture WHERE NOT Furniture_ID IN (SELECT Furniture_ID FROM furniture_manufacte) ORDER BY Name DESC | nvbench |
CREATE TABLE table_40144 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many laps were driven when the time/retired is +44.284?
| SELECT COUNT("Laps") FROM table_40144 WHERE "Time/Retired" = '+44.284' | wikisql |
CREATE TABLE table_3525 (
"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 theme for Audition week?
| SELECT "Theme" FROM table_3525 WHERE "Week #" = 'Audition' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
... | SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-44495')) AND microlab.culturesite = 'sputum, expectorated' AND DATETI... | eicu |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)... | SELECT (SELECT vitalperiodic.sao2 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-76184') AND NOT patient.unitdischargetime IS NULL ... | eicu |
CREATE TABLE table_name_61 (
joined INTEGER,
nickname VARCHAR,
enrollment VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Joined has a Nickname of knights, and an Enrollment larger than 2,960?
| SELECT SUM(joined) FROM table_name_61 WHERE nickname = "knights" AND enrollment > 2 OFFSET 960 | sql_create_context |
CREATE TABLE table_19317 (
"Barangay" text,
"Population (2010)" real,
"Economic Class" text,
"Land Area (In sqm.)" real,
"Punong Barangay (Term 2010-2013)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the economic class for punong barangay be... | SELECT "Economic Class" FROM table_19317 WHERE "Punong Barangay (Term 2010-2013)" = 'Antonio B. Gangan' | wikisql |
CREATE TABLE customers (
country VARCHAR,
first_name VARCHAR,
last_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country does Roberto Almeida live?
| SELECT country FROM customers WHERE first_name = "Roberto" AND last_name = "Almeida" | sql_create_context |
CREATE TABLE minor_in (
stuid number,
dno number
)
CREATE TABLE enrolled_in (
stuid number,
cid text,
grade text
)
CREATE TABLE gradeconversion (
lettergrade text,
gradepoint number
)
CREATE TABLE faculty (
facid number,
lname text,
fname text,
rank text,
sex text,
... | SELECT dname FROM department EXCEPT SELECT T1.dname FROM department AS T1 JOIN minor_in AS T2 ON T1.dno = T2.dno | spider |
CREATE TABLE machine (
Machine_ID int,
Making_Year int,
Class text,
Team text,
Machine_series text,
value_points real,
quality_rank int
)
CREATE TABLE repair_assignment (
technician_id int,
repair_ID int,
Machine_ID int
)
CREATE TABLE repair (
repair_ID int,
name text,
... | SELECT Name, COUNT(Name) FROM technician WHERE Team <> "NYY" GROUP BY Name ORDER BY COUNT(Name) | nvbench |
CREATE TABLE table_204_51 (
id number,
"week #" text,
"theme" text,
"song choice" text,
"original artist" text,
"order #" number,
"result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many songs was claudio zoli the original artist ?
| SELECT COUNT("song choice") FROM table_204_51 WHERE "original artist" = 'claudio zoli' | squall |
CREATE TABLE table_55317 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Home team Venue for the hawthorn team?
| SELECT "Venue" FROM table_55317 WHERE "Home team" = 'hawthorn' | wikisql |
CREATE TABLE table_46139 (
"Title" text,
"Author" text,
"ISBN UK" text,
"ISBN US" text,
"TV companions featured" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is ISBN UK, when Author is 'Dave Martin', and when ISBN US is 'N/A'?
| SELECT "ISBN UK" FROM table_46139 WHERE "Author" = 'dave martin' AND "ISBN US" = 'n/a' | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Government" AND diagnoses.short_title = "Bacteremia" | mimicsql_data |
CREATE TABLE table_3325 (
"Settlement" text,
"Cyrillic Name Other Names" text,
"Type" text,
"Population (2011)" real,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the dominant... | SELECT "Dominant religion (2002)" FROM table_3325 WHERE "Cyrillic Name Other Names" = 'Станишић' | wikisql |
CREATE TABLE table_name_59 (
opponent VARCHAR,
week VARCHAR,
stadium VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opposing team at Schaefer Stadium later in the season than week 7?
| SELECT opponent FROM table_name_59 WHERE week > 7 AND stadium = "schaefer stadium" | sql_create_context |
CREATE TABLE table_name_29 (
grid INTEGER,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the smallest grid for Prince bira?
| SELECT MIN(grid) FROM table_name_29 WHERE driver = "prince bira" | sql_create_context |
CREATE TABLE table_203_125 (
id number,
"club" text,
"winners" number,
"runner-ups" number,
"winning years" text,
"runner-up years" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the last year that fk austria wien won the austrian super... | SELECT MAX("winning years") FROM table_203_125 WHERE "club" = 'fk austria wien' | squall |
CREATE TABLE table_34752 (
"Rank" real,
"Name" text,
"Headquarters" text,
"Primary industry" text,
"Market value ( USD million)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest rank of Deutsche Telekom with a market value over 209,... | SELECT MIN("Rank") FROM table_34752 WHERE "Name" = 'deutsche telekom' AND "Market value ( USD million)" > '209,628' | wikisql |
CREATE TABLE Sales (
sales_transaction_id INTEGER,
sales_details VARCHAR(255)
)
CREATE TABLE Ref_Transaction_Types (
transaction_type_code VARCHAR(10),
transaction_type_description VARCHAR(80)
)
CREATE TABLE Lots (
lot_id INTEGER,
investor_id INTEGER,
lot_details VARCHAR(255)
)
CREATE TAB... | SELECT date_of_transaction, COUNT(date_of_transaction) FROM Sales AS T1 JOIN Transactions AS T2 ON T1.sales_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction < 3000 ORDER BY date_of_transaction | nvbench |
CREATE TABLE table_54886 (
"Tournament" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which tournament in 2012 ... | SELECT "2012" FROM table_54886 WHERE "2007" = 'a' AND "2011" = 'a' | wikisql |
CREATE TABLE table_name_15 (
winning_driver VARCHAR,
circuit VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the winning driver for havana
| SELECT winning_driver FROM table_name_15 WHERE circuit = "havana" | sql_create_context |
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 prescriptions... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.insurance = "Government" AND demographic.dod_year < "2154.0" | mimicsql_data |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT LAST_NAME, SALARY FROM employees ORDER BY LAST_NAME DESC | nvbench |
CREATE TABLE table_name_26 (
agricultural_panel INTEGER,
nominated_by_the_taoiseach VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Agricultural Panel has a Nominated by the Taoiseach larger than 6, and a Total larger than 60?
| SELECT SUM(agricultural_panel) FROM table_name_26 WHERE nominated_by_the_taoiseach > 6 AND total > 60 | sql_create_context |
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH ... | (SELECT jybgb.BGDH 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.RYBH = '21625825' AND jybgb.BGRQ BETWEEN '2002-07-09' AND '2012-02-15') UNI... | css |
CREATE TABLE table_62147 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Lee Trevino of the United States with a total greater than 294 had what To par?
| SELECT "To par" FROM table_62147 WHERE "Total" > '294' AND "Country" = 'united states' AND "Player" = 'lee trevino' | wikisql |
CREATE TABLE table_name_83 (
years VARCHAR,
nationality VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Years, when Nationality is United States, and when Position is PG / SG?
| SELECT years FROM table_name_83 WHERE nationality = "united states" AND position = "pg / sg" | sql_create_context |
CREATE TABLE employee (
emp_num number,
emp_lname text,
emp_fname text,
emp_initial text,
emp_jobcode text,
emp_hiredate time,
emp_dob time
)
CREATE TABLE class (
class_code text,
crs_code text,
class_section text,
class_time text,
class_room text,
prof_num number
)
... | SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN class AS T3 ON T2.class_code = T3.class_code WHERE T3.crs_code = 'ACCT-211' AND T1.stu_lname LIKE 'S%' | spider |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT jybgb.BGDH 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.RYBH = '33852265' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WH... | css |
CREATE TABLE table_73878 (
"Branding" text,
"Callsign" text,
"Ch. #" text,
"Station Type" text,
"Power kW (ERP)" text,
"Location (Transmitter Site)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The location (transmitter site) San Fernando, Pam... | SELECT "Power kW (ERP)" FROM table_73878 WHERE "Location (Transmitter Site)" = 'San Fernando, Pampanga **' | wikisql |
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 AS "post_link", Score, ViewCount, Title, CreationDate, Tags, CommentCount, LENGTH(Body) AS len_body FROM Posts WHERE PostTypeId = 1 AND (Tags LIKE '%excel%' COLLATE SQL_Latin1_General_CP1_CI_AS OR Tags LIKE '%vba%' COLLATE SQL_Latin1_General_CP1_CI_AS) AND (Tags LIKE '%scraping%' OR Title LIKE '%scrape%' COLL... | sede |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsysto... | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-23267') AND NOT patient.unitdischargetime IS... | eicu |
CREATE TABLE table_name_87 (
manner_of_departure VARCHAR,
date_of_appointment VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want the manner of departure for date of appointment being 12 october 2007
| SELECT manner_of_departure FROM table_name_87 WHERE date_of_appointment = "12 october 2007" | sql_create_context |
CREATE TABLE table_name_45 (
penalties INTEGER,
points_total VARCHAR,
played VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the least number of penalties he got when his point total was over 1419 in more than 98 games?
| SELECT MIN(penalties) FROM table_name_45 WHERE points_total = 1419 AND played > 98 | sql_create_context |
CREATE TABLE table_31464 (
"Rank" real,
"Rider" text,
"Sat 20 Aug" text,
"Mon 22 Aug" text,
"Tues 23 Aug" text,
"Wed 24 Aug" text,
"Thurs 25 Aug" text,
"Fri 26 Aug" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is shown for fri 26 ... | SELECT "Fri 26 Aug" FROM table_31464 WHERE "Mon 22 Aug" = '—— No Time' | wikisql |
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_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
... | SELECT Sex, AVG(Age) FROM Student GROUP BY Sex ORDER BY AVG(Age) DESC | nvbench |
CREATE TABLE table_204_342 (
id number,
"#" number,
"player" text,
"span" text,
"caps" number,
"total caps" number,
"win %" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many players have spans above three years ?
| SELECT COUNT("player") FROM table_204_342 WHERE "span" - "span" > 3 | squall |
CREATE TABLE table_13665809_2 (
byu_uu_score VARCHAR,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many byu-uu score with winner being utah state (2 1) won over byu by media vote
| SELECT COUNT(byu_uu_score) FROM table_13665809_2 WHERE winner = "Utah State (2–1) Won over BYU by media vote" | sql_create_context |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,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 departments (
DEPARTMENT_ID decimal... | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | nvbench |
CREATE TABLE table_41303 (
"Team" text,
"University" text,
"Location" text,
"Year entered league" real,
"2013\u201314 division" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team had a year entering the league under 2009, located in Bath?
| SELECT "Team" FROM table_41303 WHERE "Year entered league" < '2009' AND "Location" = 'bath' | wikisql |
CREATE TABLE table_name_68 (
year INTEGER,
position VARCHAR,
class VARCHAR,
stages_won VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average year that has a car that won 0 stages with a position of DNF?
| SELECT AVG(year) FROM table_name_68 WHERE class = "car" AND stages_won = "0" AND position = "dnf" | sql_create_context |
CREATE TABLE table_67636 (
"Prod. No." text,
"Title" text,
"Written by" text,
"Directed by" text,
"Original airdate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the title of the episode originally aired on February 2, 2008?
| SELECT "Title" FROM table_67636 WHERE "Original airdate" = 'february 2, 2008' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.icd9_code = "3734" | mimicsql_data |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TI... | SELECT SALARY, DEPARTMENT_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
CREATE TABLE table_2394 (
"District" text,
"Capital City" text,
"Area (km\u00b2)" real,
"Area (sq.mi)" real,
"Population (2005 est)" real,
"2-letter abbreviation" text,
"3-letter abbreviation" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- W... | SELECT "Population (2005 est)" FROM table_2394 WHERE "3-letter abbreviation" = 'CYO' | wikisql |
CREATE TABLE fgwyjzb (
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 gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '冯明远' AND gwyjzb.MED_SER_ORG_NO = '9007676' AND NOT gwyjzb.IN_DIAG_DIS_NM LIKE '%化脓性%' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '冯明远' AND fgwyjzb.MED_SER_ORG_NO = '9007676' AND NOT fgwyjzb.IN_DIAG_DIS_NM LIKE '%化脓性%' | css |
CREATE TABLE table_63191 (
"Year" real,
"Title" text,
"Billboard Hot 100" text,
"UK Singles Chart" text,
"Album" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the UK singles chart for the album psychotic supper, in the year 1992, with a tit... | SELECT "UK Singles Chart" FROM table_63191 WHERE "Album" = 'psychotic supper' AND "Year" = '1992' AND "Title" = 'song & emotion' | 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 ReviewRejectionReasons (
Id number,
Name text,
Descr... | SELECT * FROM Tags ORDER BY Count DESC LIMIT 100 | sede |
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 WHERE demographic.ethnicity = "WHITE" AND demographic.dob_year < "2065" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.