instruction
stringlengths
53
549
output
stringlengths
30
2.33k
### Instruction: Which TNS-Sofres 5/26/09 has an Ipsos 5/25/09 of 1%? ### Response:
SELECT tns_sofres_5_26_09 FROM table_name_82 WHERE ipsos_5_25_09 = "1%"
### Instruction: Quantidade de votos por coment rio. ### Response:
SELECT PostId AS "post_link", Comments.Id AS "comment_link", Comments.Score, Comments.Text FROM Comments INNER JOIN Posts ON Posts.Id = Comments.PostId WHERE UserId = @UserId ORDER BY Comments.Score DESC
### Instruction: What's the value for arizona when colorado and nevada are nixon, and texas is humphrey? ### Response:
SELECT "Arizona" FROM table_62540 WHERE "Colorado" = 'nixon' AND "Nevada" = 'nixon' AND "Texas" = 'humphrey'
### Instruction: What is the lowest number of Gold the Nation of Italy had when it ranked other than 1, and had more than 0 Silver? ### Response:
SELECT MIN("Gold") FROM table_51380 WHERE "Rank" > '1' AND "Nation" = 'italy' AND "Silver" > '0'
### Instruction: Which Men's doubles have a Year smaller than 1960, and Men's singles of noel b. radford? ### Response:
SELECT "Men's doubles" FROM table_75490 WHERE "Year" < '1960' AND "Men's singles" = 'noel b. radford'
### Instruction: Find the number of the names of swimmers who has a result of 'win', and display by the bar in descending. ### Response:
SELECT name, COUNT(name) FROM swimmer AS t1 JOIN record AS t2 ON t1.ID = t2.Swimmer_ID WHERE Result = 'Win' GROUP BY name ORDER BY name DESC
### Instruction: What is the maximum foot per second speed where time to feet ratio is 22.1 at 55 degrees? ### Response:
SELECT MAX("m/v ft/s") FROM table_20824 WHERE "Time to ft (m) at 55\u00b0 (seconds)" = '22.1'
### Instruction: What were the shots below par when the winning score was 67-64-63-71-66=331? ### Response:
SELECT "To par" FROM table_3129 WHERE "Winning score" = '67-64-63-71-66=331'
### Instruction: Rank smaller than 5, and a Time larger than 10.7, and a Date of 10 july 2009 has what location? ### Response:
SELECT location FROM table_name_37 WHERE rank < 5 AND time > 10.7 AND date = "10 july 2009"
### Instruction: Which method had a 3 rounds, result in a loss and the Juiz de Fora - fight 1 event? ### Response:
SELECT "Method" FROM table_66207 WHERE "Round" = '3' AND "Res." = 'loss' AND "Event" = 'juiz de fora - fight 1'
### Instruction: Show a bar chart to show different names and credit scores of customers who have taken a loan, and I want to display cust_name in desc order. ### Response:
SELECT cust_name, credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_ID = T2.cust_ID ORDER BY cust_name DESC
### Instruction: A bar chart showing the average price of each cinema. ### Response:
SELECT Name, AVG(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
### Instruction: which two institutions joined the same year as clarke university ? ### Response:
SELECT "institution" FROM table_204_501 WHERE "institution" <> 'clarke university' AND "joined" = (SELECT "joined" FROM table_204_501 WHERE "institution" = 'clarke university')
### Instruction: When the second intermediate period of egypt is the ubaid period in mesopotamia how many early calcolithics are there? ### Response:
SELECT COUNT("Early Chalcolithic") FROM table_26151 WHERE "Ubaid period in Mesopotamia" = 'Second Intermediate Period of Egypt'
### Instruction: For those records from the products and each product's manufacturer, visualize the relationship between code and revenue , and group by attribute founder. ### Response:
SELECT T1.Code, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder
### Instruction: get me the number of patients who had more than 10 days hospitalization and home health care discharge. ### Response:
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "HOME HEALTH CARE" AND demographic.days_stay > "10"
### Instruction: who won the highest amount of rugby matches between new zealand and wales for the last 100 years ? ### Response:
SELECT "victor" FROM table_203_634 WHERE "victor" IN ('new zealand', 'wales') GROUP BY "victor" ORDER BY COUNT(*) DESC LIMIT 1
### Instruction: What are the 13 -credit upper-level classes ? ### Response:
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 13 AND program_course.category LIKE 'ULCS'
### Instruction: What is the sum of goals for Torpedo Moscow in division 1 with an apps value less than 29? ### Response:
SELECT SUM("Goals") FROM table_34908 WHERE "Team" = 'torpedo moscow' AND "Division" = '1' AND "Apps" < '29'
### Instruction: What is the enrollment for the institution that was founded in 1866 and is a private/(african methodist) type? ### Response:
SELECT MAX(enrollment) FROM table_10577579_2 WHERE founded = 1866 AND type = "Private/(African Methodist)"
### Instruction: What is the total number of total viewers with a share of 18.8% and a weekly ranking under 16? ### Response:
SELECT COUNT("Total Viewers") FROM table_70459 WHERE "Share" = '18.8%' AND "BBC One Weekly Ranking" < '16'
### Instruction: What is the Version of the CD release on June 12, 2008 in Cyprus? ### Response:
SELECT "Version" FROM table_8209 WHERE "Format" = 'cd' AND "Date" = 'june 12, 2008' AND "Region" = 'cyprus'
### Instruction: find out the short title of procedure and primary disease of patient with patient id 17570. ### Response:
SELECT demographic.diagnosis, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "17570"
### Instruction: when is the latest to join prsl when founded in 2007 and the stadium is roberto clemente stadium 1? ### Response:
SELECT MAX(joined_prsl) FROM table_name_31 WHERE founded = 2007 AND stadium = "roberto clemente stadium 1"
### Instruction: What district is James Humphrey from who was first elected in 1858 and was eventually defeated democratic gain? ### Response:
SELECT district FROM table_name_3 WHERE first_elected = 1858 AND result = "defeated democratic gain" AND incumbent = "james humphrey"
### Instruction: What Vehicle Flight # has Pilot Peterson and Velocity (km/h) of 649? ### Response:
SELECT "Vehicle Flight #" FROM table_80138 WHERE "Pilot" = 'peterson' AND "Velocity (km/h)" = '649'
### Instruction: What Social AO has an External CO of simonas savickas, and an Internal CO of pieter kuijsten? ### Response:
SELECT "Social AO" FROM table_61958 WHERE "External CO" = 'simonas savickas' AND "Internal CO" = 'pieter kuijsten'
### Instruction: Which opponent played a 1990 wcq type of game, where the results were 0:0? ### Response:
SELECT "Opponent" FROM table_4998 WHERE "Type of game" = '1990 wcq' AND "Results\u00b9" = '0:0'
### Instruction: what is minimum age of patients whose days of hospital stay is 20 and year of death is less than 2168? ### Response:
SELECT MIN(demographic.age) FROM demographic WHERE demographic.days_stay = "20" AND demographic.dod_year < "2168.0"
### Instruction: Is EHS 869 counted towards ULCS ? ### Response:
SELECT COUNT(*) > 0 FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = 'EHS' AND course.number = 869 AND program_course.category LIKE '%ULCS%'
### Instruction: what is admission time and procedure icd9 code of subject id 2560? ### Response:
SELECT demographic.admittime, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "2560"
### Instruction: What is the total number of years did he play the forward position and what school/club/team/country of Oregon State did he play? ### Response:
SELECT SUM("No.(s)") FROM table_55473 WHERE "Position" = 'forward' AND "School/Club Team/Country" = 'oregon state'
### Instruction: What is the date of the match against John McEnroe with a Score of 3 6, 6 3, 2 6? ### Response:
SELECT date FROM table_name_73 WHERE opponent = "john mcenroe" AND score = "3–6, 6–3, 2–6"
### Instruction: In what Election year was Adalberto Mosaner the Mayor with less than 16,170 Inhabitants? ### Response:
SELECT SUM("Election") FROM table_50465 WHERE "Mayor" = 'adalberto mosaner' AND "Inhabitants" < '16,170'
### Instruction: How much Gold has a Silver smaller than 14, and a Rank larger than 8, and a Bronze of 3? ### Response:
SELECT COUNT("Gold") FROM table_9299 WHERE "Silver" < '14' AND "Rank" > '8' AND "Bronze" = '3'
### Instruction: What is the average Extras for Muttiah Muralitharan, with less than 353 Runs Conceded? ### Response:
SELECT AVG("Extras") FROM table_6930 WHERE "Name" = 'muttiah muralitharan' AND "Runs Conceded" < '353'
### Instruction: Bronze larger than 2, and a Rank of 4, and a Total larger than 7 has how many numbers of gold? ### Response:
SELECT AVG("Gold") FROM table_14508 WHERE "Bronze" > '2' AND "Rank" = '4' AND "Total" > '7'
### Instruction: Which Outcome has a Launch Date of march 18, 1964; 14:50 gmt? ### Response:
SELECT "Outcomes" FROM table_57779 WHERE "Launch Date" = 'march 18, 1964; 14:50 gmt'
### Instruction: how many patients whose lab test name is nonsquamous epithelial cell? ### Response:
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "NonSquamous Epithelial Cell"
### Instruction: What is the sum of the years when the winner was prof. priyambada mohanty hejmadi from orissa? ### Response:
SELECT SUM("Year") FROM table_44280 WHERE "State" = 'orissa' AND "Name" = 'prof. priyambada mohanty hejmadi'
### Instruction: For each account type, find the average account balance of customers with credit score lower than 50 Show bar chart, sort in descending by the y axis. ### Response:
SELECT acc_type, AVG(acc_bal) FROM customer WHERE credit_score < 50 GROUP BY acc_type ORDER BY AVG(acc_bal) DESC
### Instruction: Find the busiest source airport that runs most number of routes in China. ### Response:
SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid WHERE T1.country = 'China' GROUP BY T1.name ORDER BY COUNT(*) DESC LIMIT 1
### Instruction: What is the highest Money ( $ ), when Score is '69-71-70-74=284'? ### Response:
SELECT MAX("Money ( $ )") FROM table_48001 WHERE "Score" = '69-71-70-74=284'
### Instruction: How many bowlers were there when david hussey azhar mahmood gurkeerat singh was the batsmen? ### Response:
SELECT COUNT(bowler) FROM table_22962745_35 WHERE batsmen = "David Hussey Azhar Mahmood Gurkeerat Singh"
### Instruction: What is the average rank of the Reliance Entertainment movie with an opening day on Wednesday before 2012? ### Response:
SELECT AVG(rank) FROM table_name_8 WHERE day_of_week = "wednesday" AND year < 2012 AND studio_s_ = "reliance entertainment"
### Instruction: What was the date of the game held at the A venue with a result of 0-1 against the Rangers? ### Response:
SELECT "Date" FROM table_41667 WHERE "Venue" = 'a' AND "Result" = '0-1' AND "Opponent" = 'rangers'
### Instruction: A line chart shows the trend of the sum of monthly_rental over date_address_to , and group by attribute other_details. ### Response:
SELECT date_address_to, SUM(monthly_rental) FROM Student_Addresses GROUP BY other_details, date_address_to ORDER BY monthly_rental DESC
### Instruction: Show the album names and ids for albums that contain tracks with unit price bigger than 1. Visualize by bar chart. ### Response:
SELECT T1.Title, T1.AlbumId FROM Album AS T1 JOIN Track AS T2 ON T1.AlbumId = T2.AlbumId WHERE T2.UnitPrice > 1
### Instruction: List the names of wrestlers and the teams in elimination in descending order of days held. ### Response:
SELECT T2.name, T1.team FROM elimination AS T1 JOIN wrestler AS T2 ON T1.wrestler_id = T2.wrestler_id ORDER BY T2.days_held DESC
### Instruction: what is average age of patients whose age is greater than or equal to 31 and admission year is greater than or equal to 2155? ### Response:
SELECT AVG(demographic.age) FROM demographic WHERE demographic.age >= "31" AND demographic.admityear >= "2155"
### Instruction: What is the average january number when the game number was higher than 39 and the opponent was the Vancouver Canucks? ### Response:
SELECT AVG("January") FROM table_38285 WHERE "Opponent" = 'vancouver canucks' AND "Game" > '39'
### Instruction: How does BIOMEDE 590 differ from BIOMEDE 990 ? ### Response:
SELECT DISTINCT department, description, number FROM course WHERE (department = 'BIOMEDE' AND number = 590) OR (department = 'BIOMEDE' AND number = 990)
### Instruction: what is minimum age of patients whose admission type is urgent and admission year is greater than or equal to 2178? ### Response:
SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.admityear >= "2178"
### Instruction: What is the highest amount of bronze china, which has more than 1 gold and more than 11 total, has? ### Response:
SELECT MAX("Bronze") FROM table_79667 WHERE "Gold" > '1' AND "Nation" = 'china' AND "Total" > '11'
### Instruction: find out the maximum age of patients suffering from acute subdural hematoma who were hospitalized for 8 days. ### Response:
SELECT MAX(demographic.age) FROM demographic WHERE demographic.diagnosis = "ACUTE SUBDURAL HEMATOMA" AND demographic.days_stay = "8"
### Instruction: What is the Construction that has a Listed 09/08/1983, and a Name of cecil lindsey? ### Response:
SELECT construction_completed FROM table_name_49 WHERE listed = "09/08/1983" AND name = "cecil lindsey"
### Instruction: Who was the guest on 24.11.07 when the result was 0:1 at 16:00? ### Response:
SELECT guest FROM table_name_25 WHERE date = "24.11.07" AND result = "0:1" AND time = "16:00"
### Instruction: What is the sum of all played when less than 4 sets were won and 3-dart average was 53.19? ### Response:
SELECT SUM("Played") FROM table_35072 WHERE "Sets Won" < '4' AND "3-dart Average" = '53.19'
### Instruction: How many fast laps are in 6 races with 30 points in the World Series by Nissan? ### Response:
SELECT "Fast laps" FROM table_67180 WHERE "Series" = 'world series by nissan' AND "Races" = '6' AND "Points" = '30'
### Instruction: What is the 2007/08number when the 2010/11 is 1,633.6? ### Response:
SELECT "2007/08" FROM table_30613 WHERE "2010/11" = '1,633.6'
### Instruction: who is the driver for the car constructed by ferrari with a time/retired of +1:06.683? ### Response:
SELECT "Driver" FROM table_56493 WHERE "Constructor" = 'ferrari' AND "Time/Retired" = '+1:06.683'
### Instruction: A bar chart about what is minimum hours of the students playing in different position?, and order in desc by the X-axis. ### Response:
SELECT pPos, MIN(T2.HS) FROM Tryout AS T1 JOIN Player AS T2 ON T1.pID = T2.pID GROUP BY pPos ORDER BY pPos DESC
### Instruction: Which Large end has a Taper/ft smaller than 0.6000000000000001? ### Response:
SELECT COUNT(large_end) FROM table_name_5 WHERE taper / ft < 0.6000000000000001
### Instruction: Bar chart x axis date of enrolment y axis the number of date of enrolment, sort in desc by the Y-axis. ### Response:
SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment ORDER BY COUNT(date_of_enrolment) DESC
### Instruction: What player was place of t1 in To Par and had a score of 70-73-69=212? ### Response:
SELECT "To par" FROM table_80397 WHERE "Place" = 't1' AND "Score" = '70-73-69=212'
### Instruction: Which Name has a Bullett of 10.57 (.416) and a Base of 14.96 (.589)? ### Response:
SELECT name FROM table_name_86 WHERE bullet = "10.57 (.416)" AND base = "14.96 (.589)"
### Instruction: what is the number of days of hospital stay and diagnosis for the patient named Kurt Buczek? ### Response:
SELECT demographic.days_stay, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Kurt Buczek"
### Instruction: Show all dates of transactions whose type code is 'SALE', and count them by a line chart, and display by the x-axis from high to low. ### Response:
SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE transaction_type_code = "SALE" ORDER BY date_of_transaction DESC
### Instruction: What is the average cloud cover rates of the dates (bin into weekdays interval) that had the top 5 cloud cover rates? You can draw me a bar chart for this purpose, and order in descending by the Y please. ### Response:
SELECT date, AVG(cloud_cover) FROM weather ORDER BY AVG(cloud_cover) DESC
### Instruction: Which College has an Overall larger than 211, a Position of db, and a Name of carl charon? ### Response:
SELECT "College" FROM table_43945 WHERE "Overall" > '211' AND "Position" = 'db' AND "Name" = 'carl charon'
### Instruction: Show the number of accounts opened in each year for all accounts and group by other account details in a group line chart, could you display X-axis in ascending order? ### Response:
SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts GROUP BY other_account_details ORDER BY date_account_opened
### Instruction: What is the capacity for the stadium of kadrioru stadium and a current manager of sergei ratnikov? ### Response:
SELECT AVG("Capacity") FROM table_5960 WHERE "Stadium" = 'kadrioru stadium' AND "Current manager" = 'sergei ratnikov'
### Instruction: What is the lowest rank for the team that raced a time of 6:17.62 and a notes of sa/b? ### Response:
SELECT MIN("Rank") FROM table_13272 WHERE "Notes" = 'sa/b' AND "Time" = '6:17.62'
### Instruction: how many of the patients were treated with nitroglycerin sl? ### Response:
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Nitroglycerin SL"
### Instruction: provide the number of patients whose language is cape and admission location is transfer from hosp/extram? ### Response:
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "CAPE" AND demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM"
### Instruction: What is the normal 2002 that has a Country of Peru, and 2007 bigger than 1,200? ### Response:
SELECT AVG(2002) FROM table_name_88 WHERE country = "peru" AND 2007 > 1 OFFSET 200
### Instruction: Which Player has a Date of Birth (Age When Delisted) of 13 February 1987 (aged 24)? ### Response:
SELECT "Player" FROM table_55240 WHERE "Date of birth (age when delisted)" = '13 february 1987 (aged 24)'
### Instruction: yes or no for the adelaide with no for auckland, yes for melbourne, yes for the gold coast? ### Response:
SELECT "Adelaide" FROM table_67834 WHERE "Auckland" = 'no' AND "Melbourne" = 'yes' AND "Gold Coast" = 'yes'
### Instruction: What are 1 -credit classes that are upper-level ? ### Response:
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 1 AND program_course.category LIKE 'ULCS'
### Instruction: What is the average games a player born on 17 March 1915 and debut before 1935 had? ### Response:
SELECT AVG(games) FROM table_name_68 WHERE date_of_birth = "17 march 1915" AND debut_year < 1935
### Instruction: How many questions did SO have X days after its creation?. Note that the public beta started on September 15th, 2008 ### Response:
SELECT COUNT(*) FROM Posts WHERE PostTypeId = 1 AND CreationDate < DATEADD(day, '##Days##', '2008-07-15')
### Instruction: Which venue has a Date of 20,21,22,23,24 november 1998? ### Response:
SELECT "Venue" FROM table_15454 WHERE "Date" = '20,21,22,23,24 november 1998'
### Instruction: How many documents in different starting date? Return a bar chart binning starting date by weekday interval, I want to sort y-axis in descending order. ### Response:
SELECT Date_in_Location_From, COUNT(Date_in_Location_From) FROM Document_Locations ORDER BY COUNT(Date_in_Location_From) DESC
### Instruction: What week was the attendance smaller than 22,204 on December 8, 1962? ### Response:
SELECT SUM("Week") FROM table_77067 WHERE "Attendance" < '22,204' AND "Date" = 'december 8, 1962'
### Instruction: For those employees who was hired before 2002-06-21, draw a scatter chart about the correlation between manager_id and department_id . ### Response:
SELECT MANAGER_ID, DEPARTMENT_ID FROM employees WHERE HIRE_DATE < '2002-06-21'
### Instruction: At what venue did the team from Collingwood score 7.14 (56) - 4.5 (29)? ### Response:
SELECT venue FROM table_name_51 WHERE opponent = "collingwood" AND score = "7.14 (56) - 4.5 (29)"
### Instruction: get the number of patients less than 43 years who have infected right thigh graft primary disease. ### Response:
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "INFECTED RIGHT THIGH GRAFT" AND demographic.age < "43"
### Instruction: What was the sample size for polling on May 2-7, 2007 for Hillary Clinton? ### Response:
SELECT "Sample Size" FROM table_44623 WHERE "Date" = 'may 2-7, 2007' AND "Democrat" = 'hillary clinton'
### Instruction: What was the position in 1959-1960 for the club that had 14 seasons at this level? ### Response:
SELECT "Position in 1959\u20131960" FROM table_61486 WHERE "Seasons at this level" = '14 seasons'
### Instruction: count the number of inpatient hospital admission patients born before 2092. ### Response:
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.dob_year < "2092"
### Instruction: SOru - Number of active posts last month per mod. ### Response:
SELECT COUNT(*) AS PostsLastMonth, 3 AS Moderators, (COUNT(*) / 3) AS PostsLastMonthPerMod FROM Posts WHERE LastActivityDate >= DATEADD(month, -1, (SELECT MAX(LastActivityDate) FROM Posts))
### Instruction: For those employees who did not have any job in the past, for commission_pct, hire_date, visualize the trend. ### Response:
SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
### Instruction: What is the Player that has a Place of t2, and a Score of 74-70-68=212? ### Response:
SELECT "Player" FROM table_8464 WHERE "Place" = 't2' AND "Score" = '74-70-68=212'
### Instruction: When bmw activee is the vehicle type how many clean electric grid california (san francisco) measurements are there? ### Response:
SELECT COUNT(clean_electric_grid_california__san_francisco_) FROM table_24620684_2 WHERE vehicle = "BMW ActiveE"
### Instruction: Who was the Runner-up for the merrill lynch/golf digest commemorative pro-am tournament? ### Response:
SELECT "Runner(s)-up" FROM table_40274 WHERE "Tournament" = 'merrill lynch/golf digest commemorative pro-am'
### Instruction: What is the gpa per capita (nominal) for the country with gdp (nominal) is $52.0 billion? ### Response:
SELECT gdp_per_capita__nominal_ FROM table_11780179_1 WHERE gdp__nominal_ = "$52.0 billion"
### Instruction: papers about semantic parsing ### Response:
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'semantic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid
### Instruction: Top 100 users by total comment score. ### Response:
SELECT Users.Id AS "user_link", SUM(Comments.Score) AS "Total comment score" FROM Users INNER JOIN Comments ON Users.Id = Comments.UserId GROUP BY Users.Id ORDER BY SUM(Comments.Score) DESC LIMIT 100
### Instruction: Return a pie chart about the number of customer addresses in each address type code. ### Response:
SELECT address_type_code, COUNT(address_type_code) FROM Customer_Addresses AS T1 JOIN Premises AS T2 ON T1.premise_id = T2.premise_id GROUP BY address_type_code
### Instruction: Find the name of customer who has the highest amount of loans. ### Response:
SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name ORDER BY SUM(T2.amount) DESC LIMIT 1