instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_18 (
goals INTEGER,
name VARCHAR,
caps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name of gilmar, and a Caps smaller than 94 had how many highest goals?
| SELECT MAX(goals) FROM table_name_18 WHERE name = "gilmar" AND caps < 94 | sql_create_context |
CREATE TABLE table_18600760_12 (
geo_id INTEGER,
land___sqmi__ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the geo id of the land at 35.999?
| SELECT MAX(geo_id) FROM table_18600760_12 WHERE land___sqmi__ = "35.999" | sql_create_context |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND diagnoses.icd9_code = "5119" | mimicsql_data |
CREATE TABLE camera_lens (
id int,
brand text,
name text,
focal_length_mm real,
max_aperture real
)
CREATE TABLE photos (
id int,
camera_lens_id int,
mountain_id int,
color text,
name text
)
CREATE TABLE mountain (
id int,
name text,
Height real,
Prominence real... | SELECT T1.name, COUNT(T1.name) FROM camera_lens AS T1 JOIN photos AS T2 ON T2.camera_lens_id = T1.id WHERE T1.brand = 'Sigma' OR T1.brand = 'Olympus' GROUP BY T1.name | nvbench |
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 meter_600, meter_100 FROM swimmer | nvbench |
CREATE TABLE table_name_89 (
name VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of Rank 5?
| SELECT name FROM table_name_89 WHERE rank = 5 | sql_create_context |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_re... | 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 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 = 'S... | 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 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.charttime = "2111-12-31 14:29:00" | mimicsql_data |
CREATE TABLE department (
head VARCHAR,
departmentID VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the employee id of the head whose department has the least number of employees?
| SELECT head FROM department GROUP BY departmentID ORDER BY COUNT(departmentID) LIMIT 1 | sql_create_context |
CREATE TABLE mzb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '45075534' AND t_kc22.STA_DATE BETWEEN '2007-07-19' AND '2020-07-13' AND t_kc22.SELF_PAY_PRO < 0.3 UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_ID = '45075534... | css |
CREATE TABLE table_name_93 (
round INTEGER,
pick VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what Round was Pick 138?
| SELECT SUM(round) FROM table_name_93 WHERE pick = 138 | sql_create_context |
CREATE TABLE qtb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | SELECT SUM(t_kc24.OVE_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '5503215' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2001-03-19' AND '2014-04-30' UNION SELECT SUM(t_kc24.OVE_PAY) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.MED_SER_ORG_NO = '... | css |
CREATE TABLE table_21632864_1 (
champions VARCHAR,
fourth_place VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who got the first position when fujieda city government got the fourth position?
| SELECT champions FROM table_21632864_1 WHERE fourth_place = "Fujieda City Government" | sql_create_context |
CREATE TABLE table_35621 (
"Season" real,
"Team" text,
"Wins" real,
"Losses" real,
"Draws" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest number of wins for the team, Central District, who had less than 0 draws and took place dur... | SELECT MAX("Wins") FROM table_35621 WHERE "Season" < '1995' AND "Team" = 'central district' AND "Draws" < '0' | wikisql |
CREATE TABLE table_name_59 (
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is 2009, when 2008 is 1R, and when Tournament is French Open?
| SELECT 2009 FROM table_name_59 WHERE 2008 = "1r" AND tournament = "french open" | sql_create_context |
CREATE TABLE table_name_96 (
winner VARCHAR,
prize VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the winner of the prize of 93,000?
| SELECT winner FROM table_name_96 WHERE prize = "€93,000" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE hz_info_zyjzjlb (
JZLSH number,
YLJGDM number,
zyjzjlb_id number
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
... | SELECT COUNT(*) FROM zyjzjlb JOIN hz_info_zyjzjlb JOIN hz_info ON 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_id = zyjzjlb.zyjzjlb_id AND hz_info_zyjzjlb.YLJGDM = hz_info.YLJGDM WHERE hz_info.YLJGDM = '45... | css |
CREATE TABLE table_name_71 (
points INTEGER,
january VARCHAR,
score VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Points have a Score of 4 1, and a Record of 18 10 8 1, and a January larger than 2?
| SELECT AVG(points) FROM table_name_71 WHERE score = "4–1" AND record = "18–10–8–1" AND january > 2 | sql_create_context |
CREATE TABLE table_25818630_1 (
affiliation VARCHAR,
constituency VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is every affiliation for the Tottenham constituency?
| SELECT affiliation FROM table_25818630_1 WHERE constituency = "Tottenham" | sql_create_context |
CREATE TABLE table_6230 (
"Date" text,
"Course" text,
"Distance" text,
"Type" text,
"Winner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won at course Forl to Carpi?
| SELECT "Winner" FROM table_6230 WHERE "Course" = 'forlì to carpi' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2112.0" AND procedures.short_title = "Coronar arteriogr-2 cath" | mimicsql_data |
CREATE TABLE table_203_309 (
id number,
"team" text,
"winners" number,
"runners-up" number,
"years won" text,
"years lost" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which teams won a total of five dfl supercups ?
| SELECT "team" FROM table_203_309 WHERE "winners" = 5 | squall |
CREATE TABLE table_name_88 (
game_1 VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Game 1 has a fullback?
| SELECT game_1 FROM table_name_88 WHERE position = "fullback" | sql_create_context |
CREATE TABLE artist (
artist_id number,
name text,
country text,
year_join number,
age number
)
CREATE TABLE exhibition_record (
exhibition_id number,
date text,
attendance number
)
CREATE TABLE exhibition (
exhibition_id number,
year number,
theme text,
artist_id numbe... | SELECT theme, year FROM exhibition WHERE ticket_price < 15 | spider |
CREATE TABLE table_75965 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of Team 2 with a 2nd leg of 4-6?
| SELECT "Team 2" FROM table_75965 WHERE "2nd leg" = '4-6' | wikisql |
CREATE TABLE table_64734 (
"Township" text,
"County" text,
"Pop. (2010)" real,
"Land ( sqmi )" real,
"Water (sqmi)" real,
"Latitude" real,
"Longitude" real,
"GEO ID" real,
"ANSI code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In... | SELECT "County" FROM table_64734 WHERE "Latitude" < '46.935364' AND "GEO ID" = '3801700500' | wikisql |
CREATE TABLE table_name_45 (
result_score VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the result/score that has 6-5 as the record?
| SELECT result_score FROM table_name_45 WHERE record = "6-5" | sql_create_context |
CREATE TABLE table_44250 (
"Season" text,
"Series" text,
"Races" real,
"Poles" real,
"Wins" real,
"Points" text,
"Final Placing" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE AVERAGE POLES WITH POINTS N/A?
| SELECT AVG("Poles") FROM table_44250 WHERE "Points" = 'n/a' | wikisql |
CREATE TABLE table_24851 (
"Year" text,
"Date" text,
"Driver" text,
"Team" text,
"Manufacturer" text,
"Laps" text,
"Miles (km)" text,
"Race Time" text,
"Average Speed (mph)" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided abov... | SELECT "Laps" FROM table_24851 WHERE "Average Speed (mph)" = '141.911' | wikisql |
CREATE TABLE table_203_164 (
id number,
"#" number,
"date" text,
"venue" text,
"opponent" text,
"score" text,
"result" text,
"competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- when was the last time he scored an international g... | SELECT MAX("date") FROM table_203_164 | squall |
CREATE TABLE table_48740 (
"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 w... | SELECT "High assists" FROM table_48740 WHERE "Date" = 'january 2' | wikisql |
CREATE TABLE table_name_92 (
club VARCHAR,
drawn VARCHAR,
lost VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the club for drawn of 0 and lost of 0
| SELECT club FROM table_name_92 WHERE drawn = "0" AND lost = "0" | sql_create_context |
CREATE TABLE table_23157997_13 (
stage VARCHAR,
general_classification VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What stage number had the general classification Rory Sutherland?
| SELECT COUNT(stage) FROM table_23157997_13 WHERE general_classification = "Rory Sutherland" | sql_create_context |
CREATE TABLE table_name_79 (
time VARCHAR,
arranger_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the lengths of the tracks arranged by ROZ?
| SELECT time FROM table_name_79 WHERE arranger_s_ = "roz" | sql_create_context |
CREATE TABLE shop (
num_of_staff INTEGER,
score INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the average score and average staff number of all shops?
| SELECT AVG(num_of_staff), AVG(score) FROM shop | sql_create_context |
CREATE TABLE table_18024 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result of the game played on September 16, 1984?
| SELECT "Result" FROM table_18024 WHERE "Date" = 'September 16, 1984' | wikisql |
CREATE TABLE keyword (
id int,
keyword text
)
CREATE TABLE copyright (
id int,
msid int,
cid int
)
CREATE TABLE directed_by (
id int,
msid int,
did int
)
CREATE TABLE made_by (
id int,
msid int,
pid int
)
CREATE TABLE actor (
aid int,
gender text,
name text,
... | SELECT COUNT(DISTINCT (movie.title)) FROM directed_by, director, movie WHERE director.did = directed_by.did AND director.name = 'Steven Spielberg' AND movie.mid = directed_by.msid | imdb |
CREATE TABLE table_4614 (
"Line" text,
"Color" text,
"Terminus" text,
"Length" text,
"Stations" text,
"Daily Ridership" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Terminus is on line 10?
| SELECT "Terminus" FROM table_4614 WHERE "Line" = 'line 10' | wikisql |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_inf... | css |
CREATE TABLE table_31573 (
"Place" real,
"Rider" text,
"Country" text,
"Machine" text,
"Speed" text,
"Time" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country has a place smaller than 8 and points smaller than 5?
| SELECT "Country" FROM table_31573 WHERE "Place" < '8' AND "Points" < '5' | wikisql |
CREATE TABLE Apartments (
apt_id INTEGER,
building_id INTEGER,
apt_type_code CHAR(15),
apt_number CHAR(10),
bathroom_count INTEGER,
bedroom_count INTEGER,
room_count CHAR(5)
)
CREATE TABLE Guests (
guest_id INTEGER,
gender_code CHAR(1),
guest_first_name VARCHAR(80),
guest_la... | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings ORDER BY COUNT(booking_start_date) DESC | nvbench |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT * FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE hz_info.RYBH = '97868786' AND jyjgzbb.JCZBJGDL < jyjgzbb.CKZFWXX OR jyjgzbb... | css |
CREATE TABLE table_34242 (
"Game" real,
"October" real,
"Opponent" text,
"Score" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What average game has @ florida panthers as the opponent, 0-1-2 as the record, with an october greater tha... | SELECT AVG("Game") FROM table_34242 WHERE "Opponent" = '@ florida panthers' AND "Record" = '0-1-2' AND "October" > '8' | wikisql |
CREATE TABLE table_26504 (
"Rnd" real,
"Circuit" text,
"LMP Winning Team" text,
"LMPC Winning Team" text,
"GT Winning Team" text,
"GTC Winning Team" text,
"Results" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many circuits had a winni... | SELECT COUNT("Circuit") FROM table_26504 WHERE "LMP Winning Team" = '#1 Patrón Highcroft Racing' AND "GTC Winning Team" = '#81 Alex Job Racing' | wikisql |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Name | nvbench |
CREATE TABLE table_131 (
"2013 Republican primary" text,
"Manhattan" text,
"The Bronx" text,
"Brooklyn" text,
"Queens" text,
"Staten Island" text,
"Total" real,
"%" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the total number... | SELECT COUNT("Manhattan") FROM table_131 WHERE "Staten Island" = '12,658' | wikisql |
CREATE TABLE addresses (
city VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show all distinct cities in the address record.
| SELECT DISTINCT city FROM addresses | sql_create_context |
CREATE TABLE table_train_204 (
"id" int,
"systolic_blood_pressure_sbp" int,
"plasma_glucose_concentration" int,
"fasting_plasma_glucose_fpg" float,
"increase_risk_of_intervention" bool,
"diastolic_blood_pressure_dbp" int,
"life_span" bool,
"body_mass_index_bmi" float,
"NOUSE" float
)... | SELECT * FROM table_train_204 WHERE systolic_blood_pressure_sbp > 180 OR diastolic_blood_pressure_dbp > 105 | criteria2sql |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname var... | SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN course ON course.course_id = course_offering.course_id WHERE course.name L... | advising |
CREATE TABLE table_name_10 (
sr_no INTEGER,
builder VARCHAR,
secr_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Beyer Peacock's SR number with a SECR number of 769?
| SELECT AVG(sr_no) FROM table_name_10 WHERE builder = "beyer peacock" AND secr_no = 769 | sql_create_context |
CREATE TABLE table_1609 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the manner of departure of Nico... | SELECT "Manner of departure" FROM table_1609 WHERE "Outgoing manager" = 'Nicolae Manea' | wikisql |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE diagnoses_icd (
row_id number,
... | SELECT COUNT(*) > 0 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 = 25951)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'portagen... | mimic_iii |
CREATE TABLE table_39065 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent with attendance at 64,002?
| SELECT "Opponent" FROM table_39065 WHERE "Attendance" = '64,002' | wikisql |
CREATE TABLE table_66200 (
"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.
-- The final match played against Evie Dominikovic was played on what su... | SELECT "Surface" FROM table_66200 WHERE "Opponent in the final" = 'evie dominikovic' | wikisql |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId... | SELECT u.DisplayName, u.Reputation FROM Users AS u LEFT OUTER JOIN Badges AS b ON b.UserId = u.Id AND b.Name IN ('Famous Question', 'Great Question') GROUP BY u.DisplayName, u.Reputation, b.Name HAVING u.Reputation < 100000 ORDER BY u.Reputation DESC | sede |
CREATE TABLE table_79046 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many to pars were won in 1993?
| SELECT COUNT("To par") FROM table_79046 WHERE "Year(s) won" = '1993' | wikisql |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following questions for the... | SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name | nvbench |
CREATE TABLE table_41899 (
"Ballarat FL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total against that has wins less than 9, and losses less than 16, and 2 as... | SELECT SUM("Against") FROM table_41899 WHERE "Wins" < '9' AND "Losses" < '16' AND "Byes" = '2' AND "Ballarat FL" = 'ballarat' | wikisql |
CREATE TABLE table_22771048_2 (
transit_connections VARCHAR,
city_neighborhood VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the transit connection in Columbia City, Seattle?
| SELECT transit_connections FROM table_22771048_2 WHERE city_neighborhood = "Columbia City, Seattle" | sql_create_context |
CREATE TABLE table_name_6 (
rebounds INTEGER,
name VARCHAR,
games VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Rebounds did Novica Veli kovi get in less than 22 Games?
| SELECT SUM(rebounds) FROM table_name_6 WHERE name = "novica veličković" AND games < 22 | sql_create_context |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE... | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE table_name_78 (
player VARCHAR,
matches VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what player matched up with 9
| SELECT player FROM table_name_78 WHERE matches = "9" | sql_create_context |
CREATE TABLE table_7625 (
"Dates" text,
"Tournament" text,
"Country" text,
"Prize fund ( US$ )" real,
"Winner" text,
"OWGR pts" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest OWGR pts, whenn Winner is Lin Wen-Tang (4), and wh... | SELECT MAX("OWGR pts") FROM table_7625 WHERE "Winner" = 'lin wen-tang (4)' AND "Prize fund ( US$ )" < '2,250,000' | wikisql |
CREATE TABLE table_68307 (
"Name" text,
"Birth" text,
"Marriage" text,
"Became Consort" text,
"Ceased to be Consort" text,
"Spouse" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the spouse for louise of hesse-kassel
| SELECT "Spouse" FROM table_68307 WHERE "Name" = 'louise of hesse-kassel' | wikisql |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,... | SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 66015 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = ... | mimic_iii |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
... | 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 ((flight.arrival_time <= 1630 AND flight.arrival_time >= 1530) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND flight.t... | atis |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT WITH MVR; ? MAZE" | mimicsql_data |
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 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 = 'cpap/peep therapy - reduce peep as toler... | eicu |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,... | SELECT (SELECT COUNT(Id) FROM Posts LEFT JOIN PostTags ON PostTags.PostId = Id WHERE AnswerCount = 0 AND PostTags.TagId = 1002 AND ClosedDate IS NULL) AS notAnswered, (SELECT COUNT(Id) FROM Posts LEFT JOIN PostTags ON PostTags.PostId = Id WHERE AnswerCount > 0 AND PostTags.TagId = 1002 AND ClosedDate IS NULL) AS answer... | sede |
CREATE TABLE table_name_17 (
result VARCHAR,
year VARCHAR,
award VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What result took pace in 2009 and had an award of sopot international song festival?
| SELECT result FROM table_name_17 WHERE year = 2009 AND award = "sopot international song festival" | sql_create_context |
CREATE TABLE mailshot_customers (
mailshot_id number,
customer_id number,
outcome_code text,
mailshot_customer_date time
)
CREATE TABLE order_items (
item_id number,
order_item_status_code text,
order_id number,
product_id number,
item_status_code text,
item_delivered_datetime t... | SELECT T2.customer_name FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE employees (
hire_date VARCHAR,
first_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- when is the hire date for those employees whose first name does not containing the letter M?
| SELECT hire_date FROM employees WHERE NOT first_name LIKE '%M%' | sql_create_context |
CREATE TABLE table_77879 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the outgoing manager for living... | SELECT "Outgoing manager" FROM table_77879 WHERE "Team" = 'livingston' | wikisql |
CREATE TABLE table_31949 (
"Year" real,
"Director" text,
"Project" text,
"Category" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What result does the project Once Upon A Time In The West, directed by Sergio Leone have?
| SELECT "Result" FROM table_31949 WHERE "Director" = 'sergio leone' AND "Project" = 'once upon a time in the west' | wikisql |
CREATE TABLE table_60282 (
"Year" real,
"Date (Opening)" text,
"Date (Closing)" text,
"Opening Film" text,
"Number of Screening" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of Year(s), when Date (Opening) is 'September 21... | SELECT COUNT("Year") FROM table_60282 WHERE "Date (Opening)" = 'september 21' | wikisql |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25... | SELECT EMAIL, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMAIL | nvbench |
CREATE TABLE Problem_Status_Codes (
problem_status_code VARCHAR(20),
problem_status_description VARCHAR(80)
)
CREATE TABLE Problems (
problem_id INTEGER,
product_id INTEGER,
closure_authorised_by_staff_id INTEGER,
reported_by_staff_id INTEGER,
date_problem_reported DATETIME,
date_proble... | SELECT log_entry_date, problem_log_id FROM Problem_Log WHERE problem_id = 10 | nvbench |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
g... | SELECT DISTINCT department, name, number FROM course WHERE credits = 3 AND department = 'SWC' AND number < 400 + 100 AND number >= 400 | advising |
CREATE TABLE table_10960039_6 (
pick__number VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many fb players were drafted?
| SELECT COUNT(pick__number) FROM table_10960039_6 WHERE position = "FB" | 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 STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', patient.hospitaladmittime) FROM patient WHERE patient.uniquepid = '021-124150' AND NOT patient.hospitaladmittime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1 | eicu |
CREATE TABLE table_50177 (
"Radical (variants)" text,
"Stroke count" real,
"P\u012bny\u012bn" text,
"Hiragana - Romaji" text,
"Meaning" text,
"Frequency" real,
"Examples" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE RADICAL WIT... | SELECT "Radical (variants)" FROM table_50177 WHERE "P\u012bny\u012bn" = 'gǔ' AND "Stroke count" = '7' | wikisql |
CREATE TABLE table_name_21 (
density__hab__km²__ VARCHAR,
population_under_1_year_old_censo_2007_hab_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the density (hab/km ) with a population under 1 year-old censo 2007(hab) of * data from the census ta... | SELECT density__hab__km²__ FROM table_name_21 WHERE population_under_1_year_old_censo_2007_hab_ = "* data from the census taken by the inei" | sql_create_context |
CREATE TABLE table_name_62 (
record VARCHAR,
november VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What record has a november greater than 11, and st. louis blues as the opponent?
| SELECT record FROM table_name_62 WHERE november > 11 AND opponent = "st. louis blues" | sql_create_context |
CREATE TABLE person_info_hz_info (
RYBH text,
KH number,
KLX number,
YLJGDM number
)
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,... | SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.... | css |
CREATE TABLE table_6825 (
"Name" text,
"Profession" text,
"City" text,
"Entered the house" text,
"Evicted" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the profession of the housemate from Leskovac city?
| SELECT "Profession" FROM table_6825 WHERE "City" = 'leskovac' | wikisql |
CREATE TABLE table_16880 (
"No. in series" text,
"No. in season" text,
"Title" text,
"Directed by" text,
"Written by" text,
"Featured character(s)" text,
"Original air date" text,
"U.S. viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provi... | SELECT "No. in series" FROM table_16880 WHERE "Featured character(s)" = 'Hurley' | wikisql |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
View... | SELECT question.Id AS "post_link", question.Score, MAX(answer.Score) AS "Top Answer", question.AnswerCount AS "Answer Count", question.ViewCount AS "View Count" FROM Posts AS question, Posts AS answer WHERE answer.CommunityOwnedDate IS NULL AND question.CommunityOwnedDate IS NULL AND answer.PostTypeId = 2 AND answer.Pa... | sede |
CREATE TABLE table_60995 (
"Semi-closed initial unstressed vowels" text,
"17th c." text,
"American" text,
"Australian" text,
"Examples" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the American sound that has a 17th century equivalent of ,... | SELECT "American" FROM table_60995 WHERE "17th c." = 'ɪ' AND "Semi-closed initial unstressed vowels" = 'i /ɪ, ɨ/' | wikisql |
CREATE TABLE Student_Tests_Taken (
registration_id INTEGER,
date_test_taken DATETIME,
test_result VARCHAR(255)
)
CREATE TABLE Courses (
course_id INTEGER,
author_id INTEGER,
subject_id INTEGER,
course_name VARCHAR(120),
course_description VARCHAR(255)
)
CREATE TABLE Students (
stud... | SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "Spanish" ORDER BY COUNT(date_of_enrolment) DESC | nvbench |
CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
date_account_opened DATETIME,
account_name VARCHAR(50),
other_account_details VARCHAR(255)
)
CREATE TABLE Products (
product_id INTEGER,
parent_product_id INTEGER,
production_type_code VARCHAR(15),
unit_price DECIMAL(1... | SELECT customer_last_name, COUNT(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY customer_last_name | nvbench |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name 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 = 'HOUSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'INDIA... | atis |
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_Home, Team_ID FROM basketball_match GROUP BY ACC_Home, All_Home ORDER BY All_Home | nvbench |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wa... | SELECT MAX(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-18025')) AND lab.labname = 'calcium' AND STRFTIME('%y-%m', lab.labresulttime) ... | eicu |
CREATE TABLE table_69968 (
"Match" real,
"Date" text,
"Competition or tour" text,
"Ground" text,
"Opponent" text,
"Score1" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score against hapoel tel aviv?
| SELECT "Score1" FROM table_69968 WHERE "Opponent" = 'hapoel tel aviv' | wikisql |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pulmonary embolism') AS t1 GROUP BY t1.uniquepid HAVING MIN(t1.d... | eicu |
CREATE TABLE table_58188 (
"Name" text,
"Years" text,
"Area" text,
"Authority" text,
"Decile" text,
"Roll" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what area is torbay school with a state authority?
| SELECT "Area" FROM table_58188 WHERE "Authority" = 'state' AND "Name" = 'torbay school' | wikisql |
CREATE TABLE table_22085 (
"Birth Name" text,
"Birth Name As Announced in Latin (Accusative case Forename Undeclined Surname)" text,
"Papal Name" text,
"Papal Name As Announced in Latin" text,
"Latin declension of Papal Name" text,
"Numeral in Papal Name" text
)
-- Using valid SQLite, answer t... | SELECT "Papal Name" FROM table_22085 WHERE "Papal Name As Announced in Latin" = 'Pium' | wikisql |
CREATE TABLE table_18600760_12 (
geo_id INTEGER,
water__sqmi_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the geo id when water is 0.457?
| SELECT MIN(geo_id) FROM table_18600760_12 WHERE water__sqmi_ = "0.457" | sql_create_context |
CREATE TABLE table_name_86 (
rank VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What ranking is the Battersea Power Station?
| SELECT rank FROM table_name_86 WHERE name = "battersea power station" | sql_create_context |
CREATE TABLE table_77577 (
"Superlative" text,
"Actor" text,
"Record Set" text,
"Year" real,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the earliest year for ordinary people to appear in the notes?
| SELECT MIN("Year") FROM table_77577 WHERE "Notes" = 'ordinary people' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.