instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_35509 (
"Dish" text,
"Callsign" text,
"Network" text,
"Resolution" text,
"City of License" text,
"Official Website" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which dish belongs to the network that has the official website... | SELECT "Dish" FROM table_35509 WHERE "Official Website" = 'ksat.com' | wikisql |
CREATE TABLE table_name_58 (
description VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the description where the date is 1911?
| SELECT description FROM table_name_58 WHERE date = 1911 | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CRE... | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '030-47098' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '030-47098' AND patient.hospitaldischargetime IS NULL)) AND tr... | eicu |
CREATE TABLE table_204_364 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total number of competitions held in 2013 ?
| SELECT COUNT("competition") FROM table_204_364 WHERE "year" = 2013 | squall |
CREATE TABLE employee (
eid number(9,0),
name varchar2(30),
salary number(10,2)
)
CREATE TABLE certificate (
eid number(9,0),
aid number(9,0)
)
CREATE TABLE flight (
flno number(4,0),
origin varchar2(20),
destination varchar2(20),
distance number(6,0),
departure_date date,
... | SELECT destination, COUNT(destination) FROM flight WHERE price > 300 GROUP BY destination ORDER BY COUNT(destination) | nvbench |
CREATE TABLE table_14939 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What entrant had a chassis of Maserati 250f in 1954?
| SELECT "Entrant" FROM table_14939 WHERE "Chassis" = 'maserati 250f' AND "Year" = '1954' | wikisql |
CREATE TABLE table_3082 (
"Name" text,
"Position" text,
"Period" text,
"Appearances\u00b9" real,
"Goals\u00b9" real,
"Nationality\u00b2" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most goals for 1972 1975, 1976 1982
| SELECT MAX("Goals\u00b9") FROM table_3082 WHERE "Period" = '1972 – 1975, 1976 – 1982' | wikisql |
CREATE TABLE table_name_63 (
record VARCHAR,
date VARCHAR,
score VARCHAR,
visitor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Record of the Game on January 20 with Visitor Toronto Maple Leafs with a Score of 3 1?
| SELECT record FROM table_name_63 WHERE score = "3–1" AND visitor = "toronto maple leafs" AND date = "january 20" | sql_create_context |
CREATE TABLE table_13510 (
"Player" text,
"Games" real,
"Comp" real,
"Yards" real,
"Rating" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of yards for a 118.7 rating?
| SELECT SUM("Yards") FROM table_13510 WHERE "Rating" = '118.7' | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE lab.fluid = "Other Body Fluid" | mimicsql_data |
CREATE TABLE table_42216 (
"Player" text,
"Club" text,
"League" real,
"FA Cup" real,
"FA Trophy" real,
"League Cup" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average FA Cup that has gary jones as the player, an... | SELECT AVG("FA Cup") FROM table_42216 WHERE "Player" = 'gary jones' AND "FA Trophy" > '5' | wikisql |
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 zzmzjzjlb.JZKSBM, zzmzjzjlb.JZKSMC FROM zzmzjzjlb WHERE zzmzjzjlb.JZLSH = '45476480212' UNION SELECT fzzmzjzjlb.JZKSBM, fzzmzjzjlb.JZKSMC FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZLSH = '45476480212' | css |
CREATE TABLE table_name_39 (
overall_rank INTEGER,
share VARCHAR,
timeslot_rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the rank of the episode with a share of 6 and timeslot rank smaller than 4?
| SELECT AVG(overall_rank) FROM table_name_39 WHERE share = 6 AND timeslot_rank < 4 | sql_create_context |
CREATE TABLE table_name_80 (
year_ended VARCHAR,
passenger_load_factor___percentage_ VARCHAR,
revenue__€m_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Year Ended has a Passenger Load Factor (%) larger than 72.8, and a Revenue ( m) smaller than 9... | SELECT year_ended FROM table_name_80 WHERE passenger_load_factor___percentage_ > 72.8 AND revenue__€m_ < 906.8 | sql_create_context |
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 employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL v... | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(DEPARTMENT_ID) DESC | nvbench |
CREATE TABLE table_24481478_1 (
game_site VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- At which location did 29753 fans show up to watch the game?
| SELECT game_site FROM table_24481478_1 WHERE attendance = 29753 | sql_create_context |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT OUT_DIAG_DIS_CD, OUT_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_ID = '78487358' AND MED_SER_ORG_NO = '4050783' AND OUT_DIAG_DOC_NM LIKE '韦%' | css |
CREATE TABLE table_name_63 (
draws INTEGER,
position VARCHAR,
goals_against VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Draws have a Position of 16, and less than 58 Goals against?
| SELECT MIN(draws) FROM table_name_63 WHERE position = 16 AND goals_against < 58 | sql_create_context |
CREATE TABLE table_name_16 (
bronze VARCHAR,
total VARCHAR,
silver VARCHAR,
sport VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the total number of bronze for silver being 0 and sport of wrestling and total more than 3
| SELECT COUNT(bronze) FROM table_name_16 WHERE silver = 0 AND sport = "wrestling" AND total > 3 | sql_create_context |
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adults INTEGER,
Kids INTEGER
)
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
baseP... | SELECT bedType, COUNT(*) FROM Rooms GROUP BY bedType ORDER BY bedType | nvbench |
CREATE TABLE table_69825 (
"Cyclist" text,
"Nation" text,
"Team" text,
"Time" text,
"UCI Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of UCI points for Kim Kirchen?
| SELECT SUM("UCI Points") FROM table_69825 WHERE "Cyclist" = 'kim kirchen' | wikisql |
CREATE TABLE table_name_92 (
away_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the away score when they played at Brunswick Street Oval?
| SELECT away_team AS score FROM table_name_92 WHERE venue = "brunswick street oval" | sql_create_context |
CREATE TABLE table_25840200_1 (
division VARCHAR,
tv VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What division was on HBO PPV?
| SELECT division FROM table_25840200_1 WHERE tv = "HBO PPV" | sql_create_context |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 6196 ORDER BY admissions.admittime LIMIT 1 | mimic_iii |
CREATE TABLE table_34334 (
"Date" text,
"Venue" text,
"Score 1" text,
"Comp." text,
"Match Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the match report of the match on 20 August?
| SELECT "Match Report" FROM table_34334 WHERE "Date" = '20 august' | wikisql |
CREATE TABLE table_name_60 (
team VARCHAR,
head_coach VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Team has a Head Coach of michalis pamboris?
| SELECT team FROM table_name_60 WHERE head_coach = "michalis pamboris" | sql_create_context |
CREATE TABLE table_28652 (
"Year (Ceremony)" text,
"Film title" text,
"Main Language(s)" text,
"Director" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the director for the film title Eldra?
| SELECT "Director" FROM table_28652 WHERE "Film title" = 'Eldra' | wikisql |
CREATE TABLE PROFESSOR (
EMP_NUM int,
DEPT_CODE varchar(10),
PROF_OFFICE varchar(50),
PROF_EXTENSION varchar(4),
PROF_HIGH_DEGREE varchar(5)
)
CREATE TABLE CLASS (
CLASS_CODE varchar(5),
CRS_CODE varchar(10),
CLASS_SECTION varchar(2),
CLASS_TIME varchar(20),
CLASS_ROOM varchar(8... | SELECT CLASS_ROOM, COUNT(*) FROM CLASS GROUP BY CLASS_ROOM ORDER BY COUNT(*) | nvbench |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | SELECT MIN(demographic.age) FROM demographic WHERE demographic.days_stay = "20" AND demographic.dod_year < "2186.0" | mimicsql_data |
CREATE TABLE table_203_529 (
id number,
"fin" number,
"st" number,
"driver" text,
"car #" number,
"make" text,
"points" number,
"bonus" number,
"laps" number,
"winnings" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what make di... | SELECT "make" FROM table_203_529 WHERE "driver" = 'kurt busch' | squall |
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 table_name_39 (
elected INTEGER,
party VARCHAR,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Party of republican, and a District of 5th is what highest elected?
| SELECT MAX(elected) FROM table_name_39 WHERE party = "republican" AND district = "5th" | 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 month (
month_number int,
month_name text
)
CREATE TABLE time_zone (
time_zone_code t... | 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, food_service WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKLAND' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code AND food_s... | atis |
CREATE TABLE table_37530 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game Site" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Date of november 29, 1959 had what lowest attendance?
| SELECT MIN("Attendance") FROM table_37530 WHERE "Date" = 'november 29, 1959' | 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, SUM(School_ID) FROM basketball_match GROUP BY ACC_Road | nvbench |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_cod... | 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, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, flight, flight_fare WHERE ((((CITY_1... | atis |
CREATE TABLE table_name_74 (
team_classification VARCHAR,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Ludo Peeters' team classification?
| SELECT team_classification FROM table_name_74 WHERE winner = "ludo peeters" | sql_create_context |
CREATE TABLE table_name_52 (
away_team VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How faced Geelong at home?
| SELECT away_team AS score FROM table_name_52 WHERE home_team = "geelong" | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
... | SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-22327')) AND DATETIME(treatment.treatmenttime) >= DATETIME(CU... | eicu |
CREATE TABLE table_19897294_9 (
location_s_ VARCHAR,
family_families VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- where was the abbas family and the pickering family located
| SELECT location_s_ FROM table_19897294_9 WHERE family_families = "The Abbas Family and The Pickering Family" | sql_create_context |
CREATE TABLE table_32088 (
"Call sign" text,
"Frequency" text,
"City of License" text,
"Owner" text,
"Format" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the call sign for frequency of 0 97.3 fm
| SELECT "Call sign" FROM table_32088 WHERE "Frequency" = '0 97.3 fm' | 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 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 procedures.icd9_code = "4610" | mimicsql_data |
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 TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE... | SELECT meter_300, meter_100 FROM swimmer ORDER BY meter_100 DESC | nvbench |
CREATE TABLE table_name_37 (
over_no INTEGER,
bowler VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Bowler of shane bond has what lowest overall number?
| SELECT MIN(over_no) FROM table_name_37 WHERE bowler = "shane bond" | sql_create_context |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE airport (
airport_code varchar,
... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA... | atis |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Self Pay" AND diagnoses.long_title = "Lumbago" | mimicsql_data |
CREATE TABLE table_72139 (
"No. in season" real,
"No. in series" real,
"Title" text,
"Canadian airdate" text,
"US airdate" text,
"Production code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The episode titled 'don't stop believin'' was what ... | SELECT MAX("No. in season") FROM table_72139 WHERE "Title" = 'Don''t Stop Believin' | wikisql |
CREATE TABLE table_55308 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What i... | SELECT COUNT("Game") FROM table_55308 WHERE "Team" = 'boston' | wikisql |
CREATE TABLE table_13026799_3 (
money_list_rank VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the money list rank for 1966?
| SELECT money_list_rank FROM table_13026799_3 WHERE year = 1966 | sql_create_context |
CREATE TABLE table_name_92 (
event VARCHAR,
round VARCHAR,
aces VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the event year radek t p nek was the round and there were less than 3 aces?
| SELECT COUNT(event) FROM table_name_92 WHERE round = "radek štěpánek" AND NOT aces < 3 | sql_create_context |
CREATE TABLE table_41011 (
"Bowl Game" text,
"Date" text,
"Stadium" text,
"City" text,
"Television" text,
"Conference Matchups" text,
"Payout ( US$ )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What stadium was the Fiesta Bowl played at?... | SELECT "Stadium" FROM table_41011 WHERE "Bowl Game" = 'fiesta bowl' | wikisql |
CREATE TABLE table_44328 (
"Round" real,
"Pick" real,
"Player" text,
"Nationality" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the nationality of Louisiana Tech?
| SELECT "Nationality" FROM table_44328 WHERE "College" = 'louisiana tech' | wikisql |
CREATE TABLE Accounts (
customer_id VARCHAR
)
CREATE TABLE Customers (
customer_first_name VARCHAR,
customer_last_name VARCHAR,
customer_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the customer first, last name and id with least number... | SELECT T2.customer_first_name, T2.customer_last_name, T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) LIMIT 1 | sql_create_context |
CREATE TABLE pilot (
Pilot_name VARCHAR,
pilot_ID VARCHAR
)
CREATE TABLE pilot_record (
pilot_ID VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show names of pilots that have more than one record.
| SELECT T2.Pilot_name, COUNT(*) FROM pilot_record AS T1 JOIN pilot AS T2 ON T1.pilot_ID = T2.pilot_ID GROUP BY T2.Pilot_name HAVING COUNT(*) > 1 | sql_create_context |
CREATE TABLE table_name_74 (
class VARCHAR,
laps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Class has Laps of 31?
| SELECT class FROM table_name_74 WHERE laps = 31 | sql_create_context |
CREATE TABLE table_name_96 (
year INTEGER,
award_ceremony VARCHAR,
category VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year is associated with a drama desk award ceremony and a Category of outstanding featured actress in a musical?
| SELECT AVG(year) FROM table_name_96 WHERE award_ceremony = "drama desk award" AND category = "outstanding featured actress in a musical" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeri... | SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'headache' AND STRFTIME('%y', diagnosis.d... | eicu |
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
)
CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptroller text,
Attorney_General text,
US_Senate text
)
CREATE TABLE election (
... | SELECT Committee, COUNT(Committee) FROM election GROUP BY Committee ORDER BY Committee DESC | nvbench |
CREATE TABLE table_59719 (
"Country" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country is dated October 20, 1976?
| SELECT "Country" FROM table_59719 WHERE "Date" = 'october 20, 1976' | wikisql |
CREATE TABLE table_name_52 (
time_retired VARCHAR,
laps VARCHAR,
grid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Time/Retired for less than 52 laps in grid 19?
| SELECT time_retired FROM table_name_52 WHERE laps < 52 AND grid = 19 | sql_create_context |
CREATE TABLE table_name_46 (
league VARCHAR,
fa_cup VARCHAR,
fa_trophy VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the league when the fa cup is qr4 and the fa trophy is qf?
| SELECT league FROM table_name_46 WHERE fa_cup = "qr4" AND fa_trophy = "qf" | sql_create_context |
CREATE TABLE table_63721 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the tied game or the away team of Crewe Alexandra?
| SELECT "Tie no" FROM table_63721 WHERE "Away team" = 'crewe alexandra' | wikisql |
CREATE TABLE table_204_475 (
id number,
"home team" text,
"score" text,
"away team" text,
"date" text,
"agg" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the away team with the lowest score ?
| SELECT "away team" FROM table_204_475 ORDER BY "score" LIMIT 1 | squall |
CREATE TABLE table_15449 (
"Goal" real,
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When has Result of 2 0, and a Score of 2 0?
| SELECT "Date" FROM table_15449 WHERE "Result" = '2–0' AND "Score" = '2 – 0' | wikisql |
CREATE TABLE Aircraft (
distance INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the minimum, average, and maximum distance of all aircrafts.
| SELECT MIN(distance), AVG(distance), MAX(distance) FROM Aircraft | sql_create_context |
CREATE TABLE race (
race_id number,
name text,
class text,
date text,
track_id text
)
CREATE TABLE track (
track_id number,
name text,
location text,
seating number,
year_opened number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- W... | SELECT T2.name, COUNT(*) FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id GROUP BY T1.track_id | spider |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restr... | 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRA... | atis |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "ANGIOEDEMA" | mimicsql_data |
CREATE TABLE table_15273 (
"Championship" text,
"Current champion(s)" text,
"Reign" text,
"Date won" text,
"Days held" real,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the championship with reign of 8
| SELECT "Championship" FROM table_15273 WHERE "Reign" = '8' | wikisql |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
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... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKLAND' AND NOT fare.round_trip_cost IS NULL AND flight_fare.fare_id... | atis |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE microbiologyevents (
ro... | SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 <= 3 | mimic_iii |
CREATE TABLE table_name_50 (
rowers VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were the rowers for Great britain?
| SELECT rowers FROM table_name_50 WHERE country = "great britain" | sql_create_context |
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_... | SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((flight.airline_code = 'US') AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND flight.to_airport = AIRPORT_SER... | atis |
CREATE TABLE station (
id int,
network_name text,
services text,
local_authority text
)
CREATE TABLE route (
train_id int,
station_id int
)
CREATE TABLE train (
id int,
train_number int,
name text,
origin text,
destination text,
time text,
interval text
)
CREATE TA... | SELECT name, COUNT(name) FROM train GROUP BY name ORDER BY COUNT(name) DESC | nvbench |
CREATE TABLE party (
party_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many parties do we have?
| SELECT COUNT(DISTINCT party_name) FROM party | sql_create_context |
CREATE TABLE table_name_26 (
competition VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which competition was held at Addis Ababa?
| SELECT competition FROM table_name_26 WHERE location = "addis ababa" | sql_create_context |
CREATE TABLE table_name_24 (
date VARCHAR,
race VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When is the Mexican grand prix?
| SELECT date FROM table_name_24 WHERE race = "mexican grand prix" | sql_create_context |
CREATE TABLE table_1949994_8 (
no INTEGER,
start_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What series number started production on June 6?
| SELECT MIN(no) FROM table_1949994_8 WHERE start_date = "June 6" | sql_create_context |
CREATE TABLE table_name_71 (
university_of_dublin INTEGER,
nominated_by_the_taoiseach VARCHAR,
industrial_and_commercial_panel VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total for the University of Dublin when 2 are nominated by Taoiseach... | SELECT SUM(university_of_dublin) FROM table_name_71 WHERE nominated_by_the_taoiseach = 2 AND industrial_and_commercial_panel > 0 | 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 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 WHERE demographic.diagnosis = "OVERDOSE" AND demographic.age < "64" | mimicsql_data |
CREATE TABLE table_32071 (
"Heat Rank" real,
"Lane" real,
"Swimmer" text,
"Country" text,
"Time" real,
"Overall Rank" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the heat rank for senegal
| SELECT "Heat Rank" FROM table_32071 WHERE "Country" = 'senegal' | wikisql |
CREATE TABLE table_name_51 (
elector VARCHAR,
faction VARCHAR,
nationality VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the Prato Elector with a faction of Italian?
| SELECT elector FROM table_name_51 WHERE faction = "italian" AND nationality = "prato" | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,... | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'treatment' AND cost.eventid IN (SELECT treatment.treatmentid FROM treatment WHERE treatment.treatmentname = 'therapeutic antibacterials - cephalosporin') | eicu |
CREATE TABLE table_name_91 (
score VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score when Walsall was the away team?
| SELECT score FROM table_name_91 WHERE away_team = "walsall" | sql_create_context |
CREATE TABLE table_1965650_11 (
college_junior_club_team VARCHAR,
position VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team did Russ Wiechnik, on the centre position, come from?
| SELECT college_junior_club_team FROM table_1965650_11 WHERE position = "Centre" AND player = "Russ Wiechnik" | sql_create_context |
CREATE TABLE table_22200 (
"HD designation" text,
"Constellation" text,
"Distance ( ly )" text,
"Spectral type" text,
"Signal power ( kW )" real,
"Date sent" text,
"Arrival date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the hd ... | SELECT COUNT("HD designation") FROM table_22200 WHERE "Arrival date" = 'February 2070' | wikisql |
CREATE TABLE table_name_40 (
gold VARCHAR,
silver VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Gold has a Silver greater than 30 and a Total less than 107?
| SELECT gold FROM table_name_40 WHERE silver > 30 AND total < 107 | sql_create_context |
CREATE TABLE job_history (
employee_id number,
start_date time,
end_date time,
job_id text,
department_id number
)
CREATE TABLE employees (
employee_id number,
first_name text,
last_name text,
email text,
phone_number text,
hire_date time,
job_id text,
salary number,... | SELECT T1.first_name, T1.last_name, T2.department_name, T3.city, T3.state_province FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id | spider |
CREATE TABLE table_67191 (
"Year" real,
"Film" text,
"Director" text,
"Nationality of director" text,
"Award" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Film of um sol alaranjado director is what nationality?
| SELECT "Nationality of director" FROM table_67191 WHERE "Film" = 'um sol alaranjado' | wikisql |
CREATE TABLE table_28292 (
"Browser" text,
"Operating system" text,
"Latest stable release" text,
"Theora" text,
"H.264" text,
"VP8 ( WebM )" text,
"VP9 ( WebM )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When theora is 2.3, how much is... | SELECT "H.264" FROM table_28292 WHERE "Theora" = '2.3' | wikisql |
CREATE TABLE table_16200 (
"Institution" text,
"Nickname" text,
"Location" text,
"Founded" real,
"Type" text,
"Enrollment" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many founded dates are listed for carlow university 1
| SELECT COUNT("Founded") FROM table_16200 WHERE "Institution" = 'Carlow University 1' | wikisql |
CREATE TABLE table_24886 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of episod... | SELECT "Title" FROM table_24886 WHERE "No. in series" = '165' | wikisql |
CREATE TABLE table_68680 (
"Year" text,
"Title" text,
"( Title in English )" text,
"Director" text,
"Character" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the title of the TV series in 2012?
| SELECT "Title" FROM table_68680 WHERE "Year" = '2012' | wikisql |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
... | SELECT Id AS "post_link", Tags, CreationDate FROM Posts WHERE PostTypeId = 1 AND (Tags LIKE '%<##Tagname?geometry##>%') ORDER BY CreationDate DESC | sede |
CREATE TABLE table_45323 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Directed by has an Original air date of april 29, 2000?
| SELECT "Directed by" FROM table_45323 WHERE "Original air date" = 'april 29, 2000' | wikisql |
CREATE TABLE table_1566848_7 (
cover_model VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the cover model in the 7-86 issue?
| SELECT cover_model FROM table_1566848_7 WHERE date = "7-86" | sql_create_context |
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
wind_speed_mph int
)
CREATE TABLE train (
id int,
train_number int,
name text,
origin text,
destination text,
time text,
interval text
)
CR... | SELECT services, COUNT(services) FROM station GROUP BY services ORDER BY services DESC | nvbench |
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 labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
... | SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 61751) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 ... | mimic_iii |
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_DIRE_CD text,
MED_DIRE_NM text,... | SELECT t_kc22.QTY * t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_EXP_DET_ID = '16362128474' | css |
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 gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '戚丽文' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2003-12-20' AND '2011-07-25' AND t_kc24.MED_AMOUT <= 10 UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE fgwyjzb.P... | css |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.