context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_1341690_20 (
party VARCHAR,
incumbent VARCHAR
) | What is the party of the election in which Robert Bauman is the incumbent? | SELECT party FROM table_1341690_20 WHERE incumbent = "Robert Bauman" | sql_create_context |
CREATE TABLE table_26443 (
"No. by series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production number" real,
"U.S. viewers (in millions)" text
) | When did the episode titled 'Hell hath no fury' air for the first time? | SELECT "Original air date" FROM table_26443 WHERE "Title" = 'Hell Hath No Fury' | wikisql |
CREATE TABLE table_6616 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"Nationality" text,
"School/Club Team" text
) | Name of the highest Pick is also a Round greater than 5 and Player as Tom Ivey? | SELECT MAX("Pick") FROM table_6616 WHERE "Round" > '5' AND "Player" = 'tom ivey' | wikisql |
CREATE TABLE table_27722408_2 (
high_rebounds VARCHAR,
date VARCHAR
) | Who had the most rebounds and how many did they have on October 16? | SELECT high_rebounds FROM table_27722408_2 WHERE date = "October 16" | sql_create_context |
CREATE TABLE table_204_64 (
id number,
"place" text,
"code" number,
"area (km2)" number,
"population" number,
"most spoken language" text
) | which place is the largest in area and where afrikaans is spoken ? | SELECT "place" FROM table_204_64 WHERE "most spoken language" = 'afrikaans' ORDER BY "area (km2)" DESC LIMIT 1 | squall |
CREATE TABLE table_11398 (
"State" text,
"Interview" real,
"Swimsuit" real,
"Evening Gown" real,
"Average" real
) | What is the sum number of evening gown stats for New Jersey when the interview was less than 9.344? | SELECT COUNT("Evening Gown") FROM table_11398 WHERE "State" = 'new jersey' AND "Interview" < '9.344' | wikisql |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE C... | qpd for different sites before and after. with credits to glorfindel for a decent chunk of the code https://data.stackexchange.com/stackoverflow/revision/520226/657753/#graph
an attempt to compare questions per day (and therefore general site activity) before and after the recent meta uproar | SELECT DATEADD(day, DATEDIFF(day, 0, creationdate), 0), COUNT(*) FROM Posts WHERE PostTypeId = 2 AND CreationDate BETWEEN @StartDate AND @EndDate GROUP BY DATEADD(day, DATEDIFF(day, 0, creationdate), 0) UNION SELECT DATEADD(day, DATEDIFF(day, 0, creationdate), 0), COUNT(*) FROM Posts WHERE PostTypeId = 2 AND CreationDa... | sede |
CREATE TABLE table_57173 (
"Player" text,
"Height" text,
"School" text,
"Hometown" text,
"College" text
) | Which college has a Player of shabazz muhammad? | SELECT "College" FROM table_57173 WHERE "Player" = 'shabazz muhammad' | wikisql |
CREATE TABLE table_name_9 (
finish VARCHAR,
start VARCHAR
) | What finish time started at 32? | SELECT finish FROM table_name_9 WHERE start = "32" | sql_create_context |
CREATE TABLE table_54006 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) | Where is the home on march 12? | SELECT "Home" FROM table_54006 WHERE "Date" = 'march 12' | wikisql |
CREATE TABLE table_name_73 (
goal_ratio INTEGER,
goals INTEGER
) | What is the largest goal ratio with Goals smaller than 0? | SELECT MAX(goal_ratio) FROM table_name_73 WHERE goals < 0 | sql_create_context |
CREATE TABLE gyb (
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... | 能知道患者07653980在2002.1.4到2003.6.25这段时间看的最主要的疾病吗 | SELECT qtb.IN_DIAG_DIS_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '07653980' AND qtb.IN_HOSP_DATE BETWEEN '2002-01-04' AND '2003-06-25' GROUP BY qtb.IN_DIAG_DIS_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_ID = '07653980' AND gyb.IN_HOSP_DATE... | css |
CREATE TABLE table_57464 (
"Election" text,
"1st Member" text,
"1st Party" text,
"2nd Member" text,
"2nd Party" text,
"3rd Member" text,
"3rd Party" text
) | What is the name of the 1st Party that has a 3rd Party of Unionist, and 2nd Member of Sir John Boyd-Orr? | SELECT "1st Party" FROM table_57464 WHERE "3rd Party" = 'unionist' AND "2nd Member" = 'sir john boyd-orr' | wikisql |
CREATE TABLE table_72243 (
"#" real,
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" text,
"Record" text,
"Streak" text
) | what is the total number of dates where the scorer is gordon : 32 | SELECT COUNT("Date") FROM table_72243 WHERE "Leading scorer" = 'Gordon : 32' | wikisql |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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,
C... | 号码11410667433的患者在治病过程中有哪些药品是姓王的医师开具? | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM 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 = '11410667433' AND t_kc22.HOSP_DOC_NM LIKE '王%' | css |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | give me the number of patients whose discharge location is snf and days of hospital stay is greater than 23? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SNF" AND demographic.days_stay > "23" | mimicsql_data |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE p... | BIOMATLS 990 is what ? | SELECT DISTINCT description, name FROM course WHERE department = 'BIOMATLS' AND number = 990 | advising |
CREATE TABLE table_name_71 (
bronze INTEGER,
total VARCHAR,
gold VARCHAR,
rank VARCHAR
) | What's the number of bronze when they are ranked 29, had a total more than 3 and less than 2 golds? | SELECT MIN(bronze) FROM table_name_71 WHERE gold < 2 AND rank = "29" AND total > 3 | sql_create_context |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
... | what are the one year survival rates for idiopath pulmon fibrosis patients? | SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.charttime) > 1 * 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_39971 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real
) | On 1 september 2007, at the Venue A, what was the average attendance? | SELECT AVG("Attendance") FROM table_39971 WHERE "Venue" = 'a' AND "Date" = '1 september 2007' | wikisql |
CREATE TABLE table_name_82 (
home_team VARCHAR,
venue VARCHAR
) | Who was the home team when the venue was Junction Oval? | SELECT home_team FROM table_name_82 WHERE venue = "junction oval" | sql_create_context |
CREATE TABLE table_48469 (
"Name" text,
"Team" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What is the lowest Laps, when Grid is greater than 7, and when Name is 'Fabian Coulthard'? | SELECT MIN("Laps") FROM table_48469 WHERE "Grid" > '7' AND "Name" = 'fabian coulthard' | wikisql |
CREATE TABLE table_42250 (
"Event" text,
"Record" text,
"Nation" text,
"Date" text,
"Venue" text
) | Which Nation has a Record of 15.16 m? | SELECT "Nation" FROM table_42250 WHERE "Record" = '15.16 m' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
a... | what time did patient 013-17922 get into the hospital until 2104? | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '013-17922' AND STRFTIME('%y', patient.hospitaladmittime) <= '2104' | eicu |
CREATE TABLE table_42738 (
"Season" text,
"Ep #" real,
"Season Premiere" text,
"Season Finale" text,
"Ranking" text,
"Viewers (Households in millions)" text,
"Rating" text
) | What was the ranking for the episode number before 24 that had a rating of 25.7? | SELECT "Ranking" FROM table_42738 WHERE "Ep #" < '24' AND "Rating" = '25.7' | wikisql |
CREATE TABLE table_5898 (
"Game" real,
"February" real,
"Opponent" text,
"Score" text,
"Record" text
) | Which Opponent has a Game larger than 56 and February of 24? | SELECT "Opponent" FROM table_5898 WHERE "Game" > '56' AND "February" = '24' | wikisql |
CREATE TABLE table_name_54 (
date VARCHAR,
race_name VARCHAR
) | What is the date of the gp citt di camaiore race? | SELECT date FROM table_name_54 WHERE race_name = "gp città di camaiore" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate n... | retrieve the patient ids of the people who were diagnosed with ards - pulmonary etiology until 2102. | SELECT patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'ards - pulmonary etiology' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2102') | eicu |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE ... | i need to fly from DALLAS to SAN FRANCISCO and be in SAN FRANCISCO by 1600 | 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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.arrival_time <= 1600 AND flight.to_airport = AIRPORT_SERVICE_1.... | atis |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)... | DALLAS to OAKLAND saturday | 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 = 'OAKLAND' AND date_day.day_number = 26 AND date_day.month_number = 7 AND d... | atis |
CREATE TABLE table_name_85 (
grid INTEGER,
driver VARCHAR,
fin_pos VARCHAR
) | What is the average grid for Marco Andretti with a finishing position higher than 19? | SELECT AVG(grid) FROM table_name_85 WHERE driver = "marco andretti" AND fin_pos > 19 | sql_create_context |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar... | i would like to fly to DENVER for under 500 dollars please show me the airfares between PITTSBURGH and DENVER | 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 = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.c... | atis |
CREATE TABLE table_name_19 (
nation VARCHAR,
third VARCHAR
) | In what nation did Darko Sovran place third? | SELECT nation FROM table_name_19 WHERE third = "darko sovran" | sql_create_context |
CREATE TABLE table_206361_2 (
kilometer INTEGER
) | What is the maximum number of km listed? | SELECT MAX(kilometer) FROM table_206361_2 | sql_create_context |
CREATE TABLE table_name_26 (
location VARCHAR,
county VARCHAR,
school VARCHAR
) | Where is Lafayette T. Jefferson School in 79 Tippecanoe county? | SELECT location FROM table_name_26 WHERE county = "79 tippecanoe" AND school = "lafayette t. jefferson" | sql_create_context |
CREATE TABLE table_21609 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Name the record for new orleans | SELECT "Record" FROM table_21609 WHERE "Team" = 'New Orleans' | wikisql |
CREATE TABLE table_58664 (
"Position" real,
"Team" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Difference" text,
"Points 1" real
) | What is the sum of Position, when Points 1 is greater than 23, and when Goals For is '77'? | SELECT SUM("Position") FROM table_58664 WHERE "Points 1" > '23' AND "Goals For" = '77' | wikisql |
CREATE TABLE table_name_6 (
oklahoma VARCHAR,
texas VARCHAR
) | What's the value for oklahoma when texas is kennedy? | SELECT oklahoma FROM table_name_6 WHERE texas = "kennedy" | sql_create_context |
CREATE TABLE table_203_81 (
id number,
"date" text,
"constituency" text,
"gain" text,
"loss" text,
"note" text
) | what are the number of times national progressive democrats lost ? | SELECT COUNT(*) FROM table_203_81 WHERE "loss" = 'national progressive democrats' | squall |
CREATE TABLE table_name_85 (
driver VARCHAR,
time VARCHAR
) | What is name of the drive with a Time of +13.315? | SELECT driver FROM table_name_85 WHERE time = "+13.315" | sql_create_context |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id... | Tag badges you were first to earn. | WITH badges_first AS (SELECT Class, Name, UserId, ROW_NUMBER() OVER (PARTITION BY Class, Name ORDER BY Date) AS rk FROM Badges WHERE TagBased = 1) SELECT CASE WHEN (GROUPING(Name) = 1) THEN 'TOTAL' ELSE Name END AS TagName, COUNT(CASE WHEN Class = 1 THEN 1 ELSE NULL END) AS Gold, COUNT(CASE WHEN Class = 2 THEN 1 ELSE N... | sede |
CREATE TABLE table_204_152 (
id number,
"device" text,
"type" text,
"iops" text,
"interface" text,
"notes" text
) | which interface appears first , sata 6 gbit/s or pcie ? | SELECT "interface" FROM table_204_152 WHERE "interface" IN ('sata 6 gbit/s', 'pcie') ORDER BY id LIMIT 1 | squall |
CREATE TABLE train (
Train_ID int,
Name text,
Time text,
Service text
)
CREATE TABLE train_station (
Train_ID int,
Station_ID int
)
CREATE TABLE station (
Station_ID int,
Name text,
Annual_entry_exit real,
Annual_interchanges real,
Total_Passengers real,
Location text,
... | What is the average of number_of_platforms for each location? Show the comparison with a bar chart, and sort Y-axis in ascending order please. | SELECT Location, AVG(Number_of_Platforms) FROM station GROUP BY Location ORDER BY AVG(Number_of_Platforms) | nvbench |
CREATE TABLE Financial_Transactions (
transaction_id INTEGER,
account_id INTEGER,
invoice_number INTEGER,
transaction_type VARCHAR(15),
transaction_date DATETIME,
transaction_amount DECIMAL(19,4),
transaction_comment VARCHAR(255),
other_transaction_details VARCHAR(255)
)
CREATE TABLE In... | Bar chart x axis other account details y axis how many other account details, and list by the Y-axis in desc. | SELECT other_account_details, COUNT(other_account_details) FROM Accounts GROUP BY other_account_details ORDER BY COUNT(other_account_details) DESC | nvbench |
CREATE TABLE domain_keyword (
did int,
kid int
)
CREATE TABLE cite (
cited int,
citing int
)
CREATE TABLE publication (
abstract varchar,
cid int,
citation_num int,
jid int,
pid int,
reference_num int,
title varchar,
year int
)
CREATE TABLE domain (
did int,
na... | return me the number of papers after 2000 . | SELECT COUNT(DISTINCT (title)) FROM publication WHERE year > 2000 | academic |
CREATE TABLE table_train_78 (
"id" int,
"mini_mental_state_examination_mmse" int,
"consent" bool,
"swallow_oral_medication" bool,
"rosen_modified_hachinski_ischemic_score" int,
"NOUSE" float
) | informed consent signed and dated by subject ( or legally authorized representative ) . | SELECT * FROM table_train_78 WHERE consent = 1 | criteria2sql |
CREATE TABLE table_name_33 (
main_contestant VARCHAR,
co_contestant__yaar_vs_pyaar_ VARCHAR
) | Who is the main contestant when the co-contestant (yaar vs. pyaar) is Shalini Chandran? | SELECT main_contestant FROM table_name_33 WHERE co_contestant__yaar_vs_pyaar_ = "shalini chandran" | sql_create_context |
CREATE TABLE table_203_89 (
id number,
"#" number,
"name\n(birth-death)" text,
"took office" text,
"left office" text,
"monarch" text,
"prime minister" text
) | what was the total number of monarchs ? | SELECT COUNT(DISTINCT "monarch") FROM table_203_89 | squall |
CREATE TABLE accounts (
account_id number,
customer_id number,
date_account_opened time,
account_name text,
other_account_details text
)
CREATE TABLE product_categories (
production_type_code text,
product_type_description text,
vat_rating number
)
CREATE TABLE products (
product_i... | Count the number of financial transactions that correspond to each account id. | SELECT COUNT(*), account_id FROM financial_transactions | spider |
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,
... | i want to fly DENVER to PITTSBURGH | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBU... | atis |
CREATE TABLE table_36785 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | Which Outcome has an Opponent of wendy turnbull, and a Surface of grass? | SELECT "Outcome" FROM table_36785 WHERE "Opponent" = 'wendy turnbull' AND "Surface" = 'grass' | wikisql |
CREATE TABLE table_203_366 (
id number,
"pos" number,
"class" text,
"no" number,
"team" text,
"drivers" text,
"chassis" text,
"engine" text,
"laps" number
) | which team completed only two laps ? | SELECT "team" FROM table_203_366 WHERE "laps" = 2 | squall |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number... | Comments on answers in a given tag. | SELECT c.Id AS "comment_link", c.UserId AS "user_link", c.CreationDate, c.Text, a.Id AS "post_link" FROM Comments AS c JOIN Posts AS a ON c.PostId = a.Id JOIN Posts AS q ON a.ParentId = q.Id WHERE q.Tags LIKE '%<##tagName##>%' ORDER BY c.Id DESC LIMIT 500 | sede |
CREATE TABLE table_12897 (
"Outcome" text,
"Date" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score in the final" text
) | On what surface did he play with Stephen Huss on 31 October 2010? | SELECT "Surface" FROM table_12897 WHERE "Partner" = 'stephen huss' AND "Date" = '31 october 2010' | wikisql |
CREATE TABLE table_204_717 (
id number,
"season" text,
"level" number,
"division" text,
"place" text
) | which was a better season , 2006/07 or 2007/08 ? | SELECT "season" FROM table_204_717 WHERE "season" IN ('2006/07', '2007/08') ORDER BY "place" LIMIT 1 | squall |
CREATE TABLE table_16265 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
) | What is the title of the episode directed by Peter Markle and written by Jerry Stahl? | SELECT "Title" FROM table_16265 WHERE "Directed by" = 'Peter Markle' AND "Written by" = 'Jerry Stahl' | wikisql |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number... | A user's posts, non-paged (non-Community Wiki). A way around paging for a user's posts, questions and answers. A view count of zero means it is an answer. | SELECT p.Id AS "post_link", Score AS "votes", ViewCount AS "views", p.CommunityOwnedDate AS "cw" FROM Posts AS p WHERE p.OwnerUserId = '##UserId##' AND p.CommunityOwnedDate IS NULL ORDER BY ViewCount DESC | sede |
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... | Visualize a scatter chart about the correlation between Team_ID and ACC_Percent , and group by attribute All_Neutral. | SELECT Team_ID, ACC_Percent FROM basketball_match GROUP BY All_Neutral | nvbench |
CREATE TABLE table_name_54 (
born_died VARCHAR,
active_service VARCHAR
) | What were the birth and death years when active service was 1972 1995? | SELECT born_died FROM table_name_54 WHERE active_service = "1972–1995" | sql_create_context |
CREATE TABLE table_22903426_1 (
windows_builders VARCHAR,
name VARCHAR
) | Name the windows builders for apache gump | SELECT windows_builders FROM table_22903426_1 WHERE name = "Apache Gump" | sql_create_context |
CREATE TABLE table_6012 (
"Type" text,
"wheelbase" text,
"M39 series" text,
"M809 series" text,
"M939 series" text
) | Name the M809 seris with M939 series of M931/932 | SELECT "M809 series" FROM table_6012 WHERE "M939 series" = 'm931/932' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | how many patients younger than 41 years have home health care discharge location? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "HOME HEALTH CARE" AND demographic.age < "41" | mimicsql_data |
CREATE TABLE table_name_64 (
opponent VARCHAR,
attendance VARCHAR
) | Who is the opponent for the game with 37,845 people in attendance? | SELECT opponent FROM table_name_64 WHERE attendance = "37,845" | sql_create_context |
CREATE TABLE store (
Store_ID int,
Store_Name text,
Type text,
Area_size real,
Number_of_product_category real,
Ranking int
)
CREATE TABLE district (
District_ID int,
District_name text,
Headquartered_City text,
City_Population real,
City_Area real
)
CREATE TABLE store_dist... | Find all types of store and number of them Visualize by bar chart, order by the y axis in asc please. | SELECT Type, COUNT(*) FROM store GROUP BY Type ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_name_90 (
gold INTEGER,
silver VARCHAR,
nation VARCHAR,
total VARCHAR,
bronze VARCHAR
) | What is the average number of gold medals Switzerland received when they ranked larger than 1st and received fewer than 10 bronze medals and more than 1 silver medal? | SELECT AVG(gold) FROM table_name_90 WHERE total > 1 AND bronze < 10 AND nation = "switzerland" AND silver > 1 | sql_create_context |
CREATE TABLE table_12073 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | What is the number of Tournament of U.S. Open wins with a Top-25 smaller than 4? | SELECT COUNT("Wins") FROM table_12073 WHERE "Tournament" = 'u.s. open' AND "Top-25" < '4' | wikisql |
CREATE TABLE table_name_49 (
period VARCHAR,
player VARCHAR
) | What is the period for Ben Eager? | SELECT period FROM table_name_49 WHERE player = "ben eager" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | What is the total number of patients admitted before the year 2137 due to syncope/telemetry as their primary disease? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "SYNCOPE;TELEMETRY" AND demographic.admityear < "2137" | mimicsql_data |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | 12592992患者在11年9月27日至17年3月31日之内检测甲状腺摄取实验的医务人员工号及姓名各是什么? | (SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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.BGDH = jyjgzbb... | css |
CREATE TABLE table_203_396 (
id number,
"year" number,
"domestic passengers" number,
"international passengers" number,
"total passengers" number,
"change" text
) | what is listed as the passenger percentage difference for the year 2011 ? | SELECT "change" FROM table_203_396 WHERE "year" = 2011 | squall |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Questions that could have a chance of It's A Me hat. | SELECT p.Id AS "post_link" FROM Posts AS p WHERE p.PostTypeId = 1 AND p.Score >= 0 AND p.ClosedDate IS NULL AND COALESCE(p.AnswerCount, 0) = 0 AND COALESCE(p.CommentCount, 0) = 6 ORDER BY p.Score DESC LIMIT 50 | sede |
CREATE TABLE table_40403 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score" text
) | When playing against Yi Jingqian in the final on a hard surface what was the score? | SELECT "Score" FROM table_40403 WHERE "Surface" = 'hard' AND "Opponent in the final" = 'yi jingqian' | wikisql |
CREATE TABLE table_name_74 (
equatorial_bulge VARCHAR,
body VARCHAR
) | What is the Equatorial bulge of the Body: Earth? | SELECT equatorial_bulge FROM table_name_74 WHERE body = "earth" | sql_create_context |
CREATE TABLE table_35505 (
"County" text,
"Population" real,
"Per capita income" text,
"Median household income" text,
"Median family income" text
) | What is the median household income where the per capita is $28,789? | SELECT "Median household income" FROM table_35505 WHERE "Per capita income" = '$28,789' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
h... | how many times patient 006-76924's urinary catheter output: indwelling/continuous ure output has been produced since 12/02/2100? | SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-76924')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.ce... | eicu |
CREATE TABLE table_1566848_7 (
interview_subject VARCHAR,
centerfold_model VARCHAR
) | Who was the interview subject when the centerfold model was Sherry Arnett? | SELECT COUNT(interview_subject) FROM table_1566848_7 WHERE centerfold_model = "Sherry Arnett" | sql_create_context |
CREATE TABLE table_name_6 (
played INTEGER,
goals_against VARCHAR,
losses VARCHAR
) | When goals against is greater than 60 and losses less than 29, what is the highest played? | SELECT MAX(played) FROM table_name_6 WHERE goals_against > 60 AND losses < 29 | sql_create_context |
CREATE TABLE table_name_48 (
casualties VARCHAR,
circumstances VARCHAR
) | How many casualties were from the IED circumstance? | SELECT casualties FROM table_name_48 WHERE circumstances = "ied" | sql_create_context |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as ... | Is an Philosophy of Language seminar occurring this year ? | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE (course.description LIKE '%seminar%' OR course.name LIKE '%seminar%') AND (course.description LIKE '%Philosophy of Language%' OR course.name LIKE '%Philosophy of Language%') AND course.course_id = course_offering.course_id AND semester.semester_id = cours... | advising |
CREATE TABLE table_name_81 (
main_date VARCHAR,
number_of_fixtures VARCHAR
) | What was the main date of the round with 20 fixtures? | SELECT main_date FROM table_name_81 WHERE number_of_fixtures = 20 | sql_create_context |
CREATE TABLE table_203_189 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
) | what was the longest distance traveled in the competitions ? | SELECT "notes" FROM table_203_189 ORDER BY "notes" DESC LIMIT 1 | squall |
CREATE TABLE txmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | 患者被门诊诊断为过敏性皮炎,患者的检测指标675208的参考值范围下限和上限都是啥呀? | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM txmzjzjlb JOIN jybgb JOIN jyjgzbb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE txmzjzjlb.JZZDSM = '过敏性皮炎' AND jyjgzbb.JCZBDM = '675208' UNION SELECT jyjgzbb.CKZFWXX,... | css |
CREATE TABLE table_name_11 (
away_team VARCHAR,
venue VARCHAR
) | Who was the away team at Windy Hill? | SELECT away_team FROM table_name_11 WHERE venue = "windy hill" | sql_create_context |
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,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments ... | For minoring students in ACABS , which professor taught a course where students received a B- ? | SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN student_record ON student_record.offering_id = offering_instructor.offering_id INNER JOIN student ON student.student_id = student_record.student_id WHERE (student_rec... | advising |
CREATE TABLE table_72348 (
"Institution" text,
"Team" text,
"City" text,
"Province" text,
"First season" real,
"Head coach" text,
"Enrollment" real,
"Endowment" text,
"Football stadium" text,
"Capacity" real
) | How many endowments does Mosaic Stadium have? | SELECT COUNT("Endowment") FROM table_72348 WHERE "Football stadium" = 'Mosaic Stadium' | wikisql |
CREATE TABLE table_50847 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | WHAT IS THE TO PAR FOR GEOFF OGILVY WITH A PLACE OF T3? | SELECT "To par" FROM table_50847 WHERE "Place" = 't3' AND "Player" = 'geoff ogilvy' | 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
) | Select the name of each manufacturer along with the price of its most expensive product using a bar chart, could you list y-axis in descending order please? | SELECT T2.Name, MAX(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY MAX(T1.Price) DESC | nvbench |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
... | what is the daily minimum of the weight of patient 028-55503 since 01/2104? | SELECT MIN(patient.admissionweight) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-55503') AND NOT patient.admissionweight IS NULL AND STRFTIME('%y-%m', patient.unitadmittime) >= '2104-01' GROUP BY STRFTIME('%y-%m-%d', patien... | eicu |
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... | 被门诊诊断为R76.930这个病的蒋宏深,看看他的检测指标089733的结果定量及其单位 | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND 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.JZ... | css |
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE cite (
citingpaperid int,
citedpape... | How many citations does fahad pervaiz have ? | SELECT DISTINCT COUNT(cite.citedpaperid) FROM author, cite, paper, writes WHERE author.authorname = 'fahad pervaiz' AND paper.paperid = cite.citedpaperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid | scholar |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | provide the number of patients whose lab test abnormal status is delta and lab test name is folate? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.flag = "delta" AND lab.label = "Folate" | mimicsql_data |
CREATE TABLE table_23214833_1 (
capacity VARCHAR,
team_captain VARCHAR
) | How many people can attend games in the stadium of the team whose captain is Vasil Vasilev? | SELECT capacity FROM table_23214833_1 WHERE team_captain = "Vasil Vasilev" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | Look for the number of patients with the primary disease syncope telemetry who died in or before 2158. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "SYNCOPE;TELEMETRY" AND demographic.dod_year <= "2158.0" | mimicsql_data |
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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,... | For those employees who did not have any job in the past, return a bar chart about the distribution of job_id and the sum of department_id , and group by attribute job_id. | SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID | nvbench |
CREATE TABLE employees (
employee_id number,
first_name text,
last_name text,
email text,
phone_number text,
hire_date time,
job_id text,
salary number,
commission_pct number,
manager_id number,
department_id number
)
CREATE TABLE countries (
country_id text,
country... | Return all information about employees with salaries between 8000 and 12000 for which commission is not null or where their department id is not 40. | SELECT * FROM employees WHERE salary BETWEEN 8000 AND 12000 AND commission_pct <> "null" OR department_id <> 40 | spider |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE labevents (
row... | what was the maximum arterial bp mean for patient 29635. | SELECT MAX(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29635)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arte... | mimic_iii |
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
)
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
) | Compute the total how many class across class as a pie chart. | SELECT Class, COUNT(Class) FROM captain GROUP BY Class | nvbench |
CREATE TABLE table_28906 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | Name the incumbent for jacob spangler (dr) 67.1% jacob hay (f) 32.9% | SELECT "Incumbent" FROM table_28906 WHERE "Candidates" = 'Jacob Spangler (DR) 67.1% Jacob Hay (F) 32.9%' | wikisql |
CREATE TABLE Faculty (
fname VARCHAR,
lname VARCHAR,
FacID VARCHAR,
facID VARCHAR
)
CREATE TABLE Faculty_participates_in (
facID VARCHAR
) | What is the first and last name of the faculty participating in the most activities? | SELECT T1.fname, T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID GROUP BY T1.facID ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_54851 (
"Track" real,
"Recorded" text,
"Catalogue" text,
"Release Date" text,
"Song Title" text,
"Time" text
) | What is the sum of every track with a catalogue of EPA 4054 with a 2:05 length? | SELECT SUM("Track") FROM table_54851 WHERE "Catalogue" = 'epa 4054' AND "Time" = '2:05' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.