sentence
stringlengths
3
347
sql
stringlengths
18
804
What are the building, room number, semester and year of courses in the Psychology department, sorted using course title?
SELECT T2.building , T2.room_number , T2.semester , T2.year FROM course AS T1 JOIN SECTION AS T2 ON T1.course_id = T2.course_id WHERE T1.dept_name = 'Psychology' ORDER BY T1.title
How many resulted in draws with 34 tries for?
SELECT drawn FROM table_name_99 WHERE tries_for = "34"
What is the discounted price of line item number 1?
SELECT l_extendedprice * (1 - l_discount) FROM lineitem WHERE l_linenumber = 1
What are the names of all departments in alphabetical order?
SELECT dept_name FROM department ORDER BY dept_name
In which year did the least people enter hall of fame?
SELECT yearid FROM hall_of_fame GROUP BY yearid ORDER BY COUNT(*) LIMIT 1
What is the highest Week with the Opponent Buffalo Bills?
SELECT MAX(week) FROM table_name_67 WHERE opponent = "buffalo bills"
Find products with max page size as "A4" and pages per minute color smaller than 5.
SELECT product FROM product WHERE max_page_size = "A4" AND pages_per_minute_color < 5
Show date of transaction where amount of transaction larger than 1000
SELECT date_of_transaction FROM TRANSACTIONS WHERE amount_of_transaction > 1000
What was the music for the team who earned a score of 13 (5, 4, 4)?
SELECT music FROM table_name_99 WHERE score = "13 (5, 4, 4)"
Which event has notes of women +60kg quarterfinal?
SELECT event FROM table_name_43 WHERE notes = "women +60kg quarterfinal"
What is the example with the associative type?
SELECT example FROM table_name_56 WHERE type = "associative"
Who was the high rebounder on game 1?
SELECT high_rebounds FROM table_27715173_12 WHERE game = 1
Find the average age of members of the club "Hopkins Student Enterprises".
SELECT avg(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Hopkins Student Enterprises"
What is the label for catalog number CRG3P-90054?
SELECT label FROM table_name_96 WHERE catalog = "crg3p-90054"
Which telescopes were sponsored by or originated in Belgium?
SELECT name FROM table_23851574_2 WHERE nationality_sponsors = "Belgium"
What is the time/retired when there are less than 22 laps and honda is the manufacturer?
SELECT time_retired FROM table_name_67 WHERE laps < 22 AND manufacturer = "honda"
Please list all the paths of the solutions containing files within the repository whose url is "https://github.com/maxild/playground.git".
SELECT T2.Path FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Url = 'https://github.com/maxild/playground.git'
What is the original name of the place by designer Glen Peloso with a Location of n/a?
SELECT original_name FROM table_name_4 WHERE designer = "glen peloso" AND location = "n/a"
Based on business in Phoenix, calculate the percentage of business with low funny votes.
SELECT CAST(SUM(CASE WHEN T2.review_votes_funny = 'Low' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.business_id) FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id WHERE T1.city = 'Phoenix'
display all the information for all employees who have the letters D or S in their first name and also arrange the result in descending order by salary.
SELECT * FROM employees WHERE first_name LIKE '%D%' OR first_name LIKE '%S%' ORDER BY salary DESC
Find the invoice numbers which are created before 1989-09-03 or after 2007-12-25.
SELECT invoice_number FROM invoices WHERE invoice_date < "1989-09-03" OR invoice_date > "2007-12-25"
how many address are presented on the table
SELECT count ( * ) from addresses
Can you please tell me the names of the artists who don't have any exhibitions?
SELECT name FROM artist WHERE artist_id NOT IN ( SELECT artist_id FROM exhibition )
What is Bob Tway's To par?
SELECT to_par FROM table_name_27 WHERE player = "bob tway"
What is the highest number of laps when honda is the manufacturer and the grid number is 12?
SELECT MAX(laps) FROM table_name_27 WHERE manufacturer = "honda" AND grid = 12
Who is the youngest journal committee member?
SELECT T1.name FROM editor AS T1 JOIN journal_committee AS T2 ON T1.Editor_ID = T2.Editor_ID order by T1.age asc limit 1
How many different results came out of the round in which #98 All American Racers became the GTU winning team?
SELECT COUNT(results) FROM table_13643320_2 WHERE gtu_winning_team = "#98 All American Racers"
What was the score in the tournament in which Michael Stich took third place?
SELECT score FROM table_name_32 WHERE third_place = "michael stich"
What were the San Francisco resident's years in assembly?
SELECT years_in_assembly FROM table_name_54 WHERE residence = "san francisco"
How many of them participated in more than 5 races?
select count ( * ) from ( SELECT ( T1.driverid ) FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING count ( * ) > 5 )
List name and damage for all storms in a descending order of max speed.
SELECT name , damage_millions_USD FROM storm ORDER BY max_speed DESC;
What are the results for testing the species with voges-proskauer when citrate yields a positive result?
SELECT voges_proskauer FROM table_16083989_1 WHERE citrate = "Positive"
What's the series number of the episode with a broadcast order s04 e07?
SELECT MAX(number_in_series) FROM table_1231892_4 WHERE broadcast_order = "S04 E07"
How many activities do we have?
SELECT count(*) FROM Activity
How many points did the Falcons score when the record was 4-4?
SELECT falcons_points FROM table_16710971_2 WHERE record = "4-4"
Who was the high rebounds of team @ Detroit?
SELECT high_rebounds FROM table_27721131_10 WHERE team = "@ Detroit"
What about Mrs. Hanna Willms ? | Did you mean the number of policies Mrs. Hanna Willms has listed? | Yes
SELECT count ( * ) FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id where Customer_name = "Mrs. Hanna Willms"
What is the Upper index Kcal/ Nm 3 of iso-butane, and a Lower index MJ/ Nm 3 smaller than 84.71?
SELECT COUNT(upper_index_kcal__nm_3) FROM table_name_59 WHERE fuel_gas = "iso-butane" AND lower_index_mj__nm_3 < 84.71
What is the Cardinalatial order and title that Pedro Martínez de Luna y Gotor elevated?
SELECT cardinalatial_order_and_title FROM table_name_84 WHERE elector = "pedro martínez de luna y gotor"
Which years was there a To par of +1?
SELECT year_s__won FROM table_name_45 WHERE to_par = "+1"
Report the distinct registration date and the election cycle.
SELECT DISTINCT Registration_Date , Election_Cycle FROM VOTING_RECORD
WHAT ARE THE BROWSERS LISTED IN THE TABLE
select name from browser
What is the average heat that has 52.83 sb mark and lane less than 4?
SELECT AVG(heat) FROM table_name_28 WHERE mark = "52.83 sb" AND lane < 4
How many editors are there?
SELECT count(*) FROM editor
What is the id and name of the employee with the highest salary?
SELECT eid , name FROM Employee ORDER BY salary DESC LIMIT 1
Which coach has serviced in NBA for more than 10 years.
SELECT coachID FROM coaches WHERE lgID = 'NBA' GROUP BY coachID HAVING MAX(year) - MIN(year) > 10
what is most common participant type
SELECT participant_type_code FROM participants GROUP BY participant_type_code ORDER BY count ( * ) DESC LIMIT 1
What is the average pick # of the player from round 11?
SELECT AVG(pick__number) FROM table_name_21 WHERE round = 11
Among the schools donated by donor "000eebf28658900e63b538cf8a73afbd",how many schools whose poverty level are highest?
SELECT COUNT(T1.schoolid) FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.poverty_level = 'highest poverty' AND T2.donor_acctid = '000eebf28658900e63b538cf8a73afbd'
How many members have professor edward acton as vice-chancellor?
SELECT COUNT(total_number_of_students) FROM table_142950_1 WHERE vice_chancellor = "Professor Edward Acton"
what is the country where the player is phil mickelson?
SELECT country FROM table_13282157_1 WHERE player = "Phil Mickelson"
Show the ids for projects with at least 2 documents.
SELECT project_id FROM Documents GROUP BY project_id HAVING COUNT(*) >= 2
What is the nationality of the person with number 27?
SELECT nationality FROM table_name_96 WHERE jersey_number_s_ = "27"
Hello! Can you provide me with a list of all of the player IDs in the database?
SELECT player_id FROM hall_of_fame
In which special stage named Tempo 2 was Sébastien Loeb the leader?
SELECT stage FROM table_21326205_2 WHERE rally_leader = "Sébastien Loeb" AND name = "Tempo 2"
Who is the voice actor of the hero in Lion King?
SELECT T1.`voice-actor` FROM `voice-actors` AS T1 INNER JOIN characters AS T2 ON T1.movie = T2.movie_title WHERE T2.movie_title = 'Lion King' AND T1.character = 'Lion King'
What is the first and last name of all students 18 years old who have vice president votes?
SELECT DISTINCT T1.Fname , T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.VICE_President_VOTE WHERE T1.age = 18
What is the total rank for the lane before 2?
SELECT SUM(rank) FROM table_name_87 WHERE lane < 2
What is the full name of the customer that had made the most transactions in August, 2014?
SELECT T1.First, T1.Last FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID WHERE STRFTIME('%Y-%m', T2.TransactionDate) = '2014-08' GROUP BY T1.CustomerID ORDER BY COUNT(T2.CustomerID) DESC LIMIT 1
What is the maximum overall number?
SELECT MAX(_number) FROM table_2985714_2
What is the High rebounds with a Game that is 62?
SELECT high_rebounds FROM table_name_71 WHERE game = 62
What is the number of professors who are in the Accounting or Biology departments?
SELECT count(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T2.dept_name = 'Accounting' OR T2.dept_name = 'Biology'
What are the differences between the 288th salesperson's predicted annual sales and his or her actual sales thus far?
SELECT SalesYTD - SalesQuota FROM SalesPerson WHERE BusinessEntityID = 288
What is the average profit of all the low class universal road frames? Indicate how many variety of sizes are there and the available colors.
SELECT AVG(T1.ListPrice - T1.StandardCost), COUNT(DISTINCT T1.Size) , COUNT(DISTINCT T1.Style) FROM Product AS T1 INNER JOIN ProductSubcategory AS T2 ON T1.ProductSubcategoryID = T2.ProductSubcategoryID WHERE T1.Class = 'L' AND T2.Name = 'Road Frames' GROUP BY T1.Class, T1.Color
Among all the claims, what is the settlement amount of the claim with the largest claim amount? List both the settlement amount and claim amount.
SELECT Amount_Settled , Amount_Claimed FROM Claims ORDER BY Amount_Claimed DESC LIMIT 1
What are the 3 most common cloud covers in the zip code of 94107?
SELECT cloud_cover FROM weather WHERE zip_code = 94107 GROUP BY cloud_cover ORDER BY COUNT (*) DESC LIMIT 3
Find the names of all reviewers who have contributed three or more ratings.
SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T1.rID HAVING COUNT(*) >= 3
Which Song of the Year was 42 on the UK charts prior to 1994?
SELECT song FROM table_name_14 WHERE year < 1994 AND uk_chart = "42"
Find the number of different cities which banks are located at.
SELECT count(DISTINCT city) FROM bank
What is the ratio of students who have payment due and those who do not have payment due?
SELECT CAST(SUM(IIF(`bool` = 'pos', 1, 0)) AS REAL) / SUM(IIF(`bool` = 'neg', 1, 0)) FROM no_payment_due
Who are the owners of the programs that broadcast both in the morning and at night?
SELECT t1.owner FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id WHERE t2.Time_of_day = "Morning" INTERSECT SELECT t1.owner FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id WHERE t2.Time_of_day = "Night"
What are the nationalities of swimmers "Grant Hackett" and "Craig Stevens"?
SELECT nationality FROM swimmer WHERE name = "Grant Hackett" OR name = "Craig Stevens"
What are the ids of courses offered in Fall of 2009 but not in Spring of 2010?
SELECT course_id FROM SECTION WHERE semester = 'Fall' AND YEAR = 2009 EXCEPT SELECT course_id FROM SECTION WHERE semester = 'Spring' AND YEAR = 2010
Which Crowd has an Away team of collingwood?
SELECT SUM(crowd) FROM table_name_79 WHERE away_team = "collingwood"
Whatis the original title for lion's den?
SELECT original_title FROM table_13834298_1 WHERE film_title_used_in_nomination = "Lion's Den"
What is the average rating of reviews of user id1?
SELECT avg ( T2.rating ) FROM useracct WHERE T2.u_id = 1 AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id GROUP BY T2.u_id
How many rentals were returned on 5/27/2005?
SELECT COUNT(rental_id) FROM rental WHERE rental_date = '2005-05-27'
Show the names of all the activities Mark Giuliano participates in.
SELECT T3.activity_name FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN Activity AS T3 ON T3.actid = T2.actid WHERE T1.fname = "Mark" AND T1.lname = "Giuliano"
How many settlements does each claim correspond to? List the claim id and the number of settlements.
SELECT T1.Claim_id , count(*) FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id
What are the titles of courses that are offered in more than one department?
SELECT title FROM course GROUP BY title HAVING count(*) > 1
What is the company where Eduardo Martins is a customer?
SELECT company FROM customers WHERE first_name = "Eduardo" AND last_name = "Martins";
The color diamond is assigned to which Terminus?
SELECT terminus FROM table_name_46 WHERE color = "diamond"
What is the total number of goals for when the drawn is less than 7, less than 21 games have been lost, and there are 1 of 33 points?
SELECT COUNT(goals_for) FROM table_name_33 WHERE drawn < 7 AND lost < 21 AND points_1 = "33"
What is the position when the League is the malaysian super league, and a Year of 2011?
SELECT position FROM table_name_85 WHERE league = "malaysian super league" AND year = "2011"
Name the total episode for runtime of 24:11
SELECT COUNT(episode) FROM table_2105721_1 WHERE run_time = "24:11"
Which staff started the earliest?
SELECT staff_id from project_staff order by date_from limit 1
What round was the player Ty Lawson with a pick earlier than 18?
SELECT AVG(round) FROM table_name_90 WHERE player = "ty lawson" AND pick < 18
Can you also give me the countries?
SELECT T1.first_name , T1.last_name, T1.city, T1.state, T1.country FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY T2.invoice_date DESC LIMIT 5
What is the name of the winning driver where the circuit name is posillipo?
SELECT winning_driver FROM table_1140105_6 WHERE circuit = "Posillipo"
Count the number of countries.
SELECT count(*) FROM county_public_safety
Can I also get the numbers of assets for each of these contracts
SELECT T1.maintenance_contract_id, T2.asset_id FROM Maintenance_Contracts AS T1 JOIN Assets AS T2 ON T1.maintenance_contract_id = T2.maintenance_contract_id
How many document types are there?
SELECT count(*) FROM Ref_document_types
What is the average snatch score of body builders?
SELECT avg(Snatch) FROM body_builder
How many managers are from United States on the list?
SELECT count ( * ) FROM manager where country = 'United States'
During what years did the tallest building, located at 211 Union Street, have less than 31 floors?
SELECT years_as_tallest FROM table_name_95 WHERE floors < 31 AND street_address = "211 union street"
When did the DC Comics title that debuted in 1937 end?
SELECT last_year FROM table_name_65 WHERE first_year = "1937" AND publisher = "dc comics"
Tell me the NHL team for ryan johnson
SELECT nhl_team FROM table_name_69 WHERE player = "ryan johnson"
Ok ,, what are the cuatomers id that have order of quantity 1?
SELECT T1.Customer_ID FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID = T2.Order_ID WHERE T2.Order_Quantity = 1
Among the LG brand users, calculate the percentage of the Nexus 5 model user. What is the ratio of male and female users of it?
SELECT SUM(IIF(T1.device_model = 'Nexus 5', 1, 0)) * 100 / COUNT(T1.device_id) AS per , SUM(IIF(T1.device_model = 'Nexus 5' AND T2.gender = 'M', 1, 0)) / SUM(IIF(T1.device_model = 'Nexus 5' AND T2.gender = 'F', 1, 0)) AS r FROM phone_brand_device_model2 AS T1 INNER JOIN gender_age AS T2 ON T2.device_id = T1.device_id WHERE T1.phone_brand = 'LG'
In what season was the conference record for the Pandas 15-1-1?
SELECT season FROM table_27069503_2 WHERE conf_record = "15-1-1"