sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
List the locations ids, compartments and containers for the Lock Ring
|
SELECT T2.LocationID, T2.Shelf, T2.Bin FROM Product AS T1 INNER JOIN ProductInventory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name LIKE 'Lock Ring'
|
How many male players does Winnipeg have?
|
SELECT count ( * ) FROM player where gender = "M" and residence = "Winnipeg"
|
How many zip codes are under Barre, VT?
|
SELECT COUNT(T2.zip_code) FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T1.CBSA_name = 'Barre, VT'
|
How many countries are there in the No.2 region?
|
SELECT COUNT(n_nationkey) FROM nation WHERE n_regionkey = 2
|
Find the average height and weight for all males (sex is M).
|
SELECT avg(height) , avg(weight) FROM people WHERE sex = 'M'
|
What is the rank with a 14 finish?
|
SELECT rank FROM table_name_13 WHERE finish = "14"
|
How many pets have a greater weight than 10?
|
SELECT count(*) FROM pets WHERE weight > 10
|
What is the date in the 2007-08 season where the away team was the kaizer chiefs?
|
SELECT date FROM table_27274566_2 WHERE season = "2007-08" AND away_team = "Kaizer Chiefs"
|
Name the country with the largest number of households in a residential area.
|
SELECT T1.county FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code GROUP BY T1.county ORDER BY T2.households DESC LIMIT 1
|
Which district has an IUCN of iii and was established in 1998?
|
SELECT district FROM table_name_44 WHERE iucn = "iii" AND est = 1998
|
What is the average absence period of a disabled student?
|
SELECT AVG(T1.month) FROM longest_absense_from_school AS T1 INNER JOIN disabled AS T2 ON T1.name = T2.name
|
What is the total amount of allied-unrelated where the component is human capital?
|
SELECT COUNT(allied_unrelated) FROM table_11944282_1 WHERE component = "Human Capital"
|
What was the margin of victory when the winning score was –10 (70-72-68-68=278)?
|
SELECT margin_of_victory FROM table_name_6 WHERE winning_score = –10(70 - 72 - 68 - 68 = 278)
|
What is the percentage more for the rental payment for store No.2 than store No.1?
|
SELECT CAST((SUM(IIF(T2.store_id = 2, T1.amount, 0)) - SUM(IIF(T2.store_id = 1, T1.amount, 0))) AS REAL) * 100 / SUM(IIF(T2.store_id = 1, T1.amount, 0)) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id INNER JOIN store AS T3 ON T2.store_id = T3.store_id
|
How many animal type allergies exist?
|
SELECT count(*) FROM Allergy_type WHERE allergytype = "animal"
|
What was Footscray's score as an away team?
|
SELECT away_team AS score FROM table_name_45 WHERE away_team = "footscray"
|
What did the away team score at Junction oval?
|
SELECT away_team AS score FROM table_name_30 WHERE venue = "junction oval"
|
What Country has a 67 score by Phil Mickelson?
|
SELECT country FROM table_name_89 WHERE score = 67 AND player = "phil mickelson"
|
Which Game has a Score of w 90–82 (ot)?
|
SELECT game FROM table_name_40 WHERE score = "w 90–82 (ot)"
|
How many people canceled their orders
|
SELECT count ( distinct customer_id ) FROM customer_orders where order_status = 'Cancelled'
|
Which Tries for has Points against smaller than 124, and Points for smaller than 241, and Tries against smaller than 11?
|
SELECT MAX(tries_for) FROM table_name_12 WHERE points_against < 124 AND points_for < 241 AND tries_against < 11
|
Please list the full names of the employees who are working as a Trainee.
|
SELECT T1.firstname, T1.lastname FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T2.positiontitle = 'Trainee'
|
List out root beer brand that is not caffeinated and not containing cane sugar. What is the total amount sold for this products?
|
SELECT T1.BrandName, SUM(T3.PurchasePrice) FROM rootbeerbrand AS T1 INNER JOIN rootbeer AS T2 ON T1.BrandID = T2.BrandID INNER JOIN `transaction` AS T3 ON T2.RootBeerID = T3.RootBeerID WHERE T1.CaneSugar = 'FALSE' AND T1.Caffeinated = 'FALSE' GROUP BY T1.BrandName
|
What are the names of wines whose production year are before the year of all wines by Brander winery?
|
SELECT Name FROM WINE WHERE YEAR < (SELECT min(YEAR) FROM WINE WHERE Winery = "Brander")
|
In Movie No. 19, how many people are there in Department No. 7? Please give me their job.
|
SELECT COUNT(DISTINCT job) FROM movie_crew WHERE movie_id = 19 AND department_id = 7
|
Find the first names and offices of all instructors who have taught some course and also find the course description.
|
SELECT T2.emp_fname , T4.prof_office , T3.crs_description FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN professor AS T4 ON T2.emp_num = T4.emp_num
|
List down the business ID with a star range from 3 to 4, located at Tempe.
|
SELECT business_id FROM Business WHERE city LIKE 'Tempe' AND stars BETWEEN 3 AND 4
|
Who wrote the lyrics when Jeevankala co-starred?
|
SELECT lyricist FROM table_2528382_5 WHERE co_stars = "Jeevankala"
|
Which School has a Capacity larger than 730, and an Ofsted smaller than 106135, and a Locality of heaton mersey?
|
SELECT school FROM table_name_89 WHERE capacity > 730 AND ofsted < 106135 AND locality = "heaton mersey"
|
What was Bryan Clay's react time?
|
SELECT MIN(react) FROM table_name_94 WHERE name = "bryan clay"
|
What was the final score of the match that had an attendance of 9,205?
|
SELECT score_1 FROM table_name_99 WHERE attendance = "9,205"
|
What is the total number of byes that has 1 draw and an against of 1374?
|
SELECT COUNT(byes) FROM table_name_1 WHERE draws = 1 AND against = 1374
|
Who is the oldest person?
|
SELECT name FROM Person WHERE age = (SELECT max(age) FROM person)
|
What is the highest market value in billions of the company with profits of 20.96 billions and 166.99 billions in assets?
|
SELECT MAX(market_value__billion_) AS $_ FROM table_name_79 WHERE profits__billion_$_ = 20.96 AND assets__billion_$_ > 166.99
|
What is the highest Edition I Bronze with a Gold higher than 9 and a Silver higher than 10?
|
SELECT MAX(bronze) FROM table_name_22 WHERE silver > 10 AND edition = "i" AND gold > 9
|
Which team did player Id "roypa01" play in 1992? Give the team id.
|
SELECT tmID FROM Goalies WHERE playerID = 'roypa01' AND year = 1992
|
Identify by their id all the orders that have been cancelled.
|
SELECT T2.order_id FROM order_status AS T1 INNER JOIN order_history AS T2 ON T1.status_id = T2.status_id WHERE T1.status_value = 'Cancelled'
|
Which film actor (actress) starred the most films? List his or her first name, last name and actor id.
|
SELECT T2.first_name , T2.last_name , T2.actor_id FROM film_actor AS T1 JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.actor_id ORDER BY count(*) DESC LIMIT 1
|
What song came out on March 8, 2008?
|
SELECT song FROM table_name_8 WHERE date = "march 8, 2008"
|
Who was the loser when the New York Giants were the winners on November 14?
|
SELECT loser FROM table_name_71 WHERE winner = "new york giants" AND date = "november 14"
|
What is the average and largest salary of all employees?
|
SELECT avg(salary) , max(salary) FROM Employee
|
Name the record for houston
|
SELECT record FROM table_23186738_6 WHERE team = "Houston"
|
How many courses are there in total?
|
SELECT count(*) FROM COURSES
|
What is the peak height of the highest volcanic type of mountain? Give it's name.
|
SELECT Height, Name FROM mountain WHERE Type = 'volcanic' ORDER BY Height DESC LIMIT 1
|
please show me the names of all of the representatives
|
SELECT Name FROM representative
|
What was the surface for Julie Halard when the final score was 6–3, 6–2?
|
SELECT surface FROM table_name_55 WHERE partner = "julie halard" AND score_in_the_final = "6–3, 6–2"
|
What is the cell phone number of the student whose address has the lowest monthly rental?
|
SELECT T2.cell_mobile_number FROM Student_Addresses AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id ORDER BY T1.monthly_rental ASC LIMIT 1
|
Name the most rebounds for larry smith
|
SELECT MAX(rebounds) FROM table_22824319_3 WHERE player = "Larry Smith"
|
Calculate the number of game publisher IDs for games released in 1984.
|
SELECT COUNT(T.game_publisher_id) FROM game_platform AS T WHERE T.release_year = 1984
|
What type of inspection was done at John Schaller?
|
SELECT DISTINCT T2.inspection_type FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.dba_name = 'JOHN SCHALLER'
|
Please list the full names of all the clients whose complaints are still in progress.
|
SELECT T1.first, T1.middle, T1.last FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Company response to consumer` = 'In progress'
|
What arena does the team play at that has Michael Wales as the captain?
|
SELECT arena FROM table_2384331_1 WHERE captain = "Michael Wales"
|
List the names of pilots in ascending order of rank.
|
SELECT Pilot_name FROM pilot ORDER BY Rank ASC
|
Among the organizations where headquarters are in the 'USA', what is the percentage of the them are in 'Washington'?
|
SELECT CAST(SUM(CASE WHEN T2.City = 'Washington' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.City) FROM country AS T1 INNER JOIN organization AS T2 ON T1.Code = T2.Country WHERE T2.Country = 'USA'
|
If the points were 0, what was the losing bonus?
|
SELECT losing_bonus FROM table_name_32 WHERE points = "0"
|
How many horror movies are there?
|
SELECT COUNT(T1.movie_id) FROM movie_genres AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.genre_id WHERE T2.genre_name = 'Horror'
|
What is the average number of cuts made when there were more than 2 tournaments played in 2011?
|
SELECT AVG(cuts_made) FROM table_name_50 WHERE tournaments_played > 2 AND year = 2011
|
Name the total number of goals which have played more than 44
|
SELECT COUNT(goals_for) FROM table_name_13 WHERE played > 44
|
Hello, could you find how many friends Alice has?
|
SELECT count ( * ) FROM PersonFriend where name = 'Alice'
|
Who scored more than 72?
|
SELECT player FROM table_name_28 WHERE score > 72
|
When was John McEnroe's minimum year?
|
SELECT MIN(year) FROM table_22597626_1
|
What position does Antti-Jussi Niemi play?
|
SELECT position FROM table_2840500_4 WHERE player = "Antti-Jussi Niemi"
|
Please list the names of all the players with a height of over 6'2" inches.
|
SELECT DISTINCT T1.PlayerName FROM PlayerInfo AS T1 INNER JOIN height_info AS T2 ON T1.height = T2.height_id WHERE T2.height_in_inch > '6''2"'
|
What is the label from 1973 that has a catalog number of l 35023?
|
SELECT label FROM table_name_98 WHERE date = "1973" AND catalog = "l 35023"
|
What was the result of the election featuring r. ewing thomason (d) unopposed?
|
SELECT result FROM table_1342233_43 WHERE candidates = "R. Ewing Thomason (D) Unopposed"
|
How many authors have written paper "145 GROWTH HORMONE RECEPTORS AND THE ONSET OF HYPERINSULINEMIA IN THE OBESE ZUCKER RAT: "?
|
SELECT COUNT(DISTINCT T2.Name) FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.Title = '145 GROWTH HORMONE RECEPTORS AND THE ONSET OF HYPERINSULINEMIA IN THE OBESE ZUCKER RAT: '
|
In what genre did Microvision develop a game?
|
SELECT genre FROM table_name_49 WHERE developer = "microvision"
|
What is the name of the newest song?
|
SELECT song_name FROM song ORDER BY releasedate DESC LIMIT 1
|
In year 2011 what is sum of profit/loss before tax and net profit larger than 123.8 million?
|
SELECT COUNT(profit__loss__before_tax__) AS £m_ FROM table_name_47 WHERE year_ended = "2011" AND net_profit__£m_ > 123.8
|
OK - what was the total number of bookings in 2016?
|
SELECT count ( * ) FROM apartment_bookings where booking_start_date like "%2016%"
|
Which places did Alison visit
|
SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = "Alison"
|
When the change is 8.8%, what is the density (pop/km²)?
|
SELECT density__pop_km²_ FROM table_1425958_1 WHERE _percentage_change = "8.8"
|
Find the ids and names of stations from which at least 200 trips started.
|
SELECT start_station_id , start_station_name FROM trip GROUP BY start_station_name HAVING COUNT(*) >= 200
|
What is the average episode number with q146 format?
|
SELECT AVG(episode__number) FROM table_name_26 WHERE format__number = "q146"
|
What is the ε (m −1 cm −1 ) of the red dye?
|
SELECT ε__m_−1_cm_−1__ FROM table_26428602_1 WHERE color = "red"
|
Give the names of the nations that were founded after 1950.
|
SELECT Name FROM country WHERE IndepYear > 1950
|
List out full name and email of employees who are working in Paris?
|
SELECT T1.firstName, T1.lastName, T1.email FROM employees AS T1 INNER JOIN offices AS T2 ON T1.officeCode = T2.officeCode WHERE T2.city = 'Paris'
|
What are the states with colleges that have enrollments less than the some other college?
|
SELECT DISTINCT state FROM college WHERE enr < (SELECT max(enr) FROM college)
|
Show different teams of technicians and the number of technicians in each team.
|
SELECT Team , COUNT(*) FROM technician GROUP BY Team
|
Hello, how many candidates total are there?
|
SELECT count ( * ) FROM candidate
|
List the research assistants' full names, capabilities and GPAs who were under the supervision of Merwyn Conkay.
|
SELECT T3.f_name, T3.l_name, T2.capability, T3.gpa FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T2.student_id = T3.student_id WHERE T1.first_name = 'Merwyn' AND T1.last_name = 'Conkay'
|
Find the first names of professors who are not playing Canoeing or Kayaking.
|
SELECT lname FROM faculty WHERE rank = 'Professor' EXCEPT SELECT DISTINCT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' OR T3.activity_name = 'Kayaking'
|
What are the teams that have the 5 oldest players?
|
SELECT Team FROM player ORDER BY Age DESC LIMIT 5
|
Count different addresses of each school.
|
SELECT count(DISTINCT dept_address) , school_code FROM department GROUP BY school_code
|
List the names of studios that have at least two films.
|
SELECT Studio FROM film GROUP BY Studio HAVING COUNT(*) >= 2
|
what was the extra score when the overall score was 52
|
SELECT losing_bonus FROM table_14070062_4 WHERE tries_for = "52"
|
What is the lowest first half when the score is larger than 621 and the rank 35?
|
SELECT MIN(1 AS st_half) FROM table_name_21 WHERE score > 621 AND rank = 35
|
What ranking has the nationality of spain and the goals of 26?
|
SELECT ranking FROM table_name_95 WHERE nationality = "spain" AND goals = 26
|
Calculate the percentage of female actors and quality 2 who have appeared twice at the casting of the film 1672580.
|
SELECT CAST(SUM(IIF(T2.cast_num = 2 AND T1.a_quality = 2, 1, 0)) AS REAL) * 100 / COUNT(T1.actorid) FROM actors AS T1 INNER JOIN movies2actors AS T2 ON T1.actorid = T2.actorid WHERE T2.movieid = 1672580 AND T1.a_gender = 'F'
|
What is the Score of the Chicago Black Hawks Home game with the Visiting Vancouver Canucks on November 17?
|
SELECT score FROM table_name_30 WHERE home = "chicago black hawks" AND visitor = "vancouver canucks" AND date = "november 17"
|
How many users answered the question "Overall, how much importance does your employer place on physical health?"?
|
SELECT COUNT(T1.UserID) FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T2.questiontext LIKE 'Overall, how much importance does your employer place on physical health?'
|
Count the number of different characteristic names the product 'cumin' has.
|
SELECT count(DISTINCT t3.characteristic_name) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "sesame"
|
Which country has the highest infant mortality? Also state its population growth.
|
SELECT T1.Name, T2.Population_Growth FROM country AS T1 INNER JOIN population AS T2 ON T1.Code = T2.Country ORDER BY T2.Infant_Mortality DESC LIMIT 1
|
Which Office has a Republican ticket of daniel h. conway?
|
SELECT office FROM table_name_63 WHERE republican_ticket = "daniel h. conway"
|
Name the river at Little Rock city. State the length of the river.
|
SELECT T3.Length FROM city AS T1 INNER JOIN located AS T2 ON T1.Name = T2.City INNER JOIN river AS T3 ON T3.Name = T2.River WHERE T1.Name = 'Little Rock'
|
What is the average GPA of the students with the highest research capability and high salary? List the full names of the students.
|
SELECT AVG(T2.gpa), T2.f_name, T2.l_name FROM RA AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T1.salary = 'high' AND T1.capability = 5 GROUP BY T2.student_id
|
How many different kinds of clients are supported by the web clients accelerators?
|
SELECT count(DISTINCT client) FROM web_client_accelerator
|
What I meant was the asset counts for each of these contracts
|
SELECT count ( * ) , T1.maintenance_contract_id FROM Maintenance_Contracts AS T1 JOIN Assets AS T2 ON T1.maintenance_contract_id = T2.maintenance_contract_id GROUP BY T1.maintenance_contract_id
|
What was the date of the game that led to a 4-3 record?
|
SELECT date FROM table_name_64 WHERE record = "4-3"
|
Name the ptor-austronesian for father
|
SELECT proto_austronesian FROM table_15568886_14 WHERE kinship = "father"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.