sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
Find the titles of papers whose first author is affiliated with an institution in the country "Japan" and has last name "Ohori"? | SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid JOIN inst AS t4 ON t2.instid = t4.instid WHERE t4.country = "Japan" AND t2.authorder = 1 AND t1.lname = "Ohori" |
What are all their birthdays? | SELECT T2.date_of_birth FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id where T1.city = "Port Melyssa" |
Which institution is the author "Matthias Blume" belong to? Give me the name of the institution. | SELECT DISTINCT t3.name FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t1.fname = "Matthias" AND t1.lname = "Blume" |
List the height and weight of people in descending order of height. | SELECT Height , Weight FROM people ORDER BY Height DESC |
How many donors have endowment for school named "Glenn"? | SELECT COUNT(DISTINCT T1.donator_name) FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = "Glenn" |
Find the number of rooms with a king bed. | SELECT count(*) FROM Rooms WHERE bedType = "King"; |
what is the total amount of players for the rockets in 1998 only? | SELECT COUNT(player) FROM table_11734041_16 WHERE years_for_rockets = "1998" |
Show all transaction ids with transaction code 'PUR'. | SELECT transaction_id FROM TRANSACTIONS WHERE transaction_type_code = 'PUR' |
Select the name of the products with a price less than or equal to $200. | SELECT name FROM products WHERE price <= 200 |
What was the state that had the vassal name of li? | SELECT state FROM table_name_8 WHERE name = "li" |
What is the zip code of the address where the teacher with first name "Lyla" lives? | SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Teachers AS T2 ON T1.address_id = T2.address_id WHERE T2.first_name = "Lyla" |
Show the name of the customer who has the most orders. | SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1 |
Who was the opponent with a score of 30-12? | SELECT opponent FROM table_name_72 WHERE result = "30-12" |
How many bookings do we have? | SELECT count(*) FROM BOOKINGS |
What player played guard for toronto in 1996-97? | SELECT player FROM table_10015132_11 WHERE position = "Guard" AND years_in_toronto = "1996-97" |
What is the mean played number where the goals conceded is less than 16? | SELECT AVG(played) FROM table_name_81 WHERE goals_conceded < 16 |
What was the score when Edmonton was the home team? | SELECT score FROM table_name_10 WHERE home = "edmonton" |
What is the IHSAA Class for football for the team joining in 1968? | SELECT ihsaa_class AS Football FROM table_name_15 WHERE year_joined = 1968 |
What is the total of the roll with a Decile of 8, and an Area of hororata? | SELECT SUM(roll) FROM table_name_73 WHERE decile = 8 AND area = "hororata" |
Who are the ministers who took office after 1961 or before 1959? | SELECT minister FROM party WHERE took_office > 1961 OR took_office < 1959 |
What are the names of all races held between 2009 and 2011? | SELECT name FROM races WHERE YEAR BETWEEN 2009 AND 2011 |
What regular season result had an average attendance bigger than 3,170? | SELECT reg_season FROM table_name_67 WHERE avg_attendance > 3 OFFSET 170 |
Name the general classification with roman kreuziger and points classification of fabian cancellara | SELECT general_classification FROM table_name_97 WHERE young_rider_classification = "roman kreuziger" AND points_classification = "fabian cancellara" |
How many female users were surveyed in the mental health survey for 2017 in the state of Nebraska? | SELECT COUNT(*) FROM ( SELECT T2.UserID FROM Question AS T1 INNER JOIN Answer AS T2 ON T1.questionid = T2.QuestionID INNER JOIN Survey AS T3 ON T2.SurveyID = T3.SurveyID WHERE T3.Description = 'mental health survey for 2017' AND T1.questionid = 2 AND T2.AnswerText = 'Female' UNION SELECT T2.UserID FROM Question AS T1 INNER JOIN Answer AS T2 ON T1.questionid = T2.QuestionID INNER JOIN Survey AS T3 ON T2.SurveyID = T3.SurveyID WHERE T1.questionid = 4 AND T2.AnswerText = 'Nebraska' AND T3.Description = 'mental health survey for 2017' ) |
What is the title for the project that got the donation message as "Donation on behalf of Matt Carpenter because I'm a strong believer in education". | SELECT T1.title FROM essays AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T2.donation_message LIKE 'Donation on behalf of Matt Carpenter because I''m a strong believer in education.' |
What is the maximum share count of all of the different transaction type codes? | SELECT transaction_type_code , max ( share_count ) FROM TRANSACTIONS GROUP BY transaction_type_code |
How many seasons was series number 47 shown? | SELECT COUNT(season_no) FROM table_11630008_4 WHERE series_no = 47 |
For each state, find the total account balance of customers whose credit score is above 100. | SELECT sum(acc_bal) , state FROM customer WHERE credit_score > 100 GROUP BY state |
What is Disney's highest grossing action movie? | SELECT movie_title FROM movies_total_gross WHERE genre = 'Action' ORDER BY CAST(REPLACE(trim(total_gross, '$'), ',', '') AS REAL) DESC LIMIT 1 |
If the ansi code is 1036632, what is the name of the township? | SELECT township FROM table_18600760_7 WHERE ansi_code = 1036632 |
What country has a compulsory deduction of 29.3%? | SELECT country FROM table_24486462_1 WHERE compulsory_deduction = "29.3%" |
list the titles of all movies | SELECT title FROM Movie |
How many laps for alexander wurz with a grid under 12? | SELECT COUNT(laps) FROM table_name_22 WHERE grid < 12 AND driver = "alexander wurz" |
What is the highest amount of bonus earned by the sales person in Canada? | SELECT T2.Bonus FROM SalesTerritory AS T1 INNER JOIN SalesPerson AS T2 ON T1.TerritoryID = T2.TerritoryID WHERE T1.CountryRegionCode = 'CA' ORDER BY T2.SalesQuota DESC LIMIT 1 |
Game site of miami orange bowl, and a Attendance larger than 49,754 happened on what highest week? | SELECT MAX(week) FROM table_name_60 WHERE game_site = "miami orange bowl" AND attendance > 49 OFFSET 754 |
What is the most common issue for the highest priority complaints? | SELECT T1.Issue FROM events AS T1 INNER JOIN callcenterlogs AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE T2.priority = 2 GROUP BY T1.Issue ORDER BY COUNT(T1.Issue) DESC LIMIT 1 |
how many shops opened later than 2012? | select count ( Location ) from shop where Open_Year>'2012' |
Hi - Can you tell me which department has the most students? | SELECT T2.dept_name FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY count ( * ) DESC LIMIT 1 |
Find the names of customers who either have an deputy policy or uniformed policy. | SELECT DISTINCT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t1.policy_type_code = "Deputy" OR t1.policy_type_code = "Uniform" |
What is its product price? | SELECT product_price FROM products WHERE product_type_code = 'Hardware' ORDER BY product_price DESC LIMIT 1 |
Compute the average price of all the products. | SELECT AVG(price) FROM products |
Name the number of mens doubles for 2004/2005 | SELECT COUNT(mens_doubles) FROM table_12193259_1 WHERE season = "2004/2005" |
Who had the high points while Dirk Nowitzki (13) had the high rebounds? | SELECT high_points FROM table_17288869_7 WHERE high_rebounds = "Dirk Nowitzki (13)" |
Which seasonal discount had the highest discount percentage? | SELECT Description FROM SpecialOffer WHERE Type = 'Seasonal Discount' ORDER BY DiscountPct DESC LIMIT 1 |
Who had the most high points and rebounds than charles oakley (9)? | SELECT high_points FROM table_13812785_8 WHERE high_rebounds = "Charles Oakley (9)" |
How many players are from Delray Beach, Florida? | SELECT COUNT(player) FROM table_11677691_11 WHERE hometown = "Delray Beach, Florida" |
What is the total when the score for set 1 is 14–25? | SELECT total FROM table_name_75 WHERE set_1 = "14–25" |
To whom did the company transport its heaviest shipment? | SELECT T2.cust_name FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id ORDER BY T1.weight DESC LIMIT 1 |
Show the most common type code across products. | SELECT Product_Type_Code FROM Products GROUP BY Product_Type_Code ORDER BY COUNT(*) DESC LIMIT 1 |
When was the highest amount of donated? How much was the amount? | SELECT donation_timestamp, donation_total FROM donations WHERE donation_total = ( SELECT donation_total FROM donations ORDER BY donation_total DESC LIMIT 1 ) |
Find the distinct number of president votes. | SELECT COUNT(DISTINCT President_Vote) FROM VOTING_RECORD |
Find the name and training hours of players whose hours are below 1500. | SELECT pName , HS FROM Player WHERE HS < 1500 |
Who is the commander of Morgan Park district? | SELECT commander FROM District WHERE district_name = 'Morgan Park' |
What Time/Retired has a Laps of 86 and the Team of HVM Racing? | SELECT time_retired FROM table_name_73 WHERE laps = 86 AND team = "hvm racing" |
Show the start dates and end dates of all the apartment bookings. | SELECT booking_start_date , booking_end_date FROM Apartment_Bookings |
How many official languages does Afghanistan have? | SELECT COUNT(*) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = "Afghanistan" AND IsOfficial = "T" |
Please give more detailed information about the first three books that sell the best. | SELECT T1.notes FROM titles AS T1 INNER JOIN sales AS T2 ON T1.title_id = T2.title_id ORDER BY T2.qty DESC LIMIT 3 |
what is the last name and gender of all students who played both Call of Destiny and Works of Widenius? | SELECT lname , sex FROM Student WHERE StuID IN (SELECT T1.StuID FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.GameID = T2.GameID WHERE T2.Gname = "Call of Destiny" INTERSECT SELECT T1.StuID FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.GameID = T2.GameID WHERE T2.Gname = "Works of Widenius") |
On how many projects where the teacher has ordered between 5 to 10 items are from are from Quill.com? | SELECT COUNT(projectid) FROM resources WHERE vendor_name = 'Quill.com' AND item_quantity BETWEEN 5 AND 10 |
What is the incumbent for ohio 12? | SELECT incumbent FROM table_1342249_35 WHERE district = "Ohio 12" |
What are the names of the different artists that have produced a song in English but have never receieved a rating higher than 8? | SELECT DISTINCT artist_name FROM song WHERE languages = "english" EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating > 8 |
Provide the position status and IDs of professor who advised student ID "303". | SELECT T2.hasPosition, T1.p_id_dummy FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id_dummy = T2.p_id WHERE T1.p_id = 303 |
What is every GICS sector for free float of 0.3180? | SELECT gics_sector FROM table_20667854_1 WHERE free_float = "0.3180" |
Can you list all student IDs that have any kind of allergy? | SELECT StuID FROM Has_allergy |
Which Position has Draws smaller than 7 and a Played larger than 22? | SELECT AVG(position) FROM table_name_16 WHERE draws < 7 AND played > 22 |
What was the arrival for Wansford, Peterborough East? | SELECT arrival FROM table_18332845_2 WHERE calling_at = "Wansford, Peterborough East" |
Name the interview for peru delegate | SELECT interview FROM table_11674683_2 WHERE delegate = "Peru" |
what is typical selling price of cumin | SELECT typical_selling_price FROM Products WHERE product_name = "cumin" |
List all pilot names in ascending alphabetical order. | SELECT Name FROM pilot ORDER BY Name ASC |
What turbo has a L2 cache of 4 × 256 kb, a release date of June 2013, and a Model number of core i7-4770s? | SELECT turbo FROM table_name_78 WHERE l2_cache = "4 × 256 kb" AND release_date = "june 2013" AND model_number = "core i7-4770s" |
What is the total number of drawn matches from first game years before 2006 and fewer than 2 matches played? | SELECT SUM(drawn) FROM table_name_42 WHERE first_game < 2006 AND played < 2 |
which college enrollment is 22000? | SELECT cName FROM College WHERE enr = 22000 |
Which World Rank happened in 1977? | SELECT world_rank FROM table_name_81 WHERE year = 1977 |
How many taverns failed in July 2010? | SELECT COUNT(DISTINCT T1.license_no) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE strftime('%Y-%m', T2.inspection_date) = '2010-07' AND T2.results = 'Fail' AND T1.facility_type = 'Restaurant' |
And what is their address? | SELECT address FROM patient WHERE SSN NOT IN ( SELECT T1.patient FROM Prescribes AS T1 JOIN Medication AS T2 ON T1.Medication = T2.Code WHERE T2.name = 'Procrastin-X' ) |
What is the total value for Lost, when the value for Points is greater than 21, and when the value for Draw is 2? | SELECT SUM(lost) FROM table_name_10 WHERE points > 21 AND draw = 2 |
List by ID the businesses with the reviews with the lowest veracity of Paradise Valley. | SELECT business_id FROM Business WHERE stars > 3 AND city = 'Paradise Valley' AND review_count = 'Low' |
Who held the Male Sports Rep position in 2011? | SELECT 2011 FROM table_name_73 WHERE position = "male sports rep" |
Show institution names along with the number of proteins for each institution | SELECT T1.institution , count ( * ) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id GROUP BY T1.institution_id |
Return the unique name for stations that have ever had 7 bikes available. | SELECT DISTINCT T1.name FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id WHERE T2.bikes_available = 7 |
List down all of the film IDs with highest rental duration. | SELECT film_id FROM film WHERE rental_duration = ( SELECT MAX(rental_duration) FROM film ) |
Which City has a Date of june 9, 1976? | SELECT city FROM table_name_39 WHERE date = "june 9, 1976" |
Find the building address of building manager Melyssa. | SELECT building_address FROM Apartment_Buildings WHERE building_manager = "Melyssa" |
What is the highest total price paid for an order? | SELECT UnitPrice * Quantity * (1 - Discount) AS THETOP FROM `Order Details` ORDER BY UnitPrice * Quantity * (1 - Discount) DESC LIMIT 1 |
What is the average number of runner-up that National University, which has more than 2 total championships, has? | SELECT AVG(runner_up) FROM table_name_62 WHERE university = "national university" AND total_championships > 2 |
State the nick name of the tallest player? If the player had left NHL, mention the last season he was with NHL. | SELECT nameNick, lastNHL FROM Master ORDER BY height DESC LIMIT 1 |
List all the streets with more than 10 restaurants in Alameda county. | SELECT T2.street_name FROM geographic AS T1 INNER JOIN location AS T2 ON T1.city = T2.city WHERE T1.county = 'alameda county' GROUP BY T2.street_name HAVING COUNT(T2.id_restaurant) > 10 |
What is the venue of the game with Man of the Match Vaclav Zavoral? | SELECT venue FROM table_17120964_8 WHERE man_of_the_match = "Vaclav Zavoral" |
Provide the names and birthdates of players who have left-arm fast skills. | SELECT T1.Player_Name, T1.DOB FROM Player AS T1 INNER JOIN Bowling_Style AS T2 ON T2.Bowling_Id = T1.Bowling_skill WHERE T2.Bowling_skill = 'Left-arm fast' |
Hi, could you please let me know the date of birth of the investors Simon Woodroffe and Peter Jones? | SELECT T2.Date_of_Birth FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = "Simon Woodroffe" OR T1.Investor = "Peter Jones" |
who got the first position when fujieda city government got the fourth position? | SELECT champions FROM table_21632864_1 WHERE fourth_place = "Fujieda City Government" |
What is the lowest overall with more than 17 rounds? | SELECT MIN(overall) FROM table_name_25 WHERE round > 17 |
Name the player for 1945 for player | SELECT "player" FROM table_19611329_1 WHERE year_inducted = 1945 AND inducted_as = "player" |
What are the greatest and average capacity for rooms in each building? | SELECT max(capacity) , avg(capacity) , building FROM classroom GROUP BY building |
Provide the players' names in both teams of the match that was held in June 2014. | SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Match AS T3 ON T2.Match_Id = T3.Match_Id WHERE SUBSTR(T3.Match_Date, 1, 4) = '2014' AND SUBSTR(T3.Match_Date, 7, 1) = '6' LIMIT 2 |
Count the number of customer cards of the type Debit. | SELECT count(*) FROM Customers_cards WHERE card_type_code = "Debit" |
What are the name of rooms booked by customers whose first name has "ROY" in part? | SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE firstname LIKE '%ROY%' |
What kind of animal corresponds to the accession number xp_852505.1? | SELECT common_name FROM table_15417439_1 WHERE accession_number = "XP_852505.1" |
What day was geelong the home team? | SELECT date FROM table_name_81 WHERE home_team = "geelong" |
How many cars on train no.1 have the roof open? | SELECT COUNT(id) FROM cars WHERE train_id = 1 AND roof = 'none' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.