sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
What are the register ids of electoral registries that have the cross reference source system code 'Electoral' or 'Tax'? | SELECT T1.electoral_register_id FROM Electoral_Register AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id WHERE T2.source_system_code = 'Electoral' OR T2.source_system_code = 'Tax' |
Among the establishments that failed in the inspection, what is the percentage of establishments with the highest risk level? | SELECT CAST(COUNT(CASE WHEN T1.risk_level = 3 THEN T1.license_no END) AS REAL) * 100 / COUNT(T1.risk_level) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T2.results = 'Fail' |
How many authors finished the paper "An Improved Active Suspension Model for Attitude Control of Electric Vehicles" together? | SELECT COUNT(T2.AuthorId) FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.Title = 'An Improved Active Suspension Model for Attitude Control of Electric Vehicles' |
What is the full set of information associated with staff with last name Bosco? | SELECT * FROM Staff where staff_last_name = 'Bosco' |
List all the image name and URLs in the order of their names. | SELECT image_name, image_url FROM images ORDER BY image_name |
Which Tournament has an Opponent of meike babel? | SELECT tournament FROM table_name_92 WHERE opponent = "meike babel" |
What is Built, when Works Number is "717"? | SELECT built FROM table_name_42 WHERE works_number = "717" |
How many donors from New Jersey have made a donation for an honoree? | SELECT COUNT(donationid) FROM donations WHERE for_honoree = 't' AND donor_state = 'NJ' |
Show the leader names and locations of colleges. | SELECT Leader_Name, College_Location FROM college |
Which Score has a Game larger than 76, a Location Attendance of madison square garden 19,763, and a High rebounds of wilson chandler (8)? | SELECT score FROM table_name_71 WHERE game > 76 AND location_attendance = "madison square garden 19,763" AND high_rebounds = "wilson chandler (8)" |
How many gas stations opened after 2000? | SELECT count ( * ) from gas_station where open_year > 2000 |
How many departments have more than ten employees who got a commission? | SELECT COUNT ( * ) FROM ( SELECT department_id FROM employees GROUP BY department_id HAVING COUNT ( commission_pct ) > 10 ) |
List all female students older than 18 who are not majoring in 600. List students' first name and last name. | SELECT Fname , Lname FROM Student WHERE Age > 18 AND Major != 600 AND Sex = 'F'; |
Name the lowest total for rank of 13 with bronze less than 1 | SELECT MIN(total) FROM table_name_20 WHERE rank = 13 AND bronze < 1 |
What is the least amount of silver medals a team with less than 0 gold medals has? | SELECT MIN(silver) FROM table_name_68 WHERE gold < 0 |
Which Senior status has Appointed by of l. johnson category:articles with hcards, and Born/Died of 1918–2009? | SELECT senior_status FROM table_name_7 WHERE appointed_by = "l. johnson category:articles with hcards" AND born_died = "1918–2009" |
What is the maximum fastest lap speed in race named 'Monaco Grand Prix' in 2008 ? | SELECT max(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year = 2008 AND T1.name = "Monaco Grand Prix" |
Show the average amount of transactions for different investors. | SELECT investor_id, AVG(amount_of_transaction) FROM TRANSACTIONS GROUP BY investor_id |
What is the company's profit on the product that was rated second-highest by David? | SELECT T2.ListPrice - T2.StandardCost FROM ProductReview AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T1.ReviewerName = 'David' ORDER BY T1.Rating DESC LIMIT 1 |
If Wed Aug 25 is —— no time, what is Sat aug 21? | SELECT sat_21_aug FROM table_26986076_1 WHERE wed_25_aug = "—— No Time" |
Who was the Best Male Lyricist if Neshia Nee won the Best Male Record? | SELECT best_male_lyricist FROM table_22546460_4 WHERE best_male_record = "Neshia Nee" |
Who is the home captain that played at Edgbaston? | SELECT home_captain FROM table_name_22 WHERE venue = "edgbaston" |
WHAT ARE THE TOTAL NUMBER OF POINTS WITH WINS SMALLER THAN 14, AT SD INDAUCHU, POSITION BIGGER THAN 12? | SELECT COUNT(points) FROM table_name_73 WHERE wins < 14 AND club = "sd indauchu" AND position > 12 |
How many July 1, 2013 projections have a Rank of 27? | SELECT COUNT(july_1), _2013_projection FROM table_name_58 WHERE rank = "27" |
What is the highest pick for a year after 2010 and a round larger than 1? | SELECT MAX(pick) FROM table_name_41 WHERE year > 2010 AND round > 1 |
Who played the bass for the Against the Grain album after 1982? | SELECT bass FROM table_name_97 WHERE year > 1982 AND album = "against the grain" |
Name the most founded for enrollment 2005 being 1285 | SELECT MAX(founded) FROM table_2076533_1 WHERE enrollment__2005_ = 1285 |
How many seats in 2006 has a % 1997 rating of 38.9? | SELECT COUNT(seats_2006) FROM table_21132404_1 WHERE _percentage_1997 = "38.9" |
Could you narrow that down to just male faculty members in the NEB building? | SELECT Fname , Lname FROM FACULTY WHERE sex = "M" AND Building = "NEB" |
What is the average year with an award of platinum? | SELECT AVG(year) FROM table_name_44 WHERE award_description_s_ = "platinum" |
When was the last serving date of Matt Salmon? | SELECT T1.END FROM `historical-terms` AS T1 INNER JOIN historical AS T2 ON T2.bioguide_id = T1.bioguide WHERE T2.official_full_name = 'Matt Salmon' |
What player has The United States as the country, with t2 as the place? | SELECT player FROM table_name_9 WHERE country = "united states" AND place = "t2" |
How old was Jr. F. James Sensenbrenner when he first started as a legislator? | SELECT CAST(MIN(T2.start) - T1.birthday_bio AS DATE) AS AGE FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.official_full_name = 'F. James Sensenbrenner, Jr.' |
Can you list the names of all customers who don't have any address information, please? | SELECT customer_name FROM customers WHERE customer_id NOT IN ( SELECT customer_id FROM customer_address_history ) |
Which industry has the most companies? | SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC LIMIT 1 |
What is the name and rank of every company ordered by descending number of sales? | SELECT company , rank FROM company ORDER BY Sales_billion DESC |
What is the average number of number of movies added to the lists of user 8516503? Indicate how many movies did he/she give a rating score of 5. | SELECT AVG(T3.list_movie_number) , SUM(CASE WHEN T1.rating_score = 5 THEN 1 ELSE 0 END) FROM ratings AS T1 INNER JOIN lists_users AS T2 ON T1.user_id = T2.user_id INNER JOIN lists AS T3 ON T2.user_id = T3.user_id WHERE T1.user_id = 8516503 |
Please state the API calls for method number 10 and its intended course of action. | SELECT T2.ApiCalls, T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Id = 10 |
Can you give me the names of the movies that has the top 3 highest rating star? | SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID ORDER BY T1.stars DESC LIMIT 3 |
Count the number of poker players. | SELECT count(*) FROM poker_player |
Show the positions of the players from the team with name "Ryley Goldner". | SELECT T1.Position FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = "Ryley Goldner" |
What is the State, when the year First elected is 1966, and when the Member is Alan Jarman? | SELECT state FROM table_name_13 WHERE first_elected = "1966" AND member = "alan jarman" |
By department, display average salary of employees who get a commission percentage | SELECT department_id , AVG ( salary ) FROM employees WHERE commission_pct ! = "null" GROUP BY department_id |
Name the runner-up for margin of victory of 3 strokes | SELECT runner_s__up FROM table_name_37 WHERE margin_of_victory = "3 strokes" |
Which event had Edson Claas Vieira as an opponent? | SELECT event FROM table_name_55 WHERE opponent = "edson claas vieira" |
What was the result of the fight when Tetsuji Kato's record was 19-9? | SELECT res FROM table_name_73 WHERE record = "19-9" |
Name the type for hobart college | SELECT type FROM table_1974482_1 WHERE institution = "Hobart College" |
How many menus sponsored by Krogs Fiske Restaurant were created in April 2015? | SELECT COUNT(*) FROM Menu WHERE date LIKE '2015-04%' AND sponsor = 'Krogs Fiskerestaurant' |
Give the name of the student in the History department with the most credits. | SELECT name FROM student WHERE dept_name = 'History' ORDER BY tot_cred DESC LIMIT 1 |
What was the name of the Visiting team at Jack Murphy Stadium? | SELECT visiting_team FROM table_name_90 WHERE stadium = "jack murphy stadium" |
What is the engine for a vehicle in 1960? | SELECT engine FROM table_name_59 WHERE year = 1960 |
Show the ids of the employees who don't authorize destruction for any document. | SELECT employee_id FROM Employees EXCEPT SELECT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed |
What is the name of the team that got more wins than loses in the Stanley Cup finals in 1917? | SELECT T2.name FROM TeamsSC AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year = '1917' AND T1.W > T1.L |
How many attended tie number 1? | SELECT SUM(attendance) FROM table_name_47 WHERE tie_no = "1" |
what is the chip model of XPERIA T, XPERIA J | SELECT chip_model FROM phone WHERE Hardware_Model_name = "XPERIA T, XPERIA J" |
List the territory IDs, description and region description under the in-charge of Mrs. Margaret Peacock. | SELECT T3.TerritoryID, T3.TerritoryDescription, T4.RegionDescription FROM Employees AS T1 INNER JOIN EmployeeTerritories AS T2 ON T1.EmployeeID = T2.EmployeeID INNER JOIN Territories AS T3 ON T2.TerritoryID = T3.TerritoryID INNER JOIN Region AS T4 ON T3.RegionID = T4.RegionID WHERE T1.TitleOfCourtesy = 'Mrs.' AND T1.LastName = 'Peacock' AND T1.FirstName = 'Margaret' |
What is the part number of athlon x2 4850e? | SELECT part_number_s_ FROM table_name_89 WHERE model_number = "athlon x2 4850e" |
Calculate the percentage of students who have never been absent. | SELECT CAST(SUM(IIF(month = 0, 1, 0)) AS REAL) * 100 / COUNT(name) FROM longest_absense_from_school |
How many 2-year public schools are there in "California"? | SELECT COUNT(stateid) FROM state_sector_details WHERE state = 'California' AND level = '2-year' AND control = 'Public' |
Name the total number for 18-49 share being 18-49 being 3.1 | SELECT COUNT(share__18_49_) FROM table_20971444_3 WHERE rating__18_49_ = "3.1" |
Which team/s have 48 goals total? | SELECT club FROM table_18967450_2 WHERE goals = 48 |
What was the record at the game on November 13, 1932? | SELECT record FROM table_name_38 WHERE date = "november 13, 1932" |
How many assists did the player with 54 penalty minutes have? | SELECT assists FROM table_name_45 WHERE pen_min = "54" |
Which Date has a Result of win, and a Round smaller than 2, and an Opponent of myron greenberg? | SELECT date FROM table_name_60 WHERE result = "win" AND round < 2 AND opponent = "myron greenberg" |
What is the Call sign of the Frequency 106.9 the X? | SELECT call_sign FROM table_name_19 WHERE branding = "106.9 the x" |
Which class has *alanaz as Part 4? | SELECT class FROM table_name_62 WHERE part_4 = "*alanaz" |
What is the v-core for a stepping of G1 and frequency of 1900MHz? | SELECT v_core FROM table_name_29 WHERE stepping = "g1" AND frequency = "1900mhz" |
What competition took place in a year later than 2009 with team notes? | SELECT competition FROM table_name_8 WHERE year > 2009 AND notes = "team" |
Why did Majid bagherinia leave? | SELECT manner_of_departure FROM table_22297198_3 WHERE outgoing_manager = "Majid Bagherinia" |
What about the account details with the value having the character '9' in it, please? | SELECT Account_details FROM Accounts WHERE Account_details LIKE "%9%" |
What was the score on 1/10/1974? | SELECT score FROM table_name_79 WHERE date = "1/10/1974" |
Show all the title of pages and number of occurences for each page where the word 'quipu' appears. | SELECT T1.title, T2.occurrences FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid INNER JOIN words AS T3 ON T2.wid = T3.wid WHERE T3.word = 'quipu' |
What was the score when the away team was Collingwood? | SELECT away_team AS score FROM table_name_56 WHERE away_team = "collingwood" |
Find the name of customers who do not have a loan with a type of Mortgages. | SELECT cust_name FROM customer EXCEPT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE T2.loan_type = 'Mortgages' |
For nations with more than 6 silvers and more than 10 golds, what is the lowest total? | SELECT MIN(total) FROM table_name_6 WHERE silver > 6 AND gold > 10 |
What about for just the team Boston Red Stockings? | SELECT sum ( T1.attendance ) FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year BETWEEN 2000 AND 2010 |
Which wind farm is in the USA and is noted as having multiple farms? | SELECT wind_farm FROM table_name_58 WHERE country = "usa" AND notes = "multiple farms" |
Who did they play when the score was 95-118? | SELECT opponent FROM table_name_63 WHERE score = "95-118" |
List the names of wrestlers and the teams in elimination in descending order of days held. | 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 |
Give the name and building of the departments with greater than average budget. | SELECT dept_name , building FROM department WHERE budget > (SELECT avg(budget) FROM department) |
What is the average amount of resources from projects that have received donations per honoree? | SELECT AVG(T1.item_quantity) FROM resources AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T2.for_honoree = 't' |
What campus has the most faculties in 2003? | SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2003 ORDER BY T2.faculty DESC LIMIT 1 |
What venue were the 1986 Asian games resulting in 2-0 played at? | SELECT venue FROM table_name_44 WHERE competition = "1986 asian games" AND result = "2-0" |
Describe the encounter of Mr. Hubert Baumbach on 2008/10/25. | SELECT T2.description FROM patients AS T1 INNER JOIN encounters AS T2 ON T1.patient = T2.PATIENT WHERE T1.prefix = 'Mr.' AND T1.first = 'Hubert' AND T1.last = 'Baumbach' AND T2.date = '2008-10-25' |
How many players did Boston Red Stockings have in 2000? | SELECT count(*) FROM salary AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year = 2000 |
Who all had the most assists in game 12? | SELECT high_assists FROM table_17060277_5 WHERE game = 12 |
How many rooms are located for each block code? | SELECT count(*) , T1.blockcode FROM BLOCK AS T1 JOIN room AS T2 ON T1.blockfloor = T2.blockfloor AND T1.blockcode = T2.blockcode GROUP BY T1.blockcode |
What was the total tenure time with a rank of 49? | SELECT total_tenure_time FROM table_name_3 WHERE total_tenure_rank = 49 |
Find the name and age of the visitor who bought the most tickets at once. | SELECT t1.name , t1.age FROM visitor AS t1 JOIN visit AS t2 ON t1.id = t2.visitor_id ORDER BY t2.num_of_ticket DESC LIMIT 1 |
How many wins for the year that is later than 1987 and has points less than 188? | SELECT wins FROM table_name_47 WHERE year > 1987 AND points < 188 |
How many events have each participants attended? List the participant id, type and the number. | SELECT T1.Participant_ID , T1.Participant_Type_Code , count(*) FROM Participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID GROUP BY T1.Participant_ID |
Who built the car that has a Time/Retired of 1:36:38.887? | SELECT constructor FROM table_name_66 WHERE time_retired = "1:36:38.887" |
Which state had 3821 students in the fall of 06? | SELECT states FROM table_15055594_6 WHERE fall_06 = 3821 |
How many non-discontinued products are there in the dairy category? | SELECT COUNT(T1.CategoryID) FROM Categories AS T1 INNER JOIN Products AS T2 ON T1.CategoryID = T2.CategoryID WHERE T1.CategoryName = 'Dairy Products' AND T2.Discontinued = 0 |
List out all end stations for a bicycle that were making a trip starting from 2nd at South Park station? Only retain the unique value. | SELECT DISTINCT end_station_name FROM trip WHERE start_station_name = '2nd at South Park' |
What title has daffy (as duck dodgers) as the character? | SELECT title FROM table_name_98 WHERE characters = "daffy (as duck dodgers)" |
What shows for round when the race was Int. Adac Preis Von Zweibrücken? | SELECT round FROM table_name_43 WHERE race = "int. adac preis von zweibrücken" |
Can you please order them in alphabetical order of project, and then of scientist name? | SELECT T1.Name , T3.Name , T3.Hours FROM Scientists AS T1 JOIN AssignedTo AS T2 ON T1.SSN = T2.Scientist JOIN Projects AS T3 ON T2.Project = T3.Code ORDER BY T3.Name , T1.Name |
What is the name of the sales person who handled the highest number of sales? | SELECT T1.FirstName, T1.MiddleInitial, T1.LastName FROM Employees AS T1 INNER JOIN Sales AS T2 ON T2.SalesPersonID = T1.EmployeeID GROUP BY T2.SalesPersonID, T1.FirstName, T1.MiddleInitial, T1.LastName ORDER BY COUNT(T2.SalesID) DESC LIMIT 1 |
What is thr type in Aut country? | SELECT type FROM table_name_81 WHERE country = "aut" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.