instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_38460 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team (League)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What college did Jamie Butt go to?
| SELECT "College/Junior/Club Team (League)" FROM table_38460 WHERE "Player" = 'jamie butt' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,... | SELECT JYLX FROM jybgb WHERE BGDH = '48426577162' | css |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.MED_SER_ORG_NO = '9987120' AND qtb.MED_ORG_DEPT_NM = '小儿胃肠外科' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.MED_SER_ORG_NO = '9987120' AND gyb.MED_ORG_DEPT_NM = '小儿胃肠外科' UNION SELECT zyb.MED_CLINIC_ID... | css |
CREATE TABLE table_71652 (
"Island" text,
"Location" text,
"Area ( ha )" real,
"Population" real,
"Height (m)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What island has a population over 76, a height over 210, and an area larger than 12068?
| SELECT "Island" FROM table_71652 WHERE "Population" > '76' AND "Height (m)" > '210' AND "Area ( ha )" > '12068' | 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 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.admission_type = "NEWBORN" AND demographic.admityear < "2164" | mimicsql_data |
CREATE TABLE table_name_37 (
opponent VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who did the Texan's play on Week 4?
| SELECT opponent FROM table_name_37 WHERE week = "4" | sql_create_context |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_dista... | 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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ... | atis |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_AGE <= 21) | css |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostHistory (
Id number,
... | SELECT COUNT(DISTINCT (p.Id)) FROM Posts AS p INNER JOIN PostHistory AS ph ON p.Id = ph.PostId WHERE NOT p.ClosedDate IS NULL AND p.OwnerUserId NOT IN (SELECT UserId FROM PostHistory AS ph WHERE ph.PostId = p.Id AND ph.PostHistoryTypeId IN (4, 5, 6)) | sede |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid nu... | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29309)) AND DATETIME(inputevents_cv.... | mimic_iii |
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departur... | SELECT DISTINCT airline_code FROM airline WHERE airline_code = 'UA' | atis |
CREATE TABLE table_21025437_3 (
series_no INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the lowest value under the column series no.?
| SELECT MIN(series_no) FROM table_21025437_3 | sql_create_context |
CREATE TABLE table_18481791_3 (
directed_by VARCHAR,
no_in_season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who directed season 1?
| SELECT directed_by FROM table_18481791_3 WHERE no_in_season = 1 | sql_create_context |
CREATE TABLE table_36035 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Score has a Date of 26 september 2004?
| SELECT "Score" FROM table_36035 WHERE "Date" = '26 september 2004' | wikisql |
CREATE TABLE table_10520 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Record for the game on October 30?
| SELECT "Record" FROM table_10520 WHERE "Date" = 'october 30' | wikisql |
CREATE TABLE table_name_2 (
webcast VARCHAR,
format VARCHAR,
callsign VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Tejano webcast has a callsign of KBDR?
| SELECT webcast FROM table_name_2 WHERE format = "tejano" AND callsign = "kbdr" | sql_create_context |
CREATE TABLE table_name_48 (
round INTEGER,
school VARCHAR,
pick VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the round for Arizona with a pick over 100?
| SELECT AVG(round) FROM table_name_48 WHERE school = "arizona" AND pick > 100 | sql_create_context |
CREATE TABLE table_43094 (
"Week" real,
"Date" text,
"Opponent" text,
"Time" text,
"Game Site" text,
"Result/Score" text,
"Record" text,
"Match Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the result/score for the match... | SELECT "Result/Score" FROM table_43094 WHERE "Match Report" = 'recap' AND "Week" = '14' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.icd9_code = "4160" | mimicsql_data |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName te... | SELECT P.Id AS "post_link", P.Score AS "SCORE PERG.", A.Score AS "SCORE RESP." FROM Posts AS P JOIN (SELECT Id, Score FROM Posts GROUP BY Id, Score) AS A ON P.AcceptedAnswerId = A.Id WHERE P.Score < @ScoreBaixo AND A.Score > @ScoreAlto | sede |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT All_Home, AVG(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY AVG(School_ID) DESC | nvbench |
CREATE TABLE Addresses (
address_id INTEGER,
line_1_number_building VARCHAR(80),
city VARCHAR(50),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(50),
country VARCHAR(50)
)
CREATE TABLE Vehicles (
vehicle_id INTEGER,
vehicle_details VARCHAR(255)
)
CREATE TABLE Staff (
staf... | SELECT payment_method_code, COUNT(*) FROM Customer_Payments GROUP BY payment_method_code ORDER BY COUNT(*) | nvbench |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose... | SELECT AVG(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 = 594 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)) AND chartev... | mimic_iii |
CREATE TABLE table_39249 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the Leading scorer when the Score was 89... | SELECT "Leading scorer" FROM table_39249 WHERE "Score" = '89–102' | wikisql |
CREATE TABLE table_36025 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is round 1's position?
| SELECT "Position" FROM table_36025 WHERE "Round" = '1' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.long_title = "Parenteral infusion of concentrated nutritional substances" | mimicsql_data |
CREATE TABLE Purchases (
purchase_transaction_id INTEGER,
purchase_details VARCHAR(255)
)
CREATE TABLE Investors (
investor_id INTEGER,
Investor_details VARCHAR(255)
)
CREATE TABLE Transactions_Lots (
transaction_id INTEGER,
lot_id INTEGER
)
CREATE TABLE Ref_Transaction_Types (
transactio... | 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 | nvbench |
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
Party int,
First_Elected real,
Committee text
)
CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptroller text,
A... | SELECT Committee, COUNT(Committee) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = "Democratic" GROUP BY Committee ORDER BY Committee | nvbench |
CREATE TABLE table_7668 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Format for the alfa records Label, and a Catalog of alca-9016?
| SELECT "Format" FROM table_7668 WHERE "Label" = 'alfa records' AND "Catalog" = 'alca-9016' | wikisql |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE ReviewTaskResults (
Id number,
... | WITH qs AS (SELECT YEAR(q.CreationDate) AS QuestionAskYear, MIN(CAST((a.CreationDate - q.CreationDate) AS FLOAT)) AS AnsweredDays FROM Posts AS q JOIN Posts AS a ON a.ParentId = q.Id AND a.PostTypeId = 2 WHERE q.PostTypeId = 1 GROUP BY q.Id, YEAR(q.CreationDate)), days AS (SELECT QuestionAskYear, CAST(AnsweredDays AS I... | sede |
CREATE TABLE Apartment_Buildings (
building_id INTEGER,
building_short_name CHAR(15),
building_full_name VARCHAR(80),
building_description VARCHAR(255),
building_address VARCHAR(255),
building_manager VARCHAR(50),
building_phone VARCHAR(80)
)
CREATE TABLE Apartment_Facilities (
apt_id I... | SELECT apt_type_code, COUNT(*) FROM Apartments GROUP BY apt_type_code ORDER BY COUNT(*) | nvbench |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%salzburg%' ORDER BY Reputation DESC LIMIT 100 | sede |
CREATE TABLE table_25618 (
"date (dd.mm.yyyy)" text,
"Tail number" text,
"Location" text,
"Fatalities" text,
"Brief description" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many fatalities were there in the crash described as crashed at take-... | SELECT "Fatalities" FROM table_25618 WHERE "Brief description" = 'Crashed at take-off due to engine failure' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (
med... | SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-161415' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1) AND NOT patient.admissionweight IS N... | eicu |
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE... | SELECT Nationality, COUNT(Nationality) FROM swimmer GROUP BY Nationality ORDER BY Nationality | nvbench |
CREATE TABLE table_27864 (
"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.
-- What settlement ... | SELECT "Settlement" FROM table_27864 WHERE "Cyrillic Name Other Names" = 'Мартонош (Hungarian: Martonos)' | wikisql |
CREATE TABLE table_name_87 (
home_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the home team for Windy Hill?
| SELECT home_team FROM table_name_87 WHERE venue = "windy hill" | 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.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Price | nvbench |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | SELECT microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 74392) AND microbiologyevents.spec_type_desc = 'catheter tip-iv' AND NOT microbiologyevents.org_name IS NULL ORDER BY microbiologyevents.charttime LIMIT... | mimic_iii |
CREATE TABLE table_name_7 (
margin_of_victory VARCHAR,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the margin of victory for nikki garrett?
| SELECT margin_of_victory FROM table_name_7 WHERE winner = "nikki garrett" | sql_create_context |
CREATE TABLE table_35373 (
"Game" real,
"February" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much February has a Score of 5 2, and Points of 70?
| SELECT COUNT("February") FROM table_35373 WHERE "Score" = '5–2' AND "Points" = '70' | wikisql |
CREATE TABLE reservations (
code number,
room text,
checkin text,
checkout text,
rate number,
lastname text,
firstname text,
adults number,
kids number
)
CREATE TABLE rooms (
roomid text,
roomname text,
beds number,
bedtype text,
maxoccupancy number,
basepric... | SELECT T1.firstname, T1.lastname FROM reservations AS T1 JOIN rooms AS T2 ON T1.room = T2.roomid WHERE T1.rate - T2.baseprice > 0 | spider |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost numb... | SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1902) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'absolute cd3 count') AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_T... | mimic_iii |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE departments (
DEPARTME... | SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY SUM(MANAGER_ID) | nvbench |
CREATE TABLE table_64066 (
"Name" text,
"Position" text,
"League Apps" text,
"League Goals" real,
"FA Cup Apps" text,
"FA Cup Goals" real,
"League Cup Apps" real,
"League Cup Goals" real,
"Total Apps" text,
"Total Goals" real
)
-- Using valid SQLite, answer the following questi... | SELECT MIN("FA Cup Goals") FROM table_64066 WHERE "FA Cup Apps" = '4' AND "Total Apps" = '49' AND "Total Goals" > '17' | wikisql |
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.marital_status = "SINGLE" AND demographic.age < "27" | mimicsql_data |
CREATE TABLE Products_for_hire (
daily_hire_cost VARCHAR,
product_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the daily hire costs for the products with substring 'Book' in its name?
| SELECT daily_hire_cost FROM Products_for_hire WHERE product_name LIKE '%Book%' | sql_create_context |
CREATE TABLE table_44680 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where was the fight located that lasted a time of 2... | SELECT "Location" FROM table_44680 WHERE "Time" = '2:33' | wikisql |
CREATE TABLE table_60321 (
"Position" real,
"Club" text,
"Played" real,
"Points" real,
"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 SUM("Losses") FROM table_60321 WHERE "Wins" = '15' AND "Position" > '3' | wikisql |
CREATE TABLE table_23286112_8 (
team VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the team for january 4
| SELECT team FROM table_23286112_8 WHERE date = "January 4" | sql_create_context |
CREATE TABLE table_37208 (
"Season" real,
"Winner" text,
"Finalist" text,
"Score" text,
"Host City" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the winner during the 2009 season?
| SELECT "Winner" FROM table_37208 WHERE "Season" = '2009' | wikisql |
CREATE TABLE table_14835826_1 (
series__number VARCHAR,
us_viewers__millions_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many series had 18.77 million viewers?
| SELECT COUNT(series__number) FROM table_14835826_1 WHERE us_viewers__millions_ = "18.77" | sql_create_context |
CREATE TABLE table_25429 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Opponent in the final" text,
"Score in the final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the most recent year where the final score is ... | SELECT MAX("Year") FROM table_25429 WHERE "Score in the final" = '4–6, 3–6, 6–4, 5–7' | wikisql |
CREATE TABLE table_203_839 (
id number,
"station" text,
"type" text,
"latitude" text,
"longitude" text,
"el. (m)" number,
"opened" number,
"closed" number,
"coordinates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- its operating ye... | SELECT "station" FROM table_203_839 WHERE "closed" - "opened" = 37 | squall |
CREATE TABLE table_204_449 (
id number,
"no" number,
"episode" text,
"title" text,
"original airdate" text,
"viewers" number,
"nightly\nrank" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many episodes had less than .9 viewers ?
| SELECT COUNT("episode") FROM table_204_449 WHERE "viewers" < 0.9 | squall |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Has_Allergy (
StuID INTEGE... | SELECT AllergyType, COUNT(AllergyType) FROM Allergy_Type GROUP BY AllergyType | nvbench |
CREATE TABLE table_name_28 (
home_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team plays at home at Windy Hill?
| SELECT home_team FROM table_name_28 WHERE venue = "windy hill" | sql_create_context |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
... | SELECT MAX(LENGTH(REPLACE(DisplayName, ' ', ''))) AS maxDisplayNameLength, MIN(LENGTH(REPLACE(DisplayName, ' ', ''))) AS minDisplayNameLength, AVG(LENGTH(REPLACE(DisplayName, ' ', ''))) AS avgDisplayNameLength FROM Users | sede |
CREATE TABLE table_11896 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Away team played when they had a Crowd of ... | SELECT "Away team" FROM table_11896 WHERE "Crowd" > '29,000' | wikisql |
CREATE TABLE table_76340 (
"Name" text,
"Background" text,
"Title" text,
"Appointment" text,
"Presentation of Credentials" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was appointed on October 24, 1997?
| SELECT "Name" FROM table_76340 WHERE "Appointment" = 'october 24, 1997' | wikisql |
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 c... | SELECT COUNT(*) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'alanine aminotransferase (alt)') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 70206) AND STRFTIME('%y', labevents.charttime) = '2103' | mimic_iii |
CREATE TABLE table_29360 (
"Vertical" real,
"Horizontal" real,
"Aspect ratio" text,
"Pixel aspect ratio" text,
"Scanning" text,
"Frame rate ( Hz )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the aspect ratio if the vertical pixel is... | SELECT "Aspect ratio" FROM table_29360 WHERE "Vertical" = '480' AND "Pixel aspect ratio" = '1:1' | 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 COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '孔诗蕊' AND t_kc22.STA_DATE BETWEEN '2020-11-19' AND '2021-05-01' AND t_kc22.SELF_PAY_AMO > 411.49 UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_NM = '孔诗蕊' AND t... | css |
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 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', 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 = '033-221... | eicu |
CREATE TABLE table_36167 (
"1950" real,
"1960" real,
"1970" real,
"1980" real,
"1990" real,
"1996[2]" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 1996[2] larger than 68, and a 1990 smaller than 352, and a 1970 larger than 105, and a 1950 of 1... | SELECT SUM("1980") FROM table_36167 WHERE "1996[2]" > '68' AND "1990" < '352' AND "1970" > '105' AND "1950" = '119' | wikisql |
CREATE TABLE table_name_68 (
lomavren VARCHAR,
hindi VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Lomavren associated with a Hindi of s t?
| SELECT lomavren FROM table_name_68 WHERE hindi = "sāt" | sql_create_context |
CREATE TABLE table_61951 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Gil Morgan's Place?
| SELECT "Place" FROM table_61951 WHERE "Player" = 'gil morgan' | wikisql |
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER... | SELECT AllergyType, COUNT(*) FROM Allergy_Type GROUP BY AllergyType ORDER BY AllergyType DESC | nvbench |
CREATE TABLE table_140 (
"! Late 1941" text,
"Late 1942" real,
"Sept. 1943" real,
"Late 1943" real,
"Late 1944" real,
"1978 Veteran membership" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most late 1943 with late 194 in slovenia
| SELECT MAX("Late 1943") FROM table_140 WHERE "! Late 1941" = 'Slovenia' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Dexmedetomidine" | mimicsql_data |
CREATE TABLE table_33748 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- After week 9, which games had an attendance greater than 24,229?
| SELECT "Date" FROM table_33748 WHERE "Attendance" > '24,229' AND "Week" > '9' | wikisql |
CREATE TABLE table_29770377_1 (
route_via VARCHAR,
destination VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the route for the destination of guruvayur?
| SELECT route_via FROM table_29770377_1 WHERE destination = "Guruvayur" | sql_create_context |
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight te... | 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 = 'DETROIT' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'TORONT... | atis |
CREATE TABLE table_name_13 (
club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where did the Vit ria de Set bal club place in the 2006-2007 season?
| SELECT 2006 AS _2007_season FROM table_name_13 WHERE club = "vitória de setúbal" | sql_create_context |
CREATE TABLE table_26141160_2 (
position VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Dallas Burn's draft pick was which position?
| SELECT position FROM table_26141160_2 WHERE team = "Dallas Burn" | sql_create_context |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
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 n... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT microbiologyevents.hadm_id FROM microbiologyevents WHERE microbiologyevents.spec_type_desc = 'bronchial brush' AND STRFTIME('%y', microbiologyevents.charttime) = '2105') | mimic_iii |
CREATE TABLE table_18074 (
"Rank" real,
"Building" text,
"Address" text,
"Height" text,
"Storeys" real,
"Completed" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the maximum completed for address on 410 22nd st e
| SELECT "Completed" FROM table_18074 WHERE "Address" = '410 22nd St E' | wikisql |
CREATE TABLE table_name_22 (
high_assists VARCHAR,
high_points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the high assists of Hamilton (24)?
| SELECT high_assists FROM table_name_22 WHERE high_points = "hamilton (24)" | sql_create_context |
CREATE TABLE table_45614 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was ... | SELECT "Date of appointment" FROM table_45614 WHERE "Outgoing manager" = 'paco chaparro' | wikisql |
CREATE TABLE table_203_613 (
id number,
"formula" text,
"color" text,
"symmetry" text,
"space group" text,
"no" number,
"pearson symbol" text,
"a (pm)" number,
"b (pm)" number,
"c (pm)" number,
"z" number,
"density, g/cm3" number
)
-- Using valid SQLite, answer the foll... | SELECT "formula" FROM table_203_613 WHERE "density, g/cm3" = 3.74 | squall |
CREATE TABLE table_29063233_1 (
directed_by VARCHAR,
uk_viewers__million_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who directed the episode with a UK viewership of exactly 5.77 million?
| SELECT directed_by FROM table_29063233_1 WHERE uk_viewers__million_ = "5.77" | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "DIVORCED" AND diagnoses.long_title = "Tricuspid valve disorders, specified as nonrheumatic" | mimicsql_data |
CREATE TABLE table_51727 (
"Player" text,
"Nationality" text,
"Position" text,
"Years for Jazz" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which School/Club Team did Andre Wakefield play for?
| SELECT "School/Club Team" FROM table_51727 WHERE "Player" = 'andre wakefield' | wikisql |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text... | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'SEATTLE' AND ground_service.city_code = city.city_code | atis |
CREATE TABLE table_name_80 (
name VARCHAR,
reaction VARCHAR,
lane VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had a reaction larger than 0.17400000000000002 and a lane larger than 6?
| SELECT name FROM table_name_80 WHERE reaction > 0.17400000000000002 AND lane > 6 | sql_create_context |
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 inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttim... | SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19096)) AND DATETIME(inputevents_cv.charttime, 'start of year') = DATETIME(CURRENT_TIME(),... | mimic_iii |
CREATE TABLE table_61355 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the opponent with a 0-1 record?
| SELECT "Opponent" FROM table_61355 WHERE "Record" = '0-1' | wikisql |
CREATE TABLE table_12792876_2 (
club VARCHAR,
points_against VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which club gave up 714 points?
| SELECT club FROM table_12792876_2 WHERE points_against = "714" | sql_create_context |
CREATE TABLE table_21779 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Points difference" text,
"Bonus Points" text,
"Points" text
)
-- Using valid SQLite, answer the following questions for the tables provided a... | SELECT "Played" FROM table_21779 WHERE "Points for" = '362' | wikisql |
CREATE TABLE table_name_8 (
song VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What song came out on March 8, 2008?
| SELECT song FROM table_name_8 WHERE date = "march 8, 2008" | sql_create_context |
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 All_Games, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent | nvbench |
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE dataset (
datasetid int,
datasetname va... | SELECT DISTINCT dataset.datasetid FROM dataset, keyphrase, paperdataset, paperkeyphrase WHERE keyphrase.keyphrasename = 'knn classification' AND paperdataset.datasetid = dataset.datasetid AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paperkeyphrase.paperid = paperdataset.paperid | scholar |
CREATE TABLE table_2889810_2 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many minimum 350cc has
| SELECT MIN(350 AS cc) FROM table_2889810_2 | sql_create_context |
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description... | SELECT DISTINCT flight.departure_time FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight, food_service WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code... | atis |
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 hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON 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_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.zyjzjlb... | css |
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 mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND ... | css |
CREATE TABLE employment (
Company_ID int,
People_ID int,
Year_working int
)
CREATE TABLE company (
Company_ID real,
Name text,
Headquarters text,
Industry text,
Sales_in_Billion real,
Profits_in_Billion real,
Assets_in_Billion real,
Market_Value_in_Billion real
)
CREATE TAB... | SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_77254 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the tournament when the winning score is 9 (69-69-70-71=279)?
| SELECT "Tournament" FROM table_77254 WHERE "Winning score" = '–9 (69-69-70-71=279)' | wikisql |
CREATE TABLE table_name_96 (
opponent VARCHAR,
week VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent after week 8 that had 72,190 people in attendance?
| SELECT opponent FROM table_name_96 WHERE week > 8 AND attendance = "72,190" | sql_create_context |
CREATE TABLE table_22527 (
"Term Abroad" text,
"2000/01" text,
"2001/02" text,
"2002/03" text,
"2003/04" text,
"2004/05" text,
"2005/06" text,
"2006/07" text,
"2007/08" text,
"2008/09" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT "Term Abroad" FROM table_22527 WHERE "2001/02" = '0.5' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.