context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_36 (
score VARCHAR,
home VARCHAR,
record VARCHAR
) | What is the score for the Chicago Black Hawks game with a record of 2-1? | SELECT score FROM table_name_36 WHERE home = "chicago black hawks" AND record = "2-1" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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
)
... | count the number of patients whose days of hospital stay is greater than 5 and diagnoses short title is adv eff benzodiaz tranq? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "5" AND diagnoses.short_title = "Adv eff benzodiaz tranq" | mimicsql_data |
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
)
CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptroller text,
Attorney_General text,
US_Senate text
)
CREATE TABLE election (
... | Show how many delegates in each party with a pie chart. | SELECT T2.Party, COUNT(T2.Party) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party | nvbench |
CREATE TABLE table_76817 (
"Model Number" text,
"Frequency" text,
"L2-Cache" text,
"Front Side Bus" text,
"Multiplier" text,
"Voltage" text,
"Socket" text,
"Release Date" text
) | What is the Frequency for Model Number c7 1.0? | SELECT "Frequency" FROM table_76817 WHERE "Model Number" = 'c7 1.0' | wikisql |
CREATE TABLE table_49569 (
"Location" text,
"Year" real,
"Champion" text,
"Runner-up" text,
"Score" text
) | How many years had a location at Forest Hills and a score of 6 3, 6 3 for John McEnroe? | SELECT COUNT("Year") FROM table_49569 WHERE "Location" = 'forest hills' AND "Runner-up" = 'john mcenroe' AND "Score" = '6–3, 6–3' | wikisql |
CREATE TABLE table_name_81 (
semi_finalists VARCHAR,
runner_up VARCHAR
) | Who were the semi finalists when Alexia Dechaume-Balleret Sandrine testud was the runner-up? | SELECT semi_finalists FROM table_name_81 WHERE runner_up = "alexia dechaume-balleret sandrine testud" | sql_create_context |
CREATE TABLE table_name_80 (
cuts_made INTEGER,
top_10 VARCHAR,
wins VARCHAR,
top_25 VARCHAR
) | Name the sum of cuts with wins less than 2, top-25 more than 7 and top-10 less than 2 | SELECT SUM(cuts_made) FROM table_name_80 WHERE wins < 2 AND top_25 > 7 AND top_10 < 2 | sql_create_context |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,... | Highest scoring questions and answers in each tag. | SELECT TagName, QuestionID AS "post_link", q_.Score AS "q_score", AnswerID AS "post_link", a_.Score AS "a_score" FROM (SELECT TagName, (SELECT q.Id FROM Posts AS q INNER JOIN PostTags AS qt ON q.Id = qt.PostId WHERE qt.TagId = t.Id ORDER BY q.Score DESC LIMIT 1) AS QuestionID, (SELECT a.Id FROM Posts AS a INNER JOIN Po... | 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... | what is insurance of subject id 2560? | SELECT demographic.insurance FROM demographic WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE table_24212608_1 (
episode VARCHAR,
broadcast_date VARCHAR
) | How many episodes were broadcast in 2010? | SELECT COUNT(episode) FROM table_24212608_1 WHERE broadcast_date = 2010 | sql_create_context |
CREATE TABLE table_2367847_2 (
elementary_schools VARCHAR,
district_wide VARCHAR
) | Name the total number of elementary schools for 31851 | SELECT COUNT(elementary_schools) FROM table_2367847_2 WHERE district_wide = 31851 | sql_create_context |
CREATE TABLE table_204_113 (
id number,
"rank" number,
"area" text,
"state/\nprovince" text,
"csa/cma\n2009 population" number,
"projected\n2025 population" number,
"projected increase\n2009-2025" number
) | how much larger was the 2009 population of chicago than the 2009 population of toronto ? | SELECT (SELECT "csa/cma\n2009 population" FROM table_204_113 WHERE "area" = 'chicago') - (SELECT "csa/cma\n2009 population" FROM table_204_113 WHERE "area" = 'toronto') | squall |
CREATE TABLE table_59196 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text
) | what total was the lowest and had a to par of e? | SELECT MIN("Total") FROM table_59196 WHERE "To par" = 'e' | wikisql |
CREATE TABLE table_name_75 (
label VARCHAR,
format VARCHAR,
catalog VARCHAR
) | What is the Label of the release on Stereo vinyl LP with Catalog number SF-7635? | SELECT label FROM table_name_75 WHERE format = "stereo vinyl lp" AND catalog = "sf-7635" | sql_create_context |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE... | 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, show me about the distribution of job_id and the sum of manager_id , and group by attribute job_id in a bar chart, and display by the y axis in desc please. | 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 ORDER BY SUM(MANAGER_ID) DESC | nvbench |
CREATE TABLE table_28138035_27 (
mens_singles VARCHAR,
womens_doubles VARCHAR
) | Who is listed under mens singles when womens has wang nan zhang yining? | SELECT mens_singles FROM table_28138035_27 WHERE womens_doubles = "Wang Nan Zhang Yining" | sql_create_context |
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_city_affected real
)
CREATE TABLE region (
Region_id int,
Region_code text,
Region_name text
)
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Nu... | Show me a bar chart for how many storms occured in each region? | SELECT Region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.Region_id = T2.Region_id GROUP BY T1.Region_id | nvbench |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE fare (
fare_id int,
from_airport va... | is there a LIMOUSINE service available from the PIT airport | SELECT DISTINCT ground_service.transport_type FROM airport, ground_service WHERE airport.airport_code = 'PIT' AND ground_service.airport_code = airport.airport_code AND ground_service.transport_type = 'LIMOUSINE' | atis |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
... | what is the price of a FIRST class ticket from MILWAUKEE to SAN FRANCISCO round trip | 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, fare_basis, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'MILWAUKEE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code ... | atis |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(... | For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of hire_date and the sum of salary bin hire_date by weekday, sort total number in desc order. | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(SALARY) DESC | nvbench |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
Post... | Average reputation of users depending on number of posts. | WITH postgroups_cte AS (SELECT u.Id AS uid, u.Reputation AS rep, CAST(COUNT(p.Id) / '##mult?100##' AS INT) AS pgroup FROM Users AS u INNER JOIN Posts AS p ON p.OwnerUserId = u.Id GROUP BY u.Id, u.Reputation) SELECT pgroup, AVG(CAST(rep AS FLOAT)) AS Average FROM postgroups_cte GROUP BY pgroup ORDER BY pgroup DESC | sede |
CREATE TABLE table_55324 (
"Date" text,
"Venue" text,
"Result" text,
"Competition" text,
"Scored" real
) | What date did Sigurd Rushfeldt score less than 2 points in the UEFA Euro 2004 qualifying competition? | SELECT "Date" FROM table_55324 WHERE "Scored" < '2' AND "Competition" = 'uefa euro 2004 qualifying' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugst... | count the number of people who were diagnosed with pleural effusion and didn't come back to the hospital during the same month until 4 years ago. | SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pleural effusion' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-4 year')) AS t... | eicu |
CREATE TABLE table_28221 (
"Region" text,
"Land area (km 2 )" text,
"Rainfall by depth (mm/year)" real,
"Rainfall by volume (km 3 /year)" text,
"Surface run off (km 3 /year)" text,
"Infiltration (km 3 /year)" text,
"Evapotranspiration (km 3 /year)" text
) | What was the rainfall by volume in Huetar Atlantico where the rainfall depth (mm/year) was 3527? | SELECT "Rainfall by volume (km 3 /year)" FROM table_28221 WHERE "Rainfall by depth (mm/year)" = '3527' | wikisql |
CREATE TABLE table_name_87 (
constructor VARCHAR,
grid VARCHAR
) | Which Constructor has a Grid of 17? | SELECT constructor FROM table_name_87 WHERE grid = 17 | sql_create_context |
CREATE TABLE table_name_78 (
position INTEGER,
points VARCHAR,
played VARCHAR
) | What is the greatest position when the points are less than 21, and the played greater than 14? | SELECT MAX(position) FROM table_name_78 WHERE points < 21 AND played > 14 | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREAT... | what are patient 006-76924's changes in bedside glucose second measured on the current hospital visit compared to the value first measured on the current hospital visit? | SELECT (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 = '006-76924' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'bedsi... | eicu |
CREATE TABLE table_60445 (
"Year" real,
"Delegate" text,
"Hometown" text,
"Placement in Miss Universe" text,
"Other awards" text
) | Which Placement in Miss Universe is armi barbara quiray crespo? | SELECT "Placement in Miss Universe" FROM table_60445 WHERE "Delegate" = 'armi barbara quiray crespo' | wikisql |
CREATE TABLE table_name_51 (
place VARCHAR,
country VARCHAR,
score VARCHAR,
to_par VARCHAR
) | Which Place has a Score smaller than 72, and a To par of 1, and a Country of spain? | SELECT place FROM table_name_51 WHERE score < 72 AND to_par = "−1" AND country = "spain" | sql_create_context |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
U... | How Many of my Answers have been the Accepted Answer. | SELECT answers.Id AS "post_link", answers.Score AS pontuacao, answers.OwnerUserId AS "user_link", CAST(TIME_TO_STR(answers.CreationDate, '%d/%m/%Y') AS TEXT(30)) AS CreationDate FROM Posts AS answers INNER JOIN Posts AS all_posts ON all_posts.AcceptedAnswerId = answers.Id WHERE answers.OwnerUserId = @UserId AND answers... | sede |
CREATE TABLE table_34330 (
"Volume:Issue" text,
"Issue date" text,
"Weeks on numbe one" text,
"Song" text,
"Artist(s)" text
) | Which song is from Volume:Issue 64:11-12? | SELECT "Song" FROM table_34330 WHERE "Volume:Issue" = '64:11-12' | wikisql |
CREATE TABLE fgwyjzb (
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,
... | 根据不同的出院诊断疾病编码和科室名称,所有医疗就诊记录在医院3166992中的患者的平均年龄都列出是哪些呢? | SELECT gwyjzb.MED_ORG_DEPT_NM, gwyjzb.OUT_DIAG_DIS_CD, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '3166992' GROUP BY gwyjzb.MED_ORG_DEPT_NM, gwyjzb.OUT_DIAG_DIS_CD UNION SELECT fgwyjzb.MED_ORG_DEPT_NM, fgwyjzb.OUT_DIAG_DIS_CD, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '31... | css |
CREATE TABLE table_66571 (
"State and District of Columbia" text,
"Obese adults" text,
"Overweight (incl. obese) adults" text,
"Obese children and adolescents" text,
"Obesity rank" real
) | What's the count for obese children and adolescents ranked 48? | SELECT "Obese children and adolescents" FROM table_66571 WHERE "Obesity rank" = '48' | wikisql |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CRE... | How many questions for a tag. | SELECT Id FROM Tags WHERE TagName = 'SCOM' | sede |
CREATE TABLE table_name_22 (
tries_against VARCHAR,
points_for VARCHAR
) | What is Tries Against, when Points For is 98? | SELECT tries_against FROM table_name_22 WHERE points_for = "98" | sql_create_context |
CREATE TABLE table_name_77 (
video VARCHAR,
aspect VARCHAR
) | Which video has a 16:9 aspect? | SELECT video FROM table_name_77 WHERE aspect = "16:9" | sql_create_context |
CREATE TABLE table_49514 (
"Poll Source" text,
"Dates administered" text,
"Democrat: Vivian Davis Figures" text,
"Republican: Jeff Sessions" text,
"Lead Margin" real
) | What was the date administered from a source of Rasmussen Reports and a lead margin over 32? | SELECT "Dates administered" FROM table_49514 WHERE "Poll Source" = 'rasmussen reports' AND "Lead Margin" > '32' | wikisql |
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,
... | how many of the male patients had hyperacusis? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.short_title = "Hyperacusis" | mimicsql_data |
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,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | 从2014年2月27日到2014年5月23日,列出病人60960957这期间所有检验报告单中的标本采集部位 | SELECT jybgb.BBCJBW 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 = '60960957' AND jybgb.BGRQ BETWEEN '2014-02-27' AND '201... | css |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm... | had patient 8016 been tested on total protein, pleural since 14 months ago? | SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'total protein, pleural') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8016) AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), ... | mimic_iii |
CREATE TABLE table_name_24 (
country VARCHAR,
score VARCHAR
) | What country scored 69-69-73=211? | SELECT country FROM table_name_24 WHERE score = 69 - 69 - 73 = 211 | sql_create_context |
CREATE TABLE diagnoses (
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 prescriptions... | how many patients whose age is less than 80 and diagnoses long title is late effects of cerebrovascular disease, hemiplegia affecting unspecified side? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "80" AND diagnoses.long_title = "Late effects of cerebrovascular disease, hemiplegia affecting unspecified side" | mimicsql_data |
CREATE TABLE table_13619027_10 (
game INTEGER
) | What is the highest game number? | SELECT MAX(game) FROM table_13619027_10 | sql_create_context |
CREATE TABLE table_66902 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | what is the entrant for the ferrari v8 with points less than 4? | SELECT "Entrant" FROM table_66902 WHERE "Engine" = 'ferrari v8' AND "Points" < '4' | wikisql |
CREATE TABLE table_name_7 (
reason VARCHAR,
became_heir VARCHAR
) | Which Reason is given when 1103 is the date for Became heir? | SELECT reason FROM table_name_7 WHERE became_heir = "1103" | sql_create_context |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
Cr... | Weekly trend for python (last 100 weeks). | SELECT 'Week ' + CAST(TIME_TO_STR(Posts.CreationDate, '%W') AS TEXT(2)) AS Week, YEAR(Posts.CreationDate) AS year, Tags.TagName, COUNT(*) AS Questions FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId LEFT JOIN U... | sede |
CREATE TABLE table_2840500_1 (
pick INTEGER,
player VARCHAR
) | What draft pick number was Ric Jackman? | SELECT MIN(pick) FROM table_2840500_1 WHERE player = "Ric Jackman" | sql_create_context |
CREATE TABLE table_name_80 (
wins INTEGER,
team VARCHAR
) | What are the average wins that have great britain as the team? | SELECT AVG(wins) FROM table_name_80 WHERE team = "great britain" | sql_create_context |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational... | As far as labs go , are there any classes without them ? | SELECT DISTINCT name, number FROM course WHERE department = 'EECS' AND has_lab = 'N' | advising |
CREATE TABLE table_53066 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | When was a game played where the away team scored 12.14 (86)? | SELECT "Date" FROM table_53066 WHERE "Away team score" = '12.14 (86)' | wikisql |
CREATE TABLE aircraft (
aircraft_id number,
aircraft text,
description text,
max_gross_weight text,
total_disk_area text,
max_disk_loading text
)
CREATE TABLE match (
round number,
location text,
country text,
date text,
fastest_qualifying text,
winning_pilot text,
w... | Please show the names of aircrafts associated with airport with name 'London Gatwick'. | SELECT T1.aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.aircraft_id = T2.aircraft_id JOIN airport AS T3 ON T2.airport_id = T3.airport_id WHERE T3.airport_name = "London Gatwick" | spider |
CREATE TABLE table_62484 (
"Name" text,
"Score" text,
"Balls" real,
"Venue" text,
"Date" text
) | What is Balls, when Venue is 'Bristol', and when Score is '104*'? | SELECT "Balls" FROM table_62484 WHERE "Venue" = 'bristol' AND "Score" = '104*' | wikisql |
CREATE TABLE table_1342013_12 (
result VARCHAR,
incumbent VARCHAR
) | What was the result when incumbent Fred E. Busbey was elected? | SELECT result FROM table_1342013_12 WHERE incumbent = "Fred E. Busbey" | sql_create_context |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE TagSynonyms (
Id number... | Top posts (Q&A) on the site.. | SELECT Id AS "post_link", Score, CASE WHEN PostTypeId = 1 THEN 'Question' WHEN PostTypeId = 2 THEN 'Answer' END AS "Post Type", OwnerUserId AS "user_link" FROM Posts ORDER BY Score DESC LIMIT 100 | sede |
CREATE TABLE table_41746 (
"Position" text,
"Jersey #" real,
"Name" text,
"Height (cm)" real,
"Weight (kg)" real,
"Birthdate" text,
"Birthplace" text,
"2002\u20132003 Team" text,
"NHL rights, if any" text
) | Which player is the NHL right, who was born in Downers Grove, Illinois? | SELECT "NHL rights, if any" FROM table_41746 WHERE "Birthplace" = 'downers grove, illinois' | wikisql |
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 Pr... | Show the number of accounts for each customer in a bar chart grouping by customer's last name, and rank from high to low by the total number. | SELECT customer_last_name, COUNT(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_65451 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | Which Result has an Opponent of washington redskins? | SELECT "Result" FROM table_65451 WHERE "Opponent" = 'washington redskins' | wikisql |
CREATE TABLE table_54773 (
"Rd #" real,
"Pick #" real,
"Player" text,
"Team (League)" text,
"Reg GP" real,
"Pl GP" real
) | What is the total pick# played by Anton Rodin with a Reg GP over 0? | SELECT COUNT("Pick #") FROM table_54773 WHERE "Player" = 'anton rodin' AND "Reg GP" > '0' | wikisql |
CREATE TABLE Catalog_Contents_Additional_Attributes (
catalog_entry_id INTEGER,
catalog_level_number INTEGER,
attribute_id INTEGER,
attribute_value VARCHAR(255)
)
CREATE TABLE Catalog_Structure (
catalog_level_number INTEGER,
catalog_id INTEGER,
catalog_level_name VARCHAR(50)
)
CREATE TABL... | Which catalog contents has price above 700 dollars? Show their catalog entry names and capacities, list in desc by the x-axis. | SELECT catalog_entry_name, capacity FROM Catalog_Contents WHERE price_in_dollars > 700 ORDER BY catalog_entry_name DESC | nvbench |
CREATE TABLE table_204_750 (
id number,
"team" text,
"stadium" text,
"capacity" number,
"seated" number
) | which stadium seats the least number of people ? | SELECT "team" FROM table_204_750 ORDER BY "capacity" LIMIT 1 | squall |
CREATE TABLE table_59232 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text
) | What is the average First Elected, when District is 'Massachusetts 3'? | SELECT AVG("First elected") FROM table_59232 WHERE "District" = 'massachusetts 3' | wikisql |
CREATE TABLE employee (
eid number(9,0),
name varchar2(30),
salary number(10,2)
)
CREATE TABLE flight (
flno number(4,0),
origin varchar2(20),
destination varchar2(20),
distance number(6,0),
departure_date date,
arrival_date date,
price number(7,2),
aid number(9,0)
)
CREATE... | A bar chart about what are the destinations and number of flights to each one?, order total number in desc order. | SELECT destination, COUNT(*) FROM flight GROUP BY destination ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_47621 (
"Portfolio" text,
"Minister" text,
"Took office" text,
"Left office" text,
"Party" text
) | What is Party, when Left Office is '23 April 2005', when Portfolio is 'Minister of Reforms and Devolutions'? | SELECT "Party" FROM table_47621 WHERE "Left office" = '23 april 2005' AND "Portfolio" = 'minister of reforms and devolutions' | wikisql |
CREATE TABLE table_6212 (
"Date" text,
"Course" text,
"Distance" text,
"Type" text,
"Winner" text
) | What is the distance for the 5 September race? | SELECT "Distance" FROM table_6212 WHERE "Date" = '5 september' | wikisql |
CREATE TABLE table_21373283_3 (
date VARCHAR,
pole_position VARCHAR
) | What date did Adriano Buzaid have the pole position? | SELECT date FROM table_21373283_3 WHERE pole_position = "Adriano Buzaid" | sql_create_context |
CREATE TABLE table_5924 (
"Games" real,
"Drawn" real,
"Lost" real,
"Points difference" text,
"Points" real
) | Name the most games with drawn more than 1 | SELECT MAX("Games") FROM table_5924 WHERE "Drawn" > '1' | wikisql |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden ... | Open questions with no comments or answers. | SELECT Id AS "post_link", Score, ViewCount AS "View Count" FROM Posts WHERE PostTypeId = 1 AND DeletionDate IS NULL AND AnswerCount = 0 AND CommentCount = 0 AND ClosedDate IS NULL AND CommunityOwnedDate IS NULL AND NOT EXISTS(SELECT * FROM PostHistory WHERE Posts.Id = PostHistory.PostId AND PostHistory.PostHistoryTypeI... | sede |
CREATE TABLE table_204_659 (
id number,
"seat" text,
"state" text,
"majority" number,
"member" text,
"party" text
) | what member comes next after hon trish worth ? | SELECT "member" FROM table_204_659 WHERE id = (SELECT id FROM table_204_659 WHERE "member" = 'hon trish worth') + 1 | squall |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airp... | display all fare codes | SELECT DISTINCT fare_basis_code FROM fare_basis | atis |
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 demographic ... | let me know the number of patients still living who have heparin (iabp) prescription. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "0" AND prescriptions.drug = "Heparin (IABP)" | mimicsql_data |
CREATE TABLE table_name_25 (
mean_free_path VARCHAR,
vacuum_range VARCHAR
) | What is Mean Free Path, when Vacuum Range is 'medium vacuum'? | SELECT mean_free_path FROM table_name_25 WHERE vacuum_range = "medium vacuum" | sql_create_context |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE employees (
EMPLOYEE_I... | For those employees who was hired before 2002-06-21, show me the trend about department_id over hire_date with a line chart. | SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE table_name_96 (
hangul VARCHAR,
greek VARCHAR
) | What is the Hangul equivalent of the Greek , ? | SELECT hangul FROM table_name_96 WHERE greek = "ϝ, υ" | sql_create_context |
CREATE TABLE table_1137142_1 (
group_b_winner VARCHAR,
group_c_winner VARCHAR
) | What is the number of group b winner for francavilla? | SELECT COUNT(group_b_winner) FROM table_1137142_1 WHERE group_c_winner = "Francavilla" | sql_create_context |
CREATE TABLE table_70762 (
"Class" text,
"Type" text,
"Names" text,
"Quantity made" text,
"Manufacturer" text,
"Date made" text
) | What is the class of the locomotive with a 0-4-0st type? | SELECT "Class" FROM table_70762 WHERE "Type" = '0-4-0st' | wikisql |
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 text,
ZYMC text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC... | 列出在04年11月22日到10年5月4日内患者柳清昶被开出的所有检验报告单的科室号码是什么?科室名称叫什么? | SELECT jybgb.KSBM, jybgb.KSMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJL... | css |
CREATE TABLE table_203_136 (
id number,
"year" number,
"ibm model number" text,
"name" text,
"processor" text,
"bus" text,
"hd interface" text,
"case" text,
"notes" text
) | how many models had the 8 mhz intel 8086 processor ? | SELECT COUNT(*) FROM table_203_136 WHERE "processor" = '8 mhz intel 8086' | squall |
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 have died in or before the year 2183? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.dod_year <= "2183.0" | mimicsql_data |
CREATE TABLE table_53884 (
"Episode" text,
"Air Date" text,
"Timeslot" text,
"Rating" real,
"Share" real,
"18-49 (Rating/Share)" text,
"Viewers (m)" real,
"Rank (Timeslot)" real,
"Rank (Night)" text,
"Rank (Overall)" real
) | What is the total number of Viewers with a Rank (Night) of n/a, and a Timeslot of 8:30 p.m.? | SELECT COUNT("Viewers (m)") FROM table_53884 WHERE "Rank (Night)" = 'n/a' AND "Timeslot" = '8:30 p.m.' | wikisql |
CREATE TABLE table_27423508_1 (
director VARCHAR,
spanish_title VARCHAR
) | Who was the director for Tango Bar? | SELECT director FROM table_27423508_1 WHERE spanish_title = "Tango Bar" | sql_create_context |
CREATE TABLE table_59865 (
"Atomic property" text,
"Helium" text,
"Neon" text,
"Argon" text,
"Krypton" text,
"Xenon" text,
"Radon" text
) | Which Radon has Neon of 4.79? | SELECT "Radon" FROM table_59865 WHERE "Neon" = '4.79' | wikisql |
CREATE TABLE table_29801 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real,
"U.S. viewers (millions)" text
) | Wha episode number in the series had 24.8 million u.s. viewers? | SELECT MIN("No. in series") FROM table_29801 WHERE "U.S. viewers (millions)" = '24.8' | wikisql |
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 prescriptions (
subject_id text,
hadm_id... | how many of the patients on urgent admission had icd9 code 4105? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.icd9_code = "4105" | mimicsql_data |
CREATE TABLE table_name_14 (
goals_for INTEGER,
goals_against VARCHAR,
points VARCHAR,
position VARCHAR
) | What is the sum of the goals with less than 30 points, a position less than 10, and more than 57 goals against? | SELECT SUM(goals_for) FROM table_name_14 WHERE points < 30 AND position < 10 AND goals_against > 57 | sql_create_context |
CREATE TABLE table_67411 (
"Date" text,
"Opponent" text,
"Result" text,
"Game Site" text,
"Attendance" text
) | What was the attendance of the Cup Quarterfinals game? | SELECT "Attendance" FROM table_67411 WHERE "Game Site" = 'cup quarterfinals' | wikisql |
CREATE TABLE table_25647137_2 (
touchdowns INTEGER
) | What was the highest number of touchdowns by a player? | SELECT MAX(touchdowns) FROM table_25647137_2 | sql_create_context |
CREATE TABLE table_204_56 (
id number,
"year" number,
"song" text,
"us r&b" number,
"us rap" number,
"album" text
) | which song has the most in us r & b ? | SELECT "song" FROM table_204_56 ORDER BY "us r&b" LIMIT 1 | squall |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 在医院2796899患者10619383出院诊断疾病中不包含低钾血症的是什么医疗就诊记录编号? | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '10619383' AND t_kc21.MED_SER_ORG_NO = '2796899' AND NOT t_kc21.OUT_DIAG_DIS_NM LIKE '%低钾血症%' | css |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
... | what is the difference between weights on patient 10431 second measured on the first hospital visit compared to the value first measured on the first hospital visit? | SELECT (SELECT 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 = 10431 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND chartev... | mimic_iii |
CREATE TABLE musical (
Musical_ID int,
Name text,
Year int,
Award text,
Category text,
Nominee text,
Result text
)
CREATE TABLE actor (
Actor_ID int,
Name text,
Musical_ID int,
Character text,
Duration text,
age int
) | How many actors have appeared in each musical. Show a pie chart. | SELECT T2.Name, COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID | nvbench |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name te... | List of bounties offered in a given period. | SELECT p.Id AS "post_link", p.Score AS "Score", p.AnswerCount AS "Answers", bs.BountyAmount AS "Amount", CAST(TIME_TO_STR(bs.CreationDate, '%Y-%m-%d %H:%M:%S') AS TEXT(10)) AS "Bounty Start" FROM Posts AS p INNER JOIN Votes AS bs ON p.Id = bs.PostId AND bs.VoteTypeId = 8 AND bs.CreationDate >= '##Date1?2018-01-01##' AN... | sede |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | How many upvotes does one user have from another user?. | SELECT COUNT(*) AS UpVotes FROM Posts AS P INNER JOIN Votes AS V ON V.PostId = P.Id AND V.VoteTypeId = 2 AND V.UserId = @UserId2 WHERE P.OwnerUserId = @UserId1 | sede |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test... | What courses can I take in the Fall or Winter semester to satisfy my MDE requirement ? | SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, program_course AS PROGRAM_COURSEalias0... | advising |
CREATE TABLE Shops (
Shop_ID INTEGER,
Shop_Details VARCHAR(255)
)
CREATE TABLE Ref_Hotel_Star_Ratings (
star_rating_code CHAR(15),
star_rating_description VARCHAR(80)
)
CREATE TABLE Hotels (
hotel_id INTEGER,
star_rating_code CHAR(15),
pets_allowed_yn CHAR(1),
price_range real,
oth... | Display a pie chart for what are the names and ids of the tourist attractions that are visited at most once? | SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID | nvbench |
CREATE TABLE table_name_79 (
rbis INTEGER,
team VARCHAR,
date VARCHAR
) | When the team is the Boston Red Sox and the is date July 27, 1946, what are the average RBIs? | SELECT AVG(rbis) FROM table_name_79 WHERE team = "boston red sox" AND date = "july 27, 1946" | sql_create_context |
CREATE TABLE table_name_80 (
outcome VARCHAR,
date VARCHAR
) | What was the outcome on 13 may 2007? | SELECT outcome FROM table_name_80 WHERE date = "13 may 2007" | sql_create_context |
CREATE TABLE table_name_79 (
team_1 VARCHAR
) | WHAT IS THE FIRST LEG OF TUILLA? | SELECT 1 AS st_leg FROM table_name_79 WHERE team_1 = "tuilla" | sql_create_context |
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,
... | what is patient 002-3736's first output on 02/26/2103? | 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 = '002-3736')) AND intakeoutput.cellpath LIKE '%output%' AND ST... | eicu |
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 (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | what is the number of patients whose insurance is medicare and lab test name is reticulocyte count, automated? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Medicare" AND lab.label = "Reticulocyte Count, Automated" | mimicsql_data |
CREATE TABLE table_name_63 (
date VARCHAR,
tournament VARCHAR
) | What is the Date of the Rodez, France Tournament? | SELECT date FROM table_name_63 WHERE tournament = "rodez, france" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.