context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_2 (
bronze INTEGER,
ranking VARCHAR,
gold VARCHAR
) | What is the lowest Bronze with a Ranking of 22nd of 32 and Gold larger than 4? | SELECT MIN(bronze) FROM table_name_2 WHERE ranking = "22nd of 32" AND gold > 4 | sql_create_context |
CREATE TABLE table_name_69 (
original_artist VARCHAR,
order__number VARCHAR
) | What is the original artist that has 11 as the order number? | SELECT original_artist FROM table_name_69 WHERE order__number = "11" | sql_create_context |
CREATE TABLE table_55167 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the name of the home team that scored 11.16 (82)? | SELECT "Home team" FROM table_55167 WHERE "Home team score" = '11.16 (82)' | wikisql |
CREATE TABLE table_204_595 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | what is the average number of gold medals won by the top 5 nations ? | SELECT AVG("gold") FROM table_204_595 WHERE "rank" <= 5 | squall |
CREATE TABLE table_74910 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Attendance" real,
"Record" text,
"Points" real
) | Record of 21 29 10 had what total number of points? | SELECT COUNT("Points") FROM table_74910 WHERE "Record" = '21–29–10' | wikisql |
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 employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... | Scatter chart for employee id and their salaries. | SELECT EMPLOYEE_ID, SALARY FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T1.EMPLOYEE_ID = T2.MANAGER_ID | nvbench |
CREATE TABLE table_55913 (
"Date" text,
"Name" text,
"Flag" text,
"Tonnage (GRT)" real,
"Sunk by" text
) | What is the date for the name of Granville? | SELECT "Date" FROM table_55913 WHERE "Name" = 'granville' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | give me the number of patients whose death status is 0 and year of birth is less than 2107? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.dob_year < "2107" | mimicsql_data |
CREATE TABLE table_name_17 (
country VARCHAR,
player VARCHAR,
place VARCHAR,
score VARCHAR
) | What is the country that has a place of T6, a socre of 69-69=138, and where Niclas Fasth played? | SELECT country FROM table_name_17 WHERE place = "t6" AND score = 69 - 69 = 138 AND player = "niclas fasth" | sql_create_context |
CREATE TABLE table_name_25 (
driver VARCHAR,
laps VARCHAR,
time_retired VARCHAR
) | Who drive the car that went under 60 laps and spun off? | SELECT driver FROM table_name_25 WHERE laps < 60 AND time_retired = "spun off" | sql_create_context |
CREATE TABLE journalist (
Name VARCHAR,
Nationality VARCHAR
) | Show the names of journalists from 'England' or 'Wales'. | SELECT Name FROM journalist WHERE Nationality = "England" OR Nationality = "Wales" | sql_create_context |
CREATE TABLE table_27666856_3 (
outgoing_manager VARCHAR,
team VARCHAR
) | Name the total number of outgoing manager for villarreal b | SELECT COUNT(outgoing_manager) FROM table_27666856_3 WHERE team = "Villarreal B" | sql_create_context |
CREATE TABLE table_75788 (
"Date" text,
"Time" text,
"Home" text,
"Away" text,
"Score" text,
"Ground" text
) | With the Ground of Humber College North at 12:00, what was the Away? | SELECT "Away" FROM table_75788 WHERE "Ground" = 'humber college north' AND "Time" = '12:00' | wikisql |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE program (
program_id int,
name varchar... | When is Construction Management Information System going to be offered next ? | SELECT DISTINCT semester.semester, semester.year FROM semester INNER JOIN course_offering ON semester.semester_id = course_offering.semester INNER JOIN course ON course.course_id = course_offering.course_id WHERE course.name LIKE '%Construction Management Information System%' AND semester.semester_id > (SELECT SEMESTER... | advising |
CREATE TABLE table_204_878 (
id number,
"model" text,
"release date" text,
"sensor\nres., size" text,
"lens (35 mm equiv.)\nzoom, aperture" text,
"screen\nsize, pixels" text,
"dimensions\nw (mm) \u00d7 h (mm) \u00d7 d (mm)" text,
"weight" text,
"features" text
) | how many were released in 2012 ? | SELECT COUNT(*) FROM table_204_878 WHERE "release date" = 2012 | squall |
CREATE TABLE table_203_783 (
id number,
"season" text,
"tier" number,
"division" text,
"place" text
) | how long did the team stay in first place ? | SELECT COUNT("season") FROM table_203_783 WHERE "place" = 1 | squall |
CREATE TABLE table_name_31 (
moving_from VARCHAR,
name VARCHAR
) | Where did naylor move from? | SELECT moving_from FROM table_name_31 WHERE name = "naylor" | sql_create_context |
CREATE TABLE table_71738 (
"7:00" text,
"7:30" text,
"8:00" text,
"8:30" text,
"9:00" text,
"9:30" text,
"10:00" text
) | What is on at 8:30 when etalk is on at 7:00 on that channel? | SELECT "8:30" FROM table_71738 WHERE "7:00" = 'etalk' | wikisql |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 姜岚翠这个病人的检验报告结果指标均正常的有哪些?检验报告单号是什么 | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '姜... | css |
CREATE TABLE table_name_44 (
score VARCHAR,
loss VARCHAR
) | What was the score of the game that had a loss of Cox (6 2)? | SELECT score FROM table_name_44 WHERE loss = "cox (6–2)" | sql_create_context |
CREATE TABLE table_name_58 (
league VARCHAR,
regular_season VARCHAR
) | Which League has a Regular Season of 2nd, southeast? | SELECT league FROM table_name_58 WHERE regular_season = "2nd, southeast" | sql_create_context |
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 lab (
subject_id text,
hadm_id text,
... | what is maximum age of patients whose primary disease is aortic insufficiency\re-do sternotomy; aortic valve replacement and admission year is greater than or equal to 2150? | SELECT MAX(demographic.age) FROM demographic WHERE demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT " AND demographic.admityear >= "2150" | mimicsql_data |
CREATE TABLE table_10361230_1 (
college VARCHAR,
player_name VARCHAR
) | What college did Bill Cappleman go to? | SELECT college FROM table_10361230_1 WHERE player_name = "Bill Cappleman" | sql_create_context |
CREATE TABLE table_name_10 (
rank VARCHAR,
wins VARCHAR,
points VARCHAR
) | Name the rank for wins of 0 and points of 2 | SELECT rank FROM table_name_10 WHERE wins = 0 AND points = 2 | sql_create_context |
CREATE TABLE table_204_236 (
id number,
"title" text,
"release date" text,
"developer(s)" text,
"publisher(s)" text,
"genre(s)" text
) | total number of gangster games released . | SELECT COUNT("title") FROM table_204_236 | squall |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic ... | what is the number of patients whose marital status is widowed and lab test name is bicarbonate? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "WIDOWED" AND lab.label = "Bicarbonate" | mimicsql_data |
CREATE TABLE table_29819 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Who's in the high rebounds in the verizon center 9,263 location attendance? | SELECT "High rebounds" FROM table_29819 WHERE "Location Attendance" = 'Verizon Center 9,263' | wikisql |
CREATE TABLE table_29980 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
) | What was the title of the episode with a production code of 3x6404? | SELECT "Title" FROM table_29980 WHERE "Production code" = '3X6404' | wikisql |
CREATE TABLE table_204_179 (
id number,
"season" number,
"division" number,
"tms." number,
"pos." number,
"fa cup" text,
"afc cl" number
) | what was the first year in which daegu fc finished in the top 10 of the k league classic ? | SELECT MIN("season") FROM table_204_179 WHERE "pos." <= 10 | squall |
CREATE TABLE table_name_15 (
team VARCHAR,
previous_team VARCHAR
) | What is the team of the player who was previously on the indiana pacers? | SELECT team FROM table_name_15 WHERE previous_team = "indiana pacers" | sql_create_context |
CREATE TABLE table_name_79 (
name VARCHAR,
qual_1 VARCHAR
) | Who got 59.578 for Qual 1? | SELECT name FROM table_name_79 WHERE qual_1 = "59.578" | sql_create_context |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId... | Count of posts by month for user. Simple count of posts by month | SELECT TIME_TO_STR(p.CreationDate, '%Y') AS year, TIME_TO_STR(p.CreationDate, '%m') AS month, COUNT(*) AS postcount, SUM(Score) AS the_score, SUM(Score) / CAST(COUNT(*) AS FLOAT) AS score_per_post FROM Posts AS p WHERE p.OwnerUserId = '##UserId##' GROUP BY TIME_TO_STR(p.CreationDate, '%Y'), TIME_TO_STR(p.CreationDate, ... | sede |
CREATE TABLE table_61401 (
"Shooter" text,
"Event" text,
"Rank points" text,
"Score points" text,
"Total" text
) | which Total has a Score points of 11? | SELECT "Total" FROM table_61401 WHERE "Score points" = '11' | wikisql |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 18416093这个病人的检验报告结果指标均正常的有哪些?检验报告单号是什么 | SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb ON 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 hz_info.RYBH = '18416093' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WH... | css |
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 cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE schedule... | Display a bar chart for what is total number of show times per dat for each cinema?, and show show times per day in asc order please. | SELECT Name, SUM(T1.Show_times_per_day) FROM schedule AS T1 JOIN cinema AS T2 ON T1.Cinema_ID = T2.Cinema_ID GROUP BY T1.Cinema_ID ORDER BY SUM(T1.Show_times_per_day) | nvbench |
CREATE TABLE table_30047 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Name the date for omni coliseum 10,330 | SELECT "Date" FROM table_30047 WHERE "Location Attendance" = 'Omni Coliseum 10,330' | wikisql |
CREATE TABLE table_name_4 (
money___$__ VARCHAR,
player VARCHAR
) | What is Money ( $ ), when Player is 'Morgan Pressel'? | SELECT money___$__ FROM table_name_4 WHERE player = "morgan pressel" | sql_create_context |
CREATE TABLE table_43473 (
"Sn/Sb (%)" text,
"Liquidat (\u00b0C)" real,
"Solidat (\u00b0C)" real,
"Hardness ( Brinell )" real,
"Purpose" text
) | What is the sum of Solidat (c) that's purpose is display type, heavy duty jobs, and a hardness (brinell) is smaller than 33? | SELECT SUM("Solidat (\u00b0C)") FROM table_43473 WHERE "Purpose" = 'display type, heavy duty jobs' AND "Hardness ( Brinell )" < '33' | wikisql |
CREATE TABLE table_71359 (
"Year" text,
"Division" text,
"League" text,
"Regular Season" text,
"Playoffs" text
) | What place did the Nashville Metros place in the 1994/95 Season? | SELECT "Regular Season" FROM table_71359 WHERE "Year" = '1994/95' | wikisql |
CREATE TABLE table_71280 (
"Screening Started" text,
"Screening Completed" text,
"Chapter Unfrozen" text,
"Chapter Opened" text,
"Chapter Closed" text
) | Name the screening completed for screening started 23 january 2006 | SELECT "Screening Completed" FROM table_71280 WHERE "Screening Started" = '23 january 2006' | wikisql |
CREATE TABLE table_52912 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What Constructor has a +1.027 Time/Retired? | SELECT "Constructor" FROM table_52912 WHERE "Time/Retired" = '+1.027' | wikisql |
CREATE TABLE table_name_17 (
rider VARCHAR,
time VARCHAR
) | Who had the time of 1:23.32.41? | SELECT rider FROM table_name_17 WHERE time = "1:23.32.41" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE m... | what was the drug that during their last hospital visit patient 002-64535 had been prescribed two or more times? | SELECT t1.drugname FROM (SELECT medication.drugname, COUNT(medication.drugstarttime) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002... | eicu |
CREATE TABLE table_name_85 (
nationality VARCHAR,
position VARCHAR,
school_country VARCHAR
) | What nationality is the guard from ucla? | SELECT nationality FROM table_name_85 WHERE position = "guard" AND school_country = "ucla" | sql_create_context |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Bar chart x axis acc road y axis the average of school id, and sort bar in asc order please. | SELECT ACC_Road, AVG(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road | nvbench |
CREATE TABLE table_23293785_2 (
driver VARCHAR,
location VARCHAR
) | Who is every driver for the location of Estoril Circuit? | SELECT driver FROM table_23293785_2 WHERE location = "Estoril Circuit" | sql_create_context |
CREATE TABLE table_52324 (
"Player" text,
"Height" text,
"School" text,
"Hometown" text,
"College" text,
"NBA Draft" text
) | What was the nba draft for al-farouq aminu? | SELECT "NBA Draft" FROM table_52324 WHERE "Player" = 'al-farouq aminu' | wikisql |
CREATE TABLE table_47478 (
"Track" real,
"Title" text,
"Songwriter(s)" text,
"Producer(s)" text,
"Length" text
) | Which Producer(s) has a Track smaller than 8, and a Songwriter(s) of hadise a kg z, yves jongen, and a Length of 3:08? | SELECT "Producer(s)" FROM table_47478 WHERE "Track" < '8' AND "Songwriter(s)" = 'hadise açıkgöz, yves jongen' AND "Length" = '3:08' | wikisql |
CREATE TABLE table_name_33 (
drawn INTEGER,
penalties VARCHAR,
conversions VARCHAR
) | How many ties did he have when he had 1 penalties and more than 20 conversions? | SELECT SUM(drawn) FROM table_name_33 WHERE penalties = 1 AND conversions > 20 | sql_create_context |
CREATE TABLE table_name_49 (
date VARCHAR,
attendance INTEGER
) | What date were there more than 19,600 people in attendance? | SELECT date FROM table_name_49 WHERE attendance > 19 OFFSET 600 | sql_create_context |
CREATE TABLE table_20095300_1 (
weight__st VARCHAR,
_lb_ VARCHAR,
name VARCHAR
) | How much does Point Barrow weight? | SELECT weight__st, _lb_ FROM table_20095300_1 WHERE name = "Point Barrow" | sql_create_context |
CREATE TABLE table_20967430_2 (
title VARCHAR,
original_air_date VARCHAR
) | Name the title that aired for november 08, 1985 | SELECT title FROM table_20967430_2 WHERE original_air_date = "November 08, 1985" | sql_create_context |
CREATE TABLE table_50613 (
"Athlete" text,
"Time" text,
"Country" text,
"Year" real,
"Place" real
) | Which Athlete has a Place of 1, and a Year smaller than 1988, and a Country of gre, and a Time of 21:57:00? | SELECT "Athlete" FROM table_50613 WHERE "Place" = '1' AND "Year" < '1988' AND "Country" = 'gre' AND "Time" = '21:57:00' | wikisql |
CREATE TABLE manager (
Manager_ID int,
Name text,
Country text,
Working_year_starts text,
Age int,
Level int
)
CREATE TABLE train (
Train_ID int,
Train_Num text,
Name text,
From text,
Arrival text,
Railway_ID int
)
CREATE TABLE railway_manage (
Railway_ID int,
M... | Show the number of the working years of managers in descending order of their level. | SELECT Working_year_starts, COUNT(Working_year_starts) FROM manager ORDER BY Level DESC | nvbench |
CREATE TABLE table_name_50 (
tie_no VARCHAR,
home_team VARCHAR
) | What was the Tie no when the Home team was carshalton athletic? | SELECT tie_no FROM table_name_50 WHERE home_team = "carshalton athletic" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | what is the minimum age of single patients with admission in or after the year 2158? | SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.admityear >= "2158" | mimicsql_data |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | What is the easiest class I can take to reach the PreMajor requirement ? | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM progra... | advising |
CREATE TABLE table_28898948_3 (
reason VARCHAR,
winner VARCHAR
) | When arthur collins is the winner what is the reason? | SELECT reason FROM table_28898948_3 WHERE winner = "Arthur Collins" | sql_create_context |
CREATE TABLE table_66777 (
"Counting Method" text,
"Basis" text,
"Name" text,
"Directed / Undirected" text,
"Induced / Non-Induced" text
) | What is the directed/undirected of fpf (mavisto), which has an induced/non-induced of induced? | SELECT "Directed / Undirected" FROM table_66777 WHERE "Induced / Non-Induced" = 'induced' AND "Name" = 'fpf (mavisto)' | wikisql |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... | For those employees who was hired before 2002-06-21, return a bar chart about the distribution of hire_date and the amount of hire_date bin hire_date by weekday, and could you order in descending by the y-axis? | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY COUNT(HIRE_DATE) DESC | nvbench |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE instructor (
instructor_id int,
na... | Which least difficult ULCS course has the largest class size ? | SELECT DISTINCT department, name, number FROM course WHERE course_id IN (SELECT PROGRAM_COURSE_ID FROM program_course AS PROGRAM_COURSE WHERE PROGRAM_WORKLOAD = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 WHERE PROGRAM_COURSEalias1.category LIKE '%ULCS%')) AND num_enrolled = (... | advising |
CREATE TABLE table_name_72 (
grid VARCHAR,
time_retired VARCHAR
) | How many grids had a Time/Retired of +4 laps? | SELECT COUNT(grid) FROM table_name_72 WHERE time_retired = "+4 laps" | sql_create_context |
CREATE TABLE table_25851971_1 (
no INTEGER,
written_by VARCHAR
) | What episode number was written by Anthony Sparks? | SELECT MIN(no) FROM table_25851971_1 WHERE written_by = "Anthony Sparks" | 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... | 培哚普利叔丁胺片在医疗就诊52856330986中的剂型和规格分别是什么? | SELECT t_kc22.DOSE_FORM, t_kc22.SPEC FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '52856330986' AND t_kc22.SOC_SRT_DIRE_NM = '培哚普利叔丁胺片' | css |
CREATE TABLE table_name_87 (
to_par VARCHAR,
player VARCHAR
) | Which To par has a Player of johanna head? | SELECT to_par FROM table_name_87 WHERE player = "johanna head" | sql_create_context |
CREATE TABLE table_11662133_3 (
tonnage INTEGER,
date_entered_service VARCHAR
) | what is the maximum tonnage where date entered service is 25 march 1986 | SELECT MAX(tonnage) FROM table_11662133_3 WHERE date_entered_service = "25 March 1986" | sql_create_context |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost numb... | when was the last time patient 76005 got admitted to the hospital in a year before? | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 76005 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY admissions.admittime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_name_12 (
byes VARCHAR,
losses VARCHAR,
wins VARCHAR,
wimmera_fl VARCHAR
) | How many Byes have Wins smaller than 11, and a Wimmera FL of minyip murtoa, and Losses smaller than 6? | SELECT COUNT(byes) FROM table_name_12 WHERE wins < 11 AND wimmera_fl = "minyip murtoa" AND losses < 6 | sql_create_context |
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,
... | 给患有结膜炎的那些病患们给其开的药物的编号和名称分别是什么? | 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.IN_DIAG_DIS_NM = '结膜炎' | css |
CREATE TABLE table_36329 (
"Rank" text,
"Runs" text,
"Opponent" text,
"Venue" text,
"Season" text
) | What was the rank of the team during season 2006/07? | SELECT "Rank" FROM table_36329 WHERE "Season" = '2006/07' | wikisql |
CREATE TABLE table_16989 (
"Institution" text,
"Location" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Joined" text,
"Nickname" text
) | What is the minimum enrollment at barton college | SELECT MIN("Enrollment") FROM table_16989 WHERE "Institution" = 'Barton College' | wikisql |
CREATE TABLE table_name_24 (
d_41_√ VARCHAR,
d_47_√ VARCHAR
) | What is the D 41 when the D 47 is r 34 o? | SELECT d_41_√ FROM table_name_24 WHERE d_47_√ = "r 34 o" | sql_create_context |
CREATE TABLE table_78971 (
"Name" text,
"Code" text,
"Capacity" text,
"Configuration" text,
"Power" text,
"Torque" text,
"Top speed" text,
"Acceleration 0\u2013100km/h (0\u201362mph)" text
) | What is the code of 1.5 dci 110, which has a capacity of 1,461cc? | SELECT "Code" FROM table_78971 WHERE "Capacity" = '1,461cc' AND "Name" = '1.5 dci 110' | wikisql |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswer... | Short answers with a question mark. | SELECT Posts.Id AS "post_link", Score FROM Posts WHERE PostTypeId = 2 AND Score > 0 AND DATALENGTH(Body) < 200 AND DATALENGTH(Body) - DATALENGTH(REPLACE(Body, '?', '')) >= 2 ORDER BY Score DESC | sede |
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
CREATE TABLE ENROLL (
CLASS_CODE varchar(5),
STU_NUM int,
ENROLL_GRADE varchar(50)
)
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCH... | how many students are in each department?, show in asc by the y-axis. | SELECT DEPT_CODE, COUNT(*) FROM STUDENT GROUP BY DEPT_CODE ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_19529 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
) | Which title had the production code 1ACX04? | SELECT "Title" FROM table_19529 WHERE "Production code" = '1ACX04' | wikisql |
CREATE TABLE table_name_62 (
location_attendance VARCHAR,
score VARCHAR
) | What was the location and attendance with a score of w 89 86 (ot)? | SELECT location_attendance FROM table_name_62 WHERE score = "w 89–86 (ot)" | sql_create_context |
CREATE TABLE table_204_211 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | how many times has chile been awarded ? | SELECT "total" FROM table_204_211 WHERE "nation" = 'chile' | squall |
CREATE TABLE table_name_91 (
attendance INTEGER,
opponent VARCHAR
) | What was the lowest attendance at a game against the St. Louis Cardinals? | SELECT MIN(attendance) FROM table_name_91 WHERE opponent = "st. louis cardinals" | sql_create_context |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Find ACC_Road and the average of School_ID , and group by attribute ACC_Road, and visualize them by a bar chart, rank in desc by the Y please. | SELECT ACC_Road, AVG(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY AVG(School_ID) DESC | nvbench |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | what is the primary disease and diagnosis short title of subject id 17772? | SELECT demographic.diagnosis, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "17772" | mimicsql_data |
CREATE TABLE table_name_27 (
yards INTEGER,
sacks VARCHAR,
average VARCHAR
) | What are the most yards for 2 sacks and an average greater than 0? | SELECT MAX(yards) FROM table_name_27 WHERE sacks = 2 AND average > 0 | sql_create_context |
CREATE TABLE nuclear_power_plants (
id text,
name text,
latitude text,
longitude text,
country text,
status text,
reactortype text,
reactormodel text,
constructionstartat text,
operationalfrom text,
operationalto text,
capacity text,
lastupdatedat text,
source tex... | Which country is Kaiga-4 built in? | SELECT country FROM nuclear_power_plants WHERE name = "Kaiga-4" | geonucleardata |
CREATE TABLE table_14472 (
"Name" text,
"Country" text,
"Year" real,
"Structure Height [m]" text,
"Structure Volume [10 6 m 3 ]" text,
"Reservoir Volume [10 9 m 3 ]" real,
"Type" text
) | What is the height of the fort peck dam which was built before 1968, is located in the united states and has a dam type of TE ? | SELECT "Structure Height [m]" FROM table_14472 WHERE "Year" < '1968' AND "Type" = 'te' AND "Country" = 'united states' AND "Name" = 'fort peck dam' | wikisql |
CREATE TABLE table_name_50 (
date VARCHAR,
stadium VARCHAR
) | What day did they play in central park stadium? | SELECT date FROM table_name_50 WHERE stadium = "central park" | sql_create_context |
CREATE TABLE table_name_87 (
density__inhabitants_km_2__ INTEGER,
city VARCHAR
) | What is the lowest density of serravalle scrivia? | SELECT MIN(density__inhabitants_km_2__) FROM table_name_87 WHERE city = "serravalle scrivia" | sql_create_context |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, give me the comparison about the average of revenue over the name , and group by attribute name by a bar chart, and show x axis in descending order. | SELECT T2.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC | nvbench |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
C... | Number of bounties opened and closed. | WITH subquery AS (SELECT VoteTypeId, COUNT(*) AS number FROM Votes WHERE NOT BountyAmount IS NULL GROUP BY VoteTypeId) SELECT Name, number AS "number of votes" FROM subquery INNER JOIN VoteTypes ON subquery.VoteTypeId = VoteTypes.Id | sede |
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... | 对于高于7492.17元医疗费总额的患者沈鸿信的医疗记录,列出入院诊断疾病编码和名称分别是? | SELECT qtb.IN_DIAG_DIS_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_NM = '沈鸿信' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 7492.17) UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_NM = '沈鸿信' AND gyb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLIN... | css |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | what is the number of patients whose procedure long title is radical neck dissection, unilateral? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Radical neck dissection, unilateral" | mimicsql_data |
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,... | 汉防己甲素片(薄膜衣)在医疗就医号码82581255235的收费项目中等级是什么等级? | SELECT CHA_ITEM_LEV FROM t_kc22 WHERE MED_CLINIC_ID = '82581255235' AND SOC_SRT_DIRE_NM = '汉防己甲素片(薄膜衣)' | css |
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, give me the comparison about manufacturer over the name , and group by attribute name by a bar chart, and I want to list y axis from low to high order please. | SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Manufacturer | nvbench |
CREATE TABLE table_204_500 (
id number,
"year" number,
"title" text,
"peak chart positions\nus country" number,
"peak chart positions\nus" number,
"album" text
) | what was the next album after kitty wells ? | SELECT "album" FROM table_204_500 WHERE id = (SELECT id FROM table_204_500 WHERE "album" = 'kitty wells') + 1 | squall |
CREATE TABLE table_203_285 (
id number,
"year" number,
"location" text,
"gold" text,
"silver" text,
"bronze" text
) | how long is the time between the times the championship was held in moscow ? | SELECT MAX("year") - MIN("year") FROM table_203_285 WHERE "location" = 'moscow' | squall |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Create a bar chart showing all_games_percent across all neutral | SELECT All_Neutral, All_Games_Percent FROM basketball_match | nvbench |
CREATE TABLE table_61644 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What country placed t8 and scored 71-71-71=213? | SELECT "Country" FROM table_61644 WHERE "Place" = 't8' AND "Score" = '71-71-71=213' | wikisql |
CREATE TABLE table_name_94 (
opponent VARCHAR,
rank VARCHAR
) | What is the Opponent that has a Rank of 4? | SELECT opponent FROM table_name_94 WHERE rank = "4" | sql_create_context |
CREATE TABLE table_56269 (
"Driver" text,
"Entrant" text,
"Constructor" text,
"Chassis" text,
"Engine" text,
"Tyre" text
) | What is the tyre when the entrant is sa alfa romeo and the driver is luigi fagioli? | SELECT "Tyre" FROM table_56269 WHERE "Entrant" = 'sa alfa romeo' AND "Driver" = 'luigi fagioli' | wikisql |
CREATE TABLE table_204_270 (
id number,
"transmitter" text,
"kw" number,
"bbca" number,
"bbcb" number,
"d3&4" number,
"sdn" number,
"arqa" number,
"arqb" number,
"pol." text,
"a.g." text
) | which is the next bbca with the number 26 and its transmitter | SELECT "transmitter" FROM table_204_270 WHERE "bbca" = 26 ORDER BY id LIMIT 1 | squall |
CREATE TABLE Assets_in_Events (
Asset_ID INTEGER,
Event_ID INTEGER
)
CREATE TABLE Locations (
Location_ID INTEGER,
Other_Details VARCHAR(255)
)
CREATE TABLE Events (
Event_ID INTEGER,
Address_ID INTEGER,
Channel_ID INTEGER,
Event_Type_Code CHAR(15),
Finance_ID INTEGER,
Location... | A bar chart for listing the number of the names of products that are not in any event, and sort by the Product_Name from low to high please. | 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 Product_Name | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.