context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number... | Percentage of AngularJS question without vote in the 5 days. | SELECT CASE WHEN Votes.Id IS NULL THEN 1 ELSE 0 END AS Unvoted, VoteTypes.Name, Posts.Score, Posts.Title FROM Posts LEFT JOIN Votes ON Posts.Id = Votes.PostId JOIN PostTags ON Posts.Id = PostTags.PostId JOIN Tags ON PostTags.TagId = Tags.Id JOIN VoteTypes ON VoteTypes.Id = Votes.VoteTypeId WHERE Posts.PostTypeId = 1 AN... | sede |
CREATE TABLE PostTypes (
Id number,
Name text
)
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,
ProfileImage... | SO - Total Posts by Database Server Per Month - DB2. | SELECT CONCAT(YEAR(P.CreationDate), '-', MONTH(P.CreationDate)) AS YearMonth, 'DB2' AS TagName, COUNT(*) AS PostCount FROM Posts AS P INNER JOIN PostTags AS PT ON (P.Id = PT.PostId) INNER JOIN Tags AS T ON (PT.TagId = T.Id) WHERE T.TagName LIKE 'db2%' GROUP BY YEAR(P.CreationDate), MONTH(P.CreationDate) ORDER BY YEAR(P... | sede |
CREATE TABLE table_name_74 (
sensor_res VARCHAR,
_size VARCHAR,
model VARCHAR
) | Name the sensor res for model of s9200 | SELECT sensor_res, _size FROM table_name_74 WHERE model = "s9200" | sql_create_context |
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_id varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduct... | What professor teaches computing infrastructure courses ? | SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN area ON course_offering.course_id = area.course_id WHERE area.area LIKE '%... | advising |
CREATE TABLE editor (
Editor_ID int,
Name text,
Age real
)
CREATE TABLE journal_committee (
Editor_ID int,
Journal_ID int,
Work_Type text
)
CREATE TABLE journal (
Journal_ID int,
Date text,
Theme text,
Sales int
) | Display a bar chart for the names and the ages of editors, sort Y-axis in ascending order please. | SELECT Name, Age FROM editor ORDER BY Age | nvbench |
CREATE TABLE table_16569 (
"Character" text,
"Portrayed by" text,
"First appearance" text,
"Last appearance" text,
"Duration" text,
"Episodes" text
) | On which episode did actress Sela Ward make her last appearance? | SELECT "Last appearance" FROM table_16569 WHERE "Portrayed by" = 'Sela Ward' | wikisql |
CREATE TABLE table_name_90 (
cardinal_direction VARCHAR,
english VARCHAR
) | What is the cardinal direction of Wednesday p.m. in English? | SELECT cardinal_direction FROM table_name_90 WHERE english = "wednesday p.m." | sql_create_context |
CREATE TABLE table_71543 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text
) | What was the loss of the game attended by 14,691? | SELECT "Loss" FROM table_71543 WHERE "Attendance" = '14,691' | wikisql |
CREATE TABLE table_1035 (
"Player" text,
"Position" text,
"Starter" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
) | How many field goals were made by someone playing position of right end? | SELECT COUNT("Field goals") FROM table_1035 WHERE "Position" = 'Right end' | wikisql |
CREATE TABLE table_name_55 (
week INTEGER,
date VARCHAR
) | What week was September 24, 2000 on? | SELECT SUM(week) FROM table_name_55 WHERE date = "september 24, 2000" | sql_create_context |
CREATE TABLE customer (
customer_id number,
store_id number,
first_name text,
last_name text,
email text,
address_id number,
active boolean,
create_date time,
last_update time
)
CREATE TABLE store (
store_id number,
manager_staff_id number,
address_id number,
last_up... | Which language does the film AIRPORT POLLOCK use? List the language name. | SELECT T2.name FROM film AS T1 JOIN language AS T2 ON T1.language_id = T2.language_id WHERE T1.title = 'AIRPORT POLLOCK' | spider |
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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | provide the number of patients whose ethnicity is hispanic or latino and item id is 51132? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND lab.itemid = "51132" | mimicsql_data |
CREATE TABLE table_203_723 (
id number,
"year" number,
"song" text,
"us hot 100" number,
"us msr" number,
"us a.c." number,
"can" number,
"uk singles" number,
"album" text
) | what song was a hit in 1995 after i live my life for you ? | SELECT "song" FROM table_203_723 WHERE "year" = 1995 AND id > (SELECT id FROM table_203_723 WHERE "song" = '"i live my life for you"') | squall |
CREATE TABLE rooms (
roomid text,
roomname text,
beds number,
bedtype text,
maxoccupancy number,
baseprice number,
decor text
)
CREATE TABLE reservations (
code number,
room text,
checkin text,
checkout text,
rate number,
lastname text,
firstname text,
adults... | Find the number of rooms with king bed for each decor type. | SELECT decor, COUNT(*) FROM rooms WHERE bedtype = "King" GROUP BY decor | spider |
CREATE TABLE table_22669044_9 (
team VARCHAR,
high_assists VARCHAR
) | Name the team for kirk hinrich , derrick rose , john salmons (6) | SELECT team FROM table_22669044_9 WHERE high_assists = "Kirk Hinrich , Derrick Rose , John Salmons (6)" | 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... | People who has both iOS and Android badges. | SELECT Users.Id FROM Users, Badges WHERE Badges.UserId = Users.Id AND (Badges.Name = 'android') | sede |
CREATE TABLE course (
title VARCHAR,
credits VARCHAR
) | List the names of all courses ordered by their titles and credits. | SELECT title FROM course ORDER BY title, credits | sql_create_context |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,... | count the number of patients who were diagnosed with fracture of ilium-closed but did not come back to hospital within 2 months until 2103. | SELECT (SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'fracture o... | mimic_iii |
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... | give me the number of patients whose days of hospital stay is greater than 13 and drug name is tizanidine? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "13" AND prescriptions.drug = "Tizanidine" | mimicsql_data |
CREATE TABLE table_33722 (
"Year" real,
"Kit Supplier" text,
"Sponsor" text,
"Shirt Printing" text,
"Notes" text
) | What are the notes for the shirt that said Pavv before 2005? | SELECT "Notes" FROM table_33722 WHERE "Shirt Printing" = 'pavv' AND "Year" < '2005' | wikisql |
CREATE TABLE table_54907 (
"From" text,
"Adult Rate" text,
"Development Rate" text,
"16-17 Year Olds Rate" text,
"Apprentice Rate" text
) | What was the adult rate when the 16-17 year old rate was 3.40? | SELECT "Adult Rate" FROM table_54907 WHERE "16-17 Year Olds Rate" = '£3.40' | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (... | count the number of patients whose age is less than 43 and diagnoses short title is prob-head/neck/trunk nos? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "43" AND diagnoses.short_title = "Prob-head/neck/trunk NOS" | mimicsql_data |
CREATE TABLE table_name_57 (
right_ascension___j2000__ VARCHAR,
constellation VARCHAR,
ngc_number VARCHAR
) | What is the right ascension of Pegasus with a 7343 NGC? | SELECT right_ascension___j2000__ FROM table_name_57 WHERE constellation = "pegasus" AND ngc_number = "7343" | sql_create_context |
CREATE TABLE table_name_29 (
record VARCHAR,
score VARCHAR
) | What is the record of the game with a score of 101 92? | SELECT record FROM table_name_29 WHERE score = "101–92" | sql_create_context |
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 tested for ascites, how many of them had dysthymic disorder? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Dysthymic disorder" AND lab.fluid = "Ascites" | mimicsql_data |
CREATE TABLE table_name_7 (
goals INTEGER,
nat VARCHAR,
transfer_fee VARCHAR
) | Name the highest goals for youth system and ita | SELECT MAX(goals) FROM table_name_7 WHERE nat = "ita" AND transfer_fee = "youth system" | sql_create_context |
CREATE TABLE table_name_15 (
course VARCHAR,
type VARCHAR
) | Which course has km (mi) as a type? | SELECT course FROM table_name_15 WHERE type = "km (mi)" | sql_create_context |
CREATE TABLE table_name_83 (
site VARCHAR,
attendance VARCHAR,
date VARCHAR
) | What Site has Attendance of 53,000, and a Date of october 21, 1967? | SELECT site FROM table_name_83 WHERE attendance = "53,000" AND date = "october 21, 1967" | sql_create_context |
CREATE TABLE table_72678 (
"Player" text,
"G" real,
"Tackles" real,
"Solo" real,
"Assts" real,
"Sacks" text,
"Int" real,
"Int yards" real,
"Int avg." text,
"Int TD" real,
"Fum. rec" real,
"Fum. rec TD" real
) | Name the most tackles for 3.5 sacks | SELECT MAX("Tackles") FROM table_72678 WHERE "Sacks" = '3.5' | wikisql |
CREATE TABLE Financial_Transactions (
transaction_id INTEGER,
previous_transaction_id INTEGER,
account_id INTEGER,
card_id INTEGER,
transaction_type VARCHAR(15),
transaction_date DATETIME,
transaction_amount DOUBLE,
transaction_comment VARCHAR(255),
other_transaction_details VARCHAR(... | Plot a scatter chart, customer id by card_number. | SELECT customer_id, card_number FROM Customers_Cards | nvbench |
CREATE TABLE table_70994 (
"Week" real,
"Date" text,
"Kickoff ( ET )" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game Site" text
) | Who was the opponent at the Steelers game that had a result of l 20 17? | SELECT "Opponent" FROM table_70994 WHERE "Result" = 'l 20–17' | wikisql |
CREATE TABLE table_name_59 (
date VARCHAR,
opponents_in_the_final VARCHAR
) | What is Date, when Opponents In The Final, is Maria-Fernanda Alves St phanie Dubois? | SELECT date FROM table_name_59 WHERE opponents_in_the_final = "maria-fernanda alves stéphanie dubois" | sql_create_context |
CREATE TABLE table_name_92 (
week INTEGER,
result VARCHAR,
attendance VARCHAR
) | Which Week is the highest one that has a Result of w 23-20, and an Attendance smaller than 34,127? | SELECT MAX(week) FROM table_name_92 WHERE result = "w 23-20" AND attendance < 34 OFFSET 127 | sql_create_context |
CREATE TABLE table_name_79 (
city___state VARCHAR,
event_circuit VARCHAR
) | What city is the hidden valley raceway in? | SELECT city___state FROM table_name_79 WHERE event_circuit = "hidden valley raceway" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CRE... | what is the daily average g tube output that patient 006-171217 has had in 01/last year? | SELECT AVG(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-171217')) AND intakeoutput.celllabel = 'g tu... | eicu |
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 job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about employee_id over the phone_number by a bar chart. | SELECT PHONE_NUMBER, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE table_204_435 (
id number,
"sport" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | what sport has more silver medals : wrestling or rowing | SELECT "sport" FROM table_204_435 WHERE "sport" IN ('wrestling', 'rowing') ORDER BY "silver" DESC LIMIT 1 | squall |
CREATE TABLE table_204_131 (
id number,
"tops design code" text,
"electrical system" text,
"max speed" text,
"weight" text,
"brakes" text,
"route availability" number,
"notes" text
) | is 08-0av heavier than 08-0lx ? | SELECT (SELECT "weight" FROM table_204_131 WHERE "tops design code" = '08-0av') > (SELECT "weight" FROM table_204_131 WHERE "tops design code" = '08-0lx') | squall |
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... | Stacked bar chart of school_id for with each ACC_Home in each acc road, list in desc by the names. | SELECT ACC_Road, School_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY ACC_Road DESC | nvbench |
CREATE TABLE table_name_42 (
total_medals VARCHAR,
ensemble VARCHAR,
silver_medals VARCHAR
) | What was the total number of medals received by James Logan High School when it received less than 1 silver medal? | SELECT COUNT(total_medals) FROM table_name_42 WHERE ensemble = "james logan high school" AND silver_medals < 1 | sql_create_context |
CREATE TABLE table_72581 (
"Cardinal direction" text,
"Burmese" text,
"Sanskrit" text,
"English" text,
"Planet" text,
"Sign" text
) | What is the Burmese term associated with a cardinal direction of west? | SELECT "Burmese" FROM table_72581 WHERE "Cardinal direction" = 'West' | wikisql |
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... | 小儿麻醉科因疾病T40.906而住院花费所以的平均费用是多少钱从2003年5月11日开始到2016年12月20日结束? | SELECT AVG(zyb.MED_CLINIC_ID) FROM zyb WHERE zyb.MED_SER_ORG_NO = '小儿麻醉科' AND zyb.IN_HOSP_DAYS BETWEEN '2003-05-11' AND '2016-12-20' AND zyb.IN_DIAG_DIS_NM = 'T40.906' | css |
CREATE TABLE table_39269 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Attendance" text
) | When is it has 15,557 Attendances? | SELECT "Date" FROM table_39269 WHERE "Attendance" = '15,557' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | give me the number of patients whose insurance is private and diagnoses icd9 code is 45341? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Private" AND diagnoses.icd9_code = "45341" | mimicsql_data |
CREATE TABLE table_name_34 (
city_of_license VARCHAR,
resolution VARCHAR,
official_website VARCHAR
) | Name the city of license with resolution of sd 480i and official website of telemundo.com | SELECT city_of_license FROM table_name_34 WHERE resolution = "sd 480i" AND official_website = "telemundo.com" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | what is days of hospital stay and primary disease of subject id 8323? | SELECT demographic.days_stay, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "8323" | mimicsql_data |
CREATE TABLE table_name_39 (
total INTEGER,
bronze VARCHAR,
gold VARCHAR,
rank VARCHAR
) | What is the average total for teams with more than 1 gold, ranked over 3 and more than 3 bronze? | SELECT AVG(total) FROM table_name_39 WHERE gold > 1 AND rank > 3 AND bronze > 3 | sql_create_context |
CREATE TABLE table_22707 (
"Period" text,
"Live births per year" text,
"Deaths per year" text,
"Natural change per year" text,
"CBR*" text,
"CDR*" text,
"NC*" text,
"TFR*" text,
"IMR*" real,
"Life expectancy total" text,
"Life expectancy males" text,
"Life expectancy fema... | How many live births per year are there in the period where the life expectancy for females is 73.3? | SELECT "Live births per year" FROM table_22707 WHERE "Life expectancy females" = '73.3' | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | how many patients whose gender is m and days of hospital stay is greater than 7? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.days_stay > "7" | mimicsql_data |
CREATE TABLE table_name_67 (
draw INTEGER,
performer VARCHAR,
points VARCHAR
) | Which Draw has a Performer of jenny newman, and Points smaller than 77? | SELECT AVG(draw) FROM table_name_67 WHERE performer = "jenny newman" AND points < 77 | sql_create_context |
CREATE TABLE table_name_75 (
home_team VARCHAR,
away_team VARCHAR
) | Which team played as the home team when north melbourne played as away? | SELECT home_team FROM table_name_75 WHERE away_team = "north melbourne" | sql_create_context |
CREATE TABLE table_name_7 (
score VARCHAR,
home VARCHAR
) | What was the score for the game with FK Bratstvo as home team? | SELECT score FROM table_name_7 WHERE home = "fk bratstvo" | 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 ... | tell me the percentile of hematocrit 35.0 among all patients of the same age as patient 99791 on their first hospital visit? | SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'hematocrit') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.ag... | mimic_iii |
CREATE TABLE table_name_61 (
set_2 VARCHAR,
set_1 VARCHAR
) | What shows for set 2 when Set 1 is 29 27? | SELECT set_2 FROM table_name_61 WHERE set_1 = "29–27" | sql_create_context |
CREATE TABLE table_67167 (
"Pick #" text,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | What team draft a player from Canada that was picked #43 and plays right wing? | SELECT "NHL team" FROM table_67167 WHERE "Nationality" = 'canada' AND "Position" = 'right wing' AND "Pick #" = '43' | wikisql |
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 TABLE employee (
eid number(9,0),
name varchar2(30),
salary number(10,2)
)
CREATE... | Show me distance by name in a histogram, and order names from low to high order please. | SELECT name, distance FROM aircraft ORDER BY name | nvbench |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE chartevents ... | what was the first time that patient 1249 had the maximum arterial bp [systolic] until 07/05/2105? | SELECT chartevents.charttime 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 = 1249)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial ... | mimic_iii |
CREATE TABLE table_name_39 (
association VARCHAR,
result VARCHAR,
nominee VARCHAR,
year VARCHAR
) | What was the association for Indonesian Idol after 2005 with a Nominated Result? | SELECT association FROM table_name_39 WHERE nominee = "indonesian idol" AND year > 2005 AND result = "nominated" | sql_create_context |
CREATE TABLE table_74716 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | What is the largest crowd size at a match against the Chicago Cardinals after Week 10 of the season? | SELECT MAX("Attendance") FROM table_74716 WHERE "Opponent" = 'chicago cardinals' AND "Week" > '10' | wikisql |
CREATE TABLE table_name_51 (
laps INTEGER,
driver VARCHAR
) | What is the highest number of laps for chris amon? | SELECT MAX(laps) FROM table_name_51 WHERE driver = "chris amon" | sql_create_context |
CREATE TABLE table_name_51 (
total INTEGER,
tour VARCHAR,
giro VARCHAR
) | The sun of total that has a tour of 7 and a Giro smaller than 3 is 12. | SELECT SUM(total) FROM table_name_51 WHERE tour = 7 AND giro < 3 | sql_create_context |
CREATE TABLE table_41411 (
"Name" text,
"Status" text,
"Authors" text,
"Location" text,
"Notes" text
) | Which Notes has Authors of zhou clarke zhang? | SELECT "Notes" FROM table_41411 WHERE "Authors" = 'zhou clarke zhang' | wikisql |
CREATE TABLE advisor (
s_ID varchar(5),
i_ID varchar(5)
)
CREATE TABLE instructor (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
salary numeric(8,2)
)
CREATE TABLE teaches (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric... | Return a histogram on what are the names and budgets of departments with budgets greater than the average?, order by the budget from high to low. | SELECT dept_name, budget FROM department WHERE budget > (SELECT AVG(budget) FROM department) ORDER BY budget DESC | nvbench |
CREATE TABLE table_25800134_18 (
series__number INTEGER,
season__number VARCHAR
) | name the most series number for season 22 | SELECT MAX(series__number) FROM table_25800134_18 WHERE season__number = 22 | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,... | how many times has the zofran been ordered for patient 006-66039 since 179 months ago? | SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-66039')) AND medication.drugname = 'zofran' AND DATETIME(medication.drugst... | eicu |
CREATE TABLE table_name_87 (
opponent VARCHAR,
week VARCHAR,
date VARCHAR
) | Who was the opponent for the game taht was before week 5 on October 10, 1954? | SELECT opponent FROM table_name_87 WHERE week < 5 AND date = "october 10, 1954" | sql_create_context |
CREATE TABLE table_1875157_2 (
starts INTEGER,
winnings VARCHAR
) | How many starts were there when the winnings are $690,321? | SELECT MIN(starts) FROM table_1875157_2 WHERE winnings = "$690,321" | sql_create_context |
CREATE TABLE table_41747 (
"Variant id" text,
"5\u2019UTR splice" text,
"Coding" text,
"3\u2019UTR sequence" text,
"GenBank id" text
) | Which coding's variant id is abd'1a 3? | SELECT "Coding" FROM table_41747 WHERE "Variant id" = 'abd''1a 3' | wikisql |
CREATE TABLE has_amenity (
dormid number,
amenid number
)
CREATE TABLE dorm (
dormid number,
dorm_name text,
student_capacity number,
gender text
)
CREATE TABLE lives_in (
stuid number,
dormid number,
room_number number
)
CREATE TABLE student (
stuid number,
lname text,
... | How many girl students who are younger than 25? | SELECT COUNT(*) FROM student WHERE sex = 'F' AND age < 25 | spider |
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 prescriptions... | give me the number of patients whose gender is f and drug code is azit500i? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "F" AND prescriptions.formulary_drug_cd = "AZIT500I" | mimicsql_data |
CREATE TABLE table_name_24 (
year INTEGER,
wins INTEGER
) | What is the lowest year that have wins greater than 0? | SELECT MIN(year) FROM table_name_24 WHERE wins > 0 | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartr... | how did patient 027-4674 get admitted to the hospital for the first time until 1 year ago? | SELECT patient.hospitaladmitsource FROM patient WHERE patient.uniquepid = '027-4674' AND DATETIME(patient.hospitaladmittime) <= DATETIME(CURRENT_TIME(), '-1 year') ORDER BY patient.hospitaladmittime LIMIT 1 | eicu |
CREATE TABLE table_47400 (
"Position" real,
"Club" text,
"Played" real,
"Points" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
) | What is the total number of goals when there are 3 draws, more than 18 losses, and played is smaller than 38? | SELECT COUNT("Goals for") FROM table_47400 WHERE "Draws" = '3' AND "Losses" > '18' AND "Played" < '38' | wikisql |
CREATE TABLE table_36082 (
"Name" text,
"Species Specific" text,
"Intra-molecular structure" text,
"Comparative" text,
"Link" text
) | Which Name has an Intra-molecular structure of no, and a Link of webserver, and a Comparative of no? | SELECT "Name" FROM table_36082 WHERE "Intra-molecular structure" = 'no' AND "Link" = 'webserver' AND "Comparative" = 'no' | wikisql |
CREATE TABLE table_name_18 (
draw INTEGER,
performer VARCHAR,
televotes VARCHAR
) | Name the lowest Draw which has a Performer of kaliopi and a Televotes larger than 3834? | SELECT MIN(draw) FROM table_name_18 WHERE performer = "kaliopi" AND televotes > 3834 | sql_create_context |
CREATE TABLE table_23812628_1 (
team__number1 VARCHAR,
team__number2 VARCHAR
) | Name the team number 1 for san lorenzo | SELECT team__number1 FROM table_23812628_1 WHERE team__number2 = "San Lorenzo" | sql_create_context |
CREATE TABLE table_35120 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
) | What is the FCC info for the city of Tribune, Kansas? | SELECT "FCC info" FROM table_35120 WHERE "City of license" = 'tribune, kansas' | wikisql |
CREATE TABLE table_name_84 (
score VARCHAR,
date VARCHAR
) | What was the score from the game played on June 22? | SELECT score FROM table_name_84 WHERE date = "june 22" | sql_create_context |
CREATE TABLE bridge (
architect_id int,
id int,
name text,
location text,
length_meters real,
length_feet real
)
CREATE TABLE architect (
id text,
name text,
nationality text,
gender text
)
CREATE TABLE mill (
architect_id int,
id int,
location text,
name text,
... | Give me a histogram for what are the ids and names of the architects who built at least 3 bridges ?, sort by the names in ascending. | SELECT T1.name, T1.id FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id ORDER BY T1.name | nvbench |
CREATE TABLE table_dev_17 (
"id" int,
"gender" string,
"white_blood_cell_count_wbc" int,
"hemoglobin_a1c_hba1c" float,
"cd4_count" int,
"dyslipidemia" bool,
"renal_disease" bool,
"fasting_blood_glucose_fbg" float,
"creatinine_clearance_cl" float,
"platelet_count" float,
"high... | fast blood glucose ( fbg ) >= 7 mmol / l, and hemoglobin a1c ( hgba1c ) >= 7 % | SELECT * FROM table_dev_17 WHERE fasting_blood_glucose_fbg >= 7 AND hemoglobin_a1c_hba1c >= 7 | criteria2sql |
CREATE TABLE zyjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
... | 了解一下开出编号是11178153113的检验报告单的科室编码以及名称 | SELECT zyjybgb.KSBM, zyjybgb.KSMC FROM zyjybgb WHERE zyjybgb.BGDH = '11178153113' UNION SELECT mzjybgb.KSBM, mzjybgb.KSMC FROM mzjybgb WHERE mzjybgb.BGDH = '11178153113' | css |
CREATE TABLE table_name_53 (
winner VARCHAR,
year VARCHAR
) | who was the winner in 2003? | SELECT winner FROM table_name_53 WHERE year = "2003" | sql_create_context |
CREATE TABLE table_203_586 (
id number,
"#" number,
"nation" text,
"qualification tournament" text,
"place in qt" number,
"sailor" text
) | list the nation which participated in the 2008 worlds qualification tournament and hans spitzauer was one of the sailors . | SELECT "nation" FROM table_203_586 WHERE "qualification tournament" = '2008 worlds' AND "sailor" = 'hans spitzauer' | squall |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
... | what is the total dosage of levothyroxine sodium that patient 5887 has been prescribed in 11/this year? | SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5887) AND prescriptions.drug = 'levothyroxine sodium' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 ye... | mimic_iii |
CREATE TABLE table_name_11 (
format VARCHAR,
catalog INTEGER
) | Which Format has a Catalog smaller than 61298? | SELECT format FROM table_name_11 WHERE catalog < 61298 | sql_create_context |
CREATE TABLE table_7859 (
"Position" real,
"Club" text,
"Played" real,
"Points" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
) | What is the average points with less than 30 played? | SELECT AVG("Points") FROM table_7859 WHERE "Played" < '30' | wikisql |
CREATE TABLE table_name_32 (
Id VARCHAR
) | What is the value for 2011 corresponding to a 2007 value of 1r? | SELECT 2011 FROM table_name_32 WHERE 2007 = "1r" | sql_create_context |
CREATE TABLE table_6174 (
"Date" text,
"Tournament" text,
"Location" text,
"Winner" text,
"Score" text,
"1st prize ( $ )" real
) | How many 1st prizes have a Date of aug 17? | SELECT COUNT("1st prize ( $ )") FROM table_6174 WHERE "Date" = 'aug 17' | wikisql |
CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
date_account_opened DATETIME,
account_name VARCHAR(50),
other_account_details VARCHAR(255)
)
CREATE TABLE Product_Categories (
production_type_code VARCHAR(15),
product_type_description VARCHAR(80),
vat_rating DECIMAL(19,4... | Draw a pie chart for what are the first names and ids for customers who have two or more accounts? | SELECT T2.customer_first_name, T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id | nvbench |
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... | 在04年4月10日到2021年8月16日之间患者15314573买西药的次数共是多少? | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '15314573' AND t_kc22.STA_DATE BETWEEN '2004-04-10' AND '2021-08-16' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' | css |
CREATE TABLE table_52213 (
"Year" real,
"Theme" text,
"Artist" text,
"Mintage" text,
"Issue Price" text
) | What is the theme of the Year 2002 which was created by Artist Dan Fell? | SELECT "Theme" FROM table_52213 WHERE "Year" = '2002' AND "Artist" = 'dan fell' | wikisql |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 患者72267378以前就诊的地方在哪? | SELECT txmzjzjlb.YLJGDM FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE hz_info.RYBH = '72267378' UNION SELECT ftxmzjzjlb.YLJGDM FROM hz_info JOIN ftxmzjzjlb ON hz_info.YLJGDM = ftxmzjzjlb.YLJGDM AND hz_info.KH = ftxmzjzjlb.KH AND hz_i... | css |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
Mark... | Deleted user's answers (w. scores & attributed questions). | SELECT a.Id AS link, q.Title AS title, q.Body AS question, q.OwnerUserId AS asker, q.OwnerDisplayName AS asker_name, a.Body AS answer, q.Tags AS tags, a.Score AS score FROM Posts AS q INNER JOIN Posts AS a ON q.Id = a.ParentId AND a.PostTypeId = 2 AND q.PostTypeId = 1 WHERE a.CommunityOwnedDate IS NULL AND a.OwnerDispl... | sede |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE fare (
fare_id int,
from_... | i wish to book a flight from PITTSBURGH to ATLANTA COACH discount fare | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND F... | atis |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
... | 在哪些医疗记录中病患68782989被开出过金额高于4261.3元的药品?这些对应的就诊编号为多少? | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '68782989' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 4261.3) | css |
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
)
CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
) | Stack bar chart of the number of type vs Nationality based on type, and list x-axis in descending order. | SELECT Type, COUNT(Type) FROM ship GROUP BY Nationality, Type ORDER BY Type DESC | nvbench |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE intakeoutput (
in... | how many days have passed since patient 007-15837 had a d5w intake for the first time on the current intensive care unit visit? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid =... | eicu |
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_jybgb (
YLJGDM_ZYJZJLB te... | 门诊诊断的患者为疾病G14.222的检测指标872554数值的平均值以及最值都分别有多少? | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDBM = 'G14.222' AND jyjgzbb.JCZBDM = '872554' | css |
CREATE TABLE table_23425 (
"Team" text,
"Province" text,
"Owner(s)" text,
"Price" text,
"Captain" text,
"Head coach" text,
"Icon Player" text
) | In how many teams is Waqar Younis the head coach? | SELECT COUNT("Team") FROM table_23425 WHERE "Head coach" = 'Waqar Younis' | wikisql |
CREATE TABLE table_name_48 (
class VARCHAR,
wheel_arrangement VARCHAR,
quantity_made VARCHAR
) | What is the locomotive class that has a wheel arrangement of 2-8-2 and a quantity made of 25? | SELECT class FROM table_name_48 WHERE wheel_arrangement = "2-8-2" AND quantity_made = "25" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.