context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_17 (
venue VARCHAR,
date VARCHAR
) | What was the Venue on November 14, 2007? | SELECT venue FROM table_name_17 WHERE date = "november 14, 2007" | sql_create_context |
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... | 从00年1月29日到17年6月20日病患63021185共花了多少医保钱? | SELECT SUM(t_kc24.PER_ACC_PAY) FROM t_kc24 WHERE t_kc24.PERSON_ID = '63021185' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-01-29' AND '2017-06-20' | css |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,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 locations (
LOCATION_ID decimal(4,0... | For those employees who was hired before 2002-06-21, return a bar chart about the distribution of hire_date and the sum of employee_id bin hire_date by weekday. | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE table_name_85 (
crowd INTEGER,
away_team VARCHAR
) | Which Crowd has a Away team of sydney? | SELECT MAX(crowd) FROM table_name_85 WHERE away_team = "sydney" | sql_create_context |
CREATE TABLE table_54127 (
"Date of Issue" text,
"Denomination" text,
"Design" text,
"Paper Type" text,
"First Day Cover Cancellation" text
) | What's the First Day Cover Cancellation with Denomination of $0.50 and Date of Issue as 13 June 2005? | SELECT "First Day Cover Cancellation" FROM table_54127 WHERE "Denomination" = '$0.50' AND "Date of Issue" = '13 june 2005' | wikisql |
CREATE TABLE table_53144 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What is the grid total for jean-pierre beltoise? | SELECT COUNT("Grid") FROM table_53144 WHERE "Driver" = 'jean-pierre beltoise' | wikisql |
CREATE TABLE table_30118 (
"Episode #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Originalairdate" text,
"Viewers (millions)" text
) | How many million viewers watched episodes prior to episode 2.0? | SELECT "Viewers (millions)" FROM table_30118 WHERE "Episode #" < '2.0' | wikisql |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
C... | Active users with a reputation cutoff. | SELECT Users.Id AS "user_link", Users.Reputation, COUNT(*) AS postnumber FROM Users JOIN Posts ON Users.Id = Posts.OwnerUserId WHERE DATEDIFF(MONTH, Posts.CreationDate, GETDATE()) <= '##AgeCutoffInMonths##' AND Users.Reputation >= '##ReputationCutoff##' GROUP BY Users.Id, Users.Reputation ORDER BY Users.Reputation DESC | sede |
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text 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... | Which courses are to be offered in the Fall or Winter that would meet the PreMajor requirement ? | SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id... | advising |
CREATE TABLE table_14154 (
"Year" real,
"September" text,
"October" text,
"November" text,
"December" text
) | Who is in November after 1988 when Prinzzess is in October? | SELECT "November" FROM table_14154 WHERE "Year" > '1988' AND "October" = 'prinzzess' | wikisql |
CREATE TABLE table_63251 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real
) | Where was a 0-5 game played? | SELECT "Venue" FROM table_63251 WHERE "Result" = '0-5' | wikisql |
CREATE TABLE table_name_79 (
word_form VARCHAR,
ala_lc VARCHAR
) | What is the word form for the ALA-LC transliteration of muay b n? | SELECT word_form FROM table_name_79 WHERE ala_lc = "muay bân" | sql_create_context |
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 prescription... | what is the procedure icd9 code and procedure long title of subject id 813? | SELECT procedures.icd9_code, procedures.long_title FROM procedures WHERE procedures.subject_id = "813" | mimicsql_data |
CREATE TABLE participates_in (
stuid number,
actid number
)
CREATE TABLE activity (
actid number,
activity_name text
)
CREATE TABLE faculty (
facid number,
lname text,
fname text,
rank text,
sex text,
phone number,
room text,
building text
)
CREATE TABLE student (
... | What are ids of the faculty members who not only participate in an activity but also advise a student. | SELECT facid FROM faculty_participates_in INTERSECT SELECT advisor FROM student | spider |
CREATE TABLE table_204_561 (
id number,
"fence" number,
"name" text,
"jockey" text,
"age" number,
"handicap (st-lb)" text,
"starting price" text,
"fate" text
) | what is the total age of what a myth and rough tweed ? | SELECT SUM("age") FROM table_204_561 WHERE "name" IN ('what a myth', 'rough tweed') | squall |
CREATE TABLE table_24399615_3 (
viewers INTEGER,
airdate VARCHAR
) | How many viewers were there for airdate is 22 october 2009? | SELECT MAX(viewers) FROM table_24399615_3 WHERE airdate = "22 October 2009" | 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 procedures (
... | what is age and lab test fluid of subject id 2560? | SELECT demographic.age, lab.fluid FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE table_6522 (
"Stage" real,
"Date" text,
"Route" text,
"Stage Winner" text,
"GC Leader" text
) | Who is the GC leader when Laurent Jalabert was the stage winner and the stage was greater than 6? | SELECT "GC Leader" FROM table_6522 WHERE "Stage Winner" = 'laurent jalabert' AND "Stage" > '6' | wikisql |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, return a scatter chart about the correlation between price and manufacturer . | SELECT Price, Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code | nvbench |
CREATE TABLE table_12619 (
"Position" real,
"Channel" text,
"Analogue terrestrial channel" text,
"Digital terrestrial channel" text,
"Internet" text
) | What is the channel when the analogue terrestrial channel shows n/a, and the internet is itv.com, with a position larger than 6, and digital terrestrial channel is 6 27 (+1)? | SELECT "Channel" FROM table_12619 WHERE "Analogue terrestrial channel" = 'n/a' AND "Internet" = 'itv.com' AND "Position" > '6' AND "Digital terrestrial channel" = '6 27 (+1)' | wikisql |
CREATE TABLE table_58270 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Tell me the away team for venue of western oval | SELECT "Away team" FROM table_58270 WHERE "Venue" = 'western oval' | wikisql |
CREATE TABLE table_29572583_19 (
new_points INTEGER,
status VARCHAR
) | What is listed in new points when status is second round lost to xavier malisse? | SELECT MIN(new_points) FROM table_29572583_19 WHERE status = "Second round lost to Xavier Malisse" | sql_create_context |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | 两千年十二月二十一日到一六年十二月二日,患者尤清润的二氧化碳情况是怎样的 | (SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGD... | css |
CREATE TABLE table_name_51 (
date VARCHAR,
opponent VARCHAR
) | What day did they play cambridge united? | SELECT date FROM table_name_51 WHERE opponent = "cambridge united" | sql_create_context |
CREATE TABLE table_name_30 (
placings INTEGER,
nation VARCHAR,
rank VARCHAR
) | Tell me the lowest placings for United Kingdom and rank less than 13 | SELECT MIN(placings) FROM table_name_30 WHERE nation = "united kingdom" AND rank < 13 | sql_create_context |
CREATE TABLE table_56639 (
"Elector" text,
"Nationality" text,
"Faction" text,
"Order and Title" text,
"Elevated" text,
"Elevator" text
) | What is the Order and Title with a Nationality with roman, and an Elector with matteo orsini rosso? | SELECT "Order and Title" FROM table_56639 WHERE "Nationality" = 'roman' AND "Elector" = 'matteo orsini rosso' | wikisql |
CREATE TABLE table_287659_2 (
region_name VARCHAR,
regional_page__number VARCHAR
) | Which region has a regional page # of 1-3, 5-7, 9-11, 13-15? | SELECT region_name FROM table_287659_2 WHERE regional_page__number = "1-3, 5-7, 9-11, 13-15" | sql_create_context |
CREATE TABLE table_train_195 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"allergy_to_perflutren" bool,
"heart_disease" bool,
"body_mass_index_bmi" float,
"age" float,
"NOUSE" float
) | known hypersensitivity to perflutren ( contained in definity ) | SELECT * FROM table_train_195 WHERE allergy_to_perflutren = 1 | criteria2sql |
CREATE TABLE table_name_91 (
date VARCHAR,
opponent VARCHAR
) | What date has dallas cowboys as the opponent? | SELECT date FROM table_name_91 WHERE opponent = "dallas cowboys" | sql_create_context |
CREATE TABLE table_22815568_2 (
unemployment_rate VARCHAR,
market_income_per_capita VARCHAR
) | What is the unemployment rate for the county with a market income per capita of $20,958? | SELECT COUNT(unemployment_rate) FROM table_22815568_2 WHERE market_income_per_capita = "$20,958" | sql_create_context |
CREATE TABLE table_name_47 (
score VARCHAR,
country VARCHAR
) | What is Score, when Country is 'Scotland'? | SELECT score FROM table_name_47 WHERE country = "scotland" | sql_create_context |
CREATE TABLE table_67125 (
"Year" real,
"Tournament" text,
"Round 1" real,
"Round 2" real,
"Round 3" real,
"Round 4" real,
"Score" real,
"To par" text,
"Place" text,
"Money (\uffe5)" real
) | What is the lowest round with a place of t15 in a year earlier than 1998? | SELECT MIN("Round 1") FROM table_67125 WHERE "Place" = 't15' AND "Year" < '1998' | wikisql |
CREATE TABLE table_name_41 (
school VARCHAR,
player VARCHAR
) | Which School did Player Tyrone Johnson attend? | SELECT school FROM table_name_41 WHERE player = "tyrone johnson" | sql_create_context |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE ReviewTaskStates (
Id number,
Name te... | Which came first? Badge or post?. | WITH first_post AS (SELECT MIN(p.Id) AS PostId, COUNT(DISTINCT p.Id) AS posts, OwnerUserId FROM Posts AS p GROUP BY OwnerUserId) SELECT COUNT(*) AS N, COALESCE(Name, 'none') AS Badge, ROUND(AVG(1.0 * posts), 2) AS avg_posts, ROUND(AVG(1.0 * Score), 2) AS avg_score FROM first_post AS fp JOIN Posts AS p ON fp.PostId = p.... | sede |
CREATE TABLE table_name_48 (
laps VARCHAR,
year VARCHAR
) | Name the total number of Laps for year of 1961 | SELECT COUNT(laps) FROM table_name_48 WHERE year = "1961" | sql_create_context |
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 treatment (
treat... | give me patient 021-100763's total output volume a day before. | SELECT SUM(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 = '021-100763')) AND intakeoutput.cellpath LIKE '%o... | eicu |
CREATE TABLE Products (
Product_ID INTEGER,
Product_Type_Code CHAR(15),
Product_Name VARCHAR(255),
Product_Price DECIMAL(20,4)
)
CREATE TABLE Parties_in_Events (
Party_ID INTEGER,
Event_ID INTEGER,
Role_Code CHAR(15)
)
CREATE TABLE Locations (
Location_ID INTEGER,
Other_Details VAR... | List the number of the names of products that are not in any event, and I want to show by the y-axis in desc. | SELECT Product_Name, COUNT(Product_Name) FROM Products WHERE NOT Product_ID IN (SELECT Product_ID FROM Products_in_Events) GROUP BY Product_Name ORDER BY COUNT(Product_Name) DESC | nvbench |
CREATE TABLE table_name_35 (
enrollment VARCHAR,
university VARCHAR
) | What was the university of akron's enrollment? | SELECT enrollment FROM table_name_35 WHERE university = "university of akron" | sql_create_context |
CREATE TABLE table_name_77 (
place INTEGER,
points INTEGER
) | What is the place when less than 1 point is scored? | SELECT AVG(place) FROM table_name_77 WHERE points < 1 | sql_create_context |
CREATE TABLE table_72833 (
"#" real,
"Title" text,
"Publisher" text,
"Release" text,
"Length" text,
"Hardcover" text,
"Paperback" text
) | Who pubilshed isbn 1-937007-44-8? | SELECT "Publisher" FROM table_72833 WHERE "Hardcover" = 'ISBN 1-937007-44-8' | wikisql |
CREATE TABLE table_name_25 (
current_map VARCHAR,
namesake VARCHAR
) | What is the current map designation of the feature for which derain crater was the namesake? | SELECT current_map FROM table_name_25 WHERE namesake = "derain crater" | 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 course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
... | What classes do I need to take in order to declare a major in HISTORY ? | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%HISTORY%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id | advising |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | what is insurance of subject name paul edwards? | SELECT demographic.insurance FROM demographic WHERE demographic.name = "Paul Edwards" | mimicsql_data |
CREATE TABLE table_22837 (
"Mission No." text,
"Cover Name" text,
"Launch Date" text,
"NSSDC ID No." text,
"Alt. Name" text,
"Camera" text,
"Notes" text
) | What are the alternative name/s of those satellites whose nssdc id number is 1970-054a? | SELECT "Alt. Name" FROM table_22837 WHERE "NSSDC ID No." = '1970-054A' | wikisql |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose... | how much does a procedure known as appl ext fix-tib/fibula cost? | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'procedures_icd' AND cost.event_id IN (SELECT procedures_icd.row_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 = 'appl ext fix-tib/fibula')) | mimic_iii |
CREATE TABLE table_name_44 (
pinyin VARCHAR,
county VARCHAR
) | Which Pinyin has a County of changhua? | SELECT pinyin FROM table_name_44 WHERE county = "changhua" | sql_create_context |
CREATE TABLE table_53141 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | What was the attendance when the Braves were the opponent and the record was 56-53? | SELECT AVG("Attendance") FROM table_53141 WHERE "Opponent" = 'braves' AND "Record" = '56-53' | wikisql |
CREATE TABLE table_name_69 (
bask VARCHAR,
indoor_track VARCHAR,
school VARCHAR
) | What is the basketball status for Valparaiso who has an indoor track status of yes? | SELECT bask FROM table_name_69 WHERE indoor_track = "yes" AND school = "valparaiso" | sql_create_context |
CREATE TABLE table_name_56 (
date VARCHAR,
results¹ VARCHAR
) | On what Date were the Results 4:0? | SELECT date FROM table_name_56 WHERE results¹ = "4:0" | sql_create_context |
CREATE TABLE table_204_756 (
id number,
"year" number,
"team" text,
"games" number,
"combined tackles" number,
"tackles" number,
"assisted tackles" number,
"sacks" number,
"forced fumbles" number,
"fumble recoveries" number,
"fumble return yards" number,
"interceptions" n... | what was the number of combined tackles in 2010 ? | SELECT "combined tackles" FROM table_204_756 WHERE "year" = 2010 | squall |
CREATE TABLE table_name_8 (
score VARCHAR,
date VARCHAR
) | What was the score on May 12, 2008? | SELECT score FROM table_name_8 WHERE date = "may 12, 2008" | sql_create_context |
CREATE TABLE department (
department_id number,
name text,
creation text,
ranking number,
budget_in_billions number,
num_employees number
)
CREATE TABLE head (
head_id number,
name text,
born_state text,
age number
)
CREATE TABLE management (
department_id number,
head_... | What are the maximum and minimum budget of the departments? | SELECT MAX(budget_in_billions), MIN(budget_in_billions) FROM department | spider |
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... | 之前患者93961888做过什么身体检查 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '93961888' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varch... | Which classes are educated by Dr. Linda Mokdad ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course_offering.semester < (SELECT SEMESTERalias0.semester_id FROM semester AS SEMESTERalias0 WHERE SEMESTERalias0.semester = 'WN' AND SEMESTERalias0.year = 2016) AND course.course_id = cour... | advising |
CREATE TABLE table_53387 (
"Constructor" text,
"Chassis" text,
"Engine" text,
"Tyre" text,
"Driver" text,
"Rounds" text
) | What chassis did John Watson drive? | SELECT "Chassis" FROM table_53387 WHERE "Driver" = 'john watson' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
ic... | when did patient 006-21388 leave hospital for the first time during the last year? | SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '006-21388' AND DATETIME(patient.hospitaldischargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY patient.hospitaldischargetime LIMIT 1 | eicu |
CREATE TABLE table_name_29 (
visitor VARCHAR,
home VARCHAR
) | Name the visitor for home of ny rangers | SELECT visitor FROM table_name_29 WHERE home = "ny rangers" | sql_create_context |
CREATE TABLE table_name_42 (
pos INTEGER,
time VARCHAR
) | What position is associated with a Time of 20:39.171? | SELECT AVG(pos) FROM table_name_42 WHERE time = "20:39.171" | sql_create_context |
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... | what was the last procedure patient 013-27480 had during this year. | SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-27480')) AND DATETIME(treatment.treatmenttime, 'start of year... | eicu |
CREATE TABLE table_62493 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What player is from Scotland and has a score of 74-70=144? | SELECT "Player" FROM table_62493 WHERE "Score" = '74-70=144' AND "Country" = 'scotland' | wikisql |
CREATE TABLE table_50904 (
"Team" text,
"Coach" text,
"Home Ground" text,
"Location" text,
"Founded" text
) | Which team was founded in 1970? | SELECT "Team" FROM table_50904 WHERE "Founded" = '1970' | wikisql |
CREATE TABLE table_41603 (
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
) | What is the name of the director of the episode written by robin schwartz & robert tarlow? | SELECT "Directed by" FROM table_41603 WHERE "Written by" = 'robin schwartz & robert tarlow' | wikisql |
CREATE TABLE table_2127933_3 (
year INTEGER
) | What is the earliest year? | SELECT MIN(year) FROM table_2127933_3 | sql_create_context |
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 cost (
costid num... | among those with age 40s this year what was the top three most frequent diagnosis? | SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT... | eicu |
CREATE TABLE table_204_726 (
id number,
"rank" number,
"athlete" text,
"country" text,
"time" text,
"behind" number,
"points" number
) | who is the last athlete ? | SELECT "athlete" FROM table_204_726 ORDER BY "rank" DESC LIMIT 1 | squall |
CREATE TABLE Invoice (
InvoiceId integer,
CustomerId integer,
InvoiceDate datetime,
BillingAddress varchar(70),
BillingCity varchar(40),
BillingState varchar(40),
BillingCountry varchar(40),
BillingPostalCode varchar(10),
Total decimal(10,2)
)
CREATE TABLE Artist (
ArtistId inte... | Plot the number of phone by grouped by phone as a bar graph, and order by the Y-axis in ascending. | SELECT Phone, COUNT(Phone) FROM Employee GROUP BY Phone ORDER BY COUNT(Phone) | nvbench |
CREATE TABLE table_name_19 (
english_title VARCHAR,
director VARCHAR
) | What is the English title for the film directed by George Miller? | SELECT english_title FROM table_name_19 WHERE director = "george miller" | sql_create_context |
CREATE TABLE table_443 (
"Overall Pick #" real,
"AFL Team" text,
"Player" text,
"Position" text,
"College" text
) | What is the afl team of the offensive guard? | SELECT "AFL Team" FROM table_443 WHERE "Position" = 'Offensive Guard' | wikisql |
CREATE TABLE tweets (
id bigint(20),
uid int(11),
text char(140),
createdate datetime
)
CREATE TABLE follows (
f1 int(11),
f2 int(11)
)
CREATE TABLE user_profiles (
uid int(11),
name varchar(255),
email varchar(255),
partitionid int(11),
followers int(11)
) | Find the name of each user and number of tweets tweeted by each of them. Visualize by pie chart. | SELECT name, COUNT(*) FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid | nvbench |
CREATE TABLE table_70349 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | What kind of Chassis supports a Maserati Straight-6 engine with Points greater than 0 and built in the year 1955? | SELECT "Chassis" FROM table_70349 WHERE "Engine" = 'maserati straight-6' AND "Points" > '0' AND "Year" = '1955' | wikisql |
CREATE TABLE table_97 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | What college's team is the Saskatchewan Roughriders? | SELECT "College" FROM table_97 WHERE "CFL Team" = 'Saskatchewan Roughriders' | wikisql |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, return a bar chart about the distribution of job_id and the average of department_id , and group by attribute job_id. | SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID | nvbench |
CREATE TABLE table_60353 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
) | Which team is Team 1 with a Team 2 being Sporting CP? | SELECT "Team 1" FROM table_60353 WHERE "Team 2" = 'sporting cp' | wikisql |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE voting_record (
stuid number,
registration_date text,
election_cycle text,
president_vote number,
vice_president_vote number... | What are the distinct first names of the students who have vice president votes and reside in a city whose city code is not PIT? | SELECT DISTINCT T1.fname FROM student AS T1 JOIN voting_record AS T2 ON T1.stuid = T2.vice_president_vote EXCEPT SELECT DISTINCT fname FROM student WHERE city_code = "PIT" | spider |
CREATE TABLE table_name_25 (
bronze INTEGER,
total INTEGER
) | How many bronzes were won by the country with a total higher than 5? | SELECT SUM(bronze) FROM table_name_25 WHERE total > 5 | sql_create_context |
CREATE TABLE table_name_81 (
silver VARCHAR,
gold VARCHAR,
nation VARCHAR
) | How many silvers are there with more than 2 golds in Germany? | SELECT COUNT(silver) FROM table_name_81 WHERE gold > 2 AND nation = "germany" | sql_create_context |
CREATE TABLE table_73165 (
"Year" text,
"Horsepower" text,
"Torque" text,
"Fuel System" text,
"Compression Ratio" text,
"RPO" text,
"Applications" real
) | What are the torque characteristics of the model made in 1996? | SELECT "Torque" FROM table_73165 WHERE "Year" = '1996' | wikisql |
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
)
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
) | Can you compute the number of people with different job titles? Plot them as a bar graph. | SELECT job, COUNT(job) FROM Person GROUP BY job ORDER BY name | nvbench |
CREATE TABLE table_55663 (
"Tournament" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
) | I want to know the 2001 that has a 2004 of a and 2003 of a with 2012 of 3r | SELECT "2001" FROM table_55663 WHERE "2004" = 'a' AND "2003" = 'a' AND "2012" = '3r' | wikisql |
CREATE TABLE table_name_98 (
other_party VARCHAR,
democratic VARCHAR
) | Who was the other party nominee that ran against Democratic Rick Boucher? | SELECT other_party FROM table_name_98 WHERE democratic = "rick boucher" | sql_create_context |
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM tex... | 病患奚白云所有检验报告单中时间在09年9月21日到12年11月3日内的审核日期时间都是什么时候? | (SELECT jybgb.SHSJ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '奚白云' AND jyb... | css |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | 患者编号38491236在13年11月25日到2019年6月6日期间被开出的所有检查报告单的科室编号以及名称能列举出来吗? | SELECT jybgb.KSBM, jybgb.KSMC FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH... | css |
CREATE TABLE table_56883 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | How many grid numbers were there for the driver Giancarlo Fisichella? | SELECT COUNT("Grid") FROM table_56883 WHERE "Driver" = 'giancarlo fisichella' | wikisql |
CREATE TABLE table_24289 (
"Day" text,
"Stage" text,
"Time (GMT)" text,
"Name" text,
"Length" text,
"Winner" text,
"Time" text,
"Avg. spd." text,
"Rally leader" text
) | In which special stage named Tempo 2 was S bastien Loeb the leader? | SELECT "Stage" FROM table_24289 WHERE "Rally leader" = 'Sébastien Loeb' AND "Name" = 'Tempo 2' | wikisql |
CREATE TABLE table_204_556 (
id number,
"rank" number,
"athlete" text,
"country" text,
"time" text,
"notes" text
) | which country won the gold medal ? | SELECT "country" FROM table_204_556 WHERE id = 1 | squall |
CREATE TABLE table_71992 (
"Rank" real,
"Mountain Peak" text,
"Province" text,
"Mountain Range" text,
"Location" text
) | Which province includes Axel Heiberg Island? | SELECT "Province" FROM table_71992 WHERE "Mountain Range" = 'axel heiberg island' | wikisql |
CREATE TABLE table_name_22 (
for_the_show VARCHAR,
category VARCHAR,
year VARCHAR
) | What show had a nomination for best actor in a lead role female (popular) in 2006? | SELECT for_the_show FROM table_name_22 WHERE category = "best actor in a lead role – female (popular)" AND year = 2006 | sql_create_context |
CREATE TABLE table_name_68 (
fcc_info VARCHAR,
frequency_mhz VARCHAR
) | What is the FCC information of 104.5 fm frequency? | SELECT fcc_info FROM table_name_68 WHERE frequency_mhz = "104.5 fm" | sql_create_context |
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... | 哪些工号及姓名的医务人员在患者03603176就诊过程中为他检测C反应蛋白的,时间是从0一年三月九日到0八年三月十二日 | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGD... | css |
CREATE TABLE gwyjzb (
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,
... | 医疗记录中的医院9572624在出院诊断出牙齿楔状缺损的花费的最少和最多医务费总额大概有多少? | SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '9572624' AND gwyjzb.OUT_DIAG_DIS_NM = '牙齿楔状缺损' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '9572624' AND fgwyjzb.OUT_DI... | css |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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,
... | 通过医疗记录中显示的病患28753994购买了多少次价格都不超过3093.86元的药品?对应的是什么就诊编号? | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '28753994' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 3093.86) | css |
CREATE TABLE film (
film_id SMALLINT UNSIGNED,
title VARCHAR(255),
description TEXT,
release_year YEAR,
language_id TINYINT UNSIGNED,
original_language_id TINYINT UNSIGNED,
rental_duration TINYINT UNSIGNED,
rental_rate DECIMAL(4,2),
length SMALLINT UNSIGNED,
replacement_cost DECI... | What are the payment dates for any payments that have an amount greater than 10 or were handled by a staff member with the first name Elsa, and count them by a bar chart, and order Y in desc order. | SELECT payment_date, COUNT(payment_date) FROM payment WHERE amount > 10 UNION SELECT T1.payment_date FROM payment AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Elsa' ORDER BY COUNT(payment_date) DESC | nvbench |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE Tags (
Id number,
TagName text,
C... | % Answers by author account age. | WITH AnswersByMonth AS (SELECT DATEADD(month, DATEDIFF(month, 0, CreationDate), 0) AS mo, COUNT(*) AS Answers FROM Posts AS a WHERE PostTypeId = 2 GROUP BY DATEADD(month, DATEDIFF(month, 0, CreationDate), 0)) SELECT mo, CAST(DATEDIFF(month, u.CreationDate, CreationDate) / 12 AS VARCHAR(8)) AS AccountAgeYears, COUNT(*) ... | sede |
CREATE TABLE table_name_76 (
attendance INTEGER,
week VARCHAR
) | What is the smallest attendance in week 1? | SELECT MIN(attendance) FROM table_name_76 WHERE week = 1 | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
... | what procedure was performed on patient 032-21820 for the last time in the current hospital encounter? | SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-21820' AND patient.hospitaldischargetime IS NULL)) ORDER BY t... | eicu |
CREATE TABLE table_21489362_2 (
won VARCHAR,
rr1_pts VARCHAR
) | When 3 is the rr1 points what is won score? | SELECT won FROM table_21489362_2 WHERE rr1_pts = 3 | sql_create_context |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 病患18337912在卫生所5431049出院诊断中有哪些疾病的名字包括情感性的医疗就诊记录编号是什么? | SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '18337912' AND MED_SER_ORG_NO = '5431049' AND OUT_DIAG_DIS_NM LIKE '%情感性%' | css |
CREATE TABLE table_name_48 (
score VARCHAR,
december VARCHAR
) | What's the score for December of 30? | SELECT score FROM table_name_48 WHERE december = 30 | sql_create_context |
CREATE TABLE table_name_15 (
losses INTEGER,
draws INTEGER
) | Which Losses have Draws smaller than 0? | SELECT MAX(losses) FROM table_name_15 WHERE draws < 0 | sql_create_context |
CREATE TABLE Shops (
Shop_ID INTEGER,
Shop_Details VARCHAR(255)
)
CREATE TABLE Staff (
Staff_ID INTEGER,
Tourist_Attraction_ID INTEGER,
Name VARCHAR(40),
Other_Details VARCHAR(255)
)
CREATE TABLE Tourist_Attractions (
Tourist_Attraction_ID INTEGER,
Attraction_Type_Code CHAR(15),
Lo... | Show different ways to get to attractions and the number of attractions that can be accessed in the corresponding way in a bar chart, I want to rank total number from high to low order. | SELECT How_to_Get_There, COUNT(*) FROM Tourist_Attractions GROUP BY How_to_Get_There ORDER BY COUNT(*) DESC | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.