context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_23998 (
"Name" text,
"Completions" real,
"Attempts" real,
"Completion %" text,
"Yards" real,
"Touchdowns" real,
"Interceptions" real,
"QB Rating" text
) | How many attempts did Charley Johnson have? | SELECT COUNT("Attempts") FROM table_23998 WHERE "Name" = 'Charley Johnson' | wikisql |
CREATE TABLE table_18123 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Results" text,
"Candidates" text
) | How many party were listed for district oklahoma 5? | SELECT COUNT("Party") FROM table_18123 WHERE "District" = 'Oklahoma 5' | 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... | 从09年5月21日开始到2015年10月12日结束61592932病患去的最多的是哪家医院就诊? | SELECT MED_SER_ORG_NO FROM t_kc21 WHERE PERSON_ID = '61592932' AND IN_HOSP_DATE BETWEEN '2009-05-21' AND '2015-10-12' GROUP BY MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate... | Recent questions from reputable users. | SELECT p.CreationDate, p.Id AS "post_link", p.AnswerCount, p.Tags FROM Posts AS p INNER JOIN Users AS u ON p.OwnerUserId = u.Id WHERE u.Reputation >= '##MinReputation##' AND p.PostTypeId = 1 AND p.Score >= 0 AND ClosedDate IS NULL ORDER BY p.CreationDate DESC LIMIT 500 | sede |
CREATE TABLE table_64196 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | How many silver for rank 22 when gold count was more than 0 and Bronze count was less than 5? | SELECT SUM("Silver") FROM table_64196 WHERE "Bronze" < '5' AND "Gold" > '0' AND "Rank" = '22' | wikisql |
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 demographic (... | Calculate the number of private insurance patients who have had other closed (endoscopic) biopsy of biliary duct or sphincter of oddi. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.long_title = "Other closed [endoscopic] biopsy of biliary duct or sphincter of Oddi" | mimicsql_data |
CREATE TABLE table_22815568_3 (
status VARCHAR,
county VARCHAR
) | How many statuses are listed for Wayne county? | SELECT COUNT(status) FROM table_22815568_3 WHERE county = "Wayne" | sql_create_context |
CREATE TABLE table_10741 (
"Player" text,
"Team" text,
"Date" text,
"Opposition" text,
"Game" text,
"D\u00e9but" real
) | What is the name of the game whose team is Waterford and debuted later than 1995? | SELECT "Game" FROM table_10741 WHERE "Team" = 'waterford' AND "D\u00e9but" > '1995' | wikisql |
CREATE TABLE table_name_83 (
player VARCHAR,
wins VARCHAR
) | What player has 14 wins? | SELECT player FROM table_name_83 WHERE wins = 14 | sql_create_context |
CREATE TABLE files (
f_id number,
artist_name text,
file_size text,
duration text,
formats text
)
CREATE TABLE genre (
g_name text,
rating text,
most_popular_in text
)
CREATE TABLE song (
song_name text,
artist_name text,
country text,
f_id number,
genre_is text,
... | What are the names of the songs whose rating is below the rating of all songs in English? | SELECT song_name FROM song WHERE rating < (SELECT MIN(rating) FROM song WHERE languages = 'english') | spider |
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 (
... | count the number of patients who have had transitional epithelial cells lab test. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Transitional Epithelial Cells" | mimicsql_data |
CREATE TABLE table_1630 (
"Rank" real,
"Administrative Division" text,
"Area (km\u00b2)" real,
"Area (sq mi)" real,
"National Share (%)" text,
"Comparable Country" text
) | What is the national share of the country whose area is 148064 km^2? | SELECT "National Share (%)" FROM table_1630 WHERE "Area (km\u00b2)" = '148064' | wikisql |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 门诊诊断患者冯弘毅患有心脏病,他做的检测白介素-6的结果定量是什么?对应的单位呢 | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND... | css |
CREATE TABLE table_name_46 (
nationality VARCHAR,
round INTEGER
) | Name the nationality of the player with round more than 4 | SELECT nationality FROM table_name_46 WHERE round > 4 | sql_create_context |
CREATE TABLE table_name_39 (
year VARCHAR,
laps VARCHAR
) | What year resulted in 54 laps? | SELECT year FROM table_name_39 WHERE laps = 54 | sql_create_context |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | A scatter chart shows the correlation between Team_ID and ACC_Percent , and group by attribute ACC_Regular_Season. | SELECT Team_ID, ACC_Percent FROM basketball_match GROUP BY ACC_Regular_Season | nvbench |
CREATE TABLE table_68827 (
"Date" text,
"Location" text,
"Nature of incident" text,
"Circumstances" text,
"Casualties" text
) | What is the nature of the incident that's a bomb attack? | SELECT "Nature of incident" FROM table_68827 WHERE "Circumstances" = 'bomb attack' | wikisql |
CREATE TABLE table_name_31 (
province VARCHAR,
region VARCHAR,
area VARCHAR
) | What province has a v valpara so region and an area of 927.2? | SELECT province FROM table_name_31 WHERE region = "v valparaíso" AND area = 927.2 | sql_create_context |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardi... | count the number of patients who have received a coronar arteriogr-2 cath treatment in this year. | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'coronar arteriogr-2 cath') AND DATETIME(procedures_i... | mimic_iii |
CREATE TABLE table_name_59 (
score VARCHAR,
set_1 VARCHAR
) | What is the score for Set 1 at 19:21? | SELECT score FROM table_name_59 WHERE set_1 = "19:21" | sql_create_context |
CREATE TABLE table_name_88 (
mark VARCHAR,
lane VARCHAR,
react VARCHAR
) | What is Mark, when Lane is less than 5, and when React is 0.217? | SELECT mark FROM table_name_88 WHERE lane < 5 AND react = 0.217 | sql_create_context |
CREATE TABLE table_name_89 (
voltage_input_ VARCHAR,
v_a VARCHAR,
model VARCHAR
) | What is the voltage iinput [V/A] of the whr-g54s model? | SELECT voltage_input_ AS "v_a" FROM table_name_89 WHERE model = "whr-g54s" | sql_create_context |
CREATE TABLE table_name_33 (
time VARCHAR,
opponent VARCHAR
) | What was the time of the bout against Dave Menne? | SELECT time FROM table_name_33 WHERE opponent = "dave menne" | sql_create_context |
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 ... | what is the monthly average of arterial bp [diastolic] for patient 13528 in the first hospital visit? | SELECT AVG(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 = 13528 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND chartevent... | mimic_iii |
CREATE TABLE table_203_648 (
id number,
"date" text,
"opposition" text,
"result" text,
"score" text,
"brazil scorers" text,
"competition" text
) | total number of wins | SELECT COUNT(*) FROM table_203_648 WHERE "result" = 'w' | squall |
CREATE TABLE table_36119 (
"Album#" text,
"English title" text,
"Chinese title" text,
"Released" text,
"Label" text
) | Album # of 3rd is what chinese title? | SELECT "Chinese title" FROM table_36119 WHERE "Album#" = '3rd' | wikisql |
CREATE TABLE table_70458 (
"Episode No." real,
"Airdate" text,
"Total Viewers" real,
"Share" text,
"BBC One Weekly Ranking" real
) | What date did the episode with a weekly ranking of 14 air? | SELECT "Airdate" FROM table_70458 WHERE "BBC One Weekly Ranking" = '14' | wikisql |
CREATE TABLE APPELLATIONS (
County VARCHAR
) | How many appelations are in Napa Country? | SELECT COUNT(*) FROM APPELLATIONS WHERE County = "Napa" | sql_create_context |
CREATE TABLE table_name_58 (
artist VARCHAR,
draw INTEGER
) | Which artist has a draw greater than 15? | SELECT artist FROM table_name_58 WHERE draw > 15 | 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, visualize a bar chart about the distribution of founder and the average of price , and group by attribute founder. | SELECT Founder, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder | nvbench |
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... | Find All_Road and All_Games_Percent , and visualize them by a bar chart, display bar in asc order please. | SELECT All_Road, All_Games_Percent FROM basketball_match ORDER BY All_Road | nvbench |
CREATE TABLE table_27927185_1 (
viewers__millions_ VARCHAR,
episode__number INTEGER
) | How many million viewers watched episodes prior to episode 2.0? | SELECT viewers__millions_ FROM table_27927185_1 WHERE episode__number < 2.0 | sql_create_context |
CREATE TABLE table_5133 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the Final" text,
"Score" text
) | Score of 4 6, 6 4, 6 4 included which tournament? | SELECT "Tournament" FROM table_5133 WHERE "Score" = '4–6, 6–4, 6–4' | wikisql |
CREATE TABLE table_50435 (
"Date" text,
"Home" text,
"Score" text,
"Away" text,
"Attendance" real
) | When the attendance was 3188 what was the score? | SELECT "Score" FROM table_50435 WHERE "Attendance" = '3188' | wikisql |
CREATE TABLE table_name_63 (
name VARCHAR,
west_or_south_terminus VARCHAR
) | what is the name when the west or south terminus is ne 112 west of blue springs? | SELECT name FROM table_name_63 WHERE west_or_south_terminus = "ne 112 west of blue springs" | sql_create_context |
CREATE TABLE table_name_11 (
record VARCHAR,
location VARCHAR,
date VARCHAR
) | What was their record on Wed. Dec. 5, when they played in Boston Garden? | SELECT record FROM table_name_11 WHERE location = "boston garden" AND date = "wed. dec. 5" | sql_create_context |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | Average Questions Per Users Which Have Posted At Least One Question. | SELECT COUNT(Ids) AS Questioners, SUM(PostCount) AS Questions, (SUM(PostCount) / 1.0) / (COUNT(Ids) / 1.0) AS QsPerPoster FROM (SELECT p.OwnerUserId AS Ids, COUNT(p.Id) AS PostCount FROM Posts AS p INNER JOIN Users AS u ON p.OwnerUserId = u.Id WHERE p.PostTypeId = 1 GROUP BY p.OwnerUserId) AS q | sede |
CREATE TABLE table_76590 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What is Date, when Location Attendance is 'TD Banknorth Garden 18,624'? | SELECT "Date" FROM table_76590 WHERE "Location Attendance" = 'td banknorth garden 18,624' | wikisql |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDat... | earliest still available date for a tag to show up. | SELECT CreationDate, Text, PostHistoryTypeId, UserId AS "user10926745", PostId AS "post_link" FROM PostHistory WHERE PostHistoryTypeId IN (3, 6, 9) AND Text LIKE '%<drupal>%' ORDER BY CreationDate | sede |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE VoteTypes (
Id number,
Name text... | Number of suggested edit votes in the last year. | SELECT COUNT(*) FROM SuggestedEditVotes WHERE CreationDate > DATEADD(year, -1, GETDATE()) AND UserId > -1 | sede |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREAT... | what is the maximum total cost of the hospital, which includes the laboratory pressure control test until 2102? | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'pressure control')) AND STRFTIME('%y', cost.chargetime) <= '2102' GR... | eicu |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId ... | Top 100 Answers by Tag Name. | SELECT q.Id, a.Id, a.Score, q.Tags, u.DisplayName FROM Posts AS q JOIN Posts AS a ON q.AcceptedAnswerId = a.Id JOIN Users AS u ON a.OwnerUserId = u.Id WHERE 0 = 0 AND q.Tags LIKE '%api%' AND q.PostTypeId = 1 AND a.PostTypeId = 2 ORDER BY a.Score DESC LIMIT 100 | sede |
CREATE TABLE table_name_38 (
position VARCHAR,
school VARCHAR,
points VARCHAR
) | What position does the winner from Ohio State with 412 points play? | SELECT position FROM table_name_38 WHERE school = "ohio state" AND points = "412" | sql_create_context |
CREATE TABLE table_name_88 (
aggregate VARCHAR
) | What was the 2nd leg score having an aggregate score of 4-2? | SELECT 2 AS nd_leg FROM table_name_88 WHERE aggregate = "4-2" | sql_create_context |
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
Party int,
First_Elected real,
Committee text
)
CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptroller text,
A... | Who were the governors of the parties associated with delegates from district 1, and count them by a bar chart | SELECT Governor, COUNT(Governor) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 GROUP BY Governor | nvbench |
CREATE TABLE Department_Stores (
dept_store_id INTEGER,
dept_store_chain_id INTEGER,
store_name VARCHAR(80),
store_address VARCHAR(255),
store_phone VARCHAR(80),
store_email VARCHAR(80)
)
CREATE TABLE Customer_Addresses (
customer_id INTEGER,
address_id INTEGER,
date_from DATETIME,
... | Return the names and ids of customers who have TN in their address Show bar chart, and show bar in descending order. | SELECT customer_name, customer_id FROM Customers WHERE customer_address LIKE "%TN%" ORDER BY customer_name DESC | nvbench |
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 demographic (... | give me the number of patients who underwent procedure with short tilte cardiac rhythm conv nec and were left against medical advice. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI" AND procedures.short_title = "Cardiac rhythm conv NEC" | mimicsql_data |
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(... | Give me a bar chart for employee_id of each last name, and sort by the total number in descending. | SELECT LAST_NAME, EMPLOYEE_ID FROM employees ORDER BY EMPLOYEE_ID DESC | nvbench |
CREATE TABLE table_name_62 (
intake INTEGER,
dcsf_number VARCHAR,
type VARCHAR,
ofsted_number VARCHAR
) | What is the average primary intake with an Ofsted number of 117433 and a DCSF number greater than 3335? | SELECT AVG(intake) FROM table_name_62 WHERE type = "primary" AND ofsted_number = 117433 AND dcsf_number > 3335 | sql_create_context |
CREATE TABLE table_3695 (
"District" text,
"Counties Represented" text,
"Delegate" text,
"Party" text,
"First Elected" real,
"Committee" text
) | What committees do the district 46 members serve on? | SELECT "Committee" FROM table_3695 WHERE "District" = '46' | wikisql |
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 number of days since patient 17667 received the last magnesium sulfate prescription on this hospital encounter? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', prescriptions.startdate)) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17667 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'magnesium sulfate' ORDER BY prescriptions.sta... | mimic_iii |
CREATE TABLE storm (
storm_id number,
name text,
dates_active text,
max_speed number,
damage_millions_usd number,
number_deaths number
)
CREATE TABLE affected_region (
region_id number,
storm_id number,
number_city_affected number
)
CREATE TABLE region (
region_id number,
r... | Show the name of storms which don't have affected region in record. | SELECT name FROM storm WHERE NOT storm_id IN (SELECT storm_id FROM affected_region) | spider |
CREATE TABLE table_name_22 (
bronze INTEGER,
silver INTEGER
) | What is the most bronze a team with more than 2 silvers has? | SELECT MAX(bronze) FROM table_name_22 WHERE silver > 2 | sql_create_context |
CREATE TABLE table_name_48 (
lost VARCHAR,
points VARCHAR
) | Who was the team that lost but had 10 points? | SELECT lost FROM table_name_48 WHERE points = "10" | sql_create_context |
CREATE TABLE table_name_99 (
to_par VARCHAR,
year_s__won VARCHAR
) | What is To Par, when Year(s) Won is '1968 , 1971'? | SELECT to_par FROM table_name_99 WHERE year_s__won = "1968 , 1971" | sql_create_context |
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight (
aircraft_code_sequence... | i'd like to buy a COACH class ticket from DENVER to ATLANTA with a stopover in PITTSBURGH | 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, fare_basis, flight, flight_fare, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_nam... | atis |
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 ... | What are the upper-level PIBS classes that will be available this Summer ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'PIBS' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Summer... | advising |
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... | 凤乐和这个病人在医院2365508的就诊记录中,共有多少包含科学的就诊科室名称的医疗就诊记录 | SELECT * FROM gwyjzb WHERE gwyjzb.PERSON_NM = '凤乐和' AND gwyjzb.MED_SER_ORG_NO = '2365508' AND gwyjzb.MED_ORG_DEPT_NM LIKE '%科学%' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '凤乐和' AND fgwyjzb.MED_SER_ORG_NO = '2365508' AND fgwyjzb.MED_ORG_DEPT_NM LIKE '%科学%' | css |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
v... | is heart rate of patient 1918 last measured on the first intensive care unit visit less than first measured on the first intensive care unit 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 = 1918) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemi... | mimic_iii |
CREATE TABLE Subjects (
subject_id INTEGER,
subject_name VARCHAR(120)
)
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password VARCHAR(10),
personal_name VARCHAR(40),
middle_name VARCHAR(40),
fam... | Find personal_name and author_tutor_ATB , and visualize them by a bar chart. | SELECT personal_name, author_tutor_ATB FROM Course_Authors_and_Tutors ORDER BY personal_name | nvbench |
CREATE TABLE table_name_60 (
employees__world_ VARCHAR,
revenue__mil€_ VARCHAR
) | What is hte nuumber of employees that has a revenue of 104.000? | SELECT employees__world_ FROM table_name_60 WHERE revenue__mil€_ = "104.000" | sql_create_context |
CREATE TABLE table_name_75 (
finish VARCHAR,
year VARCHAR
) | What is the finish in 1953? | SELECT finish FROM table_name_75 WHERE year = "1953" | sql_create_context |
CREATE TABLE table_204_394 (
id number,
"year" number,
"album" text,
"label" text,
"peak chart\npositions\nus" number,
"peak chart\npositions\nus r&b" number
) | what year was clayton 's first album ? | SELECT MIN("year") FROM table_204_394 | squall |
CREATE TABLE table_57621 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School/Club Team" text
) | What was the pick number when mark hayes was drafted? | SELECT "Pick" FROM table_57621 WHERE "Player" = 'mark hayes' | wikisql |
CREATE TABLE table_name_8 (
date VARCHAR,
opponent VARCHAR
) | What day was the opponent Austria? | SELECT date FROM table_name_8 WHERE opponent = "austria" | sql_create_context |
CREATE TABLE table_30722 (
"Athens XI" text,
"PIFA Colaba FC u-17" text,
"Tata Power" text,
"Dadar XI \u2018B\u2019" text,
"IDBI" text,
"World Network Services" text,
"United FC" text,
"Good Shepherd" text
) | what is the dadar xi b where the good shepherd is sea liner fc? | SELECT "Dadar XI \u2018B\u2019" FROM table_30722 WHERE "Good Shepherd" = 'Sea Liner FC' | 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
) | For those records from the products and each product's manufacturer, give me the comparison about the average of code over the headquarter , and group by attribute headquarter, and could you order in desc by the x axis? | SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T2.Headquarter DESC | nvbench |
CREATE TABLE table_59176 (
"Week 1" text,
"Week 2" text,
"Week 3" text,
"Week 4" text,
"Week 5" text
) | When Star Zemba was featured in Week 3, who was the cyber girl for Week 2? | SELECT "Week 2" FROM table_59176 WHERE "Week 3" = 'star zemba' | wikisql |
CREATE TABLE table_name_29 (
college VARCHAR,
cfl_team VARCHAR
) | Which college did the Calgary Stampeders recruit from? | SELECT college FROM table_name_29 WHERE cfl_team = "calgary stampeders" | sql_create_context |
CREATE TABLE table_name_10 (
attendance INTEGER,
time VARCHAR
) | What was the least attendance when the time was 3:15? | SELECT MIN(attendance) FROM table_name_10 WHERE time = "3:15" | sql_create_context |
CREATE TABLE table_203_465 (
id number,
"name" text,
"population (2002 census)" number,
"population (2007 estimation)" number,
"population (2011 census)" number,
"area (km2)" number,
"density (pop/km2)" number
) | how many people lived in predeal in 2011 ? | SELECT "population (2011 census)" FROM table_203_465 WHERE "name" = 'predeal' | squall |
CREATE TABLE table_name_76 (
drawn INTEGER,
lost VARCHAR,
position VARCHAR,
team VARCHAR
) | How many draws did clitheroe have when their position was less than 12 and they lost less than 4 times? | SELECT SUM(drawn) FROM table_name_76 WHERE position < 12 AND team = "clitheroe" AND lost > 4 | sql_create_context |
CREATE TABLE table_16423070_4 (
track_ VARCHAR,
_field VARCHAR,
swimming VARCHAR,
volleyball VARCHAR
) | which country won swimming track & field when lexington won swimming and madison won volleyball | SELECT track_ & _field FROM table_16423070_4 WHERE swimming = "Lexington" AND volleyball = "Madison" | sql_create_context |
CREATE TABLE table_11547 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | How many bronzes for the nation with 2 golds and ranked below 2? | SELECT SUM("Bronze") FROM table_11547 WHERE "Gold" = '2' AND "Rank" > '2' | wikisql |
CREATE TABLE table_203_451 (
id number,
"year" number,
"film" text,
"role" text,
"language" text,
"notes" text
) | what other movies was aggarwal in the same year as her role in veera ? | SELECT "film" FROM table_203_451 WHERE "film" <> 'veera' AND "year" = (SELECT "year" FROM table_203_451 WHERE "film" = 'veera') | squall |
CREATE TABLE table_204_585 (
id number,
"year" text,
"player" text,
"high school" text,
"college" text,
"nba/aba draft" text
) | who won the last one ? | SELECT "player" FROM table_204_585 ORDER BY "year" DESC LIMIT 1 | squall |
CREATE TABLE table_21420 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
) | What was the team's position when the new manager was Lucas Alcaraz? | SELECT "Position in table" FROM table_21420 WHERE "Replaced by" = 'Lucas Alcaraz' | wikisql |
CREATE TABLE table_52142 (
"Year" real,
"Single" text,
"U.S. Country" text,
"U.S." text,
"U.S. AC" text,
"Album" text
) | What US Country released an album of singles only in 1967? | SELECT "U.S. Country" FROM table_52142 WHERE "Album" = 'singles only' AND "Year" = '1967' | wikisql |
CREATE TABLE table_name_73 (
name VARCHAR,
laid_down VARCHAR,
commissioned VARCHAR
) | Tell me the name for commissioned of 30 august 1941 and laid down of 22 september 1939 | SELECT name FROM table_name_73 WHERE laid_down = "22 september 1939" AND commissioned = "30 august 1941" | 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,
... | how many hours has it been since patient 94229 stayed in the careunit tsicu for the first time on their current hospital visit? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 94229 AND admissions.dischtime IS NULL) AND transfers.careunit = 'tsicu' ORDER BY transfers.intime LIMIT 1 | mimic_iii |
CREATE TABLE table_56961 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | How many people attended the game where the home team scored 8.10 (58)? | SELECT MAX("Crowd") FROM table_56961 WHERE "Home team score" = '8.10 (58)' | wikisql |
CREATE TABLE table_name_58 (
bronze INTEGER,
nation VARCHAR
) | How many total bronze medals did Canada receive? | SELECT MAX(bronze) FROM table_name_58 WHERE nation = "canada" | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom te... | count the number of patients who had been tested until 1 year ago for rbc, ascites. | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'rbc, ascites') AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(), '-1 year')) | mimic_iii |
CREATE TABLE table_16677738_1 (
year INTEGER
) | What is the lowest overall year? | SELECT MIN(year) FROM table_16677738_1 | sql_create_context |
CREATE TABLE table_75027 (
"Call sign" text,
"Analog channel" text,
"Digital channel" text,
"Virtual channel" text,
"Network" text,
"Station Ownership" text
) | Station Ownership of eicb tv, and a Call sign of ktcj-ld is what virtual network? | SELECT "Virtual channel" FROM table_75027 WHERE "Station Ownership" = 'eicb tv' AND "Call sign" = 'ktcj-ld' | wikisql |
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
)
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
) | Give me a histogram for how old is each gender, on average?, rank in asc by the x-axis. | SELECT gender, AVG(age) FROM Person GROUP BY gender ORDER BY gender | nvbench |
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_CLINIC_ID text,
MED_DIRE_CD tex... | 医生负责医疗就诊12315818260出院诊断的编号及名称都是什么? | SELECT gwyjzb.OUT_DIAG_DOC_CD, gwyjzb.OUT_DIAG_DOC_NM FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '12315818260' UNION SELECT fgwyjzb.OUT_DIAG_DOC_CD, fgwyjzb.OUT_DIAG_DOC_NM FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '12315818260' | css |
CREATE TABLE table_name_56 (
score VARCHAR,
tie_no VARCHAR
) | What was the score for the game with a tie no of 1? | SELECT score FROM table_name_56 WHERE tie_no = "1" | sql_create_context |
CREATE TABLE table_name_43 (
nomination VARCHAR,
year INTEGER
) | What was the nomination in a year earlier than 2009? | SELECT nomination FROM table_name_43 WHERE year < 2009 | sql_create_context |
CREATE TABLE table_52144 (
"Result" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Location" text
) | What is the result of the fight that had a tko (low kicks)? | SELECT "Result" FROM table_52144 WHERE "Method" = 'tko (low kicks)' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (
medicationid n... | what is the name of the output that patient 029-16737 first got until 05/06/2104? | 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 = '029-16737')) AND intakeoutput.cellpath LIKE '%output%' AND S... | eicu |
CREATE TABLE table_13833770_3 (
district VARCHAR,
party VARCHAR,
elected VARCHAR
) | what's the district with party being republican and elected being 1998 | SELECT district FROM table_13833770_3 WHERE party = "Republican" AND elected = 1998 | sql_create_context |
CREATE TABLE table_name_14 (
finalist VARCHAR,
week VARCHAR
) | What is the May 7 finalist? | SELECT finalist FROM table_name_14 WHERE week = "may 7" | sql_create_context |
CREATE TABLE table_75124 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | What's the try bonus that had 423 points? | SELECT "Try bonus" FROM table_75124 WHERE "Points for" = '423' | wikisql |
CREATE TABLE Catalogs (
catalog_id INTEGER,
catalog_name VARCHAR(50),
catalog_publisher VARCHAR(80),
date_of_publication DATETIME,
date_of_latest_revision DATETIME
)
CREATE TABLE Catalog_Contents_Additional_Attributes (
catalog_entry_id INTEGER,
catalog_level_number INTEGER,
attribute_i... | Find the name and capacity of products with price greater than 700 (in USD). Show bar chart. | SELECT catalog_entry_name, capacity FROM Catalog_Contents WHERE price_in_dollars > 700 | nvbench |
CREATE TABLE table_name_23 (
mascot VARCHAR,
enrollment INTEGER
) | What Mascot has an Enrollment greater than 2,464? | SELECT mascot FROM table_name_23 WHERE enrollment > 2 OFFSET 464 | sql_create_context |
CREATE TABLE table_33403 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | How many silver medals were won with a total medal of 3 and a rank above 9? | SELECT AVG("Silver") FROM table_33403 WHERE "Total" < '3' AND "Rank" > '9' | wikisql |
CREATE TABLE table_name_41 (
loan_club VARCHAR,
start_source VARCHAR,
ended VARCHAR
) | What is the loan club with bbc sport as the start source and ended in 3 February? | SELECT loan_club FROM table_name_41 WHERE start_source = "bbc sport" AND ended = "3 february" | sql_create_context |
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight re... | Visualize a pie chart about the proportion of Sex and the amount of Sex. | SELECT Sex, COUNT(Sex) FROM people GROUP BY Sex | nvbench |
CREATE TABLE table_50482 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Notes" text
) | What is the venue of the team race that was after 2008? | SELECT "Venue" FROM table_50482 WHERE "Year" > '2008' AND "Notes" = 'team' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.