context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_13 ( finish VARCHAR, qual VARCHAR )
Which finish has a 99.550 Qual?
SELECT finish FROM table_name_13 WHERE qual = "99.550"
sql_create_context
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, star...
What class will make fulfilling the Other requirement easier ?
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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, ...
what is patient 2004's minimum sodium, urine value until 09/2105?
SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2004) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'sodium, urine') AND STRFTIME('%y-%m', labevents.charttime) <= '2105-09'
mimic_iii
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
count the number of patients whose age is less than 55 and procedure long title is venous catheterization, not elsewhere classified?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "55" AND procedures.long_title = "Venous catheterization, not elsewhere classified"
mimicsql_data
CREATE TABLE table_name_43 ( position INTEGER, lost VARCHAR, against VARCHAR )
What is the position of the team with more than 16 losses and an against greater than 74?
SELECT SUM(position) FROM table_name_43 WHERE lost > 16 AND against > 74
sql_create_context
CREATE TABLE table_name_80 ( platform_s_ VARCHAR, genre VARCHAR )
What's the platform of the genre RPG?
SELECT platform_s_ FROM table_name_80 WHERE genre = "rpg"
sql_create_context
CREATE TABLE table_name_31 ( second VARCHAR, fourth VARCHAR )
Who was in Second Place with Isabelle Brayley came in Fourth?
SELECT second FROM table_name_31 WHERE fourth = "isabelle brayley"
sql_create_context
CREATE TABLE table_name_79 ( appointment VARCHAR, credentials_presented VARCHAR )
What day was the appointment when Credentials Presented was jul 2, 1969?
SELECT appointment FROM table_name_79 WHERE credentials_presented = "jul 2, 1969"
sql_create_context
CREATE TABLE table_30206 ( "#" real, "Date" text, "Opponent" text, "Site/Stadium" text, "Score" text, "Win" text, "Loss" text, "Save" text, "Attendance" real, "Overall Record" text, "NCAAT Record" text )
What was the site of the game that had an 11-4 score?
SELECT "Site/Stadium" FROM table_30206 WHERE "Score" = '11-4'
wikisql
CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) 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 cine...
For each cinema, show the price and group them by film title in a stacked bar chart, could you display by the Price in asc?
SELECT Title, 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 Name, Title ORDER BY Price
nvbench
CREATE TABLE table_name_56 ( home_team VARCHAR )
When essendon was the home team, how much did they score?
SELECT home_team AS score FROM table_name_56 WHERE home_team = "essendon"
sql_create_context
CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adults INTEGER, Kids INTEGER ) CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, baseP...
Please give me scatter to visualize two attr: the average and minimum price of the rooms in different decor using a scatter.
SELECT AVG(basePrice), MIN(basePrice) FROM Rooms GROUP BY decor
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_CLINIC_ID text, MED_DIRE_CD tex...
02年4月26日开始截止到08年6月23日医疗机构1165324就诊记录里保险类型是儿童的记录总量
SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '1165324' AND gwyjzb.IN_HOSP_DATE BETWEEN '2002-04-26' AND '2008-06-23' AND gwyjzb.INSU_TYPE = '儿童' UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '1165324' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2002-04-26' AND '2008-06-23' AND fgwyjzb.INSU_TYPE =...
css
CREATE TABLE table_40543 ( "Season" text, "Champion" text, "Runner-Up" text, "3rd Position" text, "Top Goalscorer(s)" text, "Team(s)" real )
What is the lowest team (s) that have tvmk as top scorer (s) and flora as the champion?
SELECT MIN("Team(s)") FROM table_40543 WHERE "Top Goalscorer(s)" = 'tvmk' AND "Champion" = 'flora'
wikisql
CREATE TABLE table_45318 ( "Year" real, "Program Title" text, "Placement" text, "Score" real, "Class" text )
What was the total number for the PIW Class' The Adventures Of... and had a score bigger than 94.6?
SELECT COUNT("Year") FROM table_45318 WHERE "Class" = 'piw' AND "Program Title" = 'the adventures of...' AND "Score" > '94.6'
wikisql
CREATE TABLE table_name_38 ( place VARCHAR, mark VARCHAR, date VARCHAR )
What is the place of the record on 1996-05-25 with a mark greater than 90.73?
SELECT place FROM table_name_38 WHERE mark > 90.73 AND date = "1996-05-25"
sql_create_context
CREATE TABLE table_name_63 ( location VARCHAR, type VARCHAR, date VARCHAR, year VARCHAR, president VARCHAR )
What is the Location with a Year larger than 2011, and a President with herman van rompuy (2nd term), and a Date of 28 29 june, and a Type with scheduled?
SELECT location FROM table_name_63 WHERE year > 2011 AND president = "herman van rompuy (2nd term)" AND date = "28–29 june" AND type = "scheduled"
sql_create_context
CREATE TABLE table_37430 ( "Medal" text, "Name" text, "Games" text, "Sport" text, "Event" text )
What event was in the 2008 Beijing games?
SELECT "Event" FROM table_37430 WHERE "Games" = '2008 beijing'
wikisql
CREATE TABLE table_name_69 ( to_par VARCHAR, score VARCHAR, place VARCHAR )
With a score smaller than 71 along with a place of t6, what is the To par score?
SELECT to_par FROM table_name_69 WHERE score < 71 AND place = "t6"
sql_create_context
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, ...
在2003年9月3日到2003年10月12日间患者53577732全部检验报告单的审核日期都是几月几号?
SELECT jybgb.SHSJ FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN person_info_hz_info JOIN person_info 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 AND person_info_hz_info.KH = hz_info.KH AND pers...
css
CREATE TABLE table_name_4 ( year INTEGER, position VARCHAR )
Name the lowest year for 12th position
SELECT MIN(year) FROM table_name_4 WHERE position = "12th"
sql_create_context
CREATE TABLE table_58233 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
what was the largest attendance at kardinia park?
SELECT MAX("Crowd") FROM table_58233 WHERE "Venue" = 'kardinia park'
wikisql
CREATE TABLE table_16175217_1 ( donor_payment VARCHAR, children_per_donor VARCHAR )
What are donor payments in the country where there are 12 children to 6 families (2 per family)?
SELECT donor_payment FROM table_16175217_1 WHERE children_per_donor = "12 children to 6 families (2 per family)"
sql_create_context
CREATE TABLE table_name_83 ( venue VARCHAR, year VARCHAR, position VARCHAR )
Name the venue for 2nd position of year before 2008
SELECT venue FROM table_name_83 WHERE year < 2008 AND position = "2nd"
sql_create_context
CREATE TABLE table_203_133 ( id number, "year" number, "japanese title" text, "english title" text, "role" text, "network" text )
which year 's were the most japanese titles produced ?
SELECT "year" FROM table_203_133 GROUP BY "year" HAVING COUNT("japanese title") = (SELECT COUNT("japanese title") FROM table_203_133 GROUP BY "year" ORDER BY COUNT("japanese title") DESC LIMIT 1)
squall
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE compartment_clas...
what type of aircraft leaves from BOSTON to WASHINGTON at 900
SELECT DISTINCT aircraft.aircraft_code FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, equipment_sequence, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND flight.departure_time = 900 AND fligh...
atis
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, ...
Unanswered questions migrated to dba.se.
SELECT COUNT(p.Id) FROM Posts AS p JOIN PostTypes AS pt ON p.PostTypeId = pt.Id AND pt.Name = 'Question' JOIN PostHistory AS ph ON ph.PostId = p.Id JOIN PostHistoryTypes AS pht ON pht.Id = ph.PostHistoryTypeId AND pht.Name = 'Post Migrated Here' WHERE EXISTS(SELECT 1 FROM Posts AS ap JOIN PostTypes AS apt ON apt.Id = a...
sede
CREATE TABLE table_23476629_2 ( height__in_ VARCHAR, province VARCHAR )
What is the height in inches of contestants who are from the province of La Rioja?
SELECT height__in_ FROM table_23476629_2 WHERE province = "La Rioja"
sql_create_context
CREATE TABLE table_17429402_7 ( years_of_participation VARCHAR, school VARCHAR )
What are the years of participation for pickerington north?
SELECT years_of_participation FROM table_17429402_7 WHERE school = "Pickerington North"
sql_create_context
CREATE TABLE table_name_97 ( spoofed_title VARCHAR, artist VARCHAR, issue VARCHAR )
Which Spoofed title had Mort Drucker as the artist in issue 88?
SELECT spoofed_title FROM table_name_97 WHERE artist = "mort drucker" AND issue = 88
sql_create_context
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Show me about the correlation between Team_ID and School_ID , and group by attribute ACC_Road in a scatter chart.
SELECT Team_ID, School_ID FROM basketball_match GROUP BY ACC_Road
nvbench
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...
Jquery + angular js posts.
SELECT COUNT(*) FROM Posts WHERE Tags LIKE '%<angularjs>%' AND AcceptedAnswerId > 0
sede
CREATE TABLE table_11926114_1 ( premiere VARCHAR, english_title VARCHAR )
How many premier episodes were there with the title survivor's law ii?
SELECT COUNT(premiere) FROM table_11926114_1 WHERE english_title = "Survivor's Law II"
sql_create_context
CREATE TABLE table_name_53 ( exited VARCHAR, finished VARCHAR )
What day did the person who finished in 12th place leave on?
SELECT exited FROM table_name_53 WHERE finished = "12th"
sql_create_context
CREATE TABLE table_204_725 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
name a country that won more than one silver medal but no bronze medals .
SELECT "nation" FROM table_204_725 WHERE "silver" > 1 AND "bronze" = 0
squall
CREATE TABLE Customer ( CustomerId integer, FirstName varchar(40), LastName varchar(20), Company varchar(80), Address varchar(70), City varchar(40), State varchar(40), Country varchar(40), PostalCode varchar(10), Phone varchar(24), Fax varchar(24), Email varchar(60), ...
A bar chart for listing the number of the phone numbers of all employees, list by the total number in desc.
SELECT Phone, COUNT(Phone) FROM Employee GROUP BY Phone ORDER BY COUNT(Phone) DESC
nvbench
CREATE TABLE table_75541 ( "Longi- tude" text, "Usual translation" text, "Chinese name \u00b9" text, "Japanese name" text, "Korean name \u00b2" text, "Vietnamese name" text, "Date \u00b3" text )
Which Longi- tude is on jun 6?
SELECT "Longi- tude" FROM table_75541 WHERE "Date \u00b3" = 'jun 6'
wikisql
CREATE TABLE table_train_70 ( "id" int, "pregnancy_or_lactation" bool, "white_blood_cell_count_wbc" int, "systolic_blood_pressure_sbp" int, "mean_arterial_pressure_map" int, "temperature" float, "oliguria" bool, "surgery" bool, "heart_rate" int, "systemic_inflammatory_response" b...
major surgery or pancreatitis / non infectious inflammation.
SELECT * FROM table_train_70 WHERE surgery = 1 OR systemic_inflammatory_response = 1
criteria2sql
CREATE TABLE table_48254 ( "Country" text, "Preliminary" real, "Interview" real, "Swimsuit" real, "Evening Gown" real, "Average" real )
What is the swimsuit number when the preliminary is 8.721, and the average is more than 8.781?
SELECT COUNT("Swimsuit") FROM table_48254 WHERE "Preliminary" = '8.721' AND "Average" > '8.781'
wikisql
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id n...
how did patient 12775 enter hospital for the first time in 2105?
SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 12775 AND STRFTIME('%y', admissions.admittime) = '2105' ORDER BY admissions.admittime LIMIT 1
mimic_iii
CREATE TABLE table_name_6 ( location_attendance VARCHAR, opponent VARCHAR )
What was the location when the opponent was Seattle Supersonics?
SELECT location_attendance FROM table_name_6 WHERE opponent = "seattle supersonics"
sql_create_context
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, h...
what is the daily average amount of rbc, pleural patient 15794 has on the current hospital visit?
SELECT AVG(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15794 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'rbc, pleural') GROUP BY STRFTIME('%y-%m-%d...
mimic_iii
CREATE TABLE table_23424 ( "Team" text, "Province" text, "Owner(s)" text, "Price" text, "Captain" text, "Head coach" text, "Icon Player" text )
Who's the head coach of the team with a price of $3.22 million?
SELECT "Head coach" FROM table_23424 WHERE "Price" = '$3.22 million'
wikisql
CREATE TABLE teaches ( id text, course_id text, sec_id text, semester text, year number ) CREATE TABLE student ( id text, name text, dept_name text, tot_cred number ) CREATE TABLE course ( course_id text, title text, dept_name text, credits number ) CREATE TABLE ti...
Count the number of classrooms in Lamberton.
SELECT COUNT(*) FROM classroom WHERE building = 'Lamberton'
spider
CREATE TABLE table_name_75 ( player VARCHAR, score VARCHAR )
Which player had a score of 72-69=141?
SELECT player FROM table_name_75 WHERE score = 72 - 69 = 141
sql_create_context
CREATE TABLE table_27882867_9 ( location_attendance VARCHAR, team VARCHAR )
Where was the location and attendance when they played milwaukee?
SELECT location_attendance FROM table_27882867_9 WHERE team = "Milwaukee"
sql_create_context
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...
自02年4月10日起,到07年7月20日,医院7737144的哪些科室涉及的医疗费超过8492.85元
SELECT COUNT(*) FROM (SELECT gwyjzb.MED_ORG_DEPT_CD FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '7737144' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-04-10' AND '2007-07-20' GROUP BY gwyjzb.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) > 8492.85 UNION SELECT fgwyjzb....
css
CREATE TABLE table_name_88 ( source VARCHAR, knight VARCHAR )
What source has a Knight of 2%?
SELECT source FROM table_name_88 WHERE knight = "2%"
sql_create_context
CREATE TABLE table_66295 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" text )
what player has place t10
SELECT "Player" FROM table_66295 WHERE "Place" = 't10'
wikisql
CREATE TABLE table_train_166 ( "id" int, "hemoglobin_a1c_hba1c" float, "diabetic" string, "body_mass_index_bmi" float, "NOUSE" float )
diagnosis of type ii diabetes mellitus
SELECT * FROM table_train_166 WHERE diabetic = 'ii'
criteria2sql
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH ...
检验申请机构以及检验机构在编码为22785794819检验报告单的名称都叫什么?
SELECT JYSQJGMC, JYJGMC FROM jybgb WHERE BGDH = '22785794819'
css
CREATE TABLE debate ( Debate_ID int, Date text, Venue text, Num_of_Audience int ) CREATE TABLE people ( People_ID int, District text, Name text, Party text, Age int ) CREATE TABLE debate_people ( Debate_ID int, Affirmative int, Negative int, If_Affirmative_Win bool ...
Create a pie chart showing the number of venue across venue.
SELECT Venue, COUNT(Venue) FROM debate GROUP BY Venue
nvbench
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Return a bar chart about the distribution of ACC_Road and the sum of Team_ID , and group by attribute ACC_Road, sort in descending by the X.
SELECT ACC_Road, SUM(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road DESC
nvbench
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, ...
Reputation of top users.
SELECT Id, Reputation FROM Users ORDER BY Reputation DESC LIMIT 50000
sede
CREATE TABLE table_23270 ( "Institution" text, "Location" text, "Nickname" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" real )
What's the type of the school in New London, Connecticut?
SELECT "Type" FROM table_23270 WHERE "Location" = 'New London, Connecticut'
wikisql
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTasks ( Id num...
Posts with accepted answer answered after a week.
SELECT COUNT(*) FROM Posts AS a LEFT JOIN Posts AS b ON a.AcceptedAnswerId = b.Id WHERE NOT a.AcceptedAnswerId IS NULL AND DATEDIFF(day, a.CreationDate, CreationDate) > 6
sede
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 txmzjzjlb ( HXPLC number, HZX...
自零三年二月十六日起,截止到一一年五月二十二日,医院6771925在门诊就诊中开了6张以上的检验报告单的科室有多少
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM txmzjzjlb JOIN jybgb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE txmzjzjlb.YLJGDM = '6771925' AND jybgb.BGRQ BETWEEN '2003-02-16' AND '2011-05-22' GROUP BY jybgb.KSBM HAVING COUNT(*) > 6 UNION SELECT jybgb.KSBM FROM ftxmzjzjlb J...
css
CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, available_yn BIT ) CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, ...
Show the number of the facility codes of apartments with more than 4 bedrooms, and could you show by the Y in asc?
SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code ORDER BY COUNT(facility_code)
nvbench
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Visualize the relationship between Team_ID and ACC_Percent , and group by attribute ACC_Regular_Season.
SELECT Team_ID, ACC_Percent FROM basketball_match GROUP BY ACC_Regular_Season
nvbench
CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int, STU_CLASS varchar(2), STU_GPA float(8), STU_TRANSFER numeric, DEPT_CODE varchar(18), STU_PHONE varchar(4), PROF_NUM int ) CREATE TABLE PR...
Find the number of departments in each school Plot them as bar chart, could you list in ascending by the X?
SELECT SCHOOL_CODE, COUNT(DISTINCT DEPT_NAME) FROM DEPARTMENT ORDER BY SCHOOL_CODE
nvbench
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...
give me the number of patients whose diagnoses long title is family history of other specified malignant neoplasm?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Family history of other specified malignant neoplasm"
mimicsql_data
CREATE TABLE table_24936 ( "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 )
Who wrote the episode that has a production code 3x7557?
SELECT "Written by" FROM table_24936 WHERE "Production code" = '3X7557'
wikisql
CREATE TABLE table_name_98 ( draws INTEGER, wins VARCHAR, against VARCHAR )
What's the lowest number of draws when the wins are less than 15, and against is 1228?
SELECT MIN(draws) FROM table_name_98 WHERE wins < 15 AND against = 1228
sql_create_context
CREATE TABLE table_13833770_3 ( district INTEGER, incumbent VARCHAR )
what is the minimum district with incumbent being tom reynolds
SELECT MIN(district) FROM table_13833770_3 WHERE incumbent = "Tom Reynolds"
sql_create_context
CREATE TABLE table_39942 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real )
What is the total number of games played with 3 losses, 1 or more drawns and 10 or fewer points?
SELECT SUM("Played") FROM table_39942 WHERE "Lost" = '3' AND "Drawn" > '1' AND "Points" < '10'
wikisql
CREATE TABLE greatermanchestercrime ( crimeid text, crimets time, location text, lsoa text, type text, outcome text )
What is the crime rate for Eden Street area?
SELECT COUNT(*) FROM greatermanchestercrime WHERE location LIKE "%Eden Street%"
greatermanchestercrime
CREATE TABLE table_12594 ( "Year" real, "Date" text, "Home Team" text, "Result" text, "Visiting Team" text, "Venue" text, "Attendance" real )
What is the number in attendance at Los Angeles Memorial Coliseum?
SELECT COUNT("Attendance") FROM table_12594 WHERE "Venue" = 'los angeles memorial coliseum'
wikisql
CREATE TABLE table_19418 ( "School Year" text, "Class A" text, "Class AA" text, "Class AAA" text, "Class AAAA" text, "Class AAAAA" text )
Name the number of class aa for bridgeport and 1999-2000
SELECT COUNT("Class AA") FROM table_19418 WHERE "Class AAA" = 'Bridgeport' AND "School Year" = '1999-2000'
wikisql
CREATE TABLE table_9500 ( "Rank" text, "Nation" text, "Gold" text, "Silver" text, "Bronze" real, "Total" real )
How many totals have golds of 3, silvers of 3, and bronzes under 3?
SELECT SUM("Total") FROM table_9500 WHERE "Gold" = '3' AND "Bronze" < '3' AND "Silver" = '3'
wikisql
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instruc...
Is 401 offered to undergrads ?
SELECT DISTINCT advisory_requirement, enforced_requirement, name FROM course WHERE department = 'EECS' AND number = 401
advising
CREATE TABLE table_name_83 ( name VARCHAR, moving_to VARCHAR, nat VARCHAR, transfer_window VARCHAR )
What is the name of the player who is Sco and moving to greenock morton in the summer?
SELECT name FROM table_name_83 WHERE nat = "sco" AND transfer_window = "summer" AND moving_to = "greenock morton"
sql_create_context
CREATE TABLE table_14569 ( "Name" text, "Championship" real, "FA Cup" real, "League Cup" real, "Total" real )
Name the most FA cup for championship of 18 and total of 19
SELECT MAX("FA Cup") FROM table_14569 WHERE "Championship" = '18' AND "Total" = '19'
wikisql
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, ...
provide the number of patients whose diagnoses long title is hemiplegia, unspecified, affecting dominant side?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Hemiplegia, unspecified, affecting dominant side"
mimicsql_data
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE diagnoses_icd ( row_id ...
what is the five year survival rate of patients who were prescribed lactulose after being diagnosed with digestive neoplasm nos?
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd...
mimic_iii
CREATE TABLE table_6853 ( "Season" text, "Team" text, "Conference (Conf.)" text, "Division (Div.)" text, "Win%" text, "Awards" text )
Which season has a .354 Win%?
SELECT "Season" FROM table_6853 WHERE "Win%" = '.354'
wikisql
CREATE TABLE ref_characteristic_types ( characteristic_type_code text, characteristic_type_description text ) CREATE TABLE products ( product_id number, color_code text, product_category_code text, product_name text, typical_buying_price text, typical_selling_price text, product_des...
Return the unit of measure for 'Herb' products.
SELECT unit_of_measure FROM ref_product_categories WHERE product_category_code = "Herbs"
spider
CREATE TABLE table_name_91 ( overall INTEGER, round VARCHAR )
What is the overall pick number for the player who was picked on round 8?
SELECT MIN(overall) FROM table_name_91 WHERE round = 8
sql_create_context
CREATE TABLE table_25056 ( "African rank" real, "World rank" real, "Nation" text, "GDP per capita" text, "Total GDP world rank" real )
What is the total gdp world rank when the gdp per capita was listed at $1,163?
SELECT MIN("Total GDP world rank") FROM table_25056 WHERE "GDP per capita" = '$1,163'
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, ...
give me the number of divorced patients who belong to white-russian ethnic background.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.ethnicity = "WHITE - RUSSIAN"
mimicsql_data
CREATE TABLE table_50727 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time" text, "Grid" real )
Which manufacturer has a time of +10.142?
SELECT "Manufacturer" FROM table_50727 WHERE "Time" = '+10.142'
wikisql
CREATE TABLE table_18336 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
what is the district where the incumbent is richard kelly?
SELECT "District" FROM table_18336 WHERE "Incumbent" = 'Richard Kelly'
wikisql
CREATE TABLE table_16608 ( "Date" text, "Founder" text, "Extroversion Scales" text, "People-task orientation scale" text, "Introverted, Task-Oriented" text, "Extroverted, Task-Oriented" text, "Extroverted, Relationship-Oriented" text, "Introverted, Relationship Oriented" text, "Moder...
what's the people-task orientation scale where extroverted, relationship-oriented is team type
SELECT "People-task orientation scale" FROM table_16608 WHERE "Extroverted, Relationship-Oriented" = 'Team Type'
wikisql
CREATE TABLE table_28639 ( "Rank" real, "Couple" text, "Judges" real, "Public" real, "Total" real, "Vote percentage" text, "Result" text )
How many judges were there when the result is safe with a vote percentage of 10.7%?
SELECT MIN("Judges") FROM table_28639 WHERE "Result" = 'Safe' AND "Vote percentage" = '10.7%'
wikisql
CREATE TABLE table_58111 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" text )
Which driver had a grid number of 18?
SELECT "Driver" FROM table_58111 WHERE "Grid" = '18'
wikisql
CREATE TABLE table_204_886 ( id number, "rank" number, "swimmer" text, "country" text, "time" text, "note" text )
what was claudia roll 's time ?
SELECT "time" FROM table_204_886 WHERE "swimmer" = 'claudia poll'
squall
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
what is the number of patients whose admission location is transfer from hosp/extram and procedure long title is closed [needle] biopsy of tongue?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND procedures.long_title = "Closed [needle] biopsy of tongue"
mimicsql_data
CREATE TABLE table_40656 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
How many were in attendance against the Oakland Raiders after week 7?
SELECT SUM("Attendance") FROM table_40656 WHERE "Opponent" = 'oakland raiders' AND "Week" > '7'
wikisql
CREATE TABLE table_38344 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text )
How many Picks have a Round larger than 8, and a College of fresno state?
SELECT COUNT("Pick #") FROM table_38344 WHERE "Round" > '8' AND "College" = 'fresno state'
wikisql
CREATE TABLE table_17972 ( "Round" real, "Circuit" text, "Date" text, "Length" text, "Pole Position" text, "GT3 Winner" text, "GTC Winner" text )
what are all the circuit for gtc winner graeme mundy jamie smyth and pole position bradley ellis alex mortimer
SELECT "Circuit" FROM table_17972 WHERE "GTC Winner" = 'Graeme Mundy Jamie Smyth' AND "Pole Position" = 'Bradley Ellis Alex Mortimer'
wikisql
CREATE TABLE table_21977704_1 ( entrant VARCHAR, driver VARCHAR )
Name the entrant for benedicto campos
SELECT entrant FROM table_21977704_1 WHERE driver = "Benedicto Campos"
sql_create_context
CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) 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 n...
从08年10月22日起的2年内,患者66306240的395514指标情况记录
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = '...
css
CREATE TABLE table_name_99 ( wins INTEGER, against VARCHAR, geelong_fl VARCHAR )
How many total wins for Leopold that had fewer than 1706 against?
SELECT SUM(wins) FROM table_name_99 WHERE against < 1706 AND geelong_fl = "leopold"
sql_create_context
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime tim...
when did patient 52898 receive a test in the lab for the last time this month?
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 52898) AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') ORDER BY labevents.charttime DESC LIMIT 1
mimic_iii
CREATE TABLE media_types ( id number, name text ) CREATE TABLE playlists ( id number, name text ) CREATE TABLE genres ( id number, name text ) CREATE TABLE sqlite_sequence ( name text, seq text ) CREATE TABLE playlist_tracks ( playlist_id number, track_id number ) CREATE TAB...
What is the company where Eduardo Martins is a customer?
SELECT company FROM customers WHERE first_name = "Eduardo" AND last_name = "Martins"
spider
CREATE TABLE table_name_94 ( ccm_chart VARCHAR, total_wks VARCHAR )
What CCM Chart had 18 total weeks?
SELECT ccm_chart FROM table_name_94 WHERE total_wks = 18
sql_create_context
CREATE TABLE table_69124 ( "Place" real, "Team" text, "Played" real, "Draw" real, "Lost" real, "Goals Scored" real, "Goals Conceded" real, "Points" real )
What is the average value for Lost, when the value for Goals Scored is greater than 20, and when the value for Played is less than 18?
SELECT AVG("Lost") FROM table_69124 WHERE "Goals Scored" > '20' AND "Played" < '18'
wikisql
CREATE TABLE table_34394 ( "Date" text, "Tournament" text, "Location" text, "Winner" text, "Score" text, "1st prize ( $ )" text )
What is the Score when the 1st prize was 63,000, and a Winner of keith fergus (1)?
SELECT "Score" FROM table_34394 WHERE "1st prize ( $ )" = '63,000' AND "Winner" = 'keith fergus (1)'
wikisql
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...
Questions asked per day in Sun-Sat week periods.
SELECT CAST(DATEADD(DAY, 1 - DATEPART(WEEKDAY, CreationDate), CreationDate) AS DATE) AS "week_of", ROUND(CAST(COUNT(*) AS FLOAT) / 7, 2) FROM Posts WHERE PostTypeId = 1 AND CAST(CreationDate AS DATE) < '2013-01-01' GROUP BY CAST(DATEADD(DAY, 1 - DATEPART(WEEKDAY, CreationDate), CreationDate) AS DATE) ORDER BY CAST(DATE...
sede
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 jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE locations ( LOCAT...
For all employees who have the letters D or S in their first name, give me the comparison about the average of department_id over the job_id , and group by attribute job_id by a bar chart, rank by the total number in asc.
SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY AVG(DEPARTMENT_ID)
nvbench
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicatio...
retrieve the patient identifications of patients that were diagnosed with swollen extremity, etiology unknown - right lower extremity in 2105.
SELECT patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'swollen extremity, etiology unknown - right lower extremity' AND STRFTIME('%y', diagnosis.diagnosistime) = '2105')
eicu