instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
CO... | SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID | nvbench |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | (SELECT jybgb.KSBM, jybgb.KSMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '... | 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 SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '29762576' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2000-02-05' AND '2020-09-20' AND t_kc22.MED_I... | css |
CREATE TABLE table_52878 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the grid associated with under 26 laps and a Time/Retired of +6.077?
| SELECT AVG("Grid") FROM table_52878 WHERE "Time/Retired" = '+6.077' AND "Laps" < '26' | wikisql |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)... | SELECT COUNT(Id) FROM Posts WHERE CreationDate BETWEEN '2019-01-01' AND '2019-03-03' | sede |
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 diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.short_title = "Sec neuroend tumor-liver" | mimicsql_data |
CREATE TABLE table_12614 (
"Team" text,
"B10 Conference" text,
"B10 %" real,
"B10 Home" text,
"B10 Road" text,
"All Games" text,
"All Games %" real,
"All Home" text,
"All Road" text,
"All Neutral" text
)
-- Using valid SQLite, answer the following questions for the tables provi... | SELECT "All Home" FROM table_12614 WHERE "All Games %" < '0.406' | wikisql |
CREATE TABLE table_76319 (
"Club" text,
"League" text,
"Venue" text,
"Capacity" text,
"Location" text,
"Established" real,
"Championships" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the venue named nassau veterans memorial colis... | SELECT MAX("Established") FROM table_76319 WHERE "Venue" = 'nassau veterans memorial coliseum' | wikisql |
CREATE TABLE table_name_56 (
rank VARCHAR,
nation VARCHAR,
bronze VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What rank has 0 as the bronze, and a total less than 3, with north korea as the nation?
| SELECT rank FROM table_name_56 WHERE bronze = 0 AND total < 3 AND nation = "north korea" | sql_create_context |
CREATE TABLE table_name_7 (
location VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the location when the time is 3:15?
| SELECT location FROM table_name_7 WHERE time = "3:15" | sql_create_context |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course_prerequisite (
pre_course_id ... | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Epistemology%' OR name LIKE '%Epistemology%') AND credits = 15 | advising |
CREATE TABLE table_63492 (
"Rank" real,
"Title" text,
"Release Date" text,
"Franchise" text,
"Developer(s)" text,
"Platform" text,
"Units sold (in Millions)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the platform of Super Mario A... | SELECT "Platform" FROM table_63492 WHERE "Title" = 'super mario all-stars' | wikisql |
CREATE TABLE table_203_568 (
id number,
"town/village" text,
"population" number,
"postal code" text,
"municipality" text,
"island" text,
"location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many towns have a population higher than ... | SELECT COUNT("town/village") FROM table_203_568 WHERE "population" > 1000 | squall |
CREATE TABLE culture_company (
company_name text,
type text,
incorporated_in text,
group_equity_shareholding number,
book_club_id text,
movie_id text
)
CREATE TABLE book_club (
book_club_id number,
year number,
author_or_editor text,
book_title text,
publisher text,
cate... | SELECT title, director FROM movie WHERE year <= 2000 ORDER BY gross_worldwide DESC LIMIT 1 | spider |
CREATE TABLE table_49566 (
"Race" real,
"Race Title" text,
"Circuit" text,
"City / State" text,
"Date" text,
"Winner" text,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the Lakeside race where Paul Morris won?
| SELECT "Date" FROM table_49566 WHERE "Race Title" = 'lakeside' AND "Winner" = 'paul morris' | wikisql |
CREATE TABLE table_203_212 (
id number,
"#" number,
"district" text,
"land area (km2)" number,
"population\n(2010 census)" number,
"density (persons/km2)" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total land area of saint luci... | SELECT "land area (km2)" FROM table_203_212 WHERE "district" = 'saint lucia' | squall |
CREATE TABLE table_name_98 (
province_region VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where is the Cagayan de Oro city located?
| SELECT province_region FROM table_name_98 WHERE location = "cagayan de oro city" | sql_create_context |
CREATE TABLE table_13741576_6 (
club VARCHAR,
points_against VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What club had 404 points against?
| SELECT club FROM table_13741576_6 WHERE points_against = "404" | sql_create_context |
CREATE TABLE subjects (
subject_id number,
subject_name text
)
CREATE TABLE course_authors_and_tutors (
author_id number,
author_tutor_atb text,
login_name text,
password text,
personal_name text,
middle_name text,
family_name text,
gender_mf text,
address_line_1 text
)
CRE... | SELECT personal_name, family_name FROM students ORDER BY family_name | spider |
CREATE TABLE table_7978 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which event did he win with a method of submission (... | SELECT "Event" FROM table_7978 WHERE "Res." = 'win' AND "Time" = 'n/a' AND "Method" = 'submission (triangle choke)' | wikisql |
CREATE TABLE table_27823058_1 (
series__number INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the highest series number ?
| SELECT MAX(series__number) FROM table_27823058_1 | sql_create_context |
CREATE TABLE table_40023 (
"Date" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Set 4" text,
"Set 5" text,
"Total" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the set 5 with a 19-25 set 1?
| SELECT "Set 5" FROM table_40023 WHERE "Set 1" = '19-25' | wikisql |
CREATE TABLE table_63216 (
"Island" text,
"Country" text,
"Population" text,
"Area km\u00b2" text,
"Density (per km\u00b2)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country has a density (per km ) of 6,814?
| SELECT "Country" FROM table_63216 WHERE "Density (per km\u00b2)" = '6,814' | wikisql |
CREATE TABLE order_items (
order_id number,
product_id number,
order_quantity text
)
CREATE TABLE customer_addresses (
customer_id number,
address_id number,
date_address_from time,
address_type text,
date_address_to time
)
CREATE TABLE customer_contact_channels (
customer_id numbe... | SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id WHERE t4.product_details = 'Latte' | spider |
CREATE TABLE table_19222 (
"Institution" text,
"Location" text,
"Established" real,
"Gained university status" real,
"Vice-chancellor" text,
"Total Number of Students" real,
"Research Funding (\u00a3,000)" real
)
-- Using valid SQLite, answer the following questions for the tables provided... | SELECT COUNT("Research Funding (\u00a3,000)") FROM table_19222 WHERE "Gained university status" = '1900' | wikisql |
CREATE TABLE phone_market (
Market_ID int,
Phone_ID text,
Num_of_stock int
)
CREATE TABLE market (
Market_ID int,
District text,
Num_of_employees int,
Num_of_shops real,
Ranking int
)
CREATE TABLE phone (
Name text,
Phone_ID int,
Memory_in_G int,
Carrier text,
Price... | SELECT Name, SUM(T1.Num_of_stock) FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name ORDER BY SUM(T1.Num_of_stock) | nvbench |
CREATE TABLE table_15001 (
"Series" text,
"TV Channel" text,
"Launch Date" text,
"Finale Date" text,
"Days" real,
"The Winner" text,
"The Prize" text,
"The Presenter" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won when the presen... | SELECT "The Winner" FROM table_15001 WHERE "The Presenter" = 'tatiana stefanidou' | wikisql |
CREATE TABLE table_name_28 (
long INTEGER,
gain INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the long figure when gain is less than 0?
| SELECT AVG(long) FROM table_name_28 WHERE gain < 0 | sql_create_context |
CREATE TABLE table_203_2 (
id number,
"name" text,
"mineral" text,
"opened" text,
"closed" text,
"years connected" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many quarries opened before 1892 ?
| SELECT COUNT(*) FROM table_203_2 WHERE "opened" <= 1892 | squall |
CREATE TABLE table_2417345_4 (
date_successor_seated VARCHAR,
successor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was successor George E. Harris (R) seated?
| SELECT date_successor_seated FROM table_2417345_4 WHERE successor = "George E. Harris (R)" | sql_create_context |
CREATE TABLE table_63594 (
"Draw" real,
"Language" text,
"Artist" text,
"English translation" text,
"Place" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest draw number when there are more than 31 points, a rank ... | SELECT MAX("Draw") FROM table_63594 WHERE "Points" > '31' AND "Place" > '6' AND "English translation" = 'listen to me' | wikisql |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label te... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'ac vasc insuff int... | mimic_iii |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedb... | SELECT * FROM Users WHERE Id = 113 | sede |
CREATE TABLE table_17622 (
"Number in series" real,
"Broadcast Order" text,
"Title" text,
"Villain/s" text,
"U.S. Air Date" text,
"Production Code" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the series number of the episode titled 'Th... | SELECT MAX("Number in series") FROM table_17622 WHERE "Title" = 'The Quest' | wikisql |
CREATE TABLE table_name_94 (
game VARCHAR,
high_rebounds VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What game has jones (10) as the high rebounds?
| SELECT game FROM table_name_94 WHERE high_rebounds = "jones (10)" | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2056" AND prescriptions.route = "SL" | mimicsql_data |
CREATE TABLE table_19712 (
"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.
-- What was the result of the game on October 6, 1974?
| SELECT "Result" FROM table_19712 WHERE "Date" = 'October 6, 1974' | wikisql |
CREATE TABLE table_name_93 (
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE 2010 WITH 2012 OF 2R AT MIAMI MASTERS?
| SELECT 2010 FROM table_name_93 WHERE 2012 = "2r" AND tournament = "miami masters" | sql_create_context |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE fare_basis (
fare_basis_cod... | 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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTO... | atis |
CREATE TABLE table_202_160 (
id number,
"season" number,
"level" text,
"division" text,
"section" text,
"position" text,
"movements" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what division was the team most commonly found in ?
| SELECT "division" FROM table_202_160 GROUP BY "division" ORDER BY COUNT(*) DESC LIMIT 1 | squall |
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_ORG_DEPT_CD, t_kc21.OUT_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '3667285' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.OUT_DIAG_DIS_NM | css |
CREATE TABLE table_58095 (
"Year" real,
"Winner" text,
"Jockey" text,
"Trainer" text,
"Owner" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won in 2003?
| SELECT "Winner" FROM table_58095 WHERE "Year" = '2003' | wikisql |
CREATE TABLE table_name_52 (
song VARCHAR,
weeks_at_number_one VARCHAR,
issue_date_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Song has a Weeks at number one larger than 2, and an Issue date(s) of 17 april - 8 may?
| SELECT song FROM table_name_52 WHERE weeks_at_number_one > 2 AND issue_date_s_ = "17 april - 8 may" | sql_create_context |
CREATE TABLE table_72576 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the player for chicago black hawks
| SELECT "Player" FROM table_72576 WHERE "NHL team" = 'Chicago Black Hawks' | wikisql |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE... | 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, date_day, days AS DAYS_0, days AS DAYS_1, flight WHERE (((DAYS_1.day_name = 'THURSDAY' AND flight.arrival_time <= 1200 AND flight.flight_days = DAYS_1.days_code) AND date_day... | atis |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE T... | SELECT COUNT(CASE WHEN UPPER(Posts.Tags) LIKE '%<OPEN-ENDED>%' THEN 1 END) AS OpenEndedCount FROM Posts JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE PostTypes.Name = 'Question' | sede |
CREATE TABLE table_name_44 (
floors VARCHAR,
street_address_in_detroit VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many floors does the address 1828 jay street have?
| SELECT floors FROM table_name_44 WHERE street_address_in_detroit = "1828 jay street" | sql_create_context |
CREATE TABLE Apartment_Bookings (
apt_booking_id INTEGER,
apt_id INTEGER,
guest_id INTEGER,
booking_status_code CHAR(15),
booking_start_date DATETIME,
booking_end_date DATETIME
)
CREATE TABLE Guests (
guest_id INTEGER,
gender_code CHAR(1),
guest_first_name VARCHAR(80),
guest_las... | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 2 ORDER BY COUNT(booking_start_date) DESC | nvbench |
CREATE TABLE table_36315 (
"Athlete" text,
"Country" text,
"Run 1" real,
"Run 2" real,
"Run 3" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had a run 2 of 50.67?
| SELECT "Athlete" FROM table_36315 WHERE "Run 2" = '50.67' | wikisql |
CREATE TABLE table_27277284_28 (
ht VARCHAR,
mult_1 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much ht does the model with 10x mult. 1 have?
| SELECT ht FROM table_27277284_28 WHERE mult_1 = "10x" | sql_create_context |
CREATE TABLE table_13618358_1 (
income_poverty_f VARCHAR,
services_ VARCHAR,
_cons_truction_b VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How low was the income where services is 72.5?
| SELECT income_poverty_f FROM table_13618358_1 WHERE services_ & _cons_truction_b = "72.5" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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 t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2138.0" AND procedures.short_title = "Allo hem stem ct w/o pur" | mimicsql_data |
CREATE TABLE table_7631 (
"Episode Number" real,
"Air Date" text,
"Guest Host" text,
"Musical Guest (Song performed)" text,
"\"Coat of Cash\" Wearing Celebrity" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest of Episode Number that... | SELECT MIN("Episode Number") FROM table_7631 WHERE "Air Date" = '20 july 2007' | wikisql |
CREATE TABLE Services (
Service_ID VARCHAR,
Service_Type_Code VARCHAR
)
CREATE TABLE EVENTS (
event_details VARCHAR,
Service_ID VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what are the event details of the services that have the type code 'Marria... | SELECT T1.event_details FROM EVENTS AS T1 JOIN Services AS T2 ON T1.Service_ID = T2.Service_ID WHERE T2.Service_Type_Code = 'Marriage' | sql_create_context |
CREATE TABLE table_name_62 (
team__number2 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 1st leg of bp. honv d team #2?
| SELECT 1 AS st_leg FROM table_name_62 WHERE team__number2 = "bp. honvéd" | sql_create_context |
CREATE TABLE table_17943 (
"Year" real,
"Starts" real,
"Wins (Majors)" text,
"2nd" real,
"3rd" real,
"Earnings ($)" real,
"Money list rank" text,
"Scoring average" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of s... | SELECT COUNT("Scoring average") FROM table_17943 WHERE "Money list rank" = '174' | wikisql |
CREATE TABLE table_name_23 (
points INTEGER,
engine VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which gc37-01 v10 engine has the fewest points?
| SELECT MIN(points) FROM table_name_23 WHERE engine = "gc37-01 v10" | sql_create_context |
CREATE TABLE Participants (
Participant_ID INTEGER,
Participant_Type_Code CHAR(15),
Participant_Details VARCHAR(255)
)
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15)
)
CREATE TABLE Participants_in_Events (
Event_ID INTEGER,
Participant_ID INTEGER
)
CREATE TABLE Eve... | SELECT T1.Event_Details, T1.Event_ID FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_Details ORDER BY T1.Event_ID | nvbench |
CREATE TABLE table_19439864_2 (
tromsø INTEGER,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the total score is 740, what is tromso?
| SELECT MIN(tromsø) FROM table_19439864_2 WHERE total = 740 | sql_create_context |
CREATE TABLE table_2417340_4 (
successor VARCHAR,
vacator VARCHAR,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the successor for vacant louisiana 5th
| SELECT successor FROM table_2417340_4 WHERE vacator = "Vacant" AND district = "Louisiana 5th" | sql_create_context |
CREATE TABLE table_45612 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team... | SELECT "Team" FROM table_45612 WHERE "Outgoing manager" = 'gonzalo arconada' | wikisql |
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_season int,
Title text,
Directed_by text,
Original_air_date text,
Production_code text
)
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE cine... | SELECT Name, Price FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Title, Name ORDER BY Price DESC | nvbench |
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 (
aircraft_code_sequence text,
airline_code varchar,
airline_fli... | 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, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND C... | atis |
CREATE TABLE table_name_35 (
first_match VARCHAR,
final_position VARCHAR,
final_round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date did the first match occur for the competition that ended with a final position of winners and the final roun... | SELECT first_match FROM table_name_35 WHERE final_position = "winners" AND final_round = "finals" | sql_create_context |
CREATE TABLE table_name_67 (
away_team VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was home team South Melbourne's opponents score?
| SELECT away_team AS score FROM table_name_67 WHERE home_team = "south melbourne" | sql_create_context |
CREATE TABLE authors (
authid number,
lname text,
fname text
)
CREATE TABLE inst (
instid number,
name text,
country text
)
CREATE TABLE papers (
paperid number,
title text
)
CREATE TABLE authorship (
authid number,
instid number,
paperid number,
authorder number
)
-... | SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Olin" AND t1.lname = "Shivers" | spider |
CREATE TABLE schedule (
film_id VARCHAR,
show_times_per_day INTEGER
)
CREATE TABLE film (
directed_by VARCHAR,
film_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show director with the largest number of show times in total.
| SELECT T2.directed_by FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T2.directed_by ORDER BY SUM(T1.show_times_per_day) DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_13592 (
"Constituency number" text,
"Name" text,
"Reserved for ( SC / ST /None)" text,
"District" text,
"Number of electorates (2009)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which constituency number has a name of Timarni?... | SELECT "Constituency number" FROM table_13592 WHERE "Name" = 'timarni' | wikisql |
CREATE TABLE table_name_20 (
league VARCHAR,
nationality VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which league's nationality was Italy when there were 62 points?
| SELECT league FROM table_name_20 WHERE nationality = "italy" AND points = "62" | sql_create_context |
CREATE TABLE table_name_35 (
grid VARCHAR,
bike VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number for grid with a Suzuki GSX-R1000 K7 for +13.283?
| SELECT COUNT(grid) FROM table_name_35 WHERE bike = "suzuki gsx-r1000 k7" AND time = "+13.283" | sql_create_context |
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station_id INTEGER,
bike_id INTEGER,
subscription_type TEXT,
zip_code INTEGER
)
CREATE TABLE weather (
date TEX... | SELECT date, mean_humidity FROM weather ORDER BY max_gust_speed_mph DESC LIMIT 3 | nvbench |
CREATE TABLE table_66980 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the years for dannevirke south school
| SELECT "Years" FROM table_66980 WHERE "Name" = 'dannevirke south school' | wikisql |
CREATE TABLE table_name_92 (
draw INTEGER,
points VARCHAR,
match VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest draw that has points greater than 4, with a match greater than 5?
| SELECT MAX(draw) FROM table_name_92 WHERE points > 4 AND match > 5 | sql_create_context |
CREATE TABLE table_16432543_1 (
nickname VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many nicknames does the school in Newark, DE have
| SELECT COUNT(nickname) FROM table_16432543_1 WHERE location = "Newark, DE" | sql_create_context |
CREATE TABLE table_71840 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country watch Tom Watson at t9 score 72-72=144?
| SELECT "Country" FROM table_71840 WHERE "Place" = 't9' AND "Score" = '72-72=144' AND "Player" = 'tom watson' | wikisql |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
... | SELECT TagName, COUNT(*) AS UpVotes FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id AND VoteTypeId = 2 WHERE Posts.OwnerUserId = @UserId GROUP BY TagName ORDER BY UpVotes DESC | sede |
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 advisory_requirement FROM course WHERE department = 'EMBA' AND number = 628 | advising |
CREATE TABLE student_course_registrations (
student_id number,
course_id number,
registration_date time
)
CREATE TABLE addresses (
address_id number,
line_1 text,
line_2 text,
city text,
zip_postcode text,
state_province_county text,
country text
)
CREATE TABLE students (
s... | SELECT COUNT(*) FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "English" | spider |
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2152" AND diagnoses.short_title = "NB obs genetc/metabl cnd" | mimicsql_data |
CREATE TABLE table_69301 (
"Year" real,
"Artist" text,
"Album / Song" text,
"Award" text,
"Result / Category" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which result is older than 2007?
| SELECT "Result / Category" FROM table_69301 WHERE "Year" < '2007' | wikisql |
CREATE TABLE table_21886 (
"Tie no" real,
"Home team" text,
"Score 1" text,
"Away team" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What tie number featured Chelsea as the home team?
| SELECT MIN("Tie no") FROM table_21886 WHERE "Home team" = 'Chelsea' | wikisql |
CREATE TABLE Financial_transactions (
transaction_type VARCHAR,
transaction_amount INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the transaction types and the total amount of transactions.
| SELECT transaction_type, SUM(transaction_amount) FROM Financial_transactions GROUP BY transaction_type | sql_create_context |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT MIN(MED_AMOUT), MAX(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE MED_SER_ORG_NO = '0440426' AND IN_DIAG_DIS_NM = '精神障碍') | css |
CREATE TABLE table_1393 (
"Television Station" text,
"Frequency" text,
"Site" text,
"Transmitted" text,
"Network" text,
"Status" text,
"Country of Region" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the site(s) for tv station 8tv... | SELECT "Site" FROM table_1393 WHERE "Television Station" = '8TV' | wikisql |
CREATE TABLE table_37997 (
"Game" real,
"April" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Game is the lowest one that has Points smaller than 92?
| SELECT MIN("Game") FROM table_37997 WHERE "Points" < '92' | wikisql |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT COUNT(DISTINCT MED_SER_ORG_NO) FROM t_kc21 WHERE PERSON_NM = '方光华' AND IN_HOSP_DATE BETWEEN '2007-07-13' AND '2021-05-12' | css |
CREATE TABLE table_13570_1 (
nucleus VARCHAR,
cytoplasm VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The pink cytoplasm will have a nucleus of what color?
| SELECT nucleus FROM table_13570_1 WHERE cytoplasm = "Pink" | sql_create_context |
CREATE TABLE table_7763 (
"Year" real,
"Team" text,
"Player" text,
"Position" text,
"School" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the lowest year that a player from midfield won first team honors?
| SELECT MIN("Year") FROM table_7763 WHERE "Team" = 'first team' AND "Position" = 'midfield' | wikisql |
CREATE TABLE table_10980 (
"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 home team has a crowd that is bigger than ... | SELECT "Home team" FROM table_10980 WHERE "Crowd" > '22,449' | wikisql |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT t_kc22.MED_EXP_DET_ID FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '96400515777' AND t_kc22.REMOTE_SETTLE_FLG = '异地1' OR t_kc22.REMOTE_SETTLE_FLG = '异地2' | css |
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname 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,
good_feedback int,
... | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%MODGREEK%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id | advising |
CREATE TABLE table_61144 (
"Year" real,
"Winner" text,
"Sport" text,
"Hometown" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the hometown of the player who went to college at USC?
| SELECT "Hometown" FROM table_61144 WHERE "College" = 'usc' | wikisql |
CREATE TABLE bank (
branch_id number,
bname text,
no_of_customers number,
city text,
state text
)
CREATE TABLE loan (
loan_id text,
loan_type text,
cust_id text,
branch_id text,
amount number
)
CREATE TABLE customer (
cust_id text,
cust_name text,
acc_type text,
... | SELECT cust_name, acc_type, acc_bal FROM customer ORDER BY credit_score DESC LIMIT 1 | spider |
CREATE TABLE station (
id int,
network_name text,
services text,
local_authority text
)
CREATE TABLE train (
id int,
train_number int,
name text,
origin text,
destination text,
time text,
interval text
)
CREATE TABLE weekly_weather (
station_id int,
day_of_week text... | SELECT local_authority, COUNT(local_authority) FROM station GROUP BY local_authority | nvbench |
CREATE TABLE table_name_1 (
content VARCHAR,
television_service VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What content is provided by the television service ewtn?
| SELECT content FROM table_name_1 WHERE television_service = "ewtn" | 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 jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decima... | SELECT HIRE_DATE, SALARY FROM employees WHERE NOT FIRST_NAME LIKE '%M%' ORDER BY HIRE_DATE DESC | nvbench |
CREATE TABLE table_12286195_1 (
original_team VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the original team of the celebrity who had the result 08 fired in week 10 (2008-03-06)
| SELECT original_team FROM table_12286195_1 WHERE result = "08 Fired in week 10 (2008-03-06)" | sql_create_context |
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB text,
BGDH number,
YLJGDM number
)
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,
... | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDBM = 'O32.933' AND jyjgzbb.JCZBDM = '830460' | css |
CREATE TABLE table_3033 (
"Borough" text,
"County" text,
"Franchise type" text,
"Members" real,
"Voters in 1800" real,
"Times contested" real,
"Fate in 1832" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which county has a membership of 1, ... | SELECT "County" FROM table_3033 WHERE "Members" = '1' AND "Franchise type" = 'Corporation' AND "Borough" = 'Ennis' | wikisql |
CREATE TABLE table_name_29 (
partner VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the partner with a score of 6 1, 6 4?
| SELECT partner FROM table_name_29 WHERE score = "6–1, 6–4" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.