context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_25699 ( "Team" text, "SEC Wins" real, "SEC Losses" real, "Percentage" text, "Home Record" text, "Road Record" text, "Overall Record" text )
What is the percentage for the team with a road record of 3-4 and a home record of 7-0?
SELECT "Percentage" FROM table_25699 WHERE "Road Record" = '3-4' AND "Home Record" = '7-0'
wikisql
CREATE TABLE table_46067 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What is the score for the away team Chelsea?
SELECT "Score" FROM table_46067 WHERE "Away team" = 'chelsea'
wikisql
CREATE TABLE table_name_91 ( wins INTEGER, rank INTEGER )
What's the mean number of wins with a rank that's more than 5?
SELECT AVG(wins) FROM table_name_91 WHERE rank > 5
sql_create_context
CREATE TABLE table_name_73 ( liberal_ticket VARCHAR, socialist_workers_ticket VARCHAR )
What is the liberal ticket that has judith white as the socialist workers?
SELECT liberal_ticket FROM table_name_73 WHERE socialist_workers_ticket = "judith white"
sql_create_context
CREATE TABLE table_13275 ( "School" text, "Location" text, "Mascot" text, "IHSAA Class" text, "County" text, "Year Joined" text, "Year Left" text, "Conference Joined" text )
What is the location for Lakewood Park Christian?
SELECT "Location" FROM table_13275 WHERE "School" = 'lakewood park christian'
wikisql
CREATE TABLE table_58720 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" text )
What was the money for place t3 and United States?
SELECT "Money ( $ )" FROM table_58720 WHERE "Place" = 't3' AND "Country" = 'united states'
wikisql
CREATE TABLE table_56374 ( "State" text, "Swimsuit" real, "Evening gown" real, "Interview" real, "Average" real )
What is the total number of interviews where the evening gown number is less than 8.82, the state is Kentucky, and the average is more than 8.85?
SELECT SUM("Interview") FROM table_56374 WHERE "Evening gown" < '8.82' AND "State" = 'kentucky' AND "Average" > '8.85'
wikisql
CREATE TABLE table_7988 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What was the score against Portland in game numbers under 20?
SELECT "Score" FROM table_7988 WHERE "Game" < '20' AND "Team" = 'portland'
wikisql
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
what name was the drug that patient 7375 had been prescribed two times until 08/2101?
SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7375) AND STRFTIME('%y-%m', prescriptions.startdate) <= '2101-08' GROUP BY prescriptions.drug) AS t1 WHERE t1.c1...
mimic_iii
CREATE TABLE table_70842 ( "Year" real, "Competition" text, "Town" text, "Opponent" text, "Final score" text )
What is the final score in 2007 for the world league in novi sad played against Italy?
SELECT "Final score" FROM table_70842 WHERE "Year" = '2007' AND "Competition" = 'world league' AND "Town" = 'novi sad' AND "Opponent" = 'italy'
wikisql
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE course...
On Friday does REES 395 have class ?
SELECT DISTINCT course_offering.friday 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.department = 'REES' AND course.number = 395 AND semester.semester = 'WN' AND semester.year = 2016
advising
CREATE TABLE table_1646960_3 ( winning_song VARCHAR, debut_album VARCHAR )
What is the winning song for the artist with a debut album 'the winner'?
SELECT winning_song FROM table_1646960_3 WHERE debut_album = "The winner"
sql_create_context
CREATE TABLE table_41815 ( "Year" real, "Tournament Name" text, "Champions" text, "Runners-up" text, "Score" text )
What tournament had a score of 5 7, 6 4, 6 4?
SELECT "Tournament Name" FROM table_41815 WHERE "Score" = '5–7, 6–4, 6–4'
wikisql
CREATE TABLE table_38766 ( "Entrants" real, "Winner" text, "Prize" text, "Runner-up" text, "Results" text )
What were the results of the event where $817,781 was awarded to less than 1,236 entrants?
SELECT "Results" FROM table_38766 WHERE "Entrants" < '1,236' AND "Prize" = '$817,781'
wikisql
CREATE TABLE table_name_41 ( attendance VARCHAR, date VARCHAR )
What iwas the attendance of the game that took place on december 6, 1998?
SELECT attendance FROM table_name_41 WHERE date = "december 6, 1998"
sql_create_context
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE course_offering ( offering_id int, course_id int, ...
Is it true that all upper-level classes have exams ?
SELECT COUNT(*) = 0 FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_exams = 'N' AND program_course.category LIKE '%ULCS%'
advising
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 ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
what is the number of patients whose diagnoses short title is perinat gi sys dis nec and drug route is po/ng?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Perinat GI sys dis NEC" AND prescriptions.route = "PO/NG"
mimicsql_data
CREATE TABLE table_57618 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is North Melbourne's Away team score?
SELECT "Away team score" FROM table_57618 WHERE "Away team" = 'north melbourne'
wikisql
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, ...
what was the top five prescribed drugs for the patients in the age of 30s in the previous year?
SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 30 AND 39) AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start o...
mimic_iii
CREATE TABLE table_204_553 ( id number, "outcome" text, "no." number, "date" text, "tournament" text, "surface" text, "partner" text, "opponents in the final" text, "score in the final" text )
which parter did she have the most ?
SELECT "partner" FROM table_204_553 GROUP BY "partner" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE table_2893 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "U.S. viewers (million)" text, "Original air date" text, "Production code" real )
What was the air date where there were 5.72 million viewers?
SELECT "Original air date" FROM table_2893 WHERE "U.S. viewers (million)" = '5.72'
wikisql
CREATE TABLE table_22259 ( "#" real, "Cover Date" text, "Story Title" text, "Writer/s" text, "Artist/s" text, "Letterer/s" text, "Colourist/s" text, "Editor/s" text, "Comments" text )
What is the title of the issue where the art was done by Barry Kitson and Farmer?
SELECT "Story Title" FROM table_22259 WHERE "Artist/s" = 'Barry Kitson and Farmer'
wikisql
CREATE TABLE table_name_59 ( cup_apps__sub_ VARCHAR, cup_goals VARCHAR )
Which Cup Apps (sub) had 2 goals?
SELECT cup_apps__sub_ FROM table_name_59 WHERE cup_goals = "2"
sql_create_context
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, g...
patient 95986 has produced gastric emesis in 05/this year?
SELECT COUNT(*) > 0 FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 95986)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'gastric emesis...
mimic_iii
CREATE TABLE table_7154 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the total number of bronze medals of the nation with 4 total medals and 1 silver?
SELECT COUNT("Bronze") FROM table_7154 WHERE "Total" = '4' AND "Silver" = '1'
wikisql
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE ...
TOP USERS IN TAG GROUPED BY COUNTRY.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", u.Id AS "user_link", u.Reputation, COUNT(p.Id) FROM Users AS u INNER JOIN Posts AS p ON p.OwnerUserId = u.Id INNER JOIN PostTags AS pt ON pt.PostId = p.Id INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE LOWER(Location) LIKE LOWER('%##countryname##%') AND t.TagNa...
sede
CREATE TABLE table_4901 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Who played a home team that scored 9.16 (70)?
SELECT "Away team" FROM table_4901 WHERE "Home team score" = '9.16 (70)'
wikisql
CREATE TABLE table_67769 ( "Municipality" text, "Number" real, "Population" real, "Area\u00b9" real, "Density\u00b2" real )
Name the least number with density more than 262 with population more than 22,415 and area less than 335.14
SELECT MIN("Number") FROM table_67769 WHERE "Density\u00b2" > '262' AND "Population" > '22,415' AND "Area\u00b9" < '335.14'
wikisql
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
编号为34349699182的这次门诊就诊中,就诊的状态和对应的代码分别是什么
SELECT JZZTDM, JZZTMC FROM mzjzjlb WHERE JZLSH = '34349699182'
css
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...
患者谢芷若在哪几次医疗记录中存在不低于5630.09元的药品消费?把医疗就诊编号列举出来
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 < 5630.09)
css
CREATE TABLE table_56921 ( "Code" real, "Type" text, "Name" text, "Area (km 2 )" real, "Population" real, "Regional County Municipality" text, "Region" real )
Tell me the number of regions with an area of 58.81
SELECT COUNT("Region") FROM table_56921 WHERE "Area (km 2 )" = '58.81'
wikisql
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
报一下身高和体重,患者18593737的
SELECT mzjzjlb.SG, mzjzjlb.TZ FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '18593737'
css
CREATE TABLE table_43224 ( "Card" text, "Weight Class" text, "Round" real, "Time" text, "Method" text )
Which weight class had a time of 4:59?
SELECT "Weight Class" FROM table_43224 WHERE "Time" = '4:59'
wikisql
CREATE TABLE table_26362 ( "1 January 2010" text, "DF" text, "Adam Hinshelwood" text, "Aldershot Town" text, "Wycombe Wanderers" text, "Undisclosed" text )
What is the df when Adam Hinshelwood is Junior Mendes?
SELECT "DF" FROM table_26362 WHERE "Adam Hinshelwood" = 'Junior Mendes'
wikisql
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, ...
what is average age of patients whose insurance is government and days of hospital stay is 5?
SELECT AVG(demographic.age) FROM demographic WHERE demographic.insurance = "Government" AND demographic.days_stay = "5"
mimicsql_data
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 demographic ( subject_id text, hadm_id t...
give me the number of patients whose admission location is trsf within this facility and year of birth is less than 1879?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.dob_year < "1879"
mimicsql_data
CREATE TABLE table_name_2 ( lost INTEGER, position VARCHAR, points VARCHAR, difference VARCHAR )
What is the total lost that has points greater than 8 and a difference of - 8 and a position of greater than 5?
SELECT SUM(lost) FROM table_name_2 WHERE points > 8 AND difference = "- 8" AND position > 5
sql_create_context
CREATE TABLE table_7565 ( "Player" text, "Country" text, "Year(s) won" text, "Total" text, "To par" text )
Which player won the Masters in 1976?
SELECT "Player" FROM table_7565 WHERE "Year(s) won" = '1976'
wikisql
CREATE TABLE Undergoes ( Patient INTEGER, Procedures INTEGER, Stay INTEGER, DateUndergoes DATETIME, Physician INTEGER, AssistingNurse INTEGER ) CREATE TABLE Room ( RoomNumber INTEGER, RoomType VARCHAR(30), BlockFloor INTEGER, BlockCode INTEGER, Unavailable BOOLEAN ) CREATE ...
What are the name and primarily affiliated department name of each physician?, and list y axis from low to high order.
SELECT T3.Name, COUNT(T3.Name) FROM Physician AS T1 JOIN Affiliated_With AS T2 ON T1.EmployeeID = T2.Physician JOIN Department AS T3 ON T2.Department = T3.DepartmentID WHERE T2.PrimaryAffiliation = 1 GROUP BY T3.Name ORDER BY COUNT(T3.Name)
nvbench
CREATE TABLE table_17641206_6 ( episode VARCHAR, written_by VARCHAR )
Name the total number of episodes written by david cantor
SELECT COUNT(episode) FROM table_17641206_6 WHERE written_by = "David Cantor"
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 those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, a bar chart shows the distribution of hire_date and the average of employee_id bin hire_date by time, and rank in descending by the y-axis.
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(EMPLOYEE_ID) DESC
nvbench
CREATE TABLE table_name_91 ( country VARCHAR, score VARCHAR )
What is the country with a 68-73-69=210 score?
SELECT country FROM table_name_91 WHERE score = 68 - 73 - 69 = 210
sql_create_context
CREATE TABLE table_name_61 ( place VARCHAR, score VARCHAR )
What is the Place of the Player with a Score of 70-71=141?
SELECT place FROM table_name_61 WHERE score = 70 - 71 = 141
sql_create_context
CREATE TABLE table_45729 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text )
Name the Outcome which has a Score in the final of 4 6, 4 6 on october 21, 1990?
SELECT "Outcome" FROM table_45729 WHERE "Score in the final" = '4–6, 4–6' AND "Date" = 'october 21, 1990'
wikisql
CREATE TABLE table_name_42 ( constructor VARCHAR, driver VARCHAR, engine VARCHAR )
Who is the Constructor for driver Piercarlo Ghinzani and a Ford cosworth dfv 3.0 v8 engine?
SELECT constructor FROM table_name_42 WHERE driver = "piercarlo ghinzani" AND engine = "ford cosworth dfv 3.0 v8"
sql_create_context
CREATE TABLE table_60812 ( "Nat." text, "Name" text, "Moving from" text, "Type" text, "Transfer window" text, "Ends" real, "Transfer fee" text )
What nationality is Diogo?
SELECT "Nat." FROM table_60812 WHERE "Name" = 'diogo'
wikisql
CREATE TABLE table_60262 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" real )
Who did they play at Atlanta-Fulton County Stadium?
SELECT "Opponent" FROM table_60262 WHERE "Game site" = 'atlanta-fulton county stadium'
wikisql
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...
Visualize a scatter chart about the correlation between School_ID and ACC_Percent , and group by attribute ACC_Home.
SELECT School_ID, ACC_Percent FROM basketball_match GROUP BY ACC_Home
nvbench
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, ...
二零零二年三月二十五号之后患者18605753的住院就诊记录对应的检验报告单都有哪些都是什么住院就诊流水号?
SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND pers...
css
CREATE TABLE student ( ID varchar(5), name varchar(20), dept_name varchar(20), tot_cred numeric(3,0) ) CREATE TABLE department ( dept_name varchar(20), building varchar(15), budget numeric(12,2) ) CREATE TABLE classroom ( building varchar(15), room_number varchar(7), capacity n...
Find the total number of instructors for each department with a bar chart, show by the total number in asc.
SELECT T1.dept_name, COUNT(DISTINCT T3.ID) FROM department AS T1 JOIN student AS T2 ON T1.dept_name = T2.dept_name JOIN instructor AS T3 ON T1.dept_name = T3.dept_name ORDER BY COUNT(DISTINCT T3.ID)
nvbench
CREATE TABLE table_name_60 ( week INTEGER, date VARCHAR, attendance VARCHAR )
What was the latest week with a date of November 12, 1967 and less than 34,761 in attendance?
SELECT MAX(week) FROM table_name_60 WHERE date = "november 12, 1967" AND attendance < 34 OFFSET 761
sql_create_context
CREATE TABLE table_name_79 ( decile INTEGER, roll VARCHAR )
For the roll of 651, what was the lowest Decile?
SELECT MIN(decile) FROM table_name_79 WHERE roll = 651
sql_create_context
CREATE TABLE table_75565 ( "Name" text, "Pada 1" text, "Pada 2" text, "Pada 3" text, "Pada 4" text )
What is the Name of ng/na?
SELECT "Name" FROM table_75565 WHERE "Pada 3" = 'ङ ng/na'
wikisql
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as ...
Are 500 -level classes offered in Spring or Summer ?
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'department0' AND course.number BETWEEN 500 AND 500 + 100 AND semester.semester IN ('SP', 'SU', 'SS') AND semester.semester_i...
advising
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE wdmzjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH number, KH text, KLX num...
患者褚雯华在04年11月9日到19年1月17日,是找的哪些工号及姓名的医务人员检测甲状腺素的
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jy...
css
CREATE TABLE table_name_19 ( score VARCHAR, partner VARCHAR )
What was the score when Mark parterned with lorenzo manta?
SELECT score FROM table_name_19 WHERE partner = "lorenzo manta"
sql_create_context
CREATE TABLE table_name_29 ( position VARCHAR, nfl_club VARCHAR )
What is the position of the pittsburgh steelers?
SELECT position FROM table_name_29 WHERE nfl_club = "pittsburgh steelers"
sql_create_context
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, Dupli...
List of all question links.
SELECT 'http://chemistry.stackexchange.com/q/' + CAST(q.Id AS TEXT(10)) FROM Posts AS q WHERE q.PostTypeId = 1 ORDER BY q.Id
sede
CREATE TABLE table_60681 ( "HD designation" text, "Constellation" text, "Distance ( ly )" real, "Spectral type" text, "Signal power ( kW )" real, "Date sent" text, "Arrival date" text )
What is Date, when Constellation is 'Delphinus'?
SELECT "Date sent" FROM table_60681 WHERE "Constellation" = 'delphinus'
wikisql
CREATE TABLE table_70658 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the average value for Gold, when the value for Silver is greater than 2, and when the Nation is West Germany?
SELECT AVG("Gold") FROM table_70658 WHERE "Silver" > '2' AND "Nation" = 'west germany'
wikisql
CREATE TABLE table_77120 ( "Day 1" text, "Day 2" text, "Day 3" text, "Day 4" text, "Day 5" text, "Wednesday" text )
What is the day 1 when day 5 is math?
SELECT "Day 1" FROM table_77120 WHERE "Day 5" = 'math'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
how many patients were born before the year 2071 with an item id 50953?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2071" AND lab.itemid = "50953"
mimicsql_data
CREATE TABLE table_67972 ( "Event" text, "Time" text, "Nationality" text, "Date" text, "Meet" text, "Location" text )
In what Location in the United States the Time 2:25.62?
SELECT "Location" FROM table_67972 WHERE "Nationality" = 'united states' AND "Time" = '2:25.62'
wikisql
CREATE TABLE table_name_63 ( length VARCHAR, class VARCHAR, date VARCHAR )
Name the length for all class and date of march 18
SELECT length FROM table_name_63 WHERE class = "all" AND date = "march 18"
sql_create_context
CREATE TABLE table_name_6 ( member VARCHAR, party VARCHAR, electorate VARCHAR )
Which member of the National Party is from the Hinkler electorate?
SELECT member FROM table_name_6 WHERE party = "national" AND electorate = "hinkler"
sql_create_context
CREATE TABLE table_name_19 ( date VARCHAR, home_team VARCHAR )
Which Date has a Home team of st kilda?
SELECT date FROM table_name_19 WHERE home_team = "st kilda"
sql_create_context
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, ...
Which is the easiest class to be taken to fulfill the Other requirement ?
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%Other%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_c...
advising
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, ...
how many patients with morbid obesity/sda primary disease are dead?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.diagnosis = "MORBID OBESITY/SDA"
mimicsql_data
CREATE TABLE table_15780049_6 ( score VARCHAR, game VARCHAR )
What is the score of game 33?
SELECT score FROM table_15780049_6 WHERE game = 33
sql_create_context
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, View...
Questions with bounties awarded in the past.
SELECT Posts.Id AS "post_link", Votes.BountyAmount AS "Bounty Amount", Votes.CreationDate AS "Bounty Creation Date" FROM Posts INNER JOIN Votes ON Votes.PostId = Posts.Id WHERE Votes.VoteTypeId = 8 ORDER BY Votes.BountyAmount DESC, Votes.CreationDate DESC
sede
CREATE TABLE table_27767 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real, "U.S. viewers (millions)" text )
What was the original air date of the episode that had 5.30 million U.S. viewers?
SELECT "Original air date" FROM table_27767 WHERE "U.S. viewers (millions)" = '5.30'
wikisql
CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date )
Ignore movies whose director is NULL For each director, what are the titles and the highest rating among all of their movies they reviewed? Draw the result by a bar chart, rank x-axis in asc order.
SELECT title, MAX(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE director <> "null" GROUP BY title ORDER BY title
nvbench
CREATE TABLE table_62036 ( "Year" real, "Result" text, "Matches" real, "Wins" real, "Draws" real, "Losses" real )
What is the smallest Draws with a Result of runner-up, and Losses larger than 1?
SELECT MIN("Draws") FROM table_62036 WHERE "Result" = 'runner-up' AND "Losses" > '1'
wikisql
CREATE TABLE table_name_58 ( away_team VARCHAR, home_team VARCHAR )
Which Away team score has a Home team of richmond?
SELECT away_team AS score FROM table_name_58 WHERE home_team = "richmond"
sql_create_context
CREATE TABLE table_8715 ( "Event" text, "Record" text, "Nationality" text, "Date" text, "Meet" text, "Place" text )
what is the meet when the date is 3 august 2012?
SELECT "Meet" FROM table_8715 WHERE "Date" = '3 august 2012'
wikisql
CREATE TABLE table_10518 ( "Order" real, "Name" text, "Seasons" text, "Games" real, "Goals" real )
What seasons had 288 games and more than 100 goals?
SELECT "Seasons" FROM table_10518 WHERE "Goals" > '100' AND "Games" = '288'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
count the number of patients whose diagnoses short title is other psoriasis and drug type is main?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Other psoriasis" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE Tasks ( task_id INTEGER, project_id INTEGER, task_details VARCHAR(255), "eg Agree Objectives" VARCHAR(1) ) CREATE TABLE Grants ( grant_id INTEGER, organisation_id INTEGER, grant_amount DECIMAL(19,4), grant_start_date DATETIME, grant_end_date DATETIME, other_details ...
List the research staff details, and order in ascending order, and count them by a bar chart
SELECT staff_details, COUNT(staff_details) FROM Research_Staff GROUP BY staff_details ORDER BY staff_details
nvbench
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, ...
what is the number of patients who are in careunit csru until 2101?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'csru' AND STRFTIME('%y', transfers.intime) <= '2101')
mimic_iii
CREATE TABLE table_name_49 ( player VARCHAR, to_par VARCHAR, score VARCHAR )
Who is the player with an E to par and a 68-73-69=210?
SELECT player FROM table_name_49 WHERE to_par = "e" AND score = 68 - 73 - 69 = 210
sql_create_context
CREATE TABLE Web_client_accelerator ( id int, name text, Operating_system text, Client text, Connection text ) CREATE TABLE browser ( id int, name text, market_share real ) CREATE TABLE accelerator_compatible_browser ( accelerator_id int, browser_id int, compatible_since_ye...
What are the ids and names of the web accelerators that are compatible with two or more browsers. Visualize by bar chart.
SELECT name, id FROM Web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id
nvbench
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 lab ( subject_id text, hadm_id text, ...
provide the number of patients who were admitted before the year 2162 and their primary disease is coronary artery disease\coronary artery bypass graft; myomectomy/sda .
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT; MYOMECTOMY/SDA" AND demographic.admityear < "2162"
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, ...
那个孙清涵的病人在2017年11月21日到2019年11月23日内所有检验结果指标记录中的仪器编号以及名称能不能给我详细列举出来?
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AN...
css
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...
为韩飞双这个患者在05年4月12日到12年6月12日内检测过尿素的医务人员工号及姓名分别是什么?
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM 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.JZLSH_MZ...
css
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...
哪些韩志明患者的检验报告单号对应的检验结果指标均异常和检验报告单号都是那个?
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '韩志明' AND NOT ...
css
CREATE TABLE table_64036 ( "Draw" real, "Artist" text, "Song" text, "Percentage" text, "Place" real )
Who is the artist that drew higher than 4?
SELECT "Artist" FROM table_64036 WHERE "Draw" > '4'
wikisql
CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(5...
Show the booking status code and the corresponding number of bookings. Show bar chart.
SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code
nvbench
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, ...
Deleted posts based on comments. Your comments with the most upvotes
SELECT p.Id AS "post_link", p.LastActivityDate FROM Posts AS p INNER JOIN Comments AS c ON c.PostId = p.Id INNER JOIN Users AS u ON p.OwnerUserId = u.Id INNER JOIN PostHistory AS h ON p.Id = h.PostId WHERE c.UserId = '##USERID##' AND h.PostHistoryTypeId = '12' ORDER BY p.LastActivityDate DESC
sede
CREATE TABLE table_name_25 ( song VARCHAR, score VARCHAR )
For which song was the score 6.5 + 6.0 + 6.0 + 5.5 = 24.0?
SELECT song FROM table_name_25 WHERE score = 6.5 + 6.0 + 6.0 + 5.5 = 24.0
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
when did patient 013-29301 get prescription for zofran and protonix for the last time at the same time in 08/this year?
SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'zofran' AND patient.uniquepid = '013-29301' AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TI...
eicu
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE diagnosis ( diagn...
what is the procedure they gave to patient 027-188709 two or more times in their current hospital encounter?
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, COUNT(treatment.treatmenttime) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ...
eicu
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE student_record ( student_id int, course_id int, semester int, ...
What classes am I eligible for after completing PAT 102 ?
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0 INNER JOIN course_prerequisite ON COURSE_0.course_id = course_prerequisite.course_id INNER JOIN course AS COURSE_1 ON COURSE_1.course_id = course_prerequisite.pre_course_id WHERE COURSE_1.department = 'PAT' AND COURSE_1.number =...
advising
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
windows phone post count, view count, view/post ratio per day.
SELECT DATE(p.CreationDate) AS pdate, COUNT(*) AS nposts_per_day, SUM(p.ViewCount) AS nviews_per_day, SUM(p.ViewCount) / COUNT(*) AS view_post_ratio FROM Tags JOIN PostTags AS pt ON Tags.Id = pt.TagId JOIN Posts AS p ON pt.PostId = p.Id WHERE Tags.TagName = @TagName GROUP BY DATE(p.CreationDate) ORDER BY pdate DESC LIM...
sede
CREATE TABLE table_name_57 ( played VARCHAR, points_1 VARCHAR, goals_for VARCHAR )
What is the played number with points 1 is 80, and goals for is more than 77?
SELECT COUNT(played) FROM table_name_57 WHERE points_1 = "80" AND goals_for > 77
sql_create_context
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,...
For all employees who have the letters D or S in their first name, give me the comparison about the average of manager_id over the job_id , and group by attribute job_id by a bar chart, and sort from low to high by the y axis please.
SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY AVG(MANAGER_ID)
nvbench
CREATE TABLE table_204_374 ( id number, "event" text, "gold" number, "silver" number, "bronze" number, "total" number, "ranking" text )
which paralymics year had the largest number of medals overall ?
SELECT "event" FROM table_204_374 ORDER BY "total" DESC LIMIT 1
squall
CREATE TABLE table_dev_57 ( "id" int, "intra_aortic_balloon_pump_iabp" bool, "systolic_blood_pressure_sbp" int, "heart_disease" bool, "vasopressors" bool, "temperature" float, "creatinine_clearance_cl" float, "cardiogenic_shock" bool, "height" int, "serum_creatinine" float, "...
renal function: serum creatinine > 2 mg / dl or creatinine clearance <= 50 ml / min
SELECT * FROM table_dev_57 WHERE serum_creatinine > 2 OR creatinine_clearance_cl <= 50
criteria2sql
CREATE TABLE Problem_Status_Codes ( problem_status_code VARCHAR(20), problem_status_description VARCHAR(80) ) CREATE TABLE Staff ( staff_id INTEGER, staff_first_name VARCHAR(80), staff_last_name VARCHAR(80), other_staff_details VARCHAR(255) ) CREATE TABLE Problems ( problem_id INTEGER, ...
For each product with some problems, list the count of problems and the product id. Show the correlation.
SELECT COUNT(*), T1.product_id FROM Problems AS T1 JOIN Product AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_id
nvbench
CREATE TABLE table_58479 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
What is the driver for Grid 8?
SELECT "Driver" FROM table_58479 WHERE "Grid" = '8'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9cod...
until 3 years ago how many patients were prescribed carvedilol 6.25 mg po tabs in the same hospital visit after the procedure of pulmonary/ccm consultation.
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'pulmonary/ccm consultation' AND DATETIME(treatment.treatmenttime) <= DATE...
eicu