instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE player_college (
player_id text,
college_id text,
year number
)
CREATE TABLE player_award_vote (
award_id text,
year number,
league_id text,
player_id text,
points_won number,
points_max number,
votes_first number
)
CREATE TABLE fielding_postseason (
player_id ... | SELECT COUNT(*) FROM park WHERE state = 'NY' | spider |
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2023" AND lab.itemid = "51263" | mimicsql_data |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
... | SELECT a.Id AS "post_link", a.Score, a.CreationDate FROM Posts AS a INNER JOIN Posts AS q ON a.ParentId = q.Id INNER JOIN PostHistory AS ph ON ph.PostId = q.Id INNER JOIN Users AS u ON u.Id = a.OwnerUserId WHERE ph.PostHistoryTypeId != 14 AND a.Score = 9 AND a.OwnerUserId NOT IN (SELECT DISTINCT (UserId) FROM Badges WH... | sede |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jyjgzbb 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 = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJ... | css |
CREATE TABLE table_48546 (
"Tournament" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"Career SR" text,
"Career W\u2013L" text
)
-- Using valid SQLite, answer the following questions for the ta... | SELECT "2004" FROM table_48546 WHERE "2005" = 'a' AND "2008" = 'a' AND "2009" = 'lq' | wikisql |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time... | SELECT Id AS "comment_link", PostId AS "post_link", CreationDate FROM Comments WHERE Text LIKE '%##Text##%' ORDER BY CreationDate DESC | sede |
CREATE TABLE table_name_96 (
height VARCHAR,
pos VARCHAR,
club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the height of the player from club vk primorac kotor who plays gk?
| SELECT height FROM table_name_96 WHERE pos = "gk" AND club = "vk primorac kotor" | sql_create_context |
CREATE TABLE table_40293 (
"Week #" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" real,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On which week was the result safe and the song choice ' across the univer... | SELECT "Week #" FROM table_40293 WHERE "Result" = 'safe' AND "Song choice" = ' across the universe ' | wikisql |
CREATE TABLE table_36214 (
"Rank" real,
"Player" text,
"Country" text,
"Events" real,
"Prize money ( $ )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What amount of prize money was there when the rank was less than 7, there were more than 6 event... | SELECT "Prize money ( $ )" FROM table_36214 WHERE "Rank" < '7' AND "Events" > '6' AND "Country" = 'fiji' | wikisql |
CREATE TABLE table_80141 (
"Year" text,
"1st Member" text,
"1st Party" text,
"2nd Member" text,
"2nd Party" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In 1865, what was the first party?
| SELECT "1st Party" FROM table_80141 WHERE "Year" = '1865' | wikisql |
CREATE TABLE table_name_4 (
title VARCHAR,
from_album VARCHAR,
label VARCHAR,
Nr VARCHAR,
x VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Title has an album of tough talk, and a Label-Nr of x-371?
| SELECT title FROM table_name_4 WHERE from_album = "tough talk" AND label - Nr = x - 371 | sql_create_context |
CREATE TABLE football_data (
season text,
datetime time,
div text,
country text,
league text,
referee text,
hometeam text,
awayteam text,
fthg number,
ftag number,
ftr text,
hthg number,
htag number,
htr text,
psh number,
psd number,
psa number,
b3... | SELECT * FROM football_data WHERE b365d > 3 | worldsoccerdatabase |
CREATE TABLE table_name_43 (
home_team VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the home team that played Geelong?
| SELECT home_team AS score FROM table_name_43 WHERE away_team = "geelong" | sql_create_context |
CREATE TABLE table_10997 (
"Stadium" text,
"Capacity" text,
"City" text,
"Province" text,
"Expected Completion" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which city expects their project completion in 2017?
| SELECT "City" FROM table_10997 WHERE "Expected Completion" = '2017' | wikisql |
CREATE TABLE table_24594 (
"Year" real,
"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_24594 WHERE "Year" = '2009' | wikisql |
CREATE TABLE music_festival (
ID int,
Music_Festival text,
Date_of_ceremony text,
Category text,
Volume int,
Result text
)
CREATE TABLE volume (
Volume_ID int,
Volume_Issue text,
Issue_Date text,
Weeks_on_Top real,
Song text,
Artist_ID int
)
CREATE TABLE artist (
Ar... | SELECT Famous_Title, Age FROM artist ORDER BY Age DESC | nvbench |
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(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '06002285' AND t_kc22.STA_DATE BETWEEN '2015-05-16' AND '2018-08-07' AND t_kc22.SOC_SRT_DIRE_NM = '妥布霉素滴眼液' | css |
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 MAX(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13329)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'uri... | mimic_iii |
CREATE TABLE table_11459 (
"Tournament" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2011 value that has a 2r in 2008 and a 4r in 20... | SELECT "2011" FROM table_11459 WHERE "2008" = '2r' AND "2012" = '4r' | wikisql |
CREATE TABLE table_10842344_1 (
no_in_season INTEGER,
production_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What episode number had production code e4423?
| SELECT MAX(no_in_season) FROM table_10842344_1 WHERE production_code = "E4423" | sql_create_context |
CREATE TABLE table_30977 (
"Season no." real,
"Series no." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT COUNT("Season no.") FROM table_30977 WHERE "Written by" = 'Warren Leight' | wikisql |
CREATE TABLE instructor (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
salary numeric(8,2)
)
CREATE TABLE section (
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
building varchar(15),
room_number varchar(7),
time_slot_id varchar(... | SELECT dept_name, SUM(credits) FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY dept_name ORDER BY SUM(credits) DESC | nvbench |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT Name, SUM(Revenue) FROM Manufacturers GROUP BY Name ORDER BY Name DESC | nvbench |
CREATE TABLE affiliated_with (
physician number,
department number,
primaryaffiliation boolean
)
CREATE TABLE procedures (
code number,
name text,
cost number
)
CREATE TABLE on_call (
nurse number,
blockfloor number,
blockcode number,
oncallstart time,
oncallend time
)
CRE... | SELECT T4.name FROM stay AS T1 JOIN patient AS T2 ON T1.patient = T2.ssn JOIN prescribes AS T3 ON T3.patient = T2.ssn JOIN medication AS T4 ON T3.medication = T4.code WHERE room = 111 | spider |
CREATE TABLE table_204_375 (
id number,
"#" number,
"season" number,
"competition" text,
"date" text,
"round" text,
"opponent" text,
"h / a" text,
"result" text,
"scorer (s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- can you... | SELECT "opponent" FROM table_204_375 WHERE "season" = 2013 ORDER BY "date" DESC LIMIT 1 | squall |
CREATE TABLE table_name_63 (
roll INTEGER,
decile VARCHAR,
area VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the roll number of Orautoha school in Raetihi, which has a decile smaller than 8?
| SELECT SUM(roll) FROM table_name_63 WHERE area = "raetihi" AND name = "orautoha school" AND decile < 8 | sql_create_context |
CREATE TABLE table_name_38 (
position VARCHAR,
player VARCHAR,
goals VARCHAR,
tries VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- With 0 Goals and less than 1 Tries, what is Matt James position?
| SELECT position FROM table_name_38 WHERE goals = "0" AND tries < 1 AND player = "matt james" | sql_create_context |
CREATE TABLE table_203_543 (
id number,
"year" text,
"show" text,
"role" text,
"channel" text,
"extra" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the number of channels she has appeared on ?
| SELECT COUNT(DISTINCT "channel") FROM table_203_543 | squall |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE comment_instructor (
instructor_id int,
... | SELECT DISTINCT department, description, number FROM course WHERE (department = 'DHYGRACK' AND number = 688) OR (department = 'DHYGRACK' AND number = 683) | advising |
CREATE TABLE student_course_registrations (
student_id VARCHAR,
course_id VARCHAR,
registration_date VARCHAR
)
CREATE TABLE courses (
course_id VARCHAR,
course_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the id of students who regis... | SELECT T2.student_id FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "statistics" ORDER BY T2.registration_date | sql_create_context |
CREATE TABLE table_44429 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Kickoff Time" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Attendance before Week 17 with a Record of Bye?... | SELECT "Attendance" FROM table_44429 WHERE "Week" < '17' AND "Record" = 'bye' | wikisql |
CREATE TABLE table_47450 (
"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.
-- Which Year(s) won has a Total of 147?
| SELECT "Year(s) won" FROM table_47450 WHERE "Total" = '147' | wikisql |
CREATE TABLE table_name_85 (
grid INTEGER,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want the lowest Grid for David Coulthard
| SELECT MIN(grid) FROM table_name_85 WHERE driver = "david coulthard" | 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 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 = '005-87465' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = '-monos' ORDER... | eicu |
CREATE TABLE table_69789 (
"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.
-- What is the roll number for East Gore School?
| SELECT COUNT("Roll") FROM table_69789 WHERE "Name" = 'east gore school' | wikisql |
CREATE TABLE table_204_735 (
id number,
"rank" number,
"team" text,
"names" text,
"time" text,
"qualification" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which team ranked below chile 's ?
| SELECT "team" FROM table_204_735 WHERE "rank" = (SELECT "rank" FROM table_204_735 WHERE "team" = 'chile') + 1 | squall |
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2110" AND lab.fluid = "Blood" | mimicsql_data |
CREATE TABLE table_name_66 (
position VARCHAR,
debut VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position had a debut in round 6?
| SELECT position FROM table_name_66 WHERE debut = "round 6" | sql_create_context |
CREATE TABLE table_29631 (
"#" real,
"No." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Viewers" real,
"Original airdate" text,
"Prod. code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people watched episode nu... | SELECT "Viewers" FROM table_29631 WHERE "#" = '13' | wikisql |
CREATE TABLE table_28285 (
"Year" real,
"Population" real,
"Total" real,
"Violent" real,
"Property Crimes" real,
"Forcible rape" real,
"Robbery" real,
"Aggravated assault" real,
"Burglary" real,
"Larceny Theft" real,
"Vehicle Theft" real
)
-- Using valid SQLite, answer the ... | SELECT COUNT("Vehicle Theft") FROM table_28285 WHERE "Forcible rape" = '1232' | wikisql |
CREATE TABLE table_42725 (
"Institution name" text,
"City/ town" text,
"State/ province" text,
"Total enrollment" text,
"Year founded" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was Waynesburg University founded in Pennsylvania?
| SELECT "Year founded" FROM table_42725 WHERE "State/ province" = 'pennsylvania' AND "Institution name" = 'waynesburg university' | wikisql |
CREATE TABLE table_name_44 (
mark VARCHAR,
lane VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Mark, when Lane is greater than 2, and when Country is Bahamas?
| SELECT mark FROM table_name_44 WHERE lane > 2 AND country = "bahamas" | sql_create_context |
CREATE TABLE table_name_78 (
dipole_moment___d__ VARCHAR,
solvent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the dipole moment of ethyl acetate (etoac)?
| SELECT dipole_moment___d__ FROM table_name_78 WHERE solvent = "ethyl acetate (etoac)" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text
)
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM te... | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM 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 ... | css |
CREATE TABLE table_66104 (
"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.
-- For the game on 13 December 1975 with Halifax Town as the away team what was the score?
| SELECT "Score" FROM table_66104 WHERE "Date" = '13 december 1975' AND "Away team" = 'halifax town' | wikisql |
CREATE TABLE table_14539 (
"Race" text,
"Position" text,
"Time" text,
"Speed" text,
"Replica" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the speed of the Superbike race?
| SELECT "Speed" FROM table_14539 WHERE "Race" = 'superbike' | wikisql |
CREATE TABLE table_58918 (
"Week 9 Oct 29" text,
"Week 10 Nov 5" text,
"Week 11 Nov 12" text,
"Week 12 Nov 19" text,
"Week 13 Nov 26" text,
"Week 14 Dec 3" text,
"Week 15 (Final) Dec 9" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is ... | SELECT "Week 10 Nov 5" FROM table_58918 WHERE "Week 15 (Final) Dec 9" = 'illinois (10-1)' | wikisql |
CREATE TABLE table_75942 (
"Round" text,
"Date" text,
"Home team" text,
"Score" text,
"Away team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the home team on April 13, 2008 when Itabuna was the away team?
| SELECT "Home team" FROM table_75942 WHERE "Date" = 'april 13, 2008' AND "Away team" = 'itabuna' | 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(*) FROM t_kc21 WHERE PERSON_NM = '马文心' AND CLINIC_TYPE = '住院' AND MOD(MED_AMOUT, 1) = 0 | css |
CREATE TABLE table_80254 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country has a prize smaller than $250 and the player Henry Picard?
| SELECT "Country" FROM table_80254 WHERE "Money ( $ )" < '250' AND "Player" = 'henry picard' | 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 jybgb.JYSQJGMC, jybgb.JYJGMC FROM jybgb WHERE jybgb.BGDH = '01566167620' | css |
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_kc21.OUT_DIAG_DOC_CD, t_kc21.OUT_DIAG_DOC_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '郎博延' AND t_kc21.IN_HOSP_DATE BETWEEN '2010-04-15' AND '2011-01-27' GROUP BY t_kc21.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone... | 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, flight WHERE (((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SEATTLE' AND date_day.day_number = 1 AND date_day.month_number = 6 AND ... | atis |
CREATE TABLE table_name_26 (
date VARCHAR,
player VARCHAR,
original_team VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date has Vancouver Canucks as the original team, Ryan Kesler as the player, and matched as the Result?
| SELECT date FROM table_name_26 WHERE original_team = "vancouver canucks" AND result = "matched" AND player = "ryan kesler" | sql_create_context |
CREATE TABLE table_57612 (
"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.
-- How big was the crowd in a game that had a home ... | SELECT "Crowd" FROM table_57612 WHERE "Home team score" = '15.15 (105)' | wikisql |
CREATE TABLE Mailshot_Customers (
mailshot_id INTEGER,
customer_id INTEGER,
outcome_code VARCHAR(15),
mailshot_customer_date DATETIME
)
CREATE TABLE Premises (
premise_id INTEGER,
premises_type VARCHAR(15),
premise_details VARCHAR(255)
)
CREATE TABLE Products (
product_id INTEGER,
... | SELECT outcome_code, COUNT(*) FROM Mailshot_Customers GROUP BY outcome_code | nvbench |
CREATE TABLE table_4880 (
"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.
-- What is the home team's score at punt road oval i... | SELECT "Home team score" FROM table_4880 WHERE "Crowd" > '17,000' AND "Venue" = 'punt road oval' | wikisql |
CREATE TABLE table_name_48 (
location VARCHAR,
round VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the location of the match that ended before round 2, against Hikaru Sato?
| SELECT location FROM table_name_48 WHERE round < 2 AND opponent = "hikaru sato" | sql_create_context |
CREATE TABLE table_5726 (
"Date" text,
"Tournament" text,
"Location" text,
"Winner" text,
"Score" text,
"1st prize ( $ )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the location of the tournament on Feb 10?
| SELECT "Location" FROM table_5726 WHERE "Date" = 'feb 10' | wikisql |
CREATE TABLE table_43128 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of medals when the bronze is more than 1, and Germany is the nation... | SELECT COUNT("Total") FROM table_43128 WHERE "Bronze" > '1' AND "Nation" = 'germany' AND "Gold" < '1' | wikisql |
CREATE TABLE table_43006 (
"Pos." text,
"Nationality" text,
"Previous team" text,
"NBA years [a ]" real,
"Career with the franchise [b ]" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the previous team of the United States player who had 2 ... | SELECT "Previous team" FROM table_43006 WHERE "Nationality" = 'united states' AND "NBA years [a ]" = '2' AND "Pos." = 'f' | wikisql |
CREATE TABLE table_name_77 (
constructor VARCHAR,
time_retired VARCHAR,
grid VARCHAR,
laps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who constructed the car with a grid under 15, 77 laps, and a Time/Retired of + 0.771?
| SELECT constructor FROM table_name_77 WHERE grid < 15 AND laps = 77 AND time_retired = "+ 0.771" | sql_create_context |
CREATE TABLE table_name_39 (
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the visiting team of Melbourne's score?
| SELECT away_team AS score FROM table_name_39 WHERE away_team = "melbourne" | sql_create_context |
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS varchar(20),
DEPT_EXTENSION varchar(4)
)
CREATE TABLE EMPLOYEE (
EMP_NUM int,
EMP_LNAME varchar(15),
EMP_FNAME varchar(12),
EMP_INITIAL varchar(1),
EMP_J... | SELECT DEPT_CODE, MAX(STU_GPA) FROM STUDENT GROUP BY DEPT_CODE | nvbench |
CREATE TABLE table_12765 (
"Rank" real,
"Name" text,
"Birth date" text,
"Death date" text,
"Age (as of 1 February 2014)" text,
"Place of death or residence" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Death date has a Rank smaller than ... | SELECT "Death date" FROM table_12765 WHERE "Rank" < '49' AND "Age (as of 1 February 2014)" = '112 years, 172 days' | wikisql |
CREATE TABLE table_name_31 (
place_of_birth VARCHAR,
elector VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is listed as the Place of birth for the Elector of Soffredo?
| SELECT place_of_birth FROM table_name_31 WHERE elector = "soffredo" | sql_create_context |
CREATE TABLE table_8183 (
"Club" text,
"Sport" text,
"Founded" real,
"League" text,
"Venue" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Club has a Founded smaller than 1882, and a League of fa premier league?
| SELECT "Club" FROM table_8183 WHERE "Founded" < '1882' AND "League" = 'fa premier league' | wikisql |
CREATE TABLE table_name_47 (
crowd INTEGER,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest crowd for Home team of geelong?
| SELECT MAX(crowd) FROM table_name_47 WHERE home_team = "geelong" | sql_create_context |
CREATE TABLE table_name_37 (
opponent VARCHAR,
game VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who has a Game smaller than 43, and a Record of 23-14-3?
| SELECT opponent FROM table_name_37 WHERE game < 43 AND record = "23-14-3" | sql_create_context |
CREATE TABLE table_44441 (
"Driver" text,
"Team" text,
"Laps" text,
"Time/Retired" text,
"Grid" text,
"Laps Led" text,
"Points" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the grid of team dreyer & reinbold racing, which has 26 po... | SELECT "Grid" FROM table_44441 WHERE "Team" = 'dreyer & reinbold racing' AND "Points" = '26' | wikisql |
CREATE TABLE table_7261 (
"Tournament" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2007 when the 2010 is 3r?
| SELECT "2007" FROM table_7261 WHERE "2010" = '3r' | 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 COUNT(*) FROM mzjzjlb WHERE mzjzjlb.YLJGDM = '8907786' AND mzjzjlb.JZKSRQ BETWEEN '2004-07-29' AND '2009-06-20' AND mzjzjlb.ZSEBZ > 0 | css |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
uniquepid text,
... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-37411... | eicu |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TA... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city... | atis |
CREATE TABLE table_80390 (
"Team" text,
"Manager" text,
"Captain" text,
"Kit manufacturer" text,
"Shirt sponsor" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which captain has howard wilkinson as the manager?
| SELECT "Captain" FROM table_80390 WHERE "Manager" = 'howard wilkinson' | wikisql |
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 intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-5052')) AND intakeoutput.cellpath LIKE '%intake%' AND ST... | eicu |
CREATE TABLE table_name_49 (
prince_devitt VARCHAR,
block_a VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Prince Devitt when Block A is Yamato?
| SELECT prince_devitt FROM table_name_49 WHERE block_a = "yamato" | sql_create_context |
CREATE TABLE table_58946 (
"Binary" real,
"Octal" real,
"Decimal" real,
"Hexadecimal" real,
"Glyph" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average hexadecimal with a decimal less than 53, an octal less than 61, and a glyph greate... | SELECT AVG("Hexadecimal") FROM table_58946 WHERE "Decimal" < '53' AND "Octal" < '61' AND "Glyph" > '0' | wikisql |
CREATE TABLE table_name_77 (
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which tournament had a 2009 result of 1R?
| SELECT tournament FROM table_name_77 WHERE 2009 = "1r" | sql_create_context |
CREATE TABLE table_name_98 (
rank VARCHAR,
nation VARCHAR,
places VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the total number of rank for places less than 94 and points less than 169.8 for japan
| SELECT COUNT(rank) FROM table_name_98 WHERE places < 94 AND points < 169.8 AND nation = "japan" | sql_create_context |
CREATE TABLE table_2562572_5 (
city___municipality VARCHAR,
cyrillic_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the city for
| SELECT city___municipality FROM table_2562572_5 WHERE cyrillic_name = "Ада" | sql_create_context |
CREATE TABLE table_70143 (
"Year" text,
"Starts" real,
"Cuts made" real,
"Wins" real,
"Top 10" real,
"Top 25" real,
"Earnings (\u20ac)" real,
"Money list rank" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which total number of starts h... | SELECT COUNT("Starts") FROM table_70143 WHERE "Wins" > '2' AND "Money list rank" > '1' | wikisql |
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 regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE employees (
EMPLOYEE_I... | SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID | nvbench |
CREATE TABLE table_76464 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Opponent has a Score of 92-111?
| SELECT "Opponent" FROM table_76464 WHERE "Score" = '92-111' | wikisql |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId num... | SELECT COUNT(a.Score) FROM Posts AS a, Posts AS q WHERE a.OwnerUserId = 31503 AND q.OwnerUserId = 28539 AND a.ParentId = q.Id AND a.Id = q.AcceptedAnswerId | sede |
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 d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE cost (
row_id... | SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.charttime) > 3 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id... | mimic_iii |
CREATE TABLE table_19744915_18 (
rank INTEGER,
couple VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When roxanne and daniel are the couple what is the highest rank?
| SELECT MAX(rank) FROM table_19744915_18 WHERE couple = "Roxanne and Daniel" | sql_create_context |
CREATE TABLE table_name_60 (
score VARCHAR,
visitor VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which score was for the Spurs as visitors with record of 35 16?
| SELECT score FROM table_name_60 WHERE visitor = "spurs" AND record = "35–16" | sql_create_context |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT All_Road, School_ID FROM basketball_match | nvbench |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE wdmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
K... | SELECT jybgb.KSBM, jybgb.KSMC FROM hz_info JOIN wdmzjzjlb JOIN jybgb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '16815496' AND jybgb.BGRQ BETWEEN '2006-09-29... | css |
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),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID | nvbench |
CREATE TABLE county_public_safety (
County_ID int,
Name text,
Population int,
Police_officers int,
Residents_per_officer int,
Case_burden int,
Crime_rate real,
Police_force text,
Location text
)
CREATE TABLE city (
City_ID int,
County_ID int,
Name text,
White real,
... | SELECT T2.Name, COUNT(T2.Name) FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID GROUP BY T2.Name | nvbench |
CREATE TABLE table_14563349_11 (
date VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many days were the Kansas City Chiefs the opposing team?
| SELECT COUNT(date) FROM table_14563349_11 WHERE opponent = "Kansas City Chiefs" | 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 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "89" AND diagnoses.long_title = "Benzodiazepine-based tranquilizers causing adverse effects in therapeutic use" | mimicsql_data |
CREATE TABLE Companies (
Industry VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the industry shared by the most companies.
| SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "4464" AND prescriptions.drug_type = "BASE" | mimicsql_data |
CREATE TABLE table_name_72 (
driver VARCHAR,
entrant VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the driver for Rovero Campello?
| SELECT driver FROM table_name_72 WHERE entrant = "rovero campello" | sql_create_context |
CREATE TABLE table_69832 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Chassis was featured in the year 1971?
| SELECT "Chassis" FROM table_69832 WHERE "Year" = '1971' | wikisql |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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... | SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '9150592' AND t_kc21.IN_HOSP_DATE BETWEEN '2000-06-12' AND '2018-01-22' | css |
CREATE TABLE table_76542 (
"Tournament" text,
"Surface" text,
"Week" text,
"Winner" text,
"Finalist" text,
"Semifinalists" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the winner in the Indian Wells?
| SELECT "Winner" FROM table_76542 WHERE "Tournament" = 'indian wells' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.