context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_36491 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
) | What is the 2nd leg where Team 2 is fc 105 libreville? | SELECT "2nd leg" FROM table_36491 WHERE "Team 2" = 'fc 105 libreville' | wikisql |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Search for edit summaries containing a string. | SELECT a.Comment AS "ridiculous_comment", a.PostId AS "id" FROM PostHistory AS a WHERE a.PostHistoryTypeId IN (4, 5, 6) AND a.UserId = 85695 AND a.Comment LIKE '%tag%' GROUP BY a.Comment, a.PostId LIMIT 50 | sede |
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... | among patients who had left femur fracture as primary disease, calculate the maximum age of those who were married | SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.diagnosis = "LEFT FEMUR FRACTURE" | mimicsql_data |
CREATE TABLE table_17355408_4 (
record VARCHAR,
team VARCHAR
) | Name the record for new orleans | SELECT record FROM table_17355408_4 WHERE team = "New Orleans" | sql_create_context |
CREATE TABLE table_name_97 (
video VARCHAR,
aspect VARCHAR,
channel VARCHAR
) | Which video is on channel 31.2 with a 4:3 aspect? | SELECT video FROM table_name_97 WHERE aspect = "4:3" AND channel = 31.2 | sql_create_context |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name v... | i want to go from DENVER to ATLANTA round trip and make a stop at PITTSBURGH may i have the cheapest fare | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, fare, flight, flight_fare, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA... | atis |
CREATE TABLE table_name_44 (
rank INTEGER,
games VARCHAR,
points VARCHAR
) | Which rank is the lowest with 37 games and more than 613 points? | SELECT MIN(rank) FROM table_name_44 WHERE games = 37 AND points > 613 | sql_create_context |
CREATE TABLE table_24018112_1 (
max_memory_speed VARCHAR,
frequency VARCHAR
) | What is the maximum memory speed for frequencies between 2.93-3.2ghz? | SELECT max_memory_speed FROM table_24018112_1 WHERE frequency = "2.93-3.2GHz" | sql_create_context |
CREATE TABLE table_204_735 (
id number,
"rank" number,
"team" text,
"names" text,
"time" text,
"qualification" text
) | which country 's team ranked last ? | SELECT "team" FROM table_204_735 ORDER BY "rank" DESC LIMIT 1 | squall |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, a line chart shows the trend of employee_id over hire_date . | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
CREATE TABLE table_76603 (
"Tournament" text,
"1983" text,
"1984" text,
"1985" text,
"1986" text,
"1987" text,
"1988" text,
"1989" text,
"1990" text,
"Career SR" text,
"Career Win-Loss" text
) | What tournament has 0 / 5 as career SR and A as 1983? | SELECT "Tournament" FROM table_76603 WHERE "Career SR" = '0 / 5' AND "1983" = 'a' | wikisql |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | 药品687379在医疗就诊39706468602中的剂型是什么?规格是什么? | SELECT DOSE_FORM, SPEC FROM t_kc22 WHERE MED_CLINIC_ID = '39706468602' AND SOC_SRT_DIRE_CD = '687379' | css |
CREATE TABLE table_name_61 (
high_assists VARCHAR,
date VARCHAR
) | What were the high assist on january 2? | SELECT high_assists FROM table_name_61 WHERE date = "january 2" | sql_create_context |
CREATE TABLE table_name_72 (
points INTEGER,
played INTEGER
) | What is the average number of points of the team with more than 18 played? | SELECT AVG(points) FROM table_name_72 WHERE played > 18 | sql_create_context |
CREATE TABLE table_35264 (
"Position" real,
"Club (City/Town)" text,
"Games Played" real,
"W-L-D" text,
"Goals For/Against" text,
"Points" real
) | Which position had 5 games played and a record of 1-2-2? | SELECT "Position" FROM table_35264 WHERE "Games Played" = '5' AND "W-L-D" = '1-2-2' | wikisql |
CREATE TABLE table_78610 (
"Pos." real,
"Team" text,
"G.P." real,
"Wins" real,
"Ties" real,
"Losses" real,
"Goals" text,
"Goal diff" text,
"Pts.." text
) | What was the largest tie when the G.P was more than 5? | SELECT MAX("Ties") FROM table_78610 WHERE "G.P." > '5' | wikisql |
CREATE TABLE table_9380 (
"Date" text,
"Opponent" text,
"Site" text,
"Result" text,
"Attendance" text
) | What is Site, when Date is 'November 13'? | SELECT "Site" FROM table_9380 WHERE "Date" = 'november 13' | wikisql |
CREATE TABLE table_21091162_1 (
record VARCHAR,
black_knights_points VARCHAR
) | How many records have black knights points as 17? | SELECT COUNT(record) FROM table_21091162_1 WHERE black_knights_points = 17 | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
ic... | what were the top five most frequent inputs event? | SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%intake%' GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 5 | eicu |
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,... | what number of patients with squamous cell carcinoma oral tongue/sda had the procedure titled opn mitral valvuloplasty? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "SQUAMOUS CELL CARCINOMA ORAL TONGUE/SDA" AND procedures.short_title = "Opn mitral valvuloplasty" | mimicsql_data |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
Owner... | Reputation per post of user. | SELECT p.Id AS "Post id", pt.Name AS "Post type", p.Score AS "Total score", (CASE vt.Id WHEN 1 THEN 'Accept' WHEN 2 THEN 'Upvote' ELSE 'Downvote' END) AS "Reputation type" FROM Posts AS p JOIN Votes AS v ON v.PostId = p.Id JOIN VoteTypes AS vt ON vt.Id = v.VoteTypeId JOIN PostTypes AS pt ON pt.Id = p.PostTypeId WHERE p... | sede |
CREATE TABLE table_name_6 (
velodrome VARCHAR,
distance VARCHAR,
pacing VARCHAR,
year VARCHAR,
country VARCHAR
) | What velodrome took place earlier than 1950 with a winner from France in tandem paced over a distance of 951.750 km? | SELECT velodrome FROM table_name_6 WHERE year < 1950 AND country = "france" AND pacing = "tandem paced" AND distance = "951.750 km" | sql_create_context |
CREATE TABLE table_67618 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | Name the total number of years for brm straight-4 | SELECT COUNT("Year") FROM table_67618 WHERE "Engine" = 'brm straight-4' | wikisql |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Plot all_games_percent by grouped by all games as a bar graph, order y axis in desc order. | SELECT All_Games, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent DESC | nvbench |
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,
... | 5091059这家医院的所有就诊的记录里,按照出院诊断疾病编码与科室的名字差异计算一下医院患者就诊的平均岁数是多少 | SELECT t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '5091059' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_CD | css |
CREATE TABLE table_name_97 (
score VARCHAR,
set_1 VARCHAR
) | Which Score has a Set 1 of 25 16? | SELECT score FROM table_name_97 WHERE set_1 = "25–16" | sql_create_context |
CREATE TABLE table_55578 (
"Party" text,
"Results 2004" text,
"CSA 5/28/09" text,
"Ifop 5/30/09" text,
"Ipsos 5/30/09" text,
"BVA 6/1/09" text,
"TNS-Sofres 6/2/09" text,
"OpinionWay 6/3/09" text,
"Ipsos 6/3/09" text,
"TNS-Sofres 6/4/09" text,
"CSA 6/4/09" text,
"Ifop 6/4/... | When BVA was 3%, what was the Ipsos? | SELECT "Ipsos 5/30/09" FROM table_55578 WHERE "BVA 6/1/09" = '3%' | wikisql |
CREATE TABLE table_52289 (
"NGC number" real,
"Object type" text,
"Constellation" text,
"Right ascension ( J2000 )" text,
"Declination ( J2000 )" text
) | Which Constellation has a NGC number smaller than 2775, and a Declination (J2000) of 05 07 ? | SELECT "Constellation" FROM table_52289 WHERE "NGC number" < '2775' AND "Declination ( J2000 )" = '°05′07″' | wikisql |
CREATE TABLE tags (
index number,
id number,
tag text
)
CREATE TABLE torrents (
groupname text,
totalsnatched number,
artist text,
groupyear number,
releasetype text,
groupid number,
id number
) | Which kind of release type is the most popular? | SELECT releasetype FROM torrents GROUP BY releasetype ORDER BY SUM(totalsnatched) DESC LIMIT 1 | whatcdhiphop |
CREATE TABLE table_10026 (
"Date" text,
"H/A/N" text,
"Opponent" text,
"Score" text,
"Record" text
) | What is Record, when H/A/N is 'A', and when Date is 'February 1'? | SELECT "Record" FROM table_10026 WHERE "H/A/N" = 'a' AND "Date" = 'february 1' | wikisql |
CREATE TABLE table_6795 (
"Episode" text,
"VII Season" text,
"VIII Season" text,
"XII Season" text,
"XIII Season" text
) | What is VII Season, when Episode is 11? | SELECT "VII Season" FROM table_6795 WHERE "Episode" = '11' | wikisql |
CREATE TABLE table_33942 (
"Latitude" text,
"Longitude" text,
"City" text,
"State" text,
"Country" text
) | What city in Svalbard has a longitude of 15 39 e? | SELECT "City" FROM table_33942 WHERE "State" = 'svalbard' AND "Longitude" = '15°39′e' | wikisql |
CREATE TABLE table_name_16 (
crowd INTEGER,
venue VARCHAR
) | What is the average crowd size at glenferrie oval? | SELECT AVG(crowd) FROM table_name_16 WHERE venue = "glenferrie oval" | sql_create_context |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
C... | people with top number of answers. | SELECT OwnerUserId, COUNT(Id) FROM Posts GROUP BY OwnerUserId ORDER BY COUNT(Id) DESC | sede |
CREATE TABLE table_73014 (
"Year" real,
"Illinois" text,
"Indiana" text,
"Kentucky" text,
"Michigan" text,
"Ohio" text,
"Wisconsin" text
) | What was the little league team from Ohio when the little league team from Kentucky was Warren County South LL Bowling Green? | SELECT "Ohio" FROM table_73014 WHERE "Kentucky" = 'Warren County South LL Bowling Green' | wikisql |
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 transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype tex... | what were the three specimen tests that were most frequently given to patients that were previously diagnosed with constrictiv pericarditis within the same hospital visit the last year? | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnos... | mimic_iii |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | Who from your location are you better than?. | SELECT U2.* FROM Users AS U1 JOIN Users AS U2 ON U1.Location = U2.Location WHERE 1 = 1 AND U1.DisplayName = 'jyparask' AND U1.Reputation <= U2.Reputation ORDER BY U2.Reputation DESC, U2.DisplayName | sede |
CREATE TABLE table_37785 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | What attendance has astros as the opponent, and april 29 as the date? | SELECT SUM("Attendance") FROM table_37785 WHERE "Opponent" = 'astros' AND "Date" = 'april 29' | wikisql |
CREATE TABLE table_75629 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | What was the result of the game where 63,243 people attended after week 9? | SELECT "Result" FROM table_75629 WHERE "Attendance" > '63,243' AND "Week" > '9' | wikisql |
CREATE TABLE table_20967430_4 (
ep VARCHAR,
prod_code VARCHAR
) | How many episodes had a production code of 5m13? | SELECT COUNT(ep) FROM table_20967430_4 WHERE prod_code = "5M13" | sql_create_context |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
C... | A user comments on a specific tag. | SELECT Comments.Id AS "comment_link" FROM Comments INNER JOIN Posts ON Comments.PostId = Posts.Id WHERE Tags LIKE '%##Tag##%' AND UserId = '##UesrId##' | sede |
CREATE TABLE table_65456 (
"Athlete" text,
"Shooting Score (pts)" text,
"Fencing Victories (pts)" text,
"Swimming Time (pts)" text,
"Equestrian Time (pts)" text,
"Running Time (pts)" text,
"Total" real
) | Which Shooting Score (pts) has a Total larger than 5464 and a Athlete of heather fell ( gbr )? | SELECT "Shooting Score (pts)" FROM table_65456 WHERE "Total" > '5464' AND "Athlete" = 'heather fell ( gbr )' | 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 cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE schedule... | Show the average price of each film in a bar chart, sort in desc by the total number. | SELECT Title, AVG(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 ORDER BY AVG(Price) DESC | nvbench |
CREATE TABLE table_name_63 (
opponent VARCHAR,
score VARCHAR
) | Who did they play when the score was 95-118? | SELECT opponent FROM table_name_63 WHERE score = "95-118" | sql_create_context |
CREATE TABLE table_34874 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Record" text
) | What was the score for game number 30? | SELECT "Score" FROM table_34874 WHERE "Game" = '30' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | how many patients are discharged to home health care? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "HOME HEALTH CARE" | mimicsql_data |
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... | 在医疗就诊03902994477期间民政补助了多少钱? | SELECT t_kc24.CIVIL_SUBSIDY FROM t_kc24 JOIN t_kc21_t_kc24 JOIN t_kc21 ON t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID AND t_kc21_t_kc24.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '03902994477' | css |
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... | 在17年3月21日到18年10月30日期间,患者12922014曾到医院看过几次病 | SELECT (SELECT COUNT(*) FROM hz_info JOIN mzjzjlb 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 person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND p... | css |
CREATE TABLE route (
train_id int,
station_id int
)
CREATE TABLE station (
id int,
network_name text,
services text,
local_authority text
)
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
win... | Show a bar graph, the data is those times of trains that run through stations for the local authority Chiltern, and the Y axis is the total number of different times, and I want to sort by the X from high to low. | SELECT time, COUNT(time) FROM station AS t1 JOIN route AS t2 ON t1.id = t2.station_id JOIN train AS t3 ON t2.train_id = t3.id WHERE t1.local_authority = "Chiltern" GROUP BY time ORDER BY time DESC | nvbench |
CREATE TABLE table_name_56 (
drew VARCHAR,
goals_against VARCHAR
) | How many draws were there with goals against that did not qualify for UEFA competitions? | SELECT drew FROM table_name_56 WHERE goals_against = "did not qualify for uefa competitions" | sql_create_context |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
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... | what is the pricing for ziprasidone hydrochloride? | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'ziprasidone hydrochloride') | mimic_iii |
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 ... | did patient 57023 have any organisms on the first blood culture ( myco/f lytic bottle) microbiology test last month? | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 57023) AND microbiologyevents.spec_type_desc = 'blood culture ( myco/f lytic bottle)' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.chart... | mimic_iii |
CREATE TABLE table_51868 (
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
) | tell me the writer of production code ad1d09. | SELECT "Written by" FROM table_51868 WHERE "Production code" = 'ad1d09' | wikisql |
CREATE TABLE table_12165999_1 (
afl_team VARCHAR,
player VARCHAR
) | Bob Johnson plays for which AFL team? | SELECT afl_team FROM table_12165999_1 WHERE player = "Bob Johnson" | sql_create_context |
CREATE TABLE Stores (
Store_ID VARCHAR(100),
Address_ID INTEGER,
Marketing_Region_Code CHAR(15),
Store_Name VARCHAR(255),
Store_Phone VARCHAR(255),
Store_Email_Address VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Clients (
Client_ID INTEGER,
Address_ID INTEGER,
Custom... | Give me the descriptions of the service types that cost more than 100, and count them by a bar chart, and sort by the total number from high to low. | SELECT Service_Type_Description, COUNT(Service_Type_Description) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100 GROUP BY Service_Type_Description ORDER BY COUNT(Service_Type_Description) DESC | nvbench |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
... | Votes per Question or Answer. | SELECT v1.CreationDate, (SELECT COUNT(*) FROM Votes AS v2 WHERE v2.CreationDate = v1.CreationDate) / (SELECT COUNT(*) FROM Posts AS p WHERE DATE(p.CreationDate) = v1.CreationDate) AS VotesPerPost FROM Votes AS v1 GROUP BY v1.CreationDate ORDER BY v1.CreationDate | sede |
CREATE TABLE table_16849 (
"Player" text,
"No." real,
"Nationality" text,
"Position" text,
"Years for Jazz" text,
"School/Club Team" text
) | What is the player that played in 2004-05? | SELECT "Player" FROM table_16849 WHERE "Years for Jazz" = '2004-05' | wikisql |
CREATE TABLE table_name_6 (
home_team VARCHAR,
venue VARCHAR
) | Who was the home team when the VFL played Arden Street Oval? | SELECT home_team FROM table_name_6 WHERE venue = "arden street oval" | sql_create_context |
CREATE TABLE table_11734041_20 (
position VARCHAR,
player VARCHAR
) | what's the position where player is williams, bernie bernie williams | SELECT position FROM table_11734041_20 WHERE player = "Williams, Bernie Bernie Williams" | sql_create_context |
CREATE TABLE table_12077540_1 (
import VARCHAR,
product VARCHAR
) | There are 5 imports of plywood. | SELECT import FROM table_12077540_1 WHERE product = "Plywood" | sql_create_context |
CREATE TABLE table_name_56 (
score VARCHAR,
result VARCHAR
) | What score has 7-0 as the result? | SELECT score FROM table_name_56 WHERE result = "7-0" | sql_create_context |
CREATE TABLE table_204_358 (
id number,
"species" text,
"common name" text,
"ncbi accession #" text,
"ncbi name" text,
"length" text,
"sequence identity" text,
"sequence similarity" text,
"years since divergence from human (mya)" number
) | what is the length of each species listed ? | SELECT "length" FROM table_204_358 | squall |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | 经过到门诊进行诊断被确定为疾病I58.073的人他们的籍贯名称、代码以及相应人数分别是多少? | SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN wdmzjzjlb 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 WHERE wdmzjzjlb.JZZDBM = 'I58.073' GROUP BY person_info.JGDM UNION SELECT... | css |
CREATE TABLE table_name_68 (
order VARCHAR,
nationality VARCHAR
) | Which Order has a Nationality of ese milan? | SELECT order FROM table_name_68 WHERE nationality = "ese milan" | sql_create_context |
CREATE TABLE has_allergy (
stuid number,
allergy text
)
CREATE TABLE allergy_type (
allergy text,
allergytype text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
) | How many different advisors are listed? | SELECT COUNT(DISTINCT advisor) FROM student | spider |
CREATE TABLE Customer_Payments (
customer_id INTEGER,
datetime_payment DATETIME,
payment_method_code VARCHAR(10),
amount_payment DOUBLE
)
CREATE TABLE Vehicles (
vehicle_id INTEGER,
vehicle_details VARCHAR(255)
)
CREATE TABLE Customers (
customer_id INTEGER,
customer_address_id INTEGER... | List all payment methods and number of payments using each payment methods by a bar chart, show by the Y-axis in descending. | SELECT payment_method_code, COUNT(*) FROM Customer_Payments GROUP BY payment_method_code ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE elimination (
elimination_id text,
wrestler_id text,
team text,
eliminated_by text,
elimination_move text,
time text
)
CREATE TABLE wrestler (
wrestler_id number,
name text,
reign text,
days_held text,
location text,
event text
) | How many eliminations did each team have? | SELECT team, COUNT(*) FROM elimination GROUP BY team | spider |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)... | tell me the time of hospital admission of patient 012-68650 until 2104? | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '012-68650' AND STRFTIME('%y', patient.hospitaladmittime) <= '2104' | eicu |
CREATE TABLE table_26250253_1 (
result VARCHAR,
week__number VARCHAR
) | Where the week # is Top 12, what is the result? | SELECT result FROM table_26250253_1 WHERE week__number = "Top 12" | sql_create_context |
CREATE TABLE table_name_18 (
position VARCHAR,
pick__number VARCHAR
) | What is the position of the player with a Pick # of 108? | SELECT position FROM table_name_18 WHERE pick__number = "108" | sql_create_context |
CREATE TABLE table_67707 (
"Date" text,
"Home captain" text,
"Away captain" text,
"Venue" text,
"Result" text
) | Who is the home captain that played at Edgbaston? | SELECT "Home captain" FROM table_67707 WHERE "Venue" = 'edgbaston' | wikisql |
CREATE TABLE table_204_550 (
id number,
"event" text,
"record" text,
"athlete" text,
"date" text,
"meet" text,
"place" text
) | how many records has harmon harmon held ? | SELECT COUNT("record") FROM table_204_550 WHERE "athlete" = 'harmon harmon' | squall |
CREATE TABLE table_name_66 (
against INTEGER,
losses VARCHAR,
wimmera_fl VARCHAR
) | How much Against has Losses smaller than 7, and a Wimmera FL of horsham? | SELECT SUM(against) FROM table_name_66 WHERE losses < 7 AND wimmera_fl = "horsham" | sql_create_context |
CREATE TABLE table_name_5 (
date VARCHAR,
label VARCHAR,
catalog VARCHAR
) | On what date was a record from Village Records with catalog VRCL-2205 released? | SELECT date FROM table_name_5 WHERE label = "village records" AND catalog = "vrcl-2205" | sql_create_context |
CREATE TABLE table_24480 (
"Season" text,
"Mens 1st XI" text,
"Mens 2nd XI" text,
"Mens 3rd XI" text,
"Ladies 1st XI" text
) | When 5th, south western district 2 is the mens 2nd xi what is the season? | SELECT "Season" FROM table_24480 WHERE "Mens 2nd XI" = '5th, South Western District 2' | wikisql |
CREATE TABLE table_name_58 (
score VARCHAR,
date VARCHAR,
result VARCHAR,
competition VARCHAR
) | What's the score at the October 30, 1996 1998 fifa world cup qualification with a result of win? | SELECT score FROM table_name_58 WHERE result = "win" AND competition = "1998 fifa world cup qualification" AND date = "october 30, 1996" | sql_create_context |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | when was the first time this year that patient 49141 was diagnosed with chronic cholecystitis? | SELECT diagnoses_icd.charttime FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'chronic cholecystitis') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 49141) AND DATETIME(... | mimic_iii |
CREATE TABLE table_204_228 (
id number,
"year" number,
"title" text,
"credit" text,
"role" text,
"notes" text
) | what was the earliest film released ? | SELECT "title" FROM table_204_228 ORDER BY "year" LIMIT 1 | squall |
CREATE TABLE table_203_212 (
id number,
"#" number,
"district" text,
"land area (km2)" number,
"population\n(2010 census)" number,
"density (persons/km2)" number
) | which of the 11 districts has the highest population density ? | SELECT "district" FROM table_203_212 ORDER BY "density (persons/km2)" DESC LIMIT 1 | squall |
CREATE TABLE table_15560 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | When was the game played in which the record was 46-29? | SELECT "Date" FROM table_15560 WHERE "Record" = '46-29' | wikisql |
CREATE TABLE table_name_25 (
total INTEGER,
name VARCHAR,
league VARCHAR
) | Which Total has a Name of alex mcleish category:articles with hcards, and a League smaller than 494? | SELECT AVG(total) FROM table_name_25 WHERE name = "alex mcleish category:articles with hcards" AND league < 494 | sql_create_context |
CREATE TABLE table_15899 (
"Name" text,
"Direction" text,
"Mantra" text,
"Weapon" text,
"Consort" text,
"Graha (Planet)" text,
"Guardian M\u0101t\u1e5bk\u0101" text
) | What is the guardian m t k for the guardian whose consort is Sv h ? | SELECT "Guardian M\u0101t\u1e5bk\u0101" FROM table_15899 WHERE "Consort" = 'Svāhā' | wikisql |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Give me the comparison about the sum of School_ID over the ACC_Road , and group by attribute ACC_Road by a bar chart, display from low to high by the X-axis. | SELECT ACC_Road, SUM(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road | nvbench |
CREATE TABLE table_name_26 (
round VARCHAR,
h___a VARCHAR
) | What Round has h/a hurst | SELECT round FROM table_name_26 WHERE h___a = "hurst" | sql_create_context |
CREATE TABLE table_name_85 (
surface VARCHAR,
partner VARCHAR
) | What surface did hayley ericksen play on? | SELECT surface FROM table_name_85 WHERE partner = "hayley ericksen" | sql_create_context |
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
) | For those records from the products and each product's manufacturer, return a bar chart about the distribution of headquarter and the sum of manufacturer , and group by attribute headquarter, and display Headquarter from high to low order please. | SELECT Headquarter, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter DESC | nvbench |
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(... | For those employees who do not work in departments with managers that have ids between 100 and 200, find phone_number and department_id , and visualize them by a bar chart, I want to show in desc by the x axis. | SELECT PHONE_NUMBER, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY PHONE_NUMBER DESC | nvbench |
CREATE TABLE table_203_200 (
id number,
"region" text,
"seed" number,
"team" text,
"coach" text,
"finished" text,
"final opponent" text,
"score" text
) | how many number of teams played altogether ? | SELECT COUNT("team") FROM table_203_200 | squall |
CREATE TABLE table_42831 (
"Spoofed Title" text,
"Actual Title" text,
"Writer" text,
"Artist" text,
"Issue" real,
"Date" text
) | What issue was the Spoofed Title of the crockford files in? | SELECT "Issue" FROM table_42831 WHERE "Spoofed Title" = 'the crockford files' | wikisql |
CREATE TABLE table_27714985_1 (
production_code_s_ INTEGER,
written_by VARCHAR
) | What is the maximum production code of an episode written by Patty Lin? | SELECT MAX(production_code_s_) FROM table_27714985_1 WHERE written_by = "Patty Lin" | sql_create_context |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
... | what is the total number of hours since patient 97395 was admitted to hospital? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 97395 AND admissions.dischtime IS NULL | mimic_iii |
CREATE TABLE table_name_92 (
winning_score VARCHAR,
date VARCHAR
) | What was the winning score on Aug 21, 1977? | SELECT winning_score FROM table_name_92 WHERE date = "aug 21, 1977" | sql_create_context |
CREATE TABLE table_204_966 (
id number,
"region" text,
"date" text,
"label" text,
"format" text,
"catalog" text
) | what region was on the label sirup ? | SELECT "region" FROM table_204_966 WHERE "label" = 'sirup' | squall |
CREATE TABLE table_79068 (
"Elimination" text,
"Wrestler" text,
"Team" text,
"Eliminated by" text,
"Elimination Move" text,
"Time" text
) | What Elimination Move is listed against Wrestler Henry, Eliminated by Batista? | SELECT "Elimination Move" FROM table_79068 WHERE "Eliminated by" = 'batista' AND "Wrestler" = 'henry' | wikisql |
CREATE TABLE table_71306 (
"Member countries" text,
"Population" text,
"Area (km\u00b2)" text,
"GDP (billion US$)" text,
"GDP per capita (US$)" text
) | What is the name of the member country that has a Population of 1,341,664? | SELECT "Member countries" FROM table_71306 WHERE "Population" = '1,341,664' | wikisql |
CREATE TABLE table_10668 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | what is the highest grid when the time/retired is fuel pump and the laps is more than 26? | SELECT MAX("Grid") FROM table_10668 WHERE "Time/Retired" = 'fuel pump' AND "Laps" > '26' | wikisql |
CREATE TABLE table_29930 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Name the high rebounds for january 14 | SELECT "High rebounds" FROM table_29930 WHERE "Date" = 'January 14' | wikisql |
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
... | Find meter_200 and the amount of meter_200 , and group by attribute meter_200, and visualize them by a bar chart, and rank by the x-axis in descending please. | SELECT meter_200, COUNT(meter_200) FROM swimmer GROUP BY meter_200 ORDER BY meter_200 DESC | nvbench |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperio... | what was the name of the prescription drug that patient 005-48105 was prescribed first in this month? | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-48105')) AND DATETIME(medication.drugstarttime, 'start of month... | eicu |
CREATE TABLE table_22147 (
"English name" text,
"Thai name" text,
"Transcription" text,
"Color" text,
"Sanskrit word" text,
"Planet" text
) | What is the color of the planet venus? | SELECT "Color" FROM table_22147 WHERE "Planet" = 'Venus' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.