instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_18600760_3 (
county VARCHAR,
latitude VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the county with a latitude of 46.770977?
| SELECT county FROM table_18600760_3 WHERE latitude = "46.770977" | 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 dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
... | SELECT DISTINCT aircraft.aircraft_code FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, equipment_sequence, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city... | atis |
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 AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_AGE <= 3) | css |
CREATE TABLE geographic (
city_name varchar,
county varchar,
region varchar
)
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_n... | SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'san francisco' AND location.street_name = 'buchanan' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5 | restaurants |
CREATE TABLE table_name_46 (
lane INTEGER,
time VARCHAR,
country VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Lanes have a Country of jamaica, and a Name of kerron stewart, and a Time larger than 22?
| SELECT SUM(lane) FROM table_name_46 WHERE country = "jamaica" AND name = "kerron stewart" AND time > 22 | sql_create_context |
CREATE TABLE table_name_15 (
name VARCHAR,
status VARCHAR,
last_performance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the actor who played Billy Elliot in the Final Cast with a Last Performance of 13 June 2009?
| SELECT name FROM table_name_15 WHERE status = "final cast" AND last_performance = "13 june 2009" | sql_create_context |
CREATE TABLE table_11545282_19 (
player VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player's position is the shooting guard?
| SELECT player FROM table_11545282_19 WHERE position = "Shooting guard" | sql_create_context |
CREATE TABLE table_60587 (
"Shooter" text,
"Event" text,
"Rank points" text,
"Score points" text,
"Total" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total when the score points show Olympic bronze medalist?
| SELECT "Total" FROM table_60587 WHERE "Score points" = 'olympic bronze medalist' | wikisql |
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 compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE restriction (
... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city... | atis |
CREATE TABLE table_19722233_5 (
assists VARCHAR,
minutes VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many assists did the player who played 195 minutes make
| SELECT assists FROM table_19722233_5 WHERE minutes = 195 | sql_create_context |
CREATE TABLE table_38393 (
"Name" text,
"Years of Operation" text,
"Location" text,
"Historical Photos" text,
"Year Clubhouse Constructed" text,
"Sign-in/Bicker" text,
"Year co-ed" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- During what Y... | SELECT "Years of Operation" FROM table_38393 WHERE "Location" = 'prospect 33 prospect ave' | 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_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '11103457' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 9690.79) | css |
CREATE TABLE table_name_94 (
wager VARCHAR,
winner VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the wager on August 23, 1992 where vampiro was the winner?
| SELECT wager FROM table_name_94 WHERE winner = "vampiro" AND date = "august 23, 1992" | 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.expire_flag = "0" AND procedures.long_title = "Insertion of endotracheal tube" | mimicsql_data |
CREATE TABLE table_33546 (
"Player" text,
"Span" text,
"Start" text,
"Tries" text,
"Conv" text,
"Pens" text,
"Drop" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Start has a 0 Conv, 0 Pens and 8 Tries?
| SELECT "Start" FROM table_33546 WHERE "Conv" = '0' AND "Pens" = '0' AND "Tries" = '8' | wikisql |
CREATE TABLE table_61788 (
"Sign" text,
"Domicile" text,
"Detriment" text,
"Exaltation" text,
"Fall" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which exaltation has a fall of moon?
| SELECT "Exaltation" FROM table_61788 WHERE "Fall" = 'moon' | wikisql |
CREATE TABLE table_40342 (
"Venue" text,
"Location" text,
"Capacity" text,
"Owner" text,
"Environment" text,
"Year Built" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the location of the venue owned by johnson c. smith university?
| SELECT "Location" FROM table_40342 WHERE "Owner" = 'johnson c. smith university' | wikisql |
CREATE TABLE table_name_47 (
date VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date has @ new orleans as the team?
| SELECT date FROM table_name_47 WHERE team = "@ new orleans" | sql_create_context |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
... | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'PHOENIX' AND ground_service.city_code = city.city_code | atis |
CREATE TABLE table_41162 (
"Week of" text,
"Tier" text,
"Winner" text,
"Runner-up" text,
"Semi finalists" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What week was the Runner-up Lori McNeil?
| SELECT "Week of" FROM table_41162 WHERE "Runner-up" = 'lori mcneil' | 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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND prescriptions.drug = "HydrALAZINE HCl" | mimicsql_data |
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 demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "0" AND procedures.long_title = "Partial glossectomy" | mimicsql_data |
CREATE TABLE table_22818 (
"Programme" text,
"Date(s) of original removal" text,
"Original channel" text,
"Date of return" text,
"New channel(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When five is the new channel what is the date of origina... | SELECT "Date(s) of original removal" FROM table_22818 WHERE "New channel(s)" = 'Five' | wikisql |
CREATE TABLE table_name_48 (
director_s_ VARCHAR,
date VARCHAR,
recipient VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the director of the film that Sister Films received an award for on 2/3/05?
| SELECT director_s_ FROM table_name_48 WHERE date = "2/3/05" AND recipient = "sister films" | sql_create_context |
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Stomach ulcer NOS" AND lab."CATEGORY" = "Blood Gas" | mimicsql_data |
CREATE TABLE table_204_3 (
id number,
"rank" number,
"name" text,
"nationality" text,
"time" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how much shorter of a time did eduardo piccinini receive than diego cuenca ?
| SELECT ABS((SELECT "time" FROM table_204_3 WHERE "name" = 'eduardo piccinini') - (SELECT "time" FROM table_204_3 WHERE "name" = 'diego cuenca')) | squall |
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 = "WIDOWED" AND diagnoses.short_title = "Vascular hamartomas" | mimicsql_data |
CREATE TABLE table_24901152_2 (
score VARCHAR,
outcome VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When winner is the outcome what is the score?
| SELECT score FROM table_24901152_2 WHERE outcome = "Winner" | sql_create_context |
CREATE TABLE table_10920 (
"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.
-- What school did delray brooks go to?
| SELECT "School" FROM table_10920 WHERE "Player" = 'delray brooks' | wikisql |
CREATE TABLE table_name_80 (
games INTEGER,
manager VARCHAR,
wins VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the sum of Richie Hebner winning games that were smaller 34?
| SELECT SUM(games) FROM table_name_80 WHERE manager = "richie hebner" AND wins < 34 | 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 qtb.OUT_DIAG_DOC_CD, qtb.OUT_DIAG_DOC_NM FROM qtb WHERE qtb.PERSON_NM = '华雨华' GROUP BY qtb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC UNION SELECT gyb.OUT_DIAG_DOC_CD, gyb.OUT_DIAG_DOC_NM FROM gyb WHERE gyb.PERSON_NM = '华雨华' GROUP BY gyb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC UNION SELECT zyb.OUT_DIAG_DOC_CD, zyb.OU... | css |
CREATE TABLE table_73394 (
"State (class)" text,
"Vacator" text,
"Reason for change" text,
"Successor" text,
"Date of successors formal installation" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of vacators when the successor wa... | SELECT COUNT("Vacator") FROM table_73394 WHERE "Successor" = 'William H. Wells ( F )' | wikisql |
CREATE TABLE table_71376 (
"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 "Tries for" FROM table_71376 WHERE "Tries against" = '38' | wikisql |
CREATE TABLE table_204_954 (
id number,
"no." number,
"country" text,
"2009 winter\nuniversiade" number,
"2007 wjcc" number,
"2007 wwcc" number,
"2008 wjcc" number,
"2008 wwcc" number,
"points" number
)
-- Using valid SQLite, answer the following questions for the tables provided a... | SELECT "country" FROM table_204_954 ORDER BY "points" DESC LIMIT 1 | squall |
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 t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 3 | eicu |
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2167" AND procedures.short_title = "Atria septa def rep NEC" | mimicsql_data |
CREATE TABLE table_43283 (
"Administrative Panel" real,
"Agricultural Panel" real,
"Cultural and Educational Panel" real,
"Industrial and Commercial Panel" real,
"Labour Panel" real,
"National University of Ireland" real,
"University of Dublin" real,
"Nominated by the Taoiseach" real,
... | SELECT AVG("Industrial and Commercial Panel") FROM table_43283 WHERE "Cultural and Educational Panel" < '0' | 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.gender = "F" AND demographic.dob_year < "2197" | mimicsql_data |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE medication (
medi... | SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'glucocorticoids - prednisone' AND DATETI... | eicu |
CREATE TABLE table_name_25 (
attendance INTEGER,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the least attendance that has 3-5 as a record?
| SELECT MIN(attendance) FROM table_name_25 WHERE record = "3-5" | sql_create_context |
CREATE TABLE hall_of_fame (
player_id TEXT,
yearid INTEGER,
votedby TEXT,
ballots NUMERIC,
needed NUMERIC,
votes NUMERIC,
inducted TEXT,
category TEXT,
needed_note TEXT
)
CREATE TABLE manager (
player_id TEXT,
year INTEGER,
team_id TEXT,
league_id TEXT,
inseason ... | SELECT yearid, COUNT(yearid) FROM hall_of_fame ORDER BY COUNT(yearid) | nvbench |
CREATE TABLE table_1566852_6 (
centerfold_model VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the subject of 20 questions in those issues where Jillian Grace is the centerfold model?
| SELECT 20 AS _questions FROM table_1566852_6 WHERE centerfold_model = "Jillian Grace" | sql_create_context |
CREATE TABLE table_42673 (
"Benchmark" text,
"Crown height" text,
"Pavilion depth" text,
"Table diameter" text,
"Girdle thickness" text,
"Crown angle" text,
"Pavilion angle" text,
"Brilliance Grade" text
)
-- Using valid SQLite, answer the following questions for the tables provided ab... | SELECT "Pavilion depth" FROM table_42673 WHERE "Brilliance Grade" = '100%' AND "Pavilion angle" = 'n/a' | wikisql |
CREATE TABLE table_1147701_5 (
model_name VARCHAR,
engine_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the model of the enginge d5252 t?
| SELECT model_name FROM table_1147701_5 WHERE engine_code = "D5252 T" | sql_create_context |
CREATE TABLE table_23308178_8 (
record VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many games did they play with 88 points?
| SELECT COUNT(record) FROM table_23308178_8 WHERE points = 88 | sql_create_context |
CREATE TABLE table_203_352 (
id number,
"position" number,
"swara" text,
"short name" text,
"notation" text,
"mnemonic" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- list each pair of swaras that share the same position .
| SELECT "swara" FROM table_203_352 WHERE "position" IN (SELECT "position" FROM table_203_352 GROUP BY "position" HAVING COUNT(*) > 1) | squall |
CREATE TABLE table_19292 (
"Celebrity" text,
"Famous for" text,
"Entered" text,
"Exited" text,
"Finished" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people finished 9th?
| SELECT COUNT("Exited") FROM table_19292 WHERE "Finished" = '9th' | wikisql |
CREATE TABLE table_43558 (
"Branding" text,
"Callsign" text,
"Frequency" text,
"Power (kW)" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the power of Mom's Radio 101.5 Tacloban?
| SELECT "Power (kW)" FROM table_43558 WHERE "Branding" = 'mom''s radio 101.5 tacloban' | wikisql |
CREATE TABLE table_name_95 (
relationship VARCHAR,
age_at_death VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the relationship of the woman who died at 96?
| SELECT relationship FROM table_name_95 WHERE age_at_death = "96" | sql_create_context |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
... | SELECT Users.Id AS "user_link", Users.DisplayName, Users.Reputation, SUM(CASE WHEN Posts.PostTypeId = 1 THEN 1 ELSE 0 END) AS Questions, SUM(CASE WHEN Posts.PostTypeId = 2 THEN 1 ELSE 0 END) AS Answers, Users.UpVotes, Users.DownVotes FROM Users INNER JOIN Posts ON Users.Id = Posts.OwnerUserId AND (Posts.PostTypeId = 1 ... | sede |
CREATE TABLE table_56747 (
"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 scored 23.11 (149)?
| SELECT "Away team" FROM table_56747 WHERE "Away team score" = '23.11 (149)' | wikisql |
CREATE TABLE table_name_84 (
year INTEGER,
from_album VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many years were there albums by heat wave?
| SELECT SUM(year) FROM table_name_84 WHERE from_album = "heat wave" | sql_create_context |
CREATE TABLE table_name_64 (
tv_station VARCHAR,
romaji_title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which TV station had a Romaji Title Maou?
| SELECT tv_station FROM table_name_64 WHERE romaji_title = "maou" | sql_create_context |
CREATE TABLE Staff (
Staff_ID INTEGER,
Tourist_Attraction_ID INTEGER,
Name VARCHAR(40),
Other_Details VARCHAR(255)
)
CREATE TABLE Ref_Hotel_Star_Ratings (
star_rating_code CHAR(15),
star_rating_description VARCHAR(80)
)
CREATE TABLE Tourist_Attraction_Features (
Tourist_Attraction_ID INTEG... | SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID ORDER BY T1.Name DESC | nvbench |
CREATE TABLE table_name_65 (
title VARCHAR,
release_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Title, when Release Date is 2011-12-01 December 2011?
| SELECT title FROM table_name_65 WHERE release_date = "2011-12-01 december 2011" | sql_create_context |
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 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid =... | eicu |
CREATE TABLE table_204_110 (
id number,
"year" number,
"champion" text,
"city" text,
"llws" text,
"record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which was the only champion to obtain sixth place in the llws ?
| SELECT "champion" FROM table_204_110 WHERE "llws" = 'sixth place' | squall |
CREATE TABLE table_2226817_7 (
directed_by VARCHAR,
original_air_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the original air date January 19, 1992, who was the episode directed by?
| SELECT directed_by FROM table_2226817_7 WHERE original_air_date = "January 19, 1992" | sql_create_context |
CREATE TABLE table_68919 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the entrant for 1975 and chassis of hill gh1
| SELECT "Entrant" FROM table_68919 WHERE "Year" = '1975' AND "Chassis" = 'hill gh1' | wikisql |
CREATE TABLE table_21795650_1 (
podiums VARCHAR,
series VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many podiums were there in the Italian Formula Renault 2.0 Winter Series?
| SELECT podiums FROM table_21795650_1 WHERE series = "Italian Formula Renault 2.0 Winter series" | sql_create_context |
CREATE TABLE club (
Club_ID int,
name text,
Region text,
Start_year text
)
CREATE TABLE competition (
Competition_ID int,
Year real,
Competition_type text,
Country text
)
CREATE TABLE club_rank (
Rank real,
Club_ID int,
Gold real,
Silver real,
Bronze real,
Total... | SELECT Country, COUNT(Country) FROM competition GROUP BY Competition_type, Country ORDER BY Country | nvbench |
CREATE TABLE table_31645 (
"Tournament" text,
"1987" text,
"1988" text,
"1989" text,
"1990" text,
"1991" text,
"1992" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1997" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text... | SELECT "1998" FROM table_31645 WHERE "Tournament" = 'canada' | wikisql |
CREATE TABLE Elimination (
Elimination_ID text,
Wrestler_ID text,
Team text,
Eliminated_By text,
Elimination_Move text,
Time text
)
CREATE TABLE wrestler (
Wrestler_ID int,
Name text,
Reign text,
Days_held text,
Location text,
Event text
)
-- Using valid SQLite, answer... | SELECT Team, COUNT(Team) FROM Elimination GROUP BY Team ORDER BY COUNT(Team) | nvbench |
CREATE TABLE table_name_94 (
displacement_cc VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the CC displacement for 1965?
| SELECT displacement_cc FROM table_name_94 WHERE year = "1965" | sql_create_context |
CREATE TABLE table_29345 (
"Rank" real,
"Total USD" real,
"Project name" text,
"Creator" text,
"Category" text,
"% funded" real,
"Backers" real,
"Closing date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the minimum % funded ... | SELECT MIN("% funded") FROM table_29345 WHERE "Closing date" = '2012-05-18' | wikisql |
CREATE TABLE table_41493 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of Top-5, when Tournament is Totals, and when Ev... | SELECT SUM("Top-5") FROM table_41493 WHERE "Tournament" = 'totals' AND "Events" > '86' | wikisql |
CREATE TABLE table_203_780 (
id number,
"rank" number,
"diver" text,
"preliminary\npoints" number,
"preliminary\nrank" number,
"final\npoints" number,
"final\nrank" number,
"final\ntotal" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- ... | SELECT "diver" FROM table_203_780 WHERE "final\npoints" > (SELECT "final\npoints" FROM table_203_780 WHERE "diver" = 'ingrid kramer') | squall |
CREATE TABLE table_8238 (
"ISLAND" text,
"CITY / TOWN" text,
"ICAO" text,
"IATA" text,
"AIRPORTNAME" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On which island is Esperadinha airport located?
| SELECT "ISLAND" FROM table_8238 WHERE "AIRPORTNAME" = 'esperadinha airport' | wikisql |
CREATE TABLE table_name_13 (
date INTEGER,
u_boats_destroyed__kuk_ VARCHAR,
tonnage VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is listed as the average Date that has U-boats destroyed (KuK) of 2 with Tonnage of 1,514,050?
| SELECT AVG(date) FROM table_name_13 WHERE u_boats_destroyed__kuk_ = "2" AND tonnage = "1,514,050" | sql_create_context |
CREATE TABLE table_63785 (
"Name" text,
"GP-GS" text,
"Gain" real,
"Loss" real,
"Long" real,
"Avg/G" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the loss when the average/gain is less than 16.7, gain is 104 and long is larger than 4?
| SELECT AVG("Loss") FROM table_63785 WHERE "Avg/G" < '16.7' AND "Long" > '4' AND "Gain" = '104' | wikisql |
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TE... | SELECT Winery, COUNT(Winery) FROM wine WHERE Price > 100 GROUP BY Grape, Winery | nvbench |
CREATE TABLE Sales (
sales_transaction_id INTEGER,
sales_details VARCHAR(255)
)
CREATE TABLE Transactions (
transaction_id INTEGER,
investor_id INTEGER,
transaction_type_code VARCHAR(10),
date_of_transaction DATETIME,
amount_of_transaction DECIMAL(19,4),
share_count VARCHAR(40),
oth... | SELECT date_of_transaction, COUNT(date_of_transaction) FROM Sales AS T1 JOIN Transactions AS T2 ON T1.sales_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction < 3000 ORDER BY COUNT(date_of_transaction) DESC | nvbench |
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Description VARCHAR(255)
)
CREATE TABLE Roles (
Role_Code CHAR(15),
Role_Name VARCHAR(255),
Role_Description VARCHAR(255)
)
CREATE TABLE Documents_to_be_Destroyed (
Document_ID INT... | SELECT Location_Code, COUNT(*) FROM Document_Locations GROUP BY Location_Code ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_name_60 (
score VARCHAR,
partner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score for the match where albert monta s was the partner?
| SELECT score FROM table_name_60 WHERE partner = "albert montañés" | sql_create_context |
CREATE TABLE table_21311525_1 (
result VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many results were there on 19/06/2009?
| SELECT COUNT(result) FROM table_21311525_1 WHERE date = "19/06/2009" | sql_create_context |
CREATE TABLE table_7362 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many games that ended in a draw were played ... | SELECT COUNT("Drawn") FROM table_7362 WHERE "Played" > '15' | wikisql |
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varch... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Faith Sparr%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offer... | advising |
CREATE TABLE table_15001681_1 (
womens_doubles VARCHAR,
year VARCHAR,
womens_singles VARCHAR,
mens_doubles VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In the year 2006, the womens singles had no competition and the mens doubles were roland hilti k... | SELECT womens_doubles FROM table_15001681_1 WHERE womens_singles = "no competition" AND mens_doubles = "Roland Hilti Kilian Pfister" AND year = 2006 | sql_create_context |
CREATE TABLE table_name_4 (
terminus VARCHAR,
color VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The color sapphire is assigned to which Terminus?
| SELECT terminus FROM table_name_4 WHERE color = "sapphire" | sql_create_context |
CREATE TABLE txmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | SELECT jybgb.SHSJ FROM hz_info JOIN txmzjzjlb JOIN jybgb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '22871857' AND jybgb.BGRQ BETWEEN '2007-03-19' AND '2009-... | css |
CREATE TABLE table_707 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's incumbent with district being florida 5
| SELECT "Incumbent" FROM table_707 WHERE "District" = 'Florida 5' | wikisql |
CREATE TABLE table_18227 (
"District" text,
"Incumbent" text,
"Party" text,
"Elected" text,
"Status" text,
"Opponent" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who are the incumbents elected in 1974?
| SELECT "Incumbent" FROM table_18227 WHERE "Elected" = '1974' | wikisql |
CREATE TABLE table_16852 (
"Player" text,
"No." real,
"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 player wears the number 6?
| SELECT "Player" FROM table_16852 WHERE "No." = '6' | wikisql |
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight real
)
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate re... | SELECT Sex, SUM(Height) FROM people GROUP BY Sex ORDER BY Sex | nvbench |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime t... | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-18575')) AND intakeoutput.cellpath LIKE '%intake%' AND D... | eicu |
CREATE TABLE procedures (
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 demographic.insurance FROM demographic WHERE demographic.subject_id = "6983" | mimicsql_data |
CREATE TABLE table_30827 (
"DrumSet Name" text,
"Product Line" text,
"Years Available" text,
"Drum Module" text,
"KickDrum Pad" text,
"Snare Pad" text,
"Tom-Tom Pads" text,
"Hi-HatPad/ Controller" text,
"CrashandRide CymbalPads" text,
"DrumStand (oftenoptional)" text
)
-- Using... | SELECT COUNT("DrumSet Name") FROM table_30827 WHERE "DrumStand (oftenoptional)" = 'HD-1/3Stand' AND "Tom-Tom Pads" = '3xCloth-Head' | wikisql |
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 jyjgzbb (
BGDH text,
BGRQ tim... | SELECT jyjgzbb.JCFF FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND jybgb.... | css |
CREATE TABLE d_icd_procedures (
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 chartevents (
row_id nu... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12568) AND STRFTIME('%y-%m', prescriptions.startdate) >= '2105-02' ORDER BY prescriptions.startdate LIMIT 1 | mimic_iii |
CREATE TABLE ship (
ship_id number,
name text,
type text,
nationality text,
tonnage number
)
CREATE TABLE mission (
mission_id number,
ship_id number,
code text,
launched_year number,
location text,
speed_knots number,
fate text
)
-- Using valid SQLite, answer the foll... | SELECT name FROM ship ORDER BY tonnage | spider |
CREATE TABLE table_57121 (
"Entrant" text,
"Constructor" text,
"Chassis" text,
"Engine" text,
"Tyre" text,
"Driver" text,
"Rounds" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the entrant with a driver Damon Hill and a Renault RS8 3... | SELECT "Entrant" FROM table_57121 WHERE "Engine" = 'renault rs8 3.0 v10' AND "Driver" = 'damon hill' | wikisql |
CREATE TABLE table_name_97 (
pick VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the pick for robert griffin iii?
| SELECT pick FROM table_name_97 WHERE name = "robert griffin iii" | 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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Hematoma complic proc" AND prescriptions.route = "BUCCAL" | mimicsql_data |
CREATE TABLE table_225206_3 (
vacator VARCHAR,
reason_for_change VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the vacator when the reason for change was failure to elect?
| SELECT vacator FROM table_225206_3 WHERE reason_for_change = "Failure to elect" | sql_create_context |
CREATE TABLE table_name_88 (
area__sq_mi_ INTEGER,
county VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which is the largest area in Greenville County, by square mile?
| SELECT MAX(area__sq_mi_) FROM table_name_88 WHERE county = "greenville county" | sql_create_context |
CREATE TABLE advisor (
s_ID varchar(5),
i_ID varchar(5)
)
CREATE TABLE student (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
tot_cred numeric(3,0)
)
CREATE TABLE section (
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
building ... | SELECT dept_name, SUM(credits) FROM course GROUP BY dept_name ORDER BY SUM(credits) DESC | nvbench |
CREATE TABLE table_name_72 (
team VARCHAR,
points VARCHAR,
class VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team had fewer than 167 points in the 250cc class?
| SELECT team FROM table_name_72 WHERE points < 167 AND class = "250cc" | sql_create_context |
CREATE TABLE table_name_60 (
director VARCHAR,
role VARCHAR,
year VARCHAR,
leading_lady VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who directs before 1949 with linda darnell leading and jonathan kent?
| SELECT director FROM table_name_60 WHERE year < 1949 AND leading_lady = "linda darnell" AND role = "jonathan kent" | sql_create_context |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE TagSynonyms (
Id number... | SELECT AnswerCount AS "answers", COUNT(*) AS "#questions", ROUND(100.0 * COUNT(CASE WHEN Score < 0 THEN 1 END) / COUNT(*), 2) AS "%_score<0", ROUND(100.0 * COUNT(CASE WHEN Score = 0 THEN 1 END) / COUNT(*), 1) AS "%_score=0", ROUND(100.0 * COUNT(CASE WHEN Score = 1 THEN 1 END) / COUNT(*), 1) AS "%_score=1", ROUND(100.0 ... | sede |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
c... | SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-16123')) AND microlab.culturesite = 'sputum, expectorated' AN... | eicu |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.