context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,... | Find all answers by user to questions with specific tag. | SELECT a.ParentId AS "post_link", q.Tags, a.Score FROM Posts AS q LEFT OUTER JOIN Posts AS a ON q.Id = a.ParentId WHERE a.OwnerUserId = '##UserID##' AND q.Tags LIKE '%<##TagName##>%' ORDER BY a.Score DESC | sede |
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_season int,
Title text,
Directed_by text,
Original_air_date text,
Production_code text
)
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE cine... | Bar chart of how many openning year from each openning year, and could you show in descending by the bars? | SELECT Openning_year, COUNT(Openning_year) FROM cinema GROUP BY Openning_year ORDER BY Openning_year DESC | nvbench |
CREATE TABLE course (
course_id varchar(8),
title varchar(50),
dept_name varchar(20),
credits numeric(2,0)
)
CREATE TABLE time_slot (
time_slot_id varchar(4),
day varchar(1),
start_hr numeric(2),
start_min numeric(2),
end_hr numeric(2),
end_min numeric(2)
)
CREATE TABLE teaches... | What is the relationship between average and greatest capacity for rooms in each building? Show me a scatter chart. | SELECT MAX(capacity), AVG(capacity) FROM classroom GROUP BY building | nvbench |
CREATE TABLE table_name_5 (
rider VARCHAR,
grid VARCHAR
) | WHAT IS THE RIDER WITH A 21 GRID? | SELECT rider FROM table_name_5 WHERE grid = "21" | sql_create_context |
CREATE TABLE School (
School_id text,
School_name text,
Location text,
Mascot text,
Enrollment int,
IHSAA_Class text,
IHSAA_Football_Class text,
County text
)
CREATE TABLE budget (
School_id int,
Year int,
Budgeted int,
total_budget_percent_budgeted real,
Invested in... | Return a bar chart showing the number of schools in each county, order X in ascending order. | SELECT County, COUNT(*) FROM School GROUP BY County ORDER BY County | nvbench |
CREATE TABLE table_train_260 (
"id" int,
"leukocyte_deficiencies" bool,
"bleeding" int,
"hemoglobin_a1c_hba1c" float,
"leukocyte_dysfunction" bool,
"renal_disease" bool,
"hba1c" float,
"serum_creatinine" float,
"NOUSE" float
) | serum creatinine > 1.6 mg / dl | SELECT * FROM table_train_260 WHERE serum_creatinine > 1.6 | criteria2sql |
CREATE TABLE table_1473672_7 (
pick__number VARCHAR,
player VARCHAR
) | How many players had been drafted in front of Yves archambault | SELECT pick__number FROM table_1473672_7 WHERE player = "Yves Archambault" | sql_create_context |
CREATE TABLE table_51880 (
"D 41" text,
"D 42" text,
"D 43" text,
"D 44" text,
"D 45" text,
"D 46" text,
"R 54" text,
"R 53" text,
"R 52" text,
"R 51" text
) | Name the D 42 which has a D 46 of r 26 | SELECT "D 42" FROM table_51880 WHERE "D 46" = 'r 26' | wikisql |
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 ... | Are any of the courses I 've taken among the hardest courses in the YIDDISH department ? | SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN student_record ON student_record.course_id = course.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = 'YIDDISH' AND program_course.workload = (SELECT M... | advising |
CREATE TABLE school (
school_id number,
school text,
location text,
enrollment number,
founded number,
denomination text,
boys_or_girls text,
day_or_boarding text,
year_entered_competition number,
school_colors text
)
CREATE TABLE school_details (
school_id number,
nickn... | Which schools do not have any player? Give me the school locations. | SELECT location FROM school WHERE NOT school_id IN (SELECT school_id FROM player) | spider |
CREATE TABLE table_20499 (
"Position" real,
"Club" text,
"Games played" real,
"Wins" real,
"Draws" real,
"Loses" real,
"Goals scored" real,
"Goals conceded" real,
"Points" real
) | Name the least position | SELECT MIN("Position") FROM table_20499 | wikisql |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_40... | Plot mean meter 100 by grouped by meter 200 as a bar graph, and order in ascending by the meter_200. | SELECT meter_200, AVG(meter_100) FROM swimmer GROUP BY meter_200 ORDER BY meter_200 | nvbench |
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE ... | give me information on flights from ATLANTA to WASHINGTON on wednesday after 1600 and thursday before 900 | 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, date_day, days, flight WHERE ((date_day.day_number = 24 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time... | atis |
CREATE TABLE table_2450 (
"Year" real,
"Division" real,
"League" text,
"Regular Season" text,
"Playoffs" text,
"Open Cup" text
) | Name the regular season for 2005 | SELECT "Regular Season" FROM table_2450 WHERE "Year" = '2005' | wikisql |
CREATE TABLE table_name_2 (
game VARCHAR,
date VARCHAR
) | Which game was on September 12? | SELECT game FROM table_name_2 WHERE date = "september 12" | sql_create_context |
CREATE TABLE table_name_62 (
year__ceremony_ VARCHAR,
result VARCHAR,
film_title_used_in_nomination VARCHAR
) | What year has a not nominated result and a nomination title of 'the color of fame'? | SELECT year__ceremony_ FROM table_name_62 WHERE result = "not nominated" AND film_title_used_in_nomination = "the color of fame" | sql_create_context |
CREATE TABLE table_79612 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | When the total is larger than 1,and the bronze is less than 3, and silver larger than 2, and a gold larger than 2, what is the nation? | SELECT "Nation" FROM table_79612 WHERE "Total" > '1' AND "Bronze" < '3' AND "Silver" > '2' AND "Gold" > '2' | wikisql |
CREATE TABLE table_203_439 (
id number,
"pos." number,
"rider" text,
"semi-final points" number,
"final points" number,
"final heats" text,
"total points" number
) | the average number of points | SELECT AVG("total points") FROM table_203_439 | squall |
CREATE TABLE table_66385 (
"Year" real,
"Gross Domestic Product" real,
"US Dollar Exchange" text,
"Inflation Index (2000=100)" real,
"Per Capita Income (as % of USA)" real
) | Which Inflation Index (2000=100) has a Per Capita Income (as % of USA) of 10.65, and a Year smaller than 1990? | SELECT MAX("Inflation Index (2000=100)") FROM table_66385 WHERE "Per Capita Income (as % of USA)" = '10.65' AND "Year" < '1990' | wikisql |
CREATE TABLE table_name_12 (
record VARCHAR,
score VARCHAR,
visitor VARCHAR
) | What is the Record with a Score with 80 87, and a Visitor with bucks? | SELECT record FROM table_name_12 WHERE score = "80–87" AND visitor = "bucks" | sql_create_context |
CREATE TABLE table_256862_1 (
winning_yacht VARCHAR,
entries VARCHAR
) | Name the wininng yacht for 14 entries | SELECT winning_yacht FROM table_256862_1 WHERE entries = "14" | sql_create_context |
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 bar chart about the distribution of headquarter and the average of price , and group by attribute headquarter, list in asc by the X. | SELECT Headquarter, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter | nvbench |
CREATE TABLE table_33573 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Who is the home team when hawthorn is the away side? | SELECT "Home team" FROM table_33573 WHERE "Away team" = 'hawthorn' | wikisql |
CREATE TABLE table_name_72 (
fumb_td INTEGER,
int_td VARCHAR,
fumb_f VARCHAR
) | Which Fumb TD has an Int TD of 1, and a Fumb F. smaller than 1? | SELECT MIN(fumb_td) FROM table_name_72 WHERE int_td = 1 AND fumb_f < 1 | sql_create_context |
CREATE TABLE table_204_538 (
id number,
"pos." number,
"driver" text,
"co-driver" text,
"car" text,
"time" text
) | what was the fastest car ? | SELECT "car" FROM table_204_538 ORDER BY "pos." LIMIT 1 | squall |
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREA... | Who are Daphne Koller 's coauthors | SELECT DISTINCT AUTHOR_1.authorid FROM author AS AUTHOR_0, author AS AUTHOR_1, writes AS WRITES_0, writes AS WRITES_1 WHERE AUTHOR_0.authorname = 'Daphne Koller' AND WRITES_0.authorid = AUTHOR_0.authorid AND WRITES_1.authorid = AUTHOR_1.authorid AND WRITES_1.paperid = WRITES_0.paperid | scholar |
CREATE TABLE table_name_74 (
away_team VARCHAR
) | What is the away team's score when footscray is the away team? | SELECT away_team AS score FROM table_name_74 WHERE away_team = "footscray" | sql_create_context |
CREATE TABLE table_1302886_1 (
kerry_number VARCHAR,
county VARCHAR
) | In cook county Kerry# is? | SELECT kerry_number FROM table_1302886_1 WHERE county = "Cook" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions... | find the maximum age of male patients whose discharge location is snf. | SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.discharge_location = "SNF" | mimicsql_data |
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 demographic ... | what is minimum age of patients whose ethnicity is black/cape verdean and days of hospital stay is 9? | SELECT MIN(demographic.age) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.days_stay = "9" | mimicsql_data |
CREATE TABLE table_40516 (
"Date" real,
"Doubles, I Class" real,
"Doubles, II Class" real,
"Greater Doubles" real,
"Doubles" real,
"Semidoubles" real,
"Total" real
) | What is the lowest Date, when Doubles, II Class is 18, and when Total is less than 164? | SELECT MIN("Date") FROM table_40516 WHERE "Doubles, II Class" = '18' AND "Total" < '164' | wikisql |
CREATE TABLE table_19260_1 (
total VARCHAR,
_percentage_core_moldova VARCHAR
) | Name the total for % core moldova for 4.36% | SELECT total FROM table_19260_1 WHERE _percentage_core_moldova = "4.36_percentage" | sql_create_context |
CREATE TABLE classroom (
building text,
room_number text,
capacity number
)
CREATE TABLE course (
course_id text,
title text,
dept_name text,
credits number
)
CREATE TABLE section (
course_id text,
sec_id text,
semester text,
year number,
building text,
room_number ... | What is the name of the deparment with the highest enrollment? | SELECT dept_name FROM student GROUP BY dept_name ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_33585 (
"Member" text,
"Party" text,
"Electorate" text,
"State" text,
"In office" text
) | In which state is the Petrie electorate? | SELECT "State" FROM table_33585 WHERE "Electorate" = 'petrie' | wikisql |
CREATE TABLE table_name_41 (
games VARCHAR,
tied VARCHAR,
goals_against VARCHAR
) | How many games had a tied less 15 with goals against being fewer than 186? | SELECT COUNT(games) FROM table_name_41 WHERE tied < 15 AND goals_against < 186 | sql_create_context |
CREATE TABLE table_204_585 (
id number,
"year" text,
"player" text,
"high school" text,
"college" text,
"nba/aba draft" text
) | how many went to cincinnati ? | SELECT COUNT(*) FROM table_204_585 WHERE "college" = 'cincinnati' | squall |
CREATE TABLE table_959 (
"Season" text,
"Regionalliga S\u00fcd" text,
"Regionalliga West/S\u00fcdwest" text,
"Regionalliga Nord" text,
"Regionalliga Nord-Ost" text
) | what's the season with regionalliga west/s dwest being arminia bielefeld | SELECT "Season" FROM table_959 WHERE "Regionalliga West/S\u00fcdwest" = 'Arminia Bielefeld' | wikisql |
CREATE TABLE table_name_66 (
height__cm_ INTEGER,
birthdate VARCHAR,
weight__kg_ VARCHAR,
position VARCHAR
) | What is the average Height when the weight is less than 91 and the position is d, and a Birthdate of july 4, 1975? | SELECT AVG(height__cm_) FROM table_name_66 WHERE weight__kg_ < 91 AND position = "d" AND birthdate = "july 4, 1975" | sql_create_context |
CREATE TABLE table_54347 (
"Dismissals" text,
"Player" text,
"Versus" text,
"Venue" text,
"Date" text
) | What is the Dismissals with a Player with source: cricinfo.com? | SELECT "Dismissals" FROM table_54347 WHERE "Player" = 'source: cricinfo.com' | wikisql |
CREATE TABLE table_name_84 (
floors INTEGER,
name VARCHAR
) | Which Floors is the highest one that has a Name of one indiana square? | SELECT MAX(floors) FROM table_name_84 WHERE name = "one indiana square" | sql_create_context |
CREATE TABLE table_name_48 (
team_wins INTEGER,
nation VARCHAR,
individual_wins VARCHAR
) | Which Team Win is from sweden and has a Individual win smaller than 1 | SELECT MAX(team_wins) FROM table_name_48 WHERE nation = "sweden" AND individual_wins < 1 | sql_create_context |
CREATE TABLE table_203_724 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | how many nations earned no bronze medals ? | SELECT COUNT("nation") FROM table_203_724 WHERE "bronze" = 0 | squall |
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight real
)
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 re... | Draw a scatter chart about the correlation between Height and Weight . | SELECT Height, Weight FROM people | nvbench |
CREATE TABLE table_30273 (
"Series no." real,
"Season no." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
) | how many people wrote the episode directed by rob schrab? | SELECT COUNT("Written by") FROM table_30273 WHERE "Directed by" = 'Rob Schrab' | wikisql |
CREATE TABLE table_17509 (
"Overall Pick #" real,
"AFL Team" text,
"Player" text,
"Position" text,
"College" text
) | What position does the Cincinnati Bengals' player have? | SELECT "Position" FROM table_17509 WHERE "AFL Team" = 'Cincinnati Bengals' | wikisql |
CREATE TABLE table_21327 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location/Attendance" text,
"Record" text
) | Who was the oppenent what the score was L 68-60? | SELECT "Opponent" FROM table_21327 WHERE "Score" = 'L 68-60' | wikisql |
CREATE TABLE table_3593 (
"Team" text,
"Manager" text,
"Chairman" text,
"Team captain" text,
"Kit maker" text,
"Sponsor" text
) | Who is the captain of Dave Jones' team? | SELECT "Team captain" FROM table_3593 WHERE "Manager" = 'Dave Jones' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
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 o... | what is the name of a procedure that patient 24547 has been given for two times in 09/2104? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 245... | mimic_iii |
CREATE TABLE table_name_98 (
top_5 INTEGER,
events VARCHAR,
top_25 VARCHAR
) | Tell me the sum of top 5 with events less than 12 and top 25 less than 0 | SELECT SUM(top_5) FROM table_name_98 WHERE events < 12 AND top_25 < 0 | sql_create_context |
CREATE TABLE table_74833 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | Name the total number of round for wide receiver for kent state | SELECT COUNT("Round") FROM table_74833 WHERE "Position" = 'wide receiver' AND "College" = 'kent state' | wikisql |
CREATE TABLE table_203_843 (
id number,
"record" text,
"date and time" text,
"competition" text,
"home or away" text,
"opponent" text,
"score" text
) | what was the first record broken ? | SELECT "record" FROM table_203_843 WHERE id = 1 | squall |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_procedures (
row_i... | is there any results of the microbiology test carried out for patient 96404 in 10/last year? | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 96404) AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', microbiologyevents.chartti... | mimic_iii |
CREATE TABLE table_29458735_5 (
county VARCHAR,
division VARCHAR,
regiment VARCHAR
) | what is he name of the county where the 2nd division and the 41st regiment was | SELECT county FROM table_29458735_5 WHERE division = "2nd division" AND regiment = "41st regiment" | sql_create_context |
CREATE TABLE table_36267 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Asian rider classification" text,
"Team classification" text,
"Asian team classification" text
) | WHich Mountains classification has an Asian team classification of seoul cycling team, and a Winner of alexandre usov? | SELECT "Mountains classification" FROM table_36267 WHERE "Asian team classification" = 'seoul cycling team' AND "Winner" = 'alexandre usov' | wikisql |
CREATE TABLE table_name_43 (
year_built VARCHAR,
location_of_the_church VARCHAR
) | When was the church in Arnafjord built? | SELECT year_built FROM table_name_43 WHERE location_of_the_church = "arnafjord" | 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... | 医院8925142所有就诊的记录里面根据不同的科室和不同的出院诊断疾病编码查询个人自费的部分与总的医疗费用相比的最小值,把最后的结果按升序来排列 | SELECT t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_CD, MIN(t_kc24.PER_EXP) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '8925142' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_CD ORDER BY MIN(t_kc24.PER_EXP / t_kc24.MED_AMOUT) | css |
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 (... | How many patients were born before the year 2114 and survived? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.dob_year < "2114" | mimicsql_data |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | what are the four most commonly prescribed drugs since 1 year ago? | SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-1 year') GROUP BY medication.drugname) AS t1 WHERE t1.c1 <= 4 | eicu |
CREATE TABLE table_train_194 (
"id" int,
"organ_transplantation" bool,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"substance_dependence" bool,
"diastolic_blood_pressure_dbp" int,
"alcohol_abuse" bool,
"age" float,
"NOUSE" float
) | bp > 160 / 90 | SELECT * FROM table_train_194 WHERE (systolic_blood_pressure_sbp > 160 OR diastolic_blood_pressure_dbp > 90) | criteria2sql |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
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... | For those employees who was hired before 2002-06-21, show me about the change of department_id over hire_date in a line chart. | SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE table_10342194_3 (
total_amount_of_trees INTEGER,
district VARCHAR
) | What is the total amount of trees when district is leninsky? | SELECT MAX(total_amount_of_trees) FROM table_10342194_3 WHERE district = "Leninsky" | sql_create_context |
CREATE TABLE table_52629 (
"Week" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Time" text,
"Attendance" text
) | Name the opponent that has attendance of 76,965 | SELECT "Opponent" FROM table_52629 WHERE "Attendance" = '76,965' | wikisql |
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... | 卫博裕病患的药品消费金额不超过8489.49元的医疗记录有哪几次?列出对应的医疗就诊编号 | SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '卫博裕' AND NOT t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 8489.49) | css |
CREATE TABLE table_name_72 (
points INTEGER,
entrant VARCHAR,
year VARCHAR,
engine VARCHAR
) | What is Brown Motors best point total using the Offenhauser L4 engine since 1950? | SELECT MAX(points) FROM table_name_72 WHERE year > 1950 AND engine = "offenhauser l4" AND entrant = "brown motors" | sql_create_context |
CREATE TABLE table_name_50 (
surface VARCHAR,
date VARCHAR
) | What was the surface for the game that was played on 12-Apr-2005? | SELECT surface FROM table_name_50 WHERE date = "12-apr-2005" | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
... | in this year, what are the top four most frequent specimen tests ordered for patients within 2 months after diagnosis of hypocalcemia? | SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hypocalcemia' AND DATETIME(diagnosis.diagnos... | eicu |
CREATE TABLE happy_hour_member (
hh_id number,
member_id number,
total_amount number
)
CREATE TABLE member (
member_id number,
name text,
membership_card text,
age number,
time_of_purchase number,
level_of_membership number,
address text
)
CREATE TABLE happy_hour (
hh_id nu... | Give me the names of members whose address is in Harford or Waterbury. | SELECT name FROM member WHERE address = 'Harford' OR address = 'Waterbury' | spider |
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... | 病人尤静逸在医院0738891的门诊中,诊断涉及神经衰弱的门诊就诊记录列一下 | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb 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 person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_i... | css |
CREATE TABLE table_29736 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | what is the date of the game 23? | SELECT "Date" FROM table_29736 WHERE "Game" = '23' | wikisql |
CREATE TABLE table_204_833 (
id number,
"game" number,
"date" text,
"team" text,
"score" text,
"high points" text,
"high rebounds" text,
"high assists" text,
"location\nattendance" text,
"record" text
) | how many points did the nuggets win by on april 9 ? | SELECT "score" - "score" FROM table_204_833 WHERE "date" = 'april 9' | squall |
CREATE TABLE table_name_46 (
seats_2010 INTEGER,
in_de_creased_by VARCHAR,
seats_2005 VARCHAR,
governorate VARCHAR
) | Name the lowest Seats 2010 which has Seats 2005 smaller than 9, and a Governorate of al muthanna governorate, and an In/de-creased by larger than 2? | SELECT MIN(seats_2010) FROM table_name_46 WHERE seats_2005 < 9 AND governorate = "al muthanna governorate" AND in_de_creased_by > 2 | sql_create_context |
CREATE TABLE table_11094950_1 (
conference VARCHAR,
team VARCHAR
) | What conference was the churchill chargers team in? | SELECT conference FROM table_11094950_1 WHERE team = "Churchill Chargers" | sql_create_context |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | What is the average salary for each job title Show bar chart, and show y-axis in desc order please. | SELECT JOB_TITLE, AVG(SALARY) FROM employees AS T1 JOIN jobs AS T2 ON T1.JOB_ID = T2.JOB_ID GROUP BY T2.JOB_TITLE ORDER BY AVG(SALARY) DESC | nvbench |
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
star... | In the Winter period , are there special topic classes available ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE (course.number = 398 OR course.number = 498 OR course.number = 598) AND course.department = 'E... | advising |
CREATE TABLE table_39596 (
"Name" text,
"Dist. from Origin" text,
"Dist. from Terminus" text,
"Speed Limit" text,
"Location (all in Nagano )" text
) | Which location includes Sakakita BS? | SELECT "Location (all in Nagano )" FROM table_39596 WHERE "Name" = 'sakakita bs' | wikisql |
CREATE TABLE table_48302 (
"Round" text,
"Team #1" text,
"Agg." text,
"Team #2" text,
"1st leg" text,
"2nd leg" text
) | What is the agg when team #2 is 2006 UEFA Intertoto Cup? | SELECT "Agg." FROM table_48302 WHERE "Team #2" = '2006 uefa intertoto cup' | wikisql |
CREATE TABLE table_255188_3 (
location VARCHAR,
nickname VARCHAR
) | What location is nicknamed the 49ers? | SELECT location FROM table_255188_3 WHERE nickname = "49ers" | sql_create_context |
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 text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | provide the number of patients whose primary disease is s/p fall and lab test fluid is urine. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "S/P FALL" AND lab.fluid = "Urine" | mimicsql_data |
CREATE TABLE customers_cards (
card_id number,
customer_id number,
card_type_code text,
card_number text,
date_valid_from time,
date_valid_to time,
other_card_details text
)
CREATE TABLE customers (
customer_id number,
customer_first_name text,
customer_last_name text,
custo... | What are the different customer ids, and how many cards does each one hold? | SELECT customer_id, COUNT(*) FROM customers_cards GROUP BY customer_id | spider |
CREATE TABLE table_name_60 (
record VARCHAR,
date VARCHAR
) | Which record is dated April 8? | SELECT record FROM table_name_60 WHERE date = "april 8" | sql_create_context |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
... | Titles and Tags Top 500. | SELECT Title, Body, Tags FROM Posts WHERE NOT Tags IS NULL LIMIT 500 | sede |
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 products with a price between 60 and 120, return a bar chart about the distribution of name and price , and order in ascending by the Y. | SELECT Name, Price FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Price | nvbench |
CREATE TABLE table_28042 (
"Series no." real,
"No. in season" real,
"Title" text,
"Written by" text,
"Directed by" text,
"Original air date" text,
"U.S. viewers (millions)" text
) | What was the original air date where there were u.s. viewers (millions) is 5.60? | SELECT "Original air date" FROM table_28042 WHERE "U.S. viewers (millions)" = '5.60' | wikisql |
CREATE TABLE table_22032599_1 (
film_title_used_in_nomination VARCHAR,
director VARCHAR
) | HOw many films did martin repka category:articles with hcards direct? | SELECT COUNT(film_title_used_in_nomination) FROM table_22032599_1 WHERE director = "Martin Repka Category:Articles with hCards" | sql_create_context |
CREATE TABLE table_36971 (
"Date" text,
"Tournament" text,
"Location" text,
"Winner" text,
"Score" text,
"1st prize ( $ )" real
) | What is the total number of first prizes in USD for the Canadian Open? | SELECT SUM("1st prize ( $ )") FROM table_36971 WHERE "Tournament" = 'canadian open' | wikisql |
CREATE TABLE table_name_31 (
analog_channel VARCHAR,
digital_channel VARCHAR
) | Which analog channel has a digital channel of 4.1? | SELECT analog_channel FROM table_name_31 WHERE digital_channel = "4.1" | sql_create_context |
CREATE TABLE table_2866503_1 (
us_air_date VARCHAR,
us_viewers__million_ VARCHAR
) | What is the U.S. air date when the U.S. viewers are 7.5 million? | SELECT us_air_date FROM table_2866503_1 WHERE us_viewers__million_ = "7.5" | sql_create_context |
CREATE TABLE table_name_76 (
location VARCHAR,
club VARCHAR
) | Where is nac breda club located? | SELECT location FROM table_name_76 WHERE club = "nac breda" | 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... | get me the number of inpatient hospital admitted patients who had blood lab test. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND lab.fluid = "Blood" | mimicsql_data |
CREATE TABLE Product_Categories (
production_type_code VARCHAR(15),
product_type_description VARCHAR(80),
vat_rating DECIMAL(19,4)
)
CREATE TABLE Financial_Transactions (
transaction_id INTEGER,
account_id INTEGER,
invoice_number INTEGER,
transaction_type VARCHAR(15),
transaction_date D... | Create a pie chart showing total number of transaction amount across transaction type. | SELECT transaction_type, SUM(transaction_amount) FROM Financial_Transactions GROUP BY transaction_type | nvbench |
CREATE TABLE table_64020 (
"Actor" text,
"Character" text,
"Soap Opera" text,
"Years" text,
"Duration" text
) | What Soap Opera with the character Teemu Luotola? | SELECT "Soap Opera" FROM table_64020 WHERE "Character" = 'teemu luotola' | wikisql |
CREATE TABLE table_name_59 (
record VARCHAR,
home VARCHAR,
visitor VARCHAR
) | Can you tell me the Record that has the Home of detroit, and the Visitor of phoenix? | SELECT record FROM table_name_59 WHERE home = "detroit" AND visitor = "phoenix" | sql_create_context |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABL... | tell me the birth date of patient 1819? | SELECT patients.dob FROM patients WHERE patients.subject_id = 1819 | mimic_iii |
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,
... | 门诊就诊15752379757的患者体征在几号记录的? | SELECT zzmzjzjlb.JLSJ FROM zzmzjzjlb WHERE zzmzjzjlb.JZLSH = '15752379757' UNION SELECT fzzmzjzjlb.JLSJ FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZLSH = '15752379757' | css |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text... | Sandbox: Inactive > 1 month && Score < 0. | SELECT SUM(CASE WHEN LastActivityDate < DATEADD(mm, -1, GETDATE()) AND Score < 0 THEN 1 ELSE 0 END) FROM Posts WHERE ParentId = 2140 | sede |
CREATE TABLE table_name_9 (
player VARCHAR,
country VARCHAR
) | Who is the player from Japan? | SELECT player FROM table_name_9 WHERE country = "japan" | sql_create_context |
CREATE TABLE table_300283_1 (
name_in_basque VARCHAR,
official_name VARCHAR
) | What is the name in Basque of the municipality whose official name is Kuartango? | SELECT name_in_basque FROM table_300283_1 WHERE official_name = "Kuartango" | sql_create_context |
CREATE TABLE table_name_32 (
nationality VARCHAR,
cardinalatial_order_and_title VARCHAR
) | What's the nationality of Cardinal-Bishop of Albano? | SELECT nationality FROM table_name_32 WHERE cardinalatial_order_and_title = "cardinal-bishop of albano" | sql_create_context |
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,
... | 患者蒋飞白在医疗机构4684405的既往病历里开的西药有多少,时间是从00年4月18日到06年8月4日 | SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '蒋飞白' AND t_kc22.STA_DATE BETWEEN '2000-04-18' AND '2006-08-04' AND gwyjzb.MED_SER_ORG_NO = '4684405' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_... | css |
CREATE TABLE table_name_83 (
total INTEGER,
position VARCHAR,
a_score VARCHAR
) | What's the total when the position was more than 6 and had an A Score of less than 7.6? | SELECT MAX(total) FROM table_name_83 WHERE position > 6 AND a_score < 7.6 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.