instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_67422 (
"Company" text,
"Type" text,
"Principal activities" text,
"Incorporated in" text,
"Group's Equity Shareholding (10 March 2010)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the incorporated for principal activites o... | SELECT "Incorporated in" FROM table_67422 WHERE "Principal activities" = 'travel agency' | wikisql |
CREATE TABLE table_18734298_1 (
no_in_series VARCHAR,
directed_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many series were directed by Rob Renzetti?
| SELECT COUNT(no_in_series) FROM table_18734298_1 WHERE directed_by = "Rob Renzetti" | sql_create_context |
CREATE TABLE film (
Film_ID VARCHAR
)
CREATE TABLE film_market_estimation (
Film_ID VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the title of the film that has the highest high market estimation.
| SELECT t1.title FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID ORDER BY high_estimate DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_38607 (
"Team" text,
"Recopa 1995" text,
"Supercopa 1995" text,
"CONMEBOL 1995" text,
"Copa Libertadores 1996" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Team has a round 1 CONMEBOL 1995?
| SELECT "Team" FROM table_38607 WHERE "CONMEBOL 1995" = 'round 1' | wikisql |
CREATE TABLE table_46084 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Score on January 23?
| SELECT "Score" FROM table_46084 WHERE "Date" = 'january 23' | 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 jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYE... | SELECT FIRST_NAME, DEPARTMENT_ID FROM employees ORDER BY DEPARTMENT_ID | nvbench |
CREATE TABLE table_41525 (
"Outcome" text,
"Year" text,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what year was Xavier Malisse the runner-up with scores o... | SELECT "Year" FROM table_41525 WHERE "Outcome" = 'runner-up' AND "Score" = '4–6, 6–4, [8–10]' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
... | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-199074' AND patient.hospitaldischargetime IS NULL)) AND me... | eicu |
CREATE TABLE table_name_47 (
venue VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Venue was used when the Home team was geelong?
| SELECT venue FROM table_name_47 WHERE home_team = "geelong" | sql_create_context |
CREATE TABLE table_name_13 (
game_modes VARCHAR,
pinyin VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which game modes have Pinyin of ch oj m l u sh ji ?
| SELECT game_modes FROM table_name_13 WHERE pinyin = "chāojí mǎlìōu shìjiè" | sql_create_context |
CREATE TABLE table_74203 (
"No. in series" text,
"No. in season" text,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Prod. code" text,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.... | SELECT COUNT("No. in season") FROM table_74203 WHERE "Title" = 'That''s So Sonny' | wikisql |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT MED_ORG_DEPT_CD, IN_DIAG_DIS_CD, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '2806498' GROUP BY MED_ORG_DEPT_CD, IN_DIAG_DIS_CD | css |
CREATE TABLE table_36661 (
"Season" real,
"Driver" text,
"Team" text,
"Tyre" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is total amount of points for the 2007 season?
| SELECT SUM("Points") FROM table_36661 WHERE "Season" = '2007' | wikisql |
CREATE TABLE restaurant (
id int,
name varchar,
food_type varchar,
city_name varchar,
rating "decimal
)
CREATE TABLE location (
restaurant_id int,
house_number int,
street_name varchar,
city_name varchar
)
CREATE TABLE geographic (
city_name varchar,
county varchar,
reg... | SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'san francisco' AND restaurant.id = location.restaurant_id AND restaurant.name = 'jamerican cuisine' | restaurants |
CREATE TABLE table_name_12 (
nationality VARCHAR,
pick VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the nationality for pick of 16
| SELECT nationality FROM table_name_12 WHERE pick = 16 | sql_create_context |
CREATE TABLE table_65794 (
"Edition" text,
"Year" text,
"City" text,
"Country" text,
"Date" text,
"No. of Events" real,
"Top Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Events have a Country of trinidad and tobago, and a Da... | SELECT "No. of Events" FROM table_65794 WHERE "Country" = 'trinidad and tobago' AND "Date" = 'march 30-april 1' | wikisql |
CREATE TABLE Ref_Transaction_Types (
transaction_type_code VARCHAR(10),
transaction_type_description VARCHAR(80)
)
CREATE TABLE Investors (
investor_id INTEGER,
Investor_details VARCHAR(255)
)
CREATE TABLE Transactions (
transaction_id INTEGER,
investor_id INTEGER,
transaction_type_code VA... | SELECT lot_details, COUNT(lot_details) FROM Investors AS T1 JOIN Lots AS T2 ON T1.investor_id = T2.investor_id WHERE T1.Investor_details = "l" GROUP BY lot_details ORDER BY lot_details DESC | nvbench |
CREATE TABLE table_41912 (
"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.
-- When was Shannon Long the Centerfold model?
| SELECT "Date" FROM table_41912 WHERE "Centerfold model" = 'shannon long' | wikisql |
CREATE TABLE table_54093 (
"Name" text,
"GNIS Feature ID" real,
"State" text,
"County" text,
"Type" text,
"USGS 7.5' Map" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total GNIS Feature ID with a County of idaho?
| SELECT SUM("GNIS Feature ID") FROM table_54093 WHERE "County" = 'idaho' | wikisql |
CREATE TABLE table_71517 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which runner-up has a 10 strokes margin of victory?
| SELECT "Runner-up" FROM table_71517 WHERE "Margin of victory" = '10 strokes' | wikisql |
CREATE TABLE Research_Staff (
staff_id INTEGER,
employer_organisation_id INTEGER,
staff_details VARCHAR(255)
)
CREATE TABLE Documents (
document_id INTEGER,
document_type_code VARCHAR(10),
grant_id INTEGER,
sent_date DATETIME,
response_received_date DATETIME,
other_details VARCHAR(2... | SELECT T2.organisation_details, T1.organisation_id FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_details | nvbench |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE diagnosis (
diagnosisid num... | 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-28507')) AND intakeoutput.celllabel = 'chest... | eicu |
CREATE TABLE table_1341472_20 (
first_elected INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the first election year listed?
| SELECT MIN(first_elected) FROM table_1341472_20 | sql_create_context |
CREATE TABLE table_16878 (
"Yard Name" text,
"Location (city, state)" text,
"1st Ship Delivery Date" text,
"Ship Types Delivered" text,
"Total Number of Ways" text,
"total vessels built" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was th... | SELECT "1st Ship Delivery Date" FROM table_16878 WHERE "Total Number of Ways" = '12 ways' | wikisql |
CREATE TABLE table_23214055_2 (
district VARCHAR,
nairs VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the district for nairs 8.2
| SELECT district FROM table_23214055_2 WHERE nairs = "8.2" | sql_create_context |
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 ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%santiago%chile%' ORDER BY Reputation DESC | sede |
CREATE TABLE college (
cname text,
state text,
enr number
)
CREATE TABLE player (
pid number,
pname text,
ycard text,
hs number
)
CREATE TABLE tryout (
pid number,
cname text,
ppos text,
decision text
)
-- Using valid SQLite, answer the following questions for the tables ... | SELECT pname FROM player WHERE ycard = 'yes' ORDER BY hs DESC | spider |
CREATE TABLE table_64375 (
"Chord" text,
"Root" text,
"Major third" text,
"Augmented fifth" text,
"Minor seventh" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the listed chord for a Minor seventh of F?
| SELECT "Chord" FROM table_64375 WHERE "Minor seventh" = 'f' | wikisql |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT ACC_Road, COUNT(ACC_Road) FROM basketball_match GROUP BY ACC_Road ORDER BY COUNT(ACC_Road) DESC | nvbench |
CREATE TABLE table_name_42 (
date VARCHAR,
total VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What day was the total smaller than 19 at Venue of anz stadium?
| SELECT date FROM table_name_42 WHERE total < 19 AND venue = "anz stadium" | sql_create_context |
CREATE TABLE table_name_74 (
connection_with_australia VARCHAR,
connection_with_america VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the connection with Australia when the connection with America shows born in the u.s.; mother is u.s. citizen?
| SELECT connection_with_australia FROM table_name_74 WHERE connection_with_america = "born in the u.s.; mother is u.s. citizen" | sql_create_context |
CREATE TABLE table_65430 (
"Season" text,
"1st round" text,
"2nd round" text,
"3rd round" text,
"Finals" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which 3rd round has a 1st round of ?
| SELECT "3rd round" FROM table_65430 WHERE "1st round" = '—' | wikisql |
CREATE TABLE table_78961 (
"Goalkeeper" text,
"Goals" real,
"Matches" real,
"Average" real,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest Average, when Goals is '34', and when Matches is less than 37?
| SELECT MAX("Average") FROM table_78961 WHERE "Goals" = '34' AND "Matches" < '37' | wikisql |
CREATE TABLE table_40902 (
"Rank" real,
"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 number of silver where the rank is higher than 4 and bronze is smaller than 1?
| SELECT COUNT("Silver") FROM table_40902 WHERE "Rank" > '4' AND "Bronze" < '1' | wikisql |
CREATE TABLE table_27713030_11 (
team VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent for the game with a score of w 94 88 (ot)?
| SELECT team FROM table_27713030_11 WHERE score = "W 94–88 (OT)" | sql_create_context |
CREATE TABLE table_name_68 (
high_rebounds VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the High rebounds with a Team that is charlotte?
| SELECT high_rebounds FROM table_name_68 WHERE team = "charlotte" | sql_create_context |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT COUNT(DISTINCT IN_DIAG_DIS_CD) FROM t_kc21 WHERE PERSON_ID = '22165131' AND IN_HOSP_DATE BETWEEN '2010-10-05' AND '2014-07-21' | css |
CREATE TABLE table_18791 (
"City of license /Market" text,
"Station" text,
"Channel TV ( DT )" text,
"Owned since" text,
"Primary affiliation" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What city has channel tv (dt) 25 (31)?
| SELECT "City of license /Market" FROM table_18791 WHERE "Channel TV ( DT )" = '25 (31)' | wikisql |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationD... | SELECT AVG(CAST(ROUND(Reputation, -FLOOR(LOG(10, Reputation))) AS INT)) AS UserReputation, SUM(CASE WHEN ClosedDate IS NULL THEN 1 ELSE 0 END) / CAST(COUNT(Posts.Id) AS FLOAT) AS "PercentOpen" FROM Posts INNER JOIN Users ON (Users.Id = Posts.OwnerUserId) WHERE PostTypeId = 1 GROUP BY ROUND(Reputation, -FLOOR(LOG(10, Re... | sede |
CREATE TABLE employee (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the total number of employees.
| SELECT COUNT(*) FROM employee | sql_create_context |
CREATE TABLE table_name_73 (
game VARCHAR,
road_team VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What game number was played on April 23, with Boston as the road team?
| SELECT game FROM table_name_73 WHERE road_team = "boston" AND date = "april 23" | sql_create_context |
CREATE TABLE table_26558_1 (
record_low VARCHAR,
precip VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record lowest temperature with a precipitation of 1.71 in.?
| SELECT record_low FROM table_26558_1 WHERE precip = "1.71 in." | sql_create_context |
CREATE TABLE table_52838 (
"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.
-- In which venue did the home team score 10.11 (71... | SELECT "Venue" FROM table_52838 WHERE "Home team score" = '10.11 (71)' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
a... | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '002-35416' AND DATETIME(patient.hospitaladmittime) >= DATETIME(CURRENT_TIME(), '-4 year') | eicu |
CREATE TABLE table_name_35 (
country VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country is Nick Price from?
| SELECT country FROM table_name_35 WHERE player = "nick price" | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TA... | SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pneumothorax') AS t1 GROUP BY t1.uniquepid HAVING MIN(t1.diagnos... | eicu |
CREATE TABLE journalist (
journalist_ID int,
Name text,
Nationality text,
Age text,
Years_working int
)
CREATE TABLE event (
Event_ID int,
Date text,
Venue text,
Name text,
Event_Attendance int
)
CREATE TABLE news_report (
journalist_ID int,
Event_ID int,
Work_Type ... | SELECT Work_Type, AVG(Years_working) FROM journalist AS t1 JOIN news_report AS t2 ON t1.journalist_ID = t2.journalist_ID GROUP BY t2.Work_Type | nvbench |
CREATE TABLE table_57257 (
"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 the score for the home team for the venu... | SELECT "Home team score" FROM table_57257 WHERE "Venue" = 'glenferrie oval' | wikisql |
CREATE TABLE table_53093 (
"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 was the attendence of the game on 26 April ... | SELECT "Crowd" FROM table_53093 WHERE "Date" = '26 april 1948' AND "Away team" = 'hawthorn' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2131.0" AND lab.itemid = "51248" | mimicsql_data |
CREATE TABLE party (
Party_ID int,
Party_Theme text,
Location text,
First_year text,
Last_year text,
Number_of_hosts int
)
CREATE TABLE host (
Host_ID int,
Name text,
Nationality text,
Age text
)
CREATE TABLE party_host (
Party_ID int,
Host_ID int,
Is_Main_in_Charge... | SELECT Last_year, COUNT(Last_year) FROM party WHERE Party_Theme = "Spring" OR Party_Theme = "Teqnology" GROUP BY Last_year ORDER BY COUNT(Last_year) DESC | nvbench |
CREATE TABLE table_20431 (
"Episode Number" real,
"Air Date" text,
"Guest Host" text,
"Musical Guest (Song performed)" text,
"Who knows the most about the guest host? panelists" text,
"Coat Of Cash Wearing Celebrity" text
)
-- Using valid SQLite, answer the following questions for the tables p... | SELECT "Musical Guest (Song performed)" FROM table_20431 WHERE "Who knows the most about the guest host? panelists" = 'Jermaine Jackson and Nora Sands' | wikisql |
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 competition_record (
Competition_ID int,
Farm_ID int,
Rank int
)
CREATE TABLE city ... | SELECT Year, COUNT(Year) FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID ORDER BY COUNT(Year) | nvbench |
CREATE TABLE table_name_75 (
owner_s_ VARCHAR,
team VARCHAR,
driver_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the owner of RSS Racing that driver Ryan Sieg belongs to?
| SELECT owner_s_ FROM table_name_75 WHERE team = "rss racing" AND driver_s_ = "ryan sieg" | sql_create_context |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number... | SELECT Score, Id AS "post_link" FROM Posts WHERE Score = 9 AND TIME_TO_STR(CreationDate, '%YEAR') = 2016 ORDER BY CreationDate DESC | sede |
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
)
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT Rank, COUNT(*) FROM captain GROUP BY Rank ORDER BY Rank | nvbench |
CREATE TABLE table_74998 (
"Year" real,
"Date" text,
"Winner" text,
"Result" text,
"Loser" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the year when the Winner was the new york jets, with a Result of 24 17, played at ... | SELECT SUM("Year") FROM table_74998 WHERE "Winner" = 'new york jets' AND "Result" = '24–17' AND "Location" = 'giants stadium' | wikisql |
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 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '006-124193' AND patient.hospitaldischargetime IS NULL | eicu |
CREATE TABLE table_name_40 (
school VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What School did Terrence Jones play for?
| SELECT school FROM table_name_40 WHERE player = "terrence jones" | 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 WHERE demographic.admission_type = "ELECTIVE" AND demographic.age < "67" | mimicsql_data |
CREATE TABLE table_51743 (
"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 the score of the away team where the hom... | SELECT "Away team score" FROM table_51743 WHERE "Home team score" = '13.20 (98)' | wikisql |
CREATE TABLE table_42191 (
"Name" text,
"Start of Reign" real,
"End of Reign" text,
"Birth Name" text,
"Title" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the end of reign for Dimitar Stojkovski?
| SELECT "End of Reign" FROM table_42191 WHERE "Birth Name" = 'dimitar stojkovski' | wikisql |
CREATE TABLE table_name_14 (
writer VARCHAR,
film VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the writer of the film Run?
| SELECT writer FROM table_name_14 WHERE film = "run" | sql_create_context |
CREATE TABLE trip (
id number,
duration number,
start_date text,
start_station_name text,
start_station_id number,
end_date text,
end_station_name text,
end_station_id number,
bike_id number,
subscription_type text,
zip_code number
)
CREATE TABLE status (
station_id numb... | SELECT COUNT(*) FROM trip AS T1 JOIN station AS T2 ON T1.end_station_id = T2.id WHERE T2.city <> "San Francisco" | spider |
CREATE TABLE table_name_3 (
partner VARCHAR,
outcome VARCHAR,
opponents_in_the_final VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHich Partner has a Outcome of winner, and a Opponents in the final of rick leach jim pugh?
| SELECT partner FROM table_name_3 WHERE outcome = "winner" AND opponents_in_the_final = "rick leach jim pugh" | sql_create_context |
CREATE TABLE table_22512 (
"Year" real,
"1st Place Team" text,
"2nd Place Team" text,
"3rd Place Team" text,
"4th Place Team" text,
"Host Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many years was the 2nd place team merchants, t... | SELECT COUNT("Year") FROM table_22512 WHERE "2nd Place Team" = 'Merchants, Tampico, IL' | wikisql |
CREATE TABLE table_name_3 (
analog_channel VARCHAR,
digital_channel VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Digital channel of 32 belongs to what analog channel?
| SELECT analog_channel FROM table_name_3 WHERE digital_channel = "32" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime t... | 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 = '010-8740') AND NOT patient.unitdischargetime IS ... | eicu |
CREATE TABLE table_14395920_2 (
winner VARCHAR,
stage VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won stage 18?
| SELECT winner FROM table_14395920_2 WHERE stage = 18 | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | SELECT procedures.icd9_code, prescriptions.drug_type FROM procedures INNER JOIN prescriptions ON procedures.hadm_id = prescriptions.hadm_id WHERE procedures.subject_id = "18480" | mimicsql_data |
CREATE TABLE table_77997 (
"Round" text,
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Round with a Opponent with blackburn?
| SELECT "Round" FROM table_77997 WHERE "Opponent" = 'blackburn' | wikisql |
CREATE TABLE table_train_126 (
"id" int,
"childhood_febrile_seizure" bool,
"neurodegenerative_disease" bool,
"cns_disease" bool,
"head_injury" bool,
"stroke" bool,
"renal_disease" bool,
"cerebrovascular_disease" bool,
"hepatic_disease" bool,
"headache" bool,
"cardiovascular_d... | SELECT * FROM table_train_126 WHERE head_injury = 1 OR (neurological_disease = 1 OR stroke = 1 OR (seizure_disorder = 1 AND childhood_febrile_seizure = 0) OR headache = 1) | criteria2sql |
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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.long_title = "Umbilical vein catheterization" | mimicsql_data |
CREATE TABLE table_204_905 (
id number,
"team" text,
"wins" number,
"losses" number,
"win %" number,
"gb" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many teams won at least 85 games ?
| SELECT COUNT("team") FROM table_204_905 WHERE "wins" >= 85 | squall |
CREATE TABLE table_77982 (
"Player" text,
"Height" text,
"School" text,
"Hometown" text,
"College" text,
"NBA Draft" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which school is in Riverside, CA?
| SELECT "School" FROM table_77982 WHERE "Hometown" = 'riverside, ca' | wikisql |
CREATE TABLE table_name_9 (
area VARCHAR,
years VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which area has Years of 1 8, and a Name of broomfield school?
| SELECT area FROM table_name_9 WHERE years = "1–8" AND name = "broomfield school" | sql_create_context |
CREATE TABLE aircraft (
Aircraft_ID int(11),
Aircraft varchar(50),
Description varchar(50),
Max_Gross_Weight varchar(50),
Total_disk_area varchar(50),
Max_disk_Loading varchar(50)
)
CREATE TABLE pilot (
Pilot_Id int(11),
Name varchar(50),
Age int(11)
)
CREATE TABLE airport_aircraft... | SELECT Aircraft, COUNT(*) FROM aircraft AS T1 JOIN match AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft ORDER BY Aircraft DESC | nvbench |
CREATE TABLE table_name_79 (
game_site VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the game site week 15?
| SELECT game_site FROM table_name_79 WHERE week = 15 | sql_create_context |
CREATE TABLE table_name_40 (
team VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Team has a Score of 89-123?
| SELECT team FROM table_name_40 WHERE score = "89-123" | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number... | SELECT COUNT(DISTINCT patient.patienthealthsystemstayid) FROM patient WHERE patient.uniquepid = '015-66570' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | eicu |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
... | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'RELIGION' AND course.number = 347 AND semester.semester = 'WN' AND semester.semester_id = course... | advising |
CREATE TABLE mzb (
CLINIC_ID 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,
INSU_TYPE text,
IN... | SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '4874710' AND t_kc22.SOC_SRT_DIRE_CD = '563098' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.MED_SER_ORG_NO = '4874710' AND t_kc22.SOC_SRT_DIRE_CD = '563098' UN... | css |
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 * FROM person_info JOIN hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjz... | css |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
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),
CO... | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(MANAGER_ID) | nvbench |
CREATE TABLE table_48797 (
"Rider" text,
"Manufacturer" text,
"Laps" text,
"Time/Retired" text,
"Grid" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the rider with 22 laps and a +19.435 time/retired?
| SELECT "Rider" FROM table_48797 WHERE "Laps" = '22' AND "Time/Retired" = '+19.435' | wikisql |
CREATE TABLE table_12534 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text,
"Streak" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Opponent has a Score of 92 93?
| SELECT "Opponent" FROM table_12534 WHERE "Score" = '92–93' | wikisql |
CREATE TABLE table_54830 (
"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.
-- When st kilda played as the away team, what date... | SELECT "Date" FROM table_54830 WHERE "Away team" = 'st kilda' | wikisql |
CREATE TABLE table_29666 (
"Episode Air Date" text,
"Audition City" text,
"Audition Date" text,
"Audition Venue" text,
"Guest Fourth Judge" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List all episode air dates whose audition venues were Nego Qui... | SELECT "Episode Air Date" FROM table_29666 WHERE "Audition Venue" = 'Nego Quirido Sambadrome' | wikisql |
CREATE TABLE table_name_44 (
year VARCHAR,
venue VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- when is the venue nikos goumas stadium and the score is 2 2 4 4 a.e.t. 6 5 pso?
| SELECT year FROM table_name_44 WHERE venue = "nikos goumas stadium" AND score = "2–2 4–4 a.e.t. 6–5 pso" | sql_create_context |
CREATE TABLE table_name_49 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is 2005 when 2003 is A, 2007 is 2r and 2012 is 3r?
| SELECT 2005 FROM table_name_49 WHERE 2003 = "a" AND 2007 = "2r" AND 2012 = "3r" | sql_create_context |
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 * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM... | css |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE admissions (
row_id numb... | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 63676) AND microbiologyevents.spec_type_desc = 'swab' AND STRFTIME('%y', microbiologyevents.charttime) >= '2105' | mimic_iii |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime t... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT procedures_icd.icd9_code FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 74392) AND STRFTIME('%y', procedures_icd.charttime) <= '2102' ORDER ... | mimic_iii |
CREATE TABLE table_name_85 (
place VARCHAR,
to_par VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the place number for the player with a To Par score of 'E'?
| SELECT place FROM table_name_85 WHERE to_par = "e" | sql_create_context |
CREATE TABLE table_53198 (
"Player" text,
"Car." real,
"Yards" text,
"Avg." text,
"TD's" real,
"Long" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the long for the player with 26 carries?
| SELECT "Long" FROM table_53198 WHERE "Car." = '26' | wikisql |
CREATE TABLE table_name_37 (
owgr_pts INTEGER,
dates VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which OWGR pts has Dates of may 10-13?
| SELECT SUM(owgr_pts) FROM table_name_37 WHERE dates = "may 10-13" | sql_create_context |
CREATE TABLE table_name_79 (
opponent VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which opponent has a time of 1:50?
| SELECT opponent FROM table_name_79 WHERE time = "1:50" | sql_create_context |
CREATE TABLE table_58555 (
"Country" text,
"Interview" real,
"Swimsuit" real,
"Evening Gown" real,
"Average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total average for swimsuits smaller than 9.62 in Colorado?
| SELECT SUM("Average") FROM table_58555 WHERE "Swimsuit" < '9.62' AND "Country" = 'colorado' | 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 FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.IN_DIAG_DIS_CD = 'H72.575' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb.IN_DIAG_... | css |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
... | SELECT Users.DisplayName, Users.Location, SUM(Posts.Score) AS TotalScore, 'https://stackoverflow.com/users/' + CAST(Users.Id AS TEXT) AS Profile FROM Posts INNER JOIN Users ON Posts.OwnerUserId = Users.Id INNER JOIN PostTags ON Posts.Id = PostTags.PostId INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE TagName = '##ta... | sede |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.