instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE grapes (
id number,
grape text,
color text
)
CREATE TABLE wine (
no number,
grape text,
winery text,
appelation text,
state text,
name text,
year number,
price number,
score number,
cases number,
drink text
)
CREATE TABLE appellations (
no numbe... | SELECT COUNT(*), grape FROM wine GROUP BY grape | spider |
CREATE TABLE table_name_74 (
surface VARCHAR,
opponents_in_the_final VARCHAR,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which Surface has Opponents in the final of mark edmondson sherwood stewart, and a Tournament of dallas , u.s.?
| SELECT surface FROM table_name_74 WHERE opponents_in_the_final = "mark edmondson sherwood stewart" AND tournament = "dallas , u.s." | sql_create_context |
CREATE TABLE table_221 (
"Race Name" text,
"Circuit" text,
"Date" text,
"Winning driver" text,
"Constructor" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which driver won at the Sachsenring circuit?
| SELECT "Winning driver" FROM table_221 WHERE "Circuit" = 'Sachsenring' | wikisql |
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 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.short_title = "Fetal/neonatal jaund NOS" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE Invoices (
invoice_number INTEGER,
order_id INTEGER,
invoice_date DATETIME
)
CREATE TABLE Customers (
customer_id INTEGER,
customer_first_name VARCHAR(50),
customer_middle_initial VARCHAR(1),
customer_last_name VARCHAR(50),
gender VARCHAR(1),
email_address VARCHAR(255),... | SELECT T2.customer_first_name, T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id ORDER BY T1.customer_id DESC | nvbench |
CREATE TABLE table_65952 (
"Rank" real,
"Athlete" text,
"Country" text,
"Time" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What rank is Germany?
| SELECT "Rank" FROM table_65952 WHERE "Country" = 'germany' | wikisql |
CREATE TABLE table_name_8 (
races INTEGER,
poles VARCHAR,
fastest_laps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of races when there was more than 1 pole, and the fastest number of laps was less than 4?
| SELECT SUM(races) FROM table_name_8 WHERE poles > 1 AND fastest_laps < 4 | sql_create_context |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
pro... | 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, fare, fare_basis, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND fare_basis.class_type = 'THRIFT' AND fa... | atis |
CREATE TABLE table_37041 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the class with call sign of k220cp
| SELECT "Class" FROM table_37041 WHERE "Call sign" = 'k220cp' | wikisql |
CREATE TABLE table_name_60 (
region VARCHAR,
catalog__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the region for the album with a catalog number of 7567-83061-2?
| SELECT region FROM table_name_60 WHERE catalog__number = "7567-83061-2" | sql_create_context |
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 text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Drug induced neutropenia" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE table_76164 (
"Rank" real,
"Company" text,
"Headquarters" text,
"Industry" text,
"Sales (billion $)" real,
"Profits (billion $)" real,
"Assets (billion $)" real,
"Market Value (billion $)" real
)
-- Using valid SQLite, answer the following questions for the tables provided... | SELECT MIN("Profits (billion $)") FROM table_76164 WHERE "Sales (billion $)" = '425.7' AND "Rank" > '4' | wikisql |
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_city_affected real
)
CREATE TABLE region (
Region_id int,
Region_code text,
Region_name text
)
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Nu... | SELECT Name, Number_Deaths FROM storm WHERE Number_Deaths >= 1 | nvbench |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid numb... | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'xanax' AND STRFTIME('%y', medication.drugstarttime)... | eicu |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TA... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'antibacterials - macrolide' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME... | eicu |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TA... | SELECT Id AS "post_link", CreationDate FROM Posts WHERE PostTypeId = 1 AND Tags = '<api>' | sede |
CREATE TABLE table_65252 (
"Opposing Team" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Status with an Against larger than 15?
| SELECT "Status" FROM table_65252 WHERE "Against" > '15' | wikisql |
CREATE TABLE table_25401874_1 (
games_played VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many games played catagories are there for Lauren McGee?
| SELECT COUNT(games_played) FROM table_25401874_1 WHERE name = "Lauren McGee" | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.insurance = "Medicare" | mimicsql_data |
CREATE TABLE table_name_6 (
event VARCHAR,
year VARCHAR,
competition VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Event, when Year is 2002, and when Competition is European Indoor Championships?
| SELECT event FROM table_name_6 WHERE year = 2002 AND competition = "european indoor championships" | sql_create_context |
CREATE TABLE table_28433 (
"Specimen weight/size" text,
"Calculated activity ( Bq )" real,
"Calculated activity ( Ci )" text,
"Estimated activity GR(api)" text,
"Estimated exposure ( mRem )/hr*" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the ... | SELECT COUNT("Calculated activity ( Bq )") FROM table_28433 WHERE "Specimen weight/size" = '1000 g / 8.79 cm' | wikisql |
CREATE TABLE table_13658 (
"Year" text,
"Start" text,
"Qual" text,
"Rank" text,
"Finish" text,
"Laps" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Start has a Qual of 207.590?
| SELECT "Start" FROM table_13658 WHERE "Qual" = '207.590' | wikisql |
CREATE TABLE table_28243691_1 (
team_nickname VARCHAR,
institution VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the mascot for texas tech university?
| SELECT team_nickname FROM table_28243691_1 WHERE institution = "Texas Tech University" | sql_create_context |
CREATE TABLE table_31630 (
"Species" text,
"Lived when ( mya )" text,
"Lived where" text,
"Fossil record" text,
"Discovery / publication of name" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the fossil record for name of 1994/2003
| SELECT "Fossil record" FROM table_31630 WHERE "Discovery / publication of name" = '1994/2003' | wikisql |
CREATE TABLE table_5791 (
"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 Opponents in the final has a Partnering of tom s carbonell o... | SELECT "Opponents in the final" FROM table_5791 WHERE "Partnering" = 'tomás carbonell' AND "Date" = 'march 28, 1995' | wikisql |
CREATE TABLE table_64338 (
"play" text,
"author" text,
"company" text,
"base" text,
"country" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which play was done by the Radu Stanca National Theatre company?
| SELECT "play" FROM table_64338 WHERE "company" = 'radu stanca national theatre' | wikisql |
CREATE TABLE competition_record (
Competition_ID int,
Farm_ID int,
Rank int
)
CREATE TABLE farm (
Farm_ID int,
Year int,
Total_Horses real,
Working_Horses real,
Total_Cattle real,
Oxen real,
Bulls real,
Cows real,
Pigs real,
Sheep_and_Goats real
)
CREATE TABLE city ... | SELECT Status, AVG(Population) FROM city GROUP BY Status | nvbench |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
P... | SELECT p.Id AS "post_link", p.CommentCount, p.LastActivityDate FROM Posts AS p JOIN PostTypes AS pt ON pt.Id = p.PostTypeId WHERE p.Score = 0 AND p.ClosedDate IS NULL AND (p.AnswerCount IS NULL OR p.AnswerCount = 0) AND p.AcceptedAnswerId IS NULL AND p.CreationDate < DATEADD(DAY, -7, GETDATE()) AND pt.Name = 'Question'... | sede |
CREATE TABLE table_27533 (
"Round" text,
"Circuit" text,
"Date" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning driver" text,
"Winning team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the fastest lap for round 14
| SELECT COUNT("Fastest Lap") FROM table_27533 WHERE "Round" = '14' | wikisql |
CREATE TABLE table_75631 (
"Year" text,
"Name" text,
"Political affiliation" text,
"Deputy" text,
"Deputy's affiliation" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Year was james mcclure Deputy, and the Name is robert mcphearson?
| SELECT "Year" FROM table_75631 WHERE "Deputy" = 'james mcclure' AND "Name" = 'robert mcphearson' | wikisql |
CREATE TABLE table_1341453_32 (
party VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What party is Frank Lobiondo a member of?
| SELECT party FROM table_1341453_32 WHERE incumbent = "Frank LoBiondo" | sql_create_context |
CREATE TABLE table_73246 (
"Round #" real,
"Pick #" real,
"NFL Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What NFL team was the player with pick number 28 drafted to?
| SELECT "NFL Team" FROM table_73246 WHERE "Pick #" = '28' | wikisql |
CREATE TABLE table_70672 (
"Volume:Issue" text,
"Issue Date(s)" text,
"Weeks on Top" real,
"Song" text,
"Artist" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Issue Date(s) of Volume:Issue of 32:18-19?
| SELECT "Issue Date(s)" FROM table_70672 WHERE "Volume:Issue" = '32:18-19' | wikisql |
CREATE TABLE table_52587 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average grid with brm and under 63 laps?
| SELECT AVG("Grid") FROM table_52587 WHERE "Constructor" = 'brm' AND "Laps" < '63' | wikisql |
CREATE TABLE table_47295 (
"Year" real,
"Date" text,
"Winner" text,
"Result" text,
"Loser" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the winner when the Philadelphia eagles were the losers after 1958 at Yankee Stadi... | SELECT "Winner" FROM table_47295 WHERE "Loser" = 'philadelphia eagles' AND "Location" = 'yankee stadium' AND "Year" > '1958' | wikisql |
CREATE TABLE table_name_2 (
date VARCHAR,
partner VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date had Alexander Krasnorutskiy as a partner with a score of 6 3, 4 6, 6 2?
| SELECT date FROM table_name_2 WHERE partner = "alexander krasnorutskiy" AND score = "6–3, 4–6, 6–2" | sql_create_context |
CREATE TABLE table_10582 (
"Name" text,
"City" text,
"Height feet/m" text,
"Year" real,
"Period" text,
"Surpassed by" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the height which has a surpassed by of book tower
| SELECT "Height feet/m" FROM table_10582 WHERE "Surpassed by" = 'book tower' | wikisql |
CREATE TABLE table_5704 (
"Year" real,
"League" text,
"Wins" real,
"Losses" real,
"Draws" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest points that has w-2 (w-league) as the league, and draws greater than 2?
| SELECT MIN("Points") FROM table_5704 WHERE "League" = 'w-2 (w-league)' AND "Draws" > '2' | wikisql |
CREATE TABLE table_23274514_7 (
date VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the date for 17-32
| SELECT date FROM table_23274514_7 WHERE record = "17-32" | sql_create_context |
CREATE TABLE table_train_160 (
"id" int,
"alt" float,
"systolic_blood_pressure_sbp" int,
"ast" float,
"platelet_count" float,
"diastolic_blood_pressure_dbp" int,
"serum_creatinine" float,
"triglyceride_tg" float,
"hypertension" bool,
"NOUSE" float
)
-- Using valid SQLite, answe... | SELECT * FROM table_train_160 WHERE hypertension = 1 OR (systolic_blood_pressure_sbp > 160 OR diastolic_blood_pressure_dbp > 100) | criteria2sql |
CREATE TABLE addresses (
address_id number,
address_content text,
city text,
zip_postcode text,
state_province_county text,
country text,
other_address_details text
)
CREATE TABLE products (
product_id number,
product_details text
)
CREATE TABLE order_items (
order_id number,
... | SELECT COUNT(DISTINCT t3.product_id) FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t1.customer_name = "Rodrick Heaney" | spider |
CREATE TABLE table_69906 (
"Kanji" text,
"Name" text,
"Builder" text,
"Laid down" text,
"Launched" text,
"Completed" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the completed date of ?
| SELECT "Completed" FROM table_69906 WHERE "Kanji" = '蓬' | wikisql |
CREATE TABLE table_name_54 (
current_car VARCHAR,
number_of_cars VARCHAR,
year_started VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Current car has a Number of cars of 1, and a Year started of 1999?
| SELECT current_car FROM table_name_54 WHERE number_of_cars = 1 AND year_started = 1999 | sql_create_context |
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2146" AND procedures.icd9_code = "8852" | mimicsql_data |
CREATE TABLE table_name_52 (
pos VARCHAR,
team VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position did the driver from Audi Sport North America finish in the race after 2008?
| SELECT pos FROM table_name_52 WHERE team = "audi sport north america" AND year > 2008 | sql_create_context |
CREATE TABLE document_types (
document_type_code text,
document_description text
)
CREATE TABLE tasks (
task_id number,
project_id number,
task_details text,
eg agree objectives text
)
CREATE TABLE research_staff (
staff_id number,
employer_organisation_id number,
staff_details tex... | SELECT project_details FROM projects WHERE organisation_id IN (SELECT organisation_id FROM projects GROUP BY organisation_id ORDER BY COUNT(*) DESC LIMIT 1) | spider |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
... | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'transplant surgery consultation')) AND STRFT... | eicu |
CREATE TABLE table_28898974_3 (
date VARCHAR,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When edward shaw is the winner what is the date?
| SELECT date FROM table_28898974_3 WHERE winner = "Edward Shaw" | sql_create_context |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
... | 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 = 20034) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemid IN (S... | mimic_iii |
CREATE TABLE Tryout (
pID numeric(5,0),
cName varchar(20),
pPos varchar(8),
decision varchar(3)
)
CREATE TABLE Player (
pID numeric(5,0),
pName varchar(20),
yCard varchar(3),
HS numeric(5,0)
)
CREATE TABLE College (
cName varchar(20),
state varchar(2),
enr numeric(5,0)
)
... | SELECT pName, COUNT(pName) FROM Player AS T1 JOIN Tryout AS T2 ON T1.pID = T2.pID GROUP BY pName ORDER BY T1.pName | nvbench |
CREATE TABLE table_26145 (
"Code name" text,
"Market name" text,
"Platform" text,
"Release date" text,
"Android version" text,
"System on chip" text,
"RAM" text,
"ROM" text,
"Display" text,
"Weight" text,
"Battery ( mAh )" real,
"Bluetooth" text,
"Wi-Fi" text,
"NF... | SELECT "Battery ( mAh )" FROM table_26145 WHERE "NFC" = 'Yes' AND "Weight" = '126g' | wikisql |
CREATE TABLE table_39091 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
)
-- Using valid SQLite, answer the following questions f... | SELECT "Losing bonus" FROM table_39091 WHERE "Try bonus" = '10' | wikisql |
CREATE TABLE table_48335 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who are the players that placed t2?
| SELECT "Player" FROM table_48335 WHERE "Place" = 't2' | wikisql |
CREATE TABLE table_name_1 (
ofsted VARCHAR,
school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many values for Ofsted occurr at Chowbent Primary School?
| SELECT COUNT(ofsted) FROM table_name_1 WHERE school = "chowbent primary school" | sql_create_context |
CREATE TABLE table_name_15 (
races VARCHAR,
wins INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of Races when there were more than 8 wins?
| SELECT COUNT(races) FROM table_name_15 WHERE wins > 8 | 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_kc22 WHERE t_kc22.t_kc21_MED_SER_ORG_NO = '0036548' AND t_kc22.SOC_SRT_DIRE_CD = '6599-i' | css |
CREATE TABLE table_52413 (
"Position" real,
"Club" text,
"Played" real,
"Points" text,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.... | SELECT AVG("Goals against") FROM table_52413 WHERE "Goals for" > '35' AND "Goal Difference" = '20' | wikisql |
CREATE TABLE schedule (
title VARCHAR,
directed_by VARCHAR,
film_id VARCHAR
)
CREATE TABLE film (
title VARCHAR,
directed_by VARCHAR,
film_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the title and director of the films without... | SELECT title, directed_by FROM film WHERE NOT film_id IN (SELECT film_id FROM schedule) | sql_create_context |
CREATE TABLE table_203_42 (
id number,
"model" text,
"class" text,
"length" text,
"fuel" text,
"starting price" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how long is the aspect ?
| SELECT "length" FROM table_203_42 WHERE "model" = 'aspect' | squall |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReas... | SELECT VoteTypeId, COUNT(*) FROM PostFeedback GROUP BY VoteTypeId | sede |
CREATE TABLE table_name_81 (
decision VARCHAR,
home VARCHAR,
visitor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who made the decision when detroit was the home team and boston was the visitor?
| SELECT decision FROM table_name_81 WHERE home = "detroit" AND visitor = "boston" | sql_create_context |
CREATE TABLE table_72789 (
"Morse Taper number" real,
"Taper" text,
"A" text,
"B (max)" text,
"C (max)" text,
"D (max)" text,
"E (max)" text,
"F" real,
"G" text,
"H" text,
"J" text,
"K" text
)
-- Using valid SQLite, answer the following questions for the tables provided... | SELECT MIN("Morse Taper number") FROM table_72789 WHERE "Taper" = '1:20.047' | wikisql |
CREATE TABLE table_name_70 (
points INTEGER,
engine VARCHAR,
entrant VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the most points when Maserati made the engine, and a Entrant of owen racing organisation?
| SELECT MAX(points) FROM table_name_70 WHERE engine = "maserati" AND entrant = "owen racing organisation" | sql_create_context |
CREATE TABLE table_name_94 (
home VARCHAR,
away VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Home with an Away that is toronto rebels?
| SELECT home FROM table_name_94 WHERE away = "toronto rebels" | sql_create_context |
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.icd9_code = "4233" | mimicsql_data |
CREATE TABLE courses (
course_id number,
author_id number,
subject_id number,
course_name text,
course_description text
)
CREATE TABLE subjects (
subject_id number,
subject_name text
)
CREATE TABLE students (
student_id number,
date_of_registration time,
date_of_latest_logon ti... | SELECT address_line_1 FROM course_authors_and_tutors WHERE personal_name = "Cathrine" | spider |
CREATE TABLE table_name_32 (
removal_treaty__year_signed_ VARCHAR,
nation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which removal treaty covered the chickasaw nation?
| SELECT removal_treaty__year_signed_ FROM table_name_32 WHERE nation = "chickasaw" | sql_create_context |
CREATE TABLE table_203_724 (
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.
-- how many nations won at least 10 silver medals ?
| SELECT COUNT("nation") FROM table_203_724 WHERE "silver" >= 10 | squall |
CREATE TABLE table_203_699 (
id number,
"name" text,
"parentage" text,
"size" text,
"flower colour" text,
"flower type" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- cornfish snow and cornfish spring are both what size ?
| SELECT "size" FROM table_203_699 WHERE "name" = 'cornish snow' | squall |
CREATE TABLE table_name_52 (
wins VARCHAR,
cuts_made VARCHAR,
top_10 VARCHAR,
events VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of wins that has a top-10 of 2, and more events than 8, more cuts than 6?
| SELECT COUNT(wins) FROM table_name_52 WHERE top_10 = 2 AND events > 8 AND cuts_made > 6 | sql_create_context |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE l... | 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 procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age >... | mimic_iii |
CREATE TABLE table_name_89 (
attendance VARCHAR,
guest VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the attendance of the game that had an away team of FK Mogren?
| SELECT attendance FROM table_name_89 WHERE guest = "fk mogren" | sql_create_context |
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 T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T2.Founder DESC | nvbench |
CREATE TABLE table_203_117 (
id number,
"region/country" text,
"1882-\n1918" number,
"1919-\n1948" number,
"1948-\n1951" number,
"1952-\n1960" number,
"1961-\n1971" number,
"1972-\n1979" number,
"1980-\n1989" number,
"1990-\n2001" number,
"2002-\n2010" number,
"2011-\n201... | SELECT "1990-\n2001" FROM table_203_117 WHERE "region/country" = 'total' | squall |
CREATE TABLE table_204_487 (
id number,
"home team" text,
"score" text,
"visiting team" text,
"location" text,
"venue" text,
"door" text,
"surface" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the surface at most of the games ... | SELECT "surface" FROM table_204_487 GROUP BY "surface" ORDER BY COUNT(*) DESC LIMIT 1 | squall |
CREATE TABLE CLASS (
CLASS_CODE varchar(5),
CRS_CODE varchar(10),
CLASS_SECTION varchar(2),
CLASS_TIME varchar(20),
CLASS_ROOM varchar(8),
PROF_NUM int
)
CREATE TABLE STUDENT (
STU_NUM int,
STU_LNAME varchar(15),
STU_FNAME varchar(15),
STU_INIT varchar(1),
STU_DOB datetime,
... | SELECT PROF_OFFICE, COUNT(PROF_OFFICE) FROM PROFESSOR AS T1 JOIN EMPLOYEE AS T2 ON T1.EMP_NUM = T2.EMP_NUM GROUP BY PROF_OFFICE ORDER BY PROF_OFFICE DESC | nvbench |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id... | SELECT q.Id, q.CreationDate, u.Reputation FROM Posts AS q INNER JOIN Users AS u ON u.Id = q.OwnerUserId WHERE q.PostTypeId = 1 ORDER BY q.CreationDate DESC LIMIT 100 | sede |
CREATE TABLE table_663 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What episode was dire... | SELECT "Title" FROM table_663 WHERE "Directed by" = 'David Duchovny' | wikisql |
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 All_Documents (
Document_ID INTEGER,
... | SELECT Date_in_Location_From, COUNT(Date_in_Location_From) FROM Document_Locations | nvbench |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId numbe... | SELECT Title FROM Posts, Tags WHERE Tags.TagName LIKE '%microsoft-cognitive' | sede |
CREATE TABLE table_name_48 (
score VARCHAR,
venue VARCHAR,
competition VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the final score of the Friendly Competition in Manama, Bahrain?
| SELECT score FROM table_name_48 WHERE venue = "manama, bahrain" AND competition = "friendly" | sql_create_context |
CREATE TABLE table_name_70 (
population INTEGER,
area_km_2 VARCHAR,
status VARCHAR,
census_ranking VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Population of the Town with a Census Ranking of 1,379 of 5,008 and an Area km 2 smaller than... | SELECT MAX(population) FROM table_name_70 WHERE status = "town" AND census_ranking = "1,379 of 5,008" AND area_km_2 < 8.35 | sql_create_context |
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.JYKSBM, jybgb.JYKSMC FROM jybgb WHERE jybgb.JZLSH = '67404927173' | css |
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 person_info.XM FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE jybgb.BGDH = '0... | css |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
... | SELECT Id AS "post_link", CreationDate, Score, AnswerCount, AcceptedAnswerId AS "post_link", Body FROM Posts WHERE PostTypeId = 1 AND TIME_TO_STR(CreationDate, '%y') >= 2014 AND Score >= 0 AND (STR_POSITION(Title, 'microservice') > 0 OR STR_POSITION(Body, 'microservice') > 0) | sede |
CREATE TABLE Office_locations (
building_id int,
company_id int,
move_in_year int
)
CREATE TABLE Companies (
id int,
name text,
Headquarters text,
Industry text,
Sales_billion real,
Profits_billion real,
Assets_billion real,
Market_Value_billion text
)
CREATE TABLE building... | SELECT T3.name, COUNT(T3.name) FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T3.name ORDER BY T3.name DESC | nvbench |
CREATE TABLE table_25724294_2 (
field_goals INTEGER,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many field goals did Walter Rheinschild have?
| SELECT MAX(field_goals) FROM table_25724294_2 WHERE player = "Walter Rheinschild" | sql_create_context |
CREATE TABLE table_34628 (
"Spacecraft" text,
"Destination" text,
"Launched" text,
"Closest approach" text,
"Time elapsed" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- With the Destination of Jupiter and the Closest approach of 4 February 2004, wh... | SELECT "Time elapsed" FROM table_34628 WHERE "Destination" = 'jupiter' AND "Closest approach" = '4 february 2004' | wikisql |
CREATE TABLE table_name_63 (
gold INTEGER,
nation VARCHAR,
bronze VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What average gold has China (chn) as the nation with a bronze greater than 1?
| SELECT AVG(gold) FROM table_name_63 WHERE nation = "china (chn)" AND bronze > 1 | sql_create_context |
CREATE TABLE table_22308881_2 (
in_county_tuition_per_credit_hour__fall_2009_ VARCHAR,
college VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much was the cost of in-county tuition per credit hour at the Gloucester College by the fall of 2009?
| SELECT in_county_tuition_per_credit_hour__fall_2009_ FROM table_22308881_2 WHERE college = "Gloucester" | sql_create_context |
CREATE TABLE table_15004 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the nation when bronze is less than 4 and the total is more than 4
| SELECT "Nation" FROM table_15004 WHERE "Total" > '4' AND "Bronze" < '4' | wikisql |
CREATE TABLE table_64279 (
"Year" text,
"League" text,
"Position" text,
"Leading Scorer" text,
"FA Cup" text,
"FA Trophy" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the league when the fa cup is qr4 and the fa trophy is qf?
| SELECT "League" FROM table_64279 WHERE "FA Cup" = 'qr4' AND "FA Trophy" = 'qf' | wikisql |
CREATE TABLE table_name_2 (
score VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Score of the game with a Record of 5 4 3?
| SELECT score FROM table_name_2 WHERE record = "5–4–3" | sql_create_context |
CREATE TABLE table_203_789 (
id number,
"season" text,
"team" text,
"country" text,
"division" number,
"apps" number,
"goals" number,
"assists" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what team is in division 2 ?
| SELECT "team" FROM table_203_789 WHERE "division" = 2 | squall |
CREATE TABLE table_name_20 (
home_team VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Home team of the Kidderminster Harriers Away game?
| SELECT home_team FROM table_name_20 WHERE away_team = "kidderminster harriers" | sql_create_context |
CREATE TABLE table_8959 (
"Tournament" text,
"Country" text,
"Location" text,
"Began" real,
"Court surface" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the tournament when the court surface is clay and began in 1892?
| SELECT "Tournament" FROM table_8959 WHERE "Court surface" = 'clay' AND "Began" = '1892' | wikisql |
CREATE TABLE table_21690 (
"Athlete" text,
"Event" text,
"Round of 32" text,
"Round of 16" text,
"Quarterfinals" text,
"Semifinals" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who did Nabil Kassel face in the Round of 32?
| SELECT "Round of 32" FROM table_21690 WHERE "Athlete" = 'Nabil Kassel' | wikisql |
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 chartevent... | SELECT MIN(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 = 12797)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arte... | mimic_iii |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,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 regions (
REGION_ID... | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
CREATE TABLE table_19162 (
"School Name" text,
"City" text,
"Students" real,
"FTE Teachers" text,
"Pupil/Teacher Ratio" text,
"School Level" text,
"Low Grade" text,
"High Grade" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the ... | SELECT MAX("Students") FROM table_19162 WHERE "Pupil/Teacher Ratio" = '20.8' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.