context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_203_348 ( id number, "number" number, "name" text, "team" text, "position" text, "years with franchise" text, "note" text )
which nba team has more retired jerseys than any other nba team ?
SELECT "team" FROM table_203_348 GROUP BY "team" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE table_54349 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" real, "Record" text )
Which Visitor was there when the Home game was played in Miami on November 4?
SELECT "Visitor" FROM table_54349 WHERE "Home" = 'miami' AND "Date" = 'november 4'
wikisql
CREATE TABLE Activity ( actid INTEGER, activity_name varchar(25) ) CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), Building VARCHAR(13) ) CREATE TABLE Student ( StuID INTEGER, ...
Show all the activity names and the number of faculty involved in each activity in a bar chart, and could you rank total number from low to high order?
SELECT activity_name, COUNT(*) FROM Activity AS T1 JOIN Faculty_Participates_in AS T2 ON T1.actid = T2.actid GROUP BY T1.actid ORDER BY COUNT(*)
nvbench
CREATE TABLE table_name_60 ( losses INTEGER, win__percentage VARCHAR, wins VARCHAR, team VARCHAR )
What's the lowest Losses recorded wiht a Wins of 1, Team of Dallas Stars, and a Win % that's smaller than 0.25?
SELECT MIN(losses) FROM table_name_60 WHERE wins = 1 AND team = "dallas stars" AND win__percentage < 0.25
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text ) 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 te...
被诊断为疾病F95.742的患者张兴邦,他的检测指标517400的结果定量和单位如何
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND...
css
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, find name and manufacturer , and group by attribute founder, and visualize them by a bar chart, rank Y-axis in descending order.
SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Manufacturer DESC
nvbench
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester i...
Do any upper-level classes not have 575 as a prerequisite ?
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%topic0%' OR name LIKE '%topic0%') AND department = 'EECS'
advising
CREATE TABLE table_21132 ( "Election" real, "Candidates fielded" real, "# of seats won" real, "Total votes" real, "% of popular vote" text, "Place" text )
What place did the party finish in the year when they earned 0.86% of the vote?
SELECT "Place" FROM table_21132 WHERE "% of popular vote" = '0.86%'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime t...
how much is fe?
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'lab' AND cost.eventid IN (SELECT lab.labid FROM lab WHERE lab.labname = 'fe')
eicu
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
what is drug name of drug code digo25?
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.formulary_drug_cd = "DIGO25"
mimicsql_data
CREATE TABLE table_70280 ( "Start Date/Time" text, "Duration" text, "End Time" text, "Spacecraft" text, "Crew" text )
Who was the crew for the duration of 12 minutes?
SELECT "Crew" FROM table_70280 WHERE "Duration" = '12 minutes'
wikisql
CREATE TABLE table_25762852_1 ( name VARCHAR, lifts VARCHAR )
if there are 30 lifts, what is the name of the ski resort?
SELECT name FROM table_25762852_1 WHERE lifts = 30
sql_create_context
CREATE TABLE table_22903426_1 ( scm_system VARCHAR, windows_builders VARCHAR )
Name the number of scm system for nant, visual studio
SELECT COUNT(scm_system) FROM table_22903426_1 WHERE windows_builders = "NAnt, Visual Studio"
sql_create_context
CREATE TABLE table_name_5 ( segment_a VARCHAR, segment_b VARCHAR )
Segment B of aerospace fuel lines has what segment A?
SELECT segment_a FROM table_name_5 WHERE segment_b = "aerospace fuel lines"
sql_create_context
CREATE TABLE table_63900 ( "Year" real, "Main" text, "Hessen" text, "Rhein" text, "Saar" text )
What is the average year for a Saar of FK Pirmasens and Hessen of Wormatia Worms?
SELECT AVG("Year") FROM table_63900 WHERE "Saar" = 'fk pirmasens' AND "Hessen" = 'wormatia worms'
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 patients whose year of death is less than or equal to 2168 and procedure icd9 code is 3142?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2168.0" AND procedures.icd9_code = "3142"
mimicsql_data
CREATE TABLE people ( Name VARCHAR, People_ID VARCHAR ) CREATE TABLE body_builder ( People_ID VARCHAR )
What are the names of body builders?
SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID
sql_create_context
CREATE TABLE table_4739 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the North Melbourne's score when they played as the home team?
SELECT "Home team score" FROM table_4739 WHERE "Home team" = 'north melbourne'
wikisql
CREATE TABLE table_name_29 ( opponent VARCHAR, attendance VARCHAR )
Which Opponent has a Attendance of 7,034?
SELECT opponent FROM table_name_29 WHERE attendance = "7,034"
sql_create_context
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id ...
when did the first hospital discharge of patient 14621 in this year?
SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 14621 AND DATETIME(admissions.dischtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY admissions.dischtime LIMIT 1
mimic_iii
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and price , and group by attribute name.
SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name
nvbench
CREATE TABLE table_2076533_1 ( control VARCHAR, main_location VARCHAR )
Name the control for albany
SELECT control FROM table_2076533_1 WHERE main_location = "Albany"
sql_create_context
CREATE TABLE table_name_68 ( rank INTEGER, location VARCHAR )
What is the lowest rank that has university park, pa as the location?
SELECT MIN(rank) FROM table_name_68 WHERE location = "university park, pa"
sql_create_context
CREATE TABLE table_47605 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What was the score of the game where the record was 2-2?
SELECT "Score" FROM table_47605 WHERE "Record" = '2-2'
wikisql
CREATE TABLE table_1689 ( "Province" text, "Provincial capital" text, "Largest city" text, "Area (km 2 )" real, "Population (2013)" real )
what is the largest city where the province is eastern cape?
SELECT "Largest city" FROM table_1689 WHERE "Province" = 'Eastern Cape'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
what is admission time and procedure icd9 code of subject id 98220?
SELECT demographic.admittime, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "98220"
mimicsql_data
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE ReviewRejectionReasons ( Id number, N...
TOP 50 user from india.
SELECT Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users ORDER BY Reputation DESC LIMIT 150
sede
CREATE TABLE table_23166 ( "RPM" real, "Standard HP" text, "Standard torque (lb/ft)" text, "Standard speed (6th gear)" text, "Modified speed (6th gear)" real, "Modified HP" text, "Modified torque (lb/ft)" text )
What is the modified speed (6th gear) when standard torque (lb/ft) is 10.3 and modified torque (lb/ft) is 8.75?
SELECT "Modified speed (6th gear)" FROM table_23166 WHERE "Standard torque (lb/ft)" = '10.3' AND "Modified torque (lb/ft)" = '8.75'
wikisql
CREATE TABLE table_30860 ( "Episode #" real, "Series #" real, "Episode Title" text, "Original air date" text, "Production Code" real )
What is the production code of the episode with series #8?
SELECT "Production Code" FROM table_30860 WHERE "Series #" = '8'
wikisql
CREATE TABLE table_12902 ( "Date" text, "Label" text, "Format" text, "Country" text, "Catalog" text )
What is the country associated with the date in 2003?
SELECT "Country" FROM table_12902 WHERE "Date" = '2003'
wikisql
CREATE TABLE table_name_52 ( home VARCHAR, date VARCHAR )
Who is the home team on March 5?
SELECT home FROM table_name_52 WHERE date = "march 5"
sql_create_context
CREATE TABLE table_18144 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text, "Candidates" text )
How did the election end for Robert Wexler?
SELECT "Results" FROM table_18144 WHERE "Incumbent" = 'Robert Wexler'
wikisql
CREATE TABLE table_35393 ( "Round" real, "Pick" real, "Player" text, "Position" text, "School/Club Team" text )
What's the sum of the Pick that has the Player of Robert Ingalls?
SELECT COUNT("Pick") FROM table_35393 WHERE "Player" = 'robert ingalls'
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 jybgb ( BBCJBW text, BBDM tex...
病号韩向彤在医院9745753内就诊的时候去过的科室名称不包含科室的全部门诊就诊记录的流水号是多少?
SELECT txmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE person_info.XM = '韩向彤' AND hz_info.YLJGDM = '9745753' AND NOT txmzjzjlb.JZKSMC LIKE '%科室%' UNION SELECT ftxmzjz...
css
CREATE TABLE table_16557 ( "Season" real, "Grand FinalDate" text, "WinningTeam" text, "Score" text, "LosingTeam" text, "Location" text, "GF Attendance" real, "Clive Churchill Medal" text )
What was the date that the st. george-illawarra dragons lost?
SELECT "Grand FinalDate" FROM table_16557 WHERE "LosingTeam" = 'St. George-Illawarra Dragons'
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, ...
count the number of patients whose ethnicity is black /haitian and were born before 2175.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/HAITIAN" AND demographic.dob_year < "2175"
mimicsql_data
CREATE TABLE table_27869 ( "Settlement" text, "Cyrillic Name Other Names" text, "Type" text, "Population (2011)" real, "Largest ethnic group (2002)" text, "Dominant religion (2002)" text )
Name the cyrillic name for 518
SELECT "Cyrillic Name Other Names" FROM table_27869 WHERE "Population (2011)" = '518'
wikisql
CREATE TABLE table_47707 ( "Date" text, "Flight" text, "Aircraft" text, "Registration" text, "Location" text, "Fatalities" real )
Which fatality was at ankara for the aircraft douglas c-47?
SELECT "Fatalities" FROM table_47707 WHERE "Location" = 'ankara' AND "Aircraft" = 'douglas c-47'
wikisql
CREATE TABLE table_35978 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
Which Cuts made has a Tournament of totals, and Wins smaller than 11?
SELECT AVG("Cuts made") FROM table_35978 WHERE "Tournament" = 'totals' AND "Wins" < '11'
wikisql
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
号码33992574为团队成员最常开的药品排序是什么样的?
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '33992574' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC
css
CREATE TABLE table_20661 ( "Title" text, "Series" text, "Release" text, "Featuring" text, "Writer" text, "Director" text, "Length" text, "Timeline" text, "Release Date" text )
What is the releases number under Season 2?
SELECT "Release" FROM table_20661 WHERE "Timeline" = 'Season 2'
wikisql
CREATE TABLE table_name_73 ( team VARCHAR, rank VARCHAR )
What team has rank 3?
SELECT team FROM table_name_73 WHERE rank = 3
sql_create_context
CREATE TABLE table_name_73 ( viewers__m_ VARCHAR, rank___number_ VARCHAR, share VARCHAR, rating VARCHAR )
How many vieweres for the episode with a share of 1, a Rating larger than 0.7000000000000001, and a Rank (#) of 100/102?
SELECT viewers__m_ FROM table_name_73 WHERE share = 1 AND rating > 0.7000000000000001 AND rank___number_ = "100/102"
sql_create_context
CREATE TABLE table_50016 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
Who is the player from the United States with a score of 71-75=146?
SELECT "Player" FROM table_50016 WHERE "Country" = 'united states' AND "Score" = '71-75=146'
wikisql
CREATE TABLE table_11498 ( "Date" text, "Opponent" text, "Home/Away" text, "Field" text, "Result" text )
What is the field of the game on July 22?
SELECT "Field" FROM table_11498 WHERE "Date" = 'july 22'
wikisql
CREATE TABLE table_25877 ( "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 date of the game when the record was 27-14?
SELECT "Date" FROM table_25877 WHERE "Record" = '27-14'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
what number of patients with hematology as lab test category had complete atroiventricular block?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Atrioventricular block, complete" AND lab."CATEGORY" = "Hematology"
mimicsql_data
CREATE TABLE table_50605 ( "Oklahoma vs." text, "Overall Record" text, "at Norman" text, "at Opponent's Venue" text, "at Neutral Site" text, "Last 5 Meetings" text, "Last 10 Meetings" text, "Current Streak" text, "Since Beginning of Big 12" text )
what is the since beginning of big 12 when last 10 meetings is ou, 7-3, neutral site is ou, 2-1, and last 5 meetings is bu, 3-2?
SELECT "Since Beginning of Big 12" FROM table_50605 WHERE "Last 10 Meetings" = 'ou, 7-3' AND "at Neutral Site" = 'ou, 2-1' AND "Last 5 Meetings" = 'bu, 3-2'
wikisql
CREATE TABLE table_21682 ( "School" text, "Years of Participation" text, "OCC Championships" real, "Last OCC Championship" text, "Last Outright OCC Championship" text )
How many schools won their last occ championship in 2006?
SELECT COUNT("School") FROM table_21682 WHERE "Last OCC Championship" = '2006'
wikisql
CREATE TABLE table_name_57 ( venue VARCHAR, result VARCHAR, year VARCHAR, category VARCHAR )
What are the venues prior to 2005 in the World Class category that resulted in a bronze?
SELECT venue FROM table_name_57 WHERE year < 2005 AND category = "world class" AND result = "bronze"
sql_create_context
CREATE TABLE table_28128 ( "Result" text, "Date" text, "Race" text, "Venue" text, "Group" text, "Distance" text, "Weight (kg)" text, "Jockey" text, "Winner/2nd" text )
What was the distance in the Manikato Stakes race?
SELECT "Distance" FROM table_28128 WHERE "Race" = 'Manikato Stakes'
wikisql
CREATE TABLE table_17058226_5 ( high_rebounds VARCHAR, high_assists VARCHAR )
Who performed all the high rebounds when craig smith (4) was the lead for high assists?
SELECT high_rebounds FROM table_17058226_5 WHERE high_assists = "Craig Smith (4)"
sql_create_context
CREATE TABLE loan ( loan_id text, loan_type text, cust_id text, branch_id text, amount number ) CREATE TABLE bank ( branch_id number, bname text, no_of_customers number, city text, state text ) CREATE TABLE customer ( cust_id text, cust_name text, acc_type text, ...
What is the total amount of money loaned by banks in New York state?
SELECT SUM(T2.amount) FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id WHERE T1.state = 'New York'
spider
CREATE TABLE table_name_77 ( week VARCHAR, result VARCHAR )
Which Week has a Result of w 23 22?
SELECT week FROM table_name_77 WHERE result = "w 23–22"
sql_create_context
CREATE TABLE table_28671 ( "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 (millions)" text )
what number is the episode 'there will be bad blood' in the series?
SELECT MIN("No. in series") FROM table_28671 WHERE "Title" = 'There Will Be Bad Blood'
wikisql
CREATE TABLE table_27700530_14 ( high_rebounds VARCHAR, date VARCHAR )
Who had the most the most rebounds and how many did they have on April 1?
SELECT high_rebounds FROM table_27700530_14 WHERE date = "April 1"
sql_create_context
CREATE TABLE table_28898948_3 ( by_election INTEGER, electorate VARCHAR )
When waikaia is the electorate what is the highest by-election?
SELECT MAX(by_election) FROM table_28898948_3 WHERE electorate = "Waikaia"
sql_create_context
CREATE TABLE table_64795 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
What is the Attendance of the game with a Result of L 20-14?
SELECT "Attendance" FROM table_64795 WHERE "Result" = 'l 20-14'
wikisql
CREATE TABLE table_76378 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location/Attendance" text, "Record" text )
What were the high rebounds on september 11?
SELECT "High rebounds" FROM table_76378 WHERE "Date" = 'september 11'
wikisql
CREATE TABLE table_name_61 ( date VARCHAR, clock VARCHAR )
Which date has a Clock of 0.8-1.6ghz?
SELECT date FROM table_name_61 WHERE clock = "0.8-1.6ghz"
sql_create_context
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...
find the number of patients who are born before the year 2053 and underwent lab test for rbc count and joint fluid.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2053" AND lab.label = "RBC, Joint Fluid"
mimicsql_data
CREATE TABLE table_name_93 ( team_website VARCHAR, institution VARCHAR )
what is the team website when the institution is indiana university of pennsylvania?
SELECT team_website FROM table_name_93 WHERE institution = "indiana university of pennsylvania"
sql_create_context
CREATE TABLE dorm_amenity ( amenid number, amenity_name text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE dorm ( dormid number, dorm_name text, student_capacity numbe...
What is the most common amenity in the dorms?
SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T1.amenid = T2.amenid GROUP BY T2.amenid ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description t...
Users above given number of upvotes.
SELECT Id AS "user_link", Reputation, CreationDate, DisplayName, LastAccessDate, UpVotes, DownVotes FROM Users WHERE UpVotes > '##votes##' ORDER BY Id
sede
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Posts ( Id number, PostTypeId nu...
Italian Stackoverflow Users > 99k.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Location, Reputation FROM Users WHERE Reputation > 99000 AND LOWER(Location) LIKE LOWER('%italy%') ORDER BY Reputation DESC
sede
CREATE TABLE table_72365 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text, "Candidates" text )
Who were the candidates in the district where Jerry Costello won?
SELECT "Candidates" FROM table_72365 WHERE "Incumbent" = 'Jerry Costello'
wikisql
CREATE TABLE climber ( climber_id number, name text, country text, time text, points number, mountain_id number ) CREATE TABLE mountain ( mountain_id number, name text, height number, prominence number, range text, country text )
Show the times used by climbers to climb mountains in Country Uganda.
SELECT T1.time FROM climber AS T1 JOIN mountain AS T2 ON T1.mountain_id = T2.mountain_id WHERE T2.country = "Uganda"
spider
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
Answers with a Negative Score Created in the last six months.
SELECT P.Id AS "post_link", P.Body FROM Posts AS P, PostTypes AS Pt, Votes AS V, VoteTypes AS Vt WHERE P.Id = V.PostId AND Vt.Id = V.VoteTypeId AND P.Score < -2 AND Pt.Id = 2 AND Vt.Id = 3 AND DATEDIFF(month, P.CreationDate, GETDATE()) < 6 GROUP BY P.Id, P.Body
sede
CREATE TABLE table_64740 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Event" text )
Which Year has a Competition of commonwealth youth games?
SELECT AVG("Year") FROM table_64740 WHERE "Competition" = 'commonwealth youth games'
wikisql
CREATE TABLE table_37503 ( "Date" text, "Tournament" text, "Location" text, "Winner" text, "Score" text, "1st prize ( $ )" text )
How much was the first place prize for the American golf classic located in Ohio?
SELECT "1st prize ( $ )" FROM table_37503 WHERE "Location" = 'ohio' AND "Tournament" = 'american golf classic'
wikisql
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_40...
Show id from each meter 400, and list by the X from high to low.
SELECT meter_400, ID FROM swimmer ORDER BY meter_400 DESC
nvbench
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
在医疗机构0896805患者66990606从08年8月22日到15年12月14日有多少次检查?
SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '66990606' AND t_kc22.STA_DATE BETWEEN '2008-08-22' AND '2015-12-14' AND gwyjzb.MED_SER_ORG_NO = '0896805' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CL...
css
CREATE TABLE table_name_83 ( result VARCHAR, western_champion VARCHAR, eastern_champion VARCHAR )
What is the score from the Sacramento monarchs from the west and the Connecticut sun from the east?
SELECT result FROM table_name_83 WHERE western_champion = "sacramento monarchs" AND eastern_champion = "connecticut sun"
sql_create_context
CREATE TABLE table_name_60 ( record VARCHAR, opponent VARCHAR )
What was the record in the game where the opponent was the cincinnati royals?
SELECT record FROM table_name_60 WHERE opponent = "cincinnati royals"
sql_create_context
CREATE TABLE table_2454589_1 ( club VARCHAR, home_city VARCHAR )
Name the club for quevedo
SELECT club FROM table_2454589_1 WHERE home_city = "Quevedo"
sql_create_context
CREATE TABLE table_name_19 ( money___$__ VARCHAR, player VARCHAR )
What was the Money ($) amount for Lloyd Mangrum?
SELECT money___$__ FROM table_name_19 WHERE player = "lloyd mangrum"
sql_create_context
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, ...
Top 100 most viewed questions. Questions must have at least 1000 views to qualify
SELECT Questions.Id AS "post_link", Questions.Title, Questions.AnswerCount, Questions.ViewCount, Questions.FavoriteCount, Questions.Score, Questions.LastActivityDate, Questions.Tags FROM Posts AS Answers INNER JOIN Posts AS Questions ON Questions.Id = Answers.ParentId INNER JOIN Users AS Users ON Answers.OwnerUserId = ...
sede
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
Select the name of each manufacturer along with the price of its most expensive product using a bar chart, order y axis from low to high order please.
SELECT T2.Name, MAX(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY MAX(T1.Price)
nvbench
CREATE TABLE table_name_2 ( termini VARCHAR, junctions VARCHAR )
What's the termini of the route with junctions of i-35 fm 3338 sh 255?
SELECT termini FROM table_name_2 WHERE junctions = "i-35 fm 3338 sh 255"
sql_create_context
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TAB...
a SQL Extension I believe) you do have to consider the matching expression as a name because although ISNULL(x,y) should never be null, it clearly is in the subtotal for that row. But you can also use the Grouping() expression and this seems to be its main reason for existing.
SELECT TIME_TO_STR(CreationDate, '%Y') AS "year", TIME_TO_STR(CreationDate, '%m') AS "date", Score AS "score", COUNT(*) AS CommentCount, SUM(LENGTH(Text)) AS Typed, GROUPING(TIME_TO_STR(CreationDate, '%Y')), GROUPING(TIME_TO_STR(CreationDate, '%m')), GROUPING(Score) FROM Comments WHERE UserId = @UserId GROUP BY CUBE (T...
sede
CREATE TABLE round ( round_id number, member_id number, decoration_theme text, rank_in_round number ) CREATE TABLE college ( college_id number, name text, leader_name text, college_location text ) CREATE TABLE member ( member_id number, name text, country text, college_...
Show the different countries and the number of members from each.
SELECT country, COUNT(*) FROM member GROUP BY country
spider
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
从2000年9月28日到2007年1月25日这段时间内患者奚霞辉所有检验结果指标记录中的仪器编号以及名称都是啥?
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb...
css
CREATE TABLE table_name_50 ( crowd INTEGER, venue VARCHAR )
what is the lowest crowd at kardinia park
SELECT MIN(crowd) FROM table_name_50 WHERE venue = "kardinia park"
sql_create_context
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE program_cours...
On average , how hard are PreMajor courses ?
SELECT AVG(workload) FROM program_course WHERE category LIKE '%PreMajor%'
advising
CREATE TABLE table_name_24 ( grid INTEGER, bike VARCHAR, rider VARCHAR )
Name the lowest Grid which has a Bike of ducati 1098 rs 08 and a Rider of max biaggi?
SELECT MIN(grid) FROM table_name_24 WHERE bike = "ducati 1098 rs 08" AND rider = "max biaggi"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
which patients have sdh primary disease?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "SDH"
mimicsql_data
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutpu...
what was the first time patient 004-86136 had a maximum of anion gap in 12/this year?
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-86136')) AND lab.labname = 'anion gap' AND DATETIME(lab.labresulttime, 'start o...
eicu
CREATE TABLE table_53417 ( "Team" text, "Games Played" real, "Wins" real, "Losses" real, "Ties" real, "Goals For" real, "Goals Against" real )
what is the lowest number of ties when the losses is 7 and games played is less than 10?
SELECT MIN("Ties") FROM table_53417 WHERE "Losses" = '7' AND "Games Played" < '10'
wikisql
CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE venue ( venueid int, venuename var...
When did Luke S Zettlemoyer publish ?
SELECT DISTINCT paper.year FROM author, paper, writes WHERE author.authorname = 'Luke S Zettlemoyer' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid ORDER BY paper.year
scholar
CREATE TABLE table_42453 ( "Year" real, "Team" text, "Chassis" text, "Engine" text, "Rank" text, "Points" real )
What is the chassis when the rank is 3rd?
SELECT "Chassis" FROM table_42453 WHERE "Rank" = '3rd'
wikisql
CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), PROF_HIGH_DEGREE varchar(5) ) CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varc...
How many sections does each course has Visualize by bar chart, and rank y axis in descending order.
SELECT CRS_CODE, COUNT(*) FROM CLASS GROUP BY CRS_CODE ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_203_173 ( id number, "year(s)" text, "serial name" text, "role" text, "co-star" text, "note(s)" text, "channel" text )
how many shows were on zee tv ?
SELECT COUNT("serial name") FROM table_203_173 WHERE "channel" = 'zee tv'
squall
CREATE TABLE table_name_2 ( protein_name VARCHAR, sequence_identity_to_human_protein VARCHAR )
What is the protein name of the protein with a sequence identity to human protein of 32%?
SELECT protein_name FROM table_name_2 WHERE sequence_identity_to_human_protein = "32%"
sql_create_context
CREATE TABLE table_48655 ( "Year" real, "Date" text, "Winner" text, "Result" text, "Loser" text, "Location" text )
Who was the winner when the result was 56-0 before 1935?
SELECT "Winner" FROM table_48655 WHERE "Year" < '1935' AND "Result" = '56-0'
wikisql
CREATE TABLE table_55793 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What date has a Home team score of 11.18 (84)?
SELECT "Date" FROM table_55793 WHERE "Home team score" = '11.18 (84)'
wikisql
CREATE TABLE table_name_63 ( left_office VARCHAR, political_party VARCHAR, took_office VARCHAR )
What is Left Office, when Political Party is Ba'ath Party ( Syria Region ), and when Took Office is 7 March 1958?
SELECT left_office FROM table_name_63 WHERE political_party = "ba'ath party ( syria region )" AND took_office = "7 march 1958"
sql_create_context
CREATE TABLE table_66045 ( "Rank" real, "Stadium" text, "Capacity" text, "Location" text, "Home Team" text )
What home team has a rank greater than 6, and 94,392 as the capacity?
SELECT "Home Team" FROM table_66045 WHERE "Rank" > '6' AND "Capacity" = '94,392'
wikisql
CREATE TABLE table_name_88 ( tournament VARCHAR, date VARCHAR )
What tournament happened on 12 november 2006?
SELECT tournament FROM table_name_88 WHERE date = "12 november 2006"
sql_create_context
CREATE TABLE table_27635 ( "SlNo" real, "Name of the City" text, "Address" text, "Contact Person" text, "Telephone No" text, "Facilities Offered" text )
What was the SlNo no of contact person SDE (P), Thiruppattur?
SELECT "SlNo" FROM table_27635 WHERE "Contact Person" = 'SDE (P), Thiruppattur'
wikisql
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
Are 2 or 3 lessons per week usually given for 555 ?
SELECT DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday, semester.semester, semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND c...
advising