context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | what is admission type and lab test name of subject id 2560? | SELECT demographic.admission_type, lab.label FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE table_76488 (
"Rank" real,
"Club" text,
"Winners" real,
"Runners-up" real,
"Third" real
) | Which Third has Runners-up of 0, and Winners of 0, and a Club of far rabat? | SELECT AVG("Third") FROM table_76488 WHERE "Runners-up" = '0' AND "Winners" = '0' AND "Club" = 'far rabat' | wikisql |
CREATE TABLE table_7214 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | What is the total amount of points when the played number was less than 12? | SELECT SUM("Points") FROM table_7214 WHERE "Played" < '12' | wikisql |
CREATE TABLE table_61178 (
"Club" text,
"Nickname" text,
"Location" text,
"Home Ground" text,
"GFL Premierships" text,
"Years in GFL" text
) | What's the home ground of the Lions? | SELECT "Home Ground" FROM table_61178 WHERE "Nickname" = 'lions' | wikisql |
CREATE TABLE table_40337 (
"Year" real,
"Category" text,
"Champion" text,
"Runner-up" text,
"Score" text
) | Which category had a year of 1991? | SELECT "Category" FROM table_40337 WHERE "Year" = '1991' | wikisql |
CREATE TABLE table_name_15 (
cell_type VARCHAR,
conduction_speed__m_s_ VARCHAR
) | Which cell type has a conduction speed of 35? | SELECT cell_type FROM table_name_15 WHERE conduction_speed__m_s_ = "35" | sql_create_context |
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 all employees who have the letters D or S in their first name, draw 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 FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | nvbench |
CREATE TABLE table_77447 (
"Game" text,
"Date" text,
"Opponent" text,
"Result" text,
"Dolphins' points" text,
"Opponents' Points" text,
"Record" text,
"Streak" text,
"Attendance" text
) | What was the attendance of the Oakland Raiders game? | SELECT "Attendance" FROM table_77447 WHERE "Opponent" = 'oakland raiders' | wikisql |
CREATE TABLE table_8743 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | What was the date of week 3? | SELECT "Date" FROM table_8743 WHERE "Week" = '3' | wikisql |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code tex... | when has patient 97330 for the last time come to the hospital? | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 97330 ORDER BY admissions.admittime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_name_18 (
hometown_school VARCHAR,
team VARCHAR,
player VARCHAR
) | What was the home town of Bob Geren, picked by the San Diego Padres? | SELECT hometown_school FROM table_name_18 WHERE team = "san diego padres" AND player = "bob geren" | sql_create_context |
CREATE TABLE table_name_5 (
score INTEGER,
player VARCHAR
) | What is the average score with lee westwood as the player? | SELECT AVG(score) FROM table_name_5 WHERE player = "lee westwood" | sql_create_context |
CREATE TABLE table_618 (
"Ensemble" text,
"Gold Medals" real,
"Silver Medals" real,
"Bronze Medals" real,
"Total Medals" real
) | How many gold medals does the Choctawhatchee High School have? | SELECT MAX("Gold Medals") FROM table_618 WHERE "Ensemble" = 'Choctawhatchee High School' | wikisql |
CREATE TABLE table_55058 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | If the Home team is carlton, what's the lowest Crowd found? | SELECT MIN("Crowd") FROM table_55058 WHERE "Home team" = 'carlton' | wikisql |
CREATE TABLE table_name_12 (
game INTEGER,
record VARCHAR
) | Which game had a record of 45-16? | SELECT AVG(game) FROM table_name_12 WHERE record = "45-16" | sql_create_context |
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREAT... | Find the number of dorms for each gender in a bar chart, list in ascending by the bars. | SELECT gender, COUNT(*) FROM Dorm GROUP BY gender ORDER BY gender | nvbench |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 哪几个医院给患者31744716开了名为连花清瘟胶囊的药 | SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_ID = '31744716' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '连花清瘟胶囊') | css |
CREATE TABLE table_13112 (
"Elected" text,
"Assembled" text,
"Dissolved" text,
"1st member" text,
"2nd member" text
) | What Assembled has Elected of 1562/63? | SELECT "Assembled" FROM table_13112 WHERE "Elected" = '1562/63' | 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... | what are patient 77177 hospital admission times in 2101? | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 77177 AND STRFTIME('%y', admissions.admittime) = '2101' | mimic_iii |
CREATE TABLE table_52417 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which Home team has an Away team score of 6.9 (45)? | SELECT "Home team" FROM table_52417 WHERE "Away team score" = '6.9 (45)' | wikisql |
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,
... | 从06年7月29日至14年1月26日之间患者陈怡宁所有检验结果指标记录中的仪器名称都叫什么?编号都是什么? | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb 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 = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHE... | css |
CREATE TABLE table_16400024_1 (
release_date VARCHAR,
part_number_s_ VARCHAR
) | What is the release date of part 80525py500512bx80525u500512bx80525u500512e? | SELECT release_date FROM table_16400024_1 WHERE part_number_s_ = "80525PY500512BX80525U500512BX80525U500512E" | 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... | How many patients admitted before the year 2158 had a procedure titled radical neck dissection, unilateral? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2158" AND procedures.long_title = "Radical neck dissection, unilateral" | mimicsql_data |
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,
... | 0057514这个医疗机构在零七年四月二十八日到零九年九月八日期间看过新生儿门诊的记录有多少 | SELECT COUNT(*) FROM mzjzjlb JOIN hz_info_mzjzjlb JOIN hz_info ON hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.mzjzjlb_id = mzjzjlb.mzjzjlb_id AND hz_info_mzjzjlb.YLJGDM = hz_info.YLJGDM WHERE hz_info.YLJGDM = '00... | css |
CREATE TABLE table_53104 (
"Race" text,
"Circuit" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Constructor" text,
"Tyre" text,
"Report" text
) | What driver was the winner when Joakim Bonnier was in the Pole Position? | SELECT "Winning driver" FROM table_53104 WHERE "Pole position" = 'joakim bonnier' | wikisql |
CREATE TABLE table_name_84 (
player VARCHAR,
jersey_number_s_ VARCHAR
) | Who has a Jersey number of 31? | SELECT player FROM table_name_84 WHERE jersey_number_s_ = "31" | sql_create_context |
CREATE TABLE table_name_54 (
year INTEGER,
location VARCHAR,
winner VARCHAR
) | WHAT YEAR WAS AT GIANTS STADIUM, WITH WINNER OF NEW YORK GIANTS? | SELECT MIN(year) FROM table_name_54 WHERE location = "giants stadium" AND winner = "new york giants" | sql_create_context |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | Downvoted, closed or deleted questions. | SELECT * FROM Posts WHERE PostTypeId = 1 AND (Score < -1 OR NOT ClosedDate IS NULL OR NOT DeletionDate IS NULL) | sede |
CREATE TABLE table_169955_1 (
months_in_malayalam_era VARCHAR,
in_malayalam VARCHAR
) | Name the months in the malayalam era for | SELECT months_in_malayalam_era FROM table_169955_1 WHERE in_malayalam = "കുംഭം" | sql_create_context |
CREATE TABLE customer_orders (
order_id number,
customer_id number,
order_status text,
order_date time,
order_details text
)
CREATE TABLE order_items (
order_id number,
product_id number,
order_quantity text
)
CREATE TABLE customer_addresses (
customer_id number,
address_id num... | Which customers use 'Cash' for payment method? Return the customer names. | SELECT customer_name FROM customers WHERE payment_method = "Cash" | spider |
CREATE TABLE table_16441561_5 (
cfl_team VARCHAR,
college VARCHAR
) | Which CFL team did the player from British Columbia get drafted to | SELECT cfl_team FROM table_16441561_5 WHERE college = "British Columbia" | sql_create_context |
CREATE TABLE table_204_294 (
id number,
"date" text,
"time" text,
"opponent#" text,
"rank#" text,
"site" text,
"tv" text,
"result" text,
"attendance" number
) | what was the nebraska cornhuskers highest rank of 2007 | SELECT MIN("rank#") FROM table_204_294 | squall |
CREATE TABLE table_name_51 (
years VARCHAR,
goals VARCHAR
) | What years had players who scored 36 goals? | SELECT years FROM table_name_51 WHERE goals = "36" | sql_create_context |
CREATE TABLE table_16295365_1 (
conference VARCHAR,
school VARCHAR
) | Which conference is Belmont in? | SELECT conference FROM table_16295365_1 WHERE school = "Belmont" | sql_create_context |
CREATE TABLE table_74385 (
"Year" real,
"Network" text,
"Play-by-play announcers" text,
"s Color commentator" text,
"Pregame hosts" text,
"Pregame analysts" text
) | Who is the s color commentator when the pregame host is jon sciambi? | SELECT "s Color commentator" FROM table_74385 WHERE "Pregame hosts" = 'Jon Sciambi' | wikisql |
CREATE TABLE table_name_51 (
home_team VARCHAR,
away_team VARCHAR
) | Who is the home side when north melbourne is the away side? | SELECT home_team FROM table_name_51 WHERE away_team = "north melbourne" | sql_create_context |
CREATE TABLE table_65882 (
"Source" text,
"Chrome" text,
"Internet Explorer" text,
"Firefox" text,
"Safari" text,
"Opera" text,
"Other" text
) | According to W3Counter, what percentage of browsers used Firefox? | SELECT "Firefox" FROM table_65882 WHERE "Source" = 'w3counter' | wikisql |
CREATE TABLE table_3976 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | Name the cfl team for robert beveridge | SELECT "CFL Team" FROM table_3976 WHERE "Player" = 'Robert Beveridge' | wikisql |
CREATE TABLE table_18940 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | Name the won for try bonus of 10 | SELECT "Won" FROM table_18940 WHERE "Try bonus" = '10' | wikisql |
CREATE TABLE table_name_63 (
rank VARCHAR,
s_wicket VARCHAR,
player VARCHAR
) | Which rank is 40 for s Wicket with a player of Daniel Marsh? | SELECT rank FROM table_name_63 WHERE s_wicket = "40" AND player = "daniel marsh" | sql_create_context |
CREATE TABLE table_name_31 (
tournament VARCHAR,
extra VARCHAR
) | In what tournament was there an extra of 400 m hurdles? | SELECT tournament FROM table_name_31 WHERE extra = "400 m hurdles" | sql_create_context |
CREATE TABLE table_name_91 (
year INTEGER,
chassis VARCHAR
) | What is the average year for a merzario a2 chassis? | SELECT AVG(year) FROM table_name_91 WHERE chassis = "merzario a2" | 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 demographic ... | how many patients born before year 2085 had s/p fall as their primary disease? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "S/P FALL" AND demographic.dob_year < "2085" | mimicsql_data |
CREATE TABLE table_67162 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What place does Fred Funk, who has a score of 69-69=138, have? | SELECT "Place" FROM table_67162 WHERE "Score" = '69-69=138' AND "Player" = 'fred funk' | wikisql |
CREATE TABLE table_3113 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
) | What was the original air date of 'The Boss'? | SELECT "Original air date" FROM table_3113 WHERE "Title" = 'The Boss' | 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
) | A visualization to show the headquarter and revenue of all manufacturers sorted by their revenue in the descending order. | SELECT Headquarter, Revenue FROM Manufacturers ORDER BY Revenue DESC | nvbench |
CREATE TABLE table_12072 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | What is the highest number of wins that has a top-25 of 13 and events less than 32? | SELECT MAX("Wins") FROM table_12072 WHERE "Top-25" = '13' AND "Events" < '32' | wikisql |
CREATE TABLE table_204_698 (
id number,
"name" text,
"lifetime" text,
"nationality" text,
"notable as" text,
"notes" text
) | patricia velasquez and ron vawter both had what career ? | SELECT "notable as" FROM table_204_698 WHERE "name" = 'patricia velasquez' INTERSECT SELECT "notable as" FROM table_204_698 WHERE "name" = 'ron vawter' | squall |
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_seaso... | For each record in schedule, show sum of price for each day in a bar chart, and I want to order from low to high by the X-axis. | SELECT Date, SUM(Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Date ORDER BY Date | nvbench |
CREATE TABLE tourist_attraction_features (
tourist_attraction_id number,
feature_id number
)
CREATE TABLE visits (
visit_id number,
tourist_attraction_id number,
tourist_id number,
visit_date time,
visit_details text
)
CREATE TABLE shops (
shop_id number,
shop_details text
)
CREAT... | What are the details of the three most expensive hotels? | SELECT other_hotel_details FROM hotels ORDER BY price_range DESC LIMIT 3 | spider |
CREATE TABLE table_56470 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/retired" text,
"Grid" real
) | How many grids have a Constructor of talbot-lago - talbot, a Laps under 83, and a driver of johnny claes? | SELECT COUNT("Grid") FROM table_56470 WHERE "Constructor" = 'talbot-lago - talbot' AND "Laps" < '83' AND "Driver" = 'johnny claes' | wikisql |
CREATE TABLE table_name_12 (
race VARCHAR,
distance VARCHAR,
winner_or_2nd VARCHAR
) | What is the race with a 10f distance and mollison as the winner or 2nd? | SELECT race FROM table_name_12 WHERE distance = "10f" AND winner_or_2nd = "mollison" | sql_create_context |
CREATE TABLE table_name_32 (
date VARCHAR,
result VARCHAR,
record VARCHAR
) | What date has w 20-17 as the result, and 1-0 as the record? | SELECT date FROM table_name_32 WHERE result = "w 20-17" AND record = "1-0" | sql_create_context |
CREATE TABLE table_name_41 (
entrant VARCHAR,
year INTEGER
) | Who was the entrant before 1988? | SELECT entrant FROM table_name_41 WHERE year < 1988 | sql_create_context |
CREATE TABLE table_204_784 (
id number,
"player" text,
"league" number,
"cup" number,
"europa league" number,
"total" number
) | who was the top goalscorer on this team ? | SELECT "player" FROM table_204_784 WHERE id = 1 | squall |
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... | 在14年6月18日到14年12月24日间叫做彭哲茂的病患开出了氟哌噻吨美利曲辛片总共多少次? | 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 '2014-06-18' AND '2014-12-24' AND t_kc22.SOC_SRT_DIRE_NM = '氟哌噻吨美利曲辛片' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fg... | css |
CREATE TABLE table_8575 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) | What label is from the Region of Spain? | SELECT "Label" FROM table_8575 WHERE "Region" = 'spain' | wikisql |
CREATE TABLE table_69999 (
"Tournament" text,
"Wins" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | During the PGA Championship, what's the lowest amount of events with wins greater than 0? | SELECT MIN("Events") FROM table_69999 WHERE "Tournament" = 'pga championship' AND "Wins" > '0' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodi... | was the magnesium value of patient 028-62326 last measured on the last hospital visit less than it was first measured on the last hospital visit? | SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-62326' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi... | eicu |
CREATE TABLE table_36124 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | When has Score of 4 5 and quebec nordiques as Visitor? | SELECT "Date" FROM table_36124 WHERE "Score" = '4–5' AND "Visitor" = 'quebec nordiques' | wikisql |
CREATE TABLE table_27927185_1 (
originalairdate VARCHAR,
viewers__millions_ VARCHAR
) | What was the original air-date that had 4.77 million viewers? | SELECT originalairdate FROM table_27927185_1 WHERE viewers__millions_ = "4.77" | sql_create_context |
CREATE TABLE table_name_29 (
points__percentage VARCHAR,
total_w_l_h VARCHAR
) | WHAT IS THE POINTS PERCENTAGE WITH A TOTAL OF 1-2-2 RECORD? | SELECT points__percentage FROM table_name_29 WHERE total_w_l_h = "1-2-2" | sql_create_context |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Comments (
Id num... | Minhas Perguntas fechadas como Ampla Demais. People keep closing old questions I answered that obviously I think are good questions, or at least salvageable. Since I get no notification of such closing, I created this query. | SELECT answer.Id AS "post_link", * FROM Posts AS answer JOIN Posts AS p ON answer.ParentId = p.Id JOIN PostHistory AS ph ON ph.PostId = p.Id JOIN PostTypes AS pt ON p.PostTypeId = pt.Id WHERE ph.CreationDate = (SELECT MAX(ph.CreationDate) FROM PostHistory AS ph JOIN CloseReasonTypes AS crt ON crt.Id = ph.Comment JOIN P... | sede |
CREATE TABLE table_13919 (
"Position" text,
"Gymnast" text,
"A Score" real,
"B Score" real,
"Total" real
) | Can you tell me the total number of Total that has the B Score of 9.15? | SELECT COUNT("Total") FROM table_13919 WHERE "B Score" = '9.15' | wikisql |
CREATE TABLE table_77335 (
"C/W 15+" real,
"Oblast\\Age" text,
"15 to 17" real,
"18 to 19" real,
"20 to 24" real,
"25 to 29" real,
"30 to 34" real,
"35 to 39" real,
"40 to 44" real,
"45 to 49" real,
"50 to 54" real,
"55 to 59" real,
"60 to 64" real,
"65 to 69" rea... | What is the total 60 to 64 when the Oblast\Age is Nenets in Yamal AO, and the 45 to 49 is bigger than 3,883? | SELECT SUM("60 to 64") FROM table_77335 WHERE "Oblast\\Age" = 'nenets in yamal ao' AND "45 to 49" > '3,883' | wikisql |
CREATE TABLE table_37190 (
"Ship" text,
"Hull No." text,
"Builder" text,
"Home Port" text,
"Commissioned\u2013 Decommissioned" text,
"NVR page" text
) | Name the ship for oakland home port and NVR page of aor-3 | SELECT "Ship" FROM table_37190 WHERE "Home Port" = 'oakland' AND "NVR page" = 'aor-3' | wikisql |
CREATE TABLE table_64079 (
"Year" real,
"Category" text,
"Film" text,
"Result" text,
"Lost to" text
) | which Film has a Category of best actress musical or comedy, and a Lost to of nicole kidman ( moulin rouge! )? | SELECT "Film" FROM table_64079 WHERE "Category" = 'best actress – musical or comedy' AND "Lost to" = 'nicole kidman ( moulin rouge! )' | wikisql |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ tim... | 门诊诊断患者柏飞鸿为煤工尘肺,他的检测指标223006的结果定量及其单位均为? | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb 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.JZ... | css |
CREATE TABLE table_62398 (
"S.no." real,
"Power Plant" text,
"State" text,
"Commissioned Capacity (MW)" real,
"year of commission" real
) | What power plant was commissioned in 2008? | SELECT "Power Plant" FROM table_62398 WHERE "year of commission" = '2008' | wikisql |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTy... | List of databases on the StackExchange network. | SELECT name FROM sysdatabases WHERE name NOT IN ('master', 'tempdb', 'model', 'msdb', 'Data.StackExchange') | sede |
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... | how many patients are diagnosed with acute subdural hematoma under age 74? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ACUTE SUBDURAL HEMATOMA" AND demographic.age < "74" | mimicsql_data |
CREATE TABLE train (
Train_ID int,
Name text,
Time text,
Service text
)
CREATE TABLE station (
Station_ID int,
Name text,
Annual_entry_exit real,
Annual_interchanges real,
Total_Passengers real,
Location text,
Main_Services text,
Number_of_Platforms int
)
CREATE TABLE t... | Show the total number of platforms of locations in each location in a bar chart, could you order by the names from high to low? | SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location ORDER BY Location DESC | nvbench |
CREATE TABLE table_27782699_3 (
outgoing_manager VARCHAR,
replaced_by VARCHAR
) | Which manager was replaced by Thomas Thomasberg? | SELECT outgoing_manager FROM table_27782699_3 WHERE replaced_by = "Thomas Thomasberg" | sql_create_context |
CREATE TABLE table_17941032_2 (
tries_against VARCHAR,
points_for VARCHAR
) | How many tries against were there with points of 150? | SELECT tries_against FROM table_17941032_2 WHERE points_for = "150" | sql_create_context |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImage... | Users from Moscow with QPosts with mscrm Tags *better performance*. | SELECT DISTINCT u.DisplayName, CONCAT('https://stackoverflow.com/users/', p.OwnerUserId) AS profile_link FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON pt.PostId = p.Id INNER JOIN Users AS u ON p.OwnerUserId = u.Id AND LOWER(u.Location) LIKE '%moscow%' WHERE t.TagName IN ('dynamics... | sede |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE T... | Minimum, Maximum, and Average Number of Answers Per Post. The minimum, maximum, and average number of answers per post on Stack Overflow. | SELECT MIN(Posts.AnswerCount) AS "minimum_#_of_answers", AVG(CAST(Posts.AnswerCount AS FLOAT)) AS "average_#_of_answers", MAX(Posts.AnswerCount) AS "maximum_#_of_answers" FROM Posts WHERE Posts.PostTypeId = 1 | sede |
CREATE TABLE table_27501030_7 (
decision VARCHAR,
opponent VARCHAR
) | What is the decision when the opponents are atlanta thrashers? | SELECT decision FROM table_27501030_7 WHERE opponent = "Atlanta Thrashers" | sql_create_context |
CREATE TABLE table_29551 (
"Country" text,
"Name" text,
"Host(s)" text,
"Judges" text,
"Network" text,
"Air dates" text
) | What is the name of the series with the unknown host? | SELECT "Name" FROM table_29551 WHERE "Host(s)" = 'unknown' | wikisql |
CREATE TABLE table_49804 (
"Game" real,
"November" real,
"Opponent" text,
"Score" text,
"Record" text
) | What is the sum of November, when Game is greater than 23? | SELECT SUM("November") FROM table_49804 WHERE "Game" > '23' | wikisql |
CREATE TABLE table_20979 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Falcons points" real,
"Opponents" real,
"Record" text,
"Attendance" real
) | What was the result of the 1978 Atlanta Falcons season when the record was 1-2? | SELECT "Result" FROM table_20979 WHERE "Record" = '1-2' | wikisql |
CREATE TABLE Document_Locations (
Document_ID INTEGER,
Location_Code CHAR(15),
Date_in_Location_From DATETIME,
Date_in_Locaton_To DATETIME
)
CREATE TABLE Documents_to_be_Destroyed (
Document_ID INTEGER,
Destruction_Authorised_by_Employee_ID INTEGER,
Destroyed_by_Employee_ID INTEGER,
Pla... | I want to see trend of day_number by calendar date | SELECT Calendar_Date, Day_Number FROM Ref_Calendar | nvbench |
CREATE TABLE table_11196 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | what was the engine used before 1996 with 5 points? | SELECT "Engine" FROM table_11196 WHERE "Year" < '1996' AND "Points" = '5' | wikisql |
CREATE TABLE table_name_46 (
enrollment INTEGER,
capacity INTEGER
) | What is the enrollment associated with a capacity greater then 35,650? | SELECT MIN(enrollment) FROM table_name_46 WHERE capacity > 35 OFFSET 650 | sql_create_context |
CREATE TABLE table_58372 (
"Rank" real,
"Player" text,
"Country" text,
"Earnings ( $ )" real,
"Events" real,
"Wins" real
) | Who is the lowest ranked player from the United States that has less than 3 Wins? | SELECT MIN("Rank") FROM table_58372 WHERE "Country" = 'united states' AND "Wins" < '3' | 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 regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALA... | For those employees who did not have any job in the past, visualize a bar chart about the distribution of hire_date and the average of department_id bin hire_date by time, could you order by the the average of department id from low to high? | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(DEPARTMENT_ID) | nvbench |
CREATE TABLE table_16645_1 (
__percentage VARCHAR,
rural INTEGER,
year__january_ VARCHAR
) | What is the rural population percentage in 1979? | SELECT MIN(rural), __percentage FROM table_16645_1 WHERE year__january_ = 1979 | sql_create_context |
CREATE TABLE table_name_36 (
team VARCHAR,
game VARCHAR,
score VARCHAR
) | What team played before game 71 and had a score w 91 86 (ot)? | SELECT team FROM table_name_36 WHERE game < 71 AND score = "w 91–86 (ot)" | 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... | how many female patients followed the procedure icd9 code 5783? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "F" AND procedures.icd9_code = "5783" | mimicsql_data |
CREATE TABLE table_name_62 (
silver INTEGER,
bronze INTEGER
) | What is the average number of silvers for nations with over 1 bronze medal? | SELECT AVG(silver) FROM table_name_62 WHERE bronze > 1 | sql_create_context |
CREATE TABLE table_30912 (
"Round" real,
"Date" text,
"Opponent" text,
"Home/Away" text,
"Score (Collingwoods score is in bold)" text,
"Result (includes margin)" text,
"Venue" text,
"Position on Ladder" text
) | Was the round where they were in 6th at home or away? | SELECT "Home/Away" FROM table_30912 WHERE "Position on Ladder" = '6th' | wikisql |
CREATE TABLE table_40059 (
"Club" text,
"Wins" real,
"Loses" real,
"Points For" real,
"Points Against" real,
"Percentage" text,
"Points" real
) | What losses have points for less than 1175, wins greater than 2, points against greater than 894, and 24 as the points? | SELECT "Loses" FROM table_40059 WHERE "Points For" < '1175' AND "Wins" > '2' AND "Points Against" > '894' AND "Points" = '24' | wikisql |
CREATE TABLE table_name_81 (
record VARCHAR,
date VARCHAR,
decision VARCHAR,
home VARCHAR
) | What record has a decision of parent, Philadelphia as the home, with december 12 as the date? | SELECT record FROM table_name_81 WHERE decision = "parent" AND home = "philadelphia" AND date = "december 12" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | Find out the long title of procedure for the patient with patient id 3343. | SELECT procedures.long_title FROM procedures WHERE procedures.subject_id = "3343" | mimicsql_data |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden ... | Show 10 most viewed posts with links. | SELECT TOP(10) AS ViewCount, Id AS "post_link" FROM Posts ORDER BY ViewCount DESC | sede |
CREATE TABLE table_2185 (
"Year" real,
"Division" real,
"League" text,
"Regular Season" text,
"Playoffs" text,
"Open Cup" text
) | What's the highest division number through the years? | SELECT MAX("Division") FROM table_2185 | wikisql |
CREATE TABLE phone (
Name text,
Phone_ID int,
Memory_in_G int,
Carrier text,
Price real
)
CREATE TABLE phone_market (
Market_ID int,
Phone_ID text,
Num_of_stock int
)
CREATE TABLE market (
Market_ID int,
District text,
Num_of_employees int,
Num_of_shops real,
Rankin... | Show the number of names of phones in a bar chart, display by the y-axis in asc. | SELECT Name, COUNT(Name) FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID GROUP BY Name ORDER BY COUNT(Name) | nvbench |
CREATE TABLE table_19671 (
"Year" real,
"Mens singles" text,
"Womens singles" text,
"Mens doubles" text,
"Womens doubles" text,
"Mixed doubles" text
) | HOW MANY YEARS DID MENS DOUBLES PLAYER HEIKI SORGE MEELIS MAISTE PLAY? | SELECT COUNT("Year") FROM table_19671 WHERE "Mens doubles" = 'Heiki Sorge Meelis Maiste' | wikisql |
CREATE TABLE table_1602620_1 (
term_ended VARCHAR,
elected VARCHAR
) | What year did the term end for those elected in 1990 | SELECT term_ended FROM table_1602620_1 WHERE elected = 1990 | sql_create_context |
CREATE TABLE table_14532 (
"Country" text,
"Total population (1000)" real,
"Total Foreign-born (1000)" real,
"Born in other EU state (1000)" real,
"Born in a non EU state (1000)" real
) | What is the highest Total Foreign-born (1000) from a non EU state (1000) of 685 and a population (1000) smaller than 10,666? | SELECT MAX("Total Foreign-born (1000)") FROM table_14532 WHERE "Born in a non EU state (1000)" = '685' AND "Total population (1000)" > '10,666' | wikisql |
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,
... | 列举出在2001年2月17日到2007年7月3日这段时间内患者24318631所有检验报告单的审核日期时间是什么呢? | SELECT jybgb.SHSJ FROM hz_info JOIN txmzjzjlb JOIN jybgb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '24318631' AND jybgb.BGRQ BETWEEN '2001-02-17' AND '2007-... | css |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.