sentence
stringlengths
3
347
sql
stringlengths
18
804
How many documents are there?
SELECT count ( * ) FROM Documents
Name the total number of director for vesničko má středisková
SELECT COUNT(director) FROM table_23141790_1 WHERE original_title = "Vesničko má středisková"
Compute the average price of all products with manufacturer code equal to 2.
SELECT AVG(price) FROM products WHERE Manufacturer = 2
How many times has Mary Smith rented a film?
SELECT COUNT(T1.customer_id) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'MARY' AND T2.last_name = 'SMITH'
Among the violations in 2016, how many of them have unscheduled inspections?
SELECT COUNT(T2.business_id) FROM violations AS T1 INNER JOIN inspections AS T2 ON T1.business_id = T2.business_id WHERE STRFTIME('%Y', T1.`date`) = '2016' AND T2.type = 'Routine - Unscheduled'
How much Longitude has a County of nelson, and a Latitude larger than 47.980183?
SELECT SUM(longitude) FROM table_name_87 WHERE county = "nelson" AND latitude > 47.980183
In season 2007–08 who is the runner-up?
SELECT runner_up FROM table_25058269_1 WHERE season = "2007–08"
What are the names and positions of all players who got a no for their tryout decision?
SELECT T1.pName,T2.pPos FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = "no"
How many of these have a height above 5000?
SELECT count ( Name ) FROM mountain WHERE Height > 5000
What is the decision of the game larger than 6.
SELECT decision FROM table_name_82 WHERE game > 6
What was the fault log ID with the most number of faulty parts?
SELECT T1.fault_log_entry_id FROM Fault_Log AS T1 JOIN Fault_Log_Parts AS T2 ON T1.fault_log_entry_id = T2.fault_log_entry_id GROUP BY T1.fault_log_entry_id ORDER BY count ( * ) DESC LIMIT 1
Which Drawn has Points for of 782?
SELECT drawn FROM table_name_2 WHERE points_for = "782"
How many times does M Chinnaswamy Stadium host games than Maharashtra Cricket Association Stadium?
SELECT SUM(CASE WHEN T2.Venue_Name = 'M Chinnaswamy Stadium' THEN 1 ELSE 0 END) - SUM(CASE WHEN T2.Venue_Name = 'Maharashtra Cricket Association Stadium' THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Venue AS T2 ON T1.Venue_Id = T2.Venue_Id
What is the Visitor of the Montreal Canadiens Home game with a Record of 6–4–4?
SELECT visitor FROM table_name_78 WHERE home = "montreal canadiens" AND record = "6–4–4"
How many players were with the school or club team La Salle?
SELECT COUNT(player) FROM table_10015132_2 WHERE school_club_team = "La Salle"
What are the details of the markets that can be accessed by walk or bus?
SELECT T1.Market_Details FROM Street_Markets AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Market_ID = T2.Tourist_Attraction_ID WHERE T2.How_to_Get_There = "walk" OR T2.How_to_Get_There = "bus"
What is the special notes value for years under 2009?
SELECT special_notes FROM table_name_56 WHERE year < 2009
Find all stores in the Attock district | Do you want the id or the name of these stores? | The name
SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id join district as t3 on t3.district_id = t2.district_id where t3.district_name = "Attock District"
Kostas Bigalis & Mirella Fragkopoulou the singer had what has the jury?
SELECT jury FROM table_name_51 WHERE singer = "kostas bigalis & mirella fragkopoulou"
What is the Italian word for the Mexican word frijol?
SELECT italian FROM table_name_59 WHERE mexican = "frijol"
What is the DPhone of Biology?
SELECT DPhone FROM DEPARTMENT WHERE DName = "Biology"
What is the No. 1 of the person with a No. 2 of John?
SELECT no_1 FROM table_name_26 WHERE no_2 = "john"
What is teh born-died dates of the king with a throne name 315 and left office in 1021?
SELECT born_died FROM table_name_74 WHERE left_office = "1021" AND throne_name = "315"
Show the name and country for all people whose age is smaller than the average.
SELECT name , country FROM people WHERE age < (SELECT avg(age) FROM people)
Find the total amount claimed in the most recently created document.
SELECT SUM(t1.amount_claimed) FROM claim_headers AS t1 JOIN claims_documents AS t2 ON t1.claim_header_id = t2.claim_id WHERE t2.created_date = (SELECT created_date FROM claims_documents ORDER BY created_date LIMIT 1)
which fa cups had a total of 565 (7)?
SELECT fa_cup FROM table_14962287_1 WHERE total = "565 (7)"
What is the imperfect stem of the word that means 'take away, remove'?
SELECT imperfect_stem FROM table_name_74 WHERE meaning = "'take away, remove'"
Show the ids and names of all documents.
SELECT document_id , document_name FROM Documents
Calculate the number of products if we add the products of the accessories and components categories.
SELECT COUNT(ProductID) FROM Product WHERE Name LIKE '%accessories %' OR Name LIKE '%components%'
What is the average absence period of a student?
SELECT AVG(month) FROM longest_absense_from_school
Which states have renewable electricity equal to 9667 (gw×h)?
SELECT state FROM table_25244412_1 WHERE renewable_electricity__gw•h_ = 9667
What is the lowest total for bronzes over 1, golds over 8, and fewer than 10 silvers?
SELECT MIN(total) FROM table_name_64 WHERE bronze > 1 AND gold > 8 AND silver < 10
Show the name of the building that has the most company offices.
SELECT T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T1.building_id ORDER BY COUNT(*) DESC LIMIT 1
Would you show the transaction type descriptions if the share count is smaller than 10?
SELECT T1.transaction_type_description FROM Ref_Transaction_Types AS T1 JOIN TRANSACTIONS AS T2 ON T1.transaction_type_code = T2.transaction_type_code WHERE T2.share_count < 10
Which Rank has a Bronze of 1, and a Nation of lithuania?
SELECT rank FROM table_name_89 WHERE bronze = 1 AND nation = "lithuania"
What is Record, when H/A/N is n?
SELECT record FROM table_name_42 WHERE h_a_n = "n"
In what nation did Darko Sovran place third?
SELECT nation FROM table_name_19 WHERE third = "darko sovran"
What is the average number of wins for teams with 14 losses and against over 2200?
SELECT AVG(wins) FROM table_name_41 WHERE losses = 14 AND against > 2200
Which school is in Raleigh, NC?
SELECT school FROM table_name_23 WHERE hometown = "raleigh, nc"
Which CFL Teams drafted an OL in 2006?
SELECT cfl_team FROM table_10812938_4 WHERE position = "OL"
How many CFL teams drafted someone from mount allison college?
SELECT COUNT(cfl_team) FROM table_26996293_3 WHERE college = "Mount Allison"
Who are the officers involved in cases that are voted as 'No Bill'. List their last name and gender.
SELECT T2.last_name, T2.gender FROM incidents AS T1 INNER JOIN officers AS T2 ON T1.case_number = T2.case_number WHERE T1.grand_jury_disposition = 'No Bill'
What is the origin and destination for all flights whose price is higher than 300?
SELECT origin , destination FROM Flight WHERE price > 300
How many credits does the department offer?
SELECT sum(crs_credit) , dept_code FROM course GROUP BY dept_code
If there are 11 lifts, what is the base elevation?
SELECT MAX(base_elevation__feet_) FROM table_25762852_1 WHERE lifts = 11
Which Tournament has a Winning score of e (72-69-71-68=280)?
SELECT tournament FROM table_name_15 WHERE winning_score = E(72 - 69 - 71 - 68 = 280)
What tournament that Fernando Roca is the runner-up?
SELECT tournament FROM table_name_14 WHERE runner_s__up = "fernando roca"
Return the name of the document that has the most sections.
SELECT t1.document_name FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code GROUP BY t1.document_code ORDER BY count(*) DESC LIMIT 1
How many orders in the south superstore with the fastest delivery are items of furniture?
SELECT COUNT(T1.`Order ID`) FROM south_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T1.`Ship Mode` = 'First Class' AND T2.Category = 'Furniture'
What are ids and total number of hours played for each game?
SELECT gameid , sum(hours_played) FROM Plays_games GROUP BY gameid
Which school has the most professors?
SELECT T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.school_code ORDER BY count ( * ) desc LIMIT 1
What is thea year the road closed April 13?
SELECT MAX(year) FROM table_12791809_1 WHERE road_closed = "April 13"
What barony is Ballycunningham in?
SELECT barony FROM table_30120566_1 WHERE townland = "Ballycunningham"
Which school has the player Thomas Tyner?
SELECT school FROM table_11677691_9 WHERE player = "Thomas Tyner"
Which team got the most wins in the Stanley Cup finals?
SELECT T2.name FROM TeamsSC AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year GROUP BY T2.name ORDER BY SUM(T1.W) DESC LIMIT 1
What is the date for the race that had the time of 2:43:19?
SELECT date FROM table_2268216_1 WHERE race_time = "2:43:19"
Name the location attendance april 5
SELECT location_attendance FROM table_27713583_11 WHERE date = "April 5"
Show the names of companies and that of employees in descending order of number of years working for that employee?
SELECT T3.Name , T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID ORDER BY T1.Year_working
Count the number of postal points in the district represented by Kirkpatrick Ann.
SELECT COUNT(T2.zip_code) FROM congress AS T1 INNER JOIN zip_congress AS T2 ON T1.cognress_rep_id = T2.district WHERE T1.first_name = 'Kirkpatrick' AND T1.last_name = 'Ann'
Who was the girl of the week after nicole woodruff in the same month?
SELECT week_5 FROM table_name_93 WHERE week_4 = "nicole woodruff"
Which film actors (actresses) played a role in more than 30 films? List his or her first name and last name.
SELECT T2.first_name , T2.last_name FROM film_actor AS T1 JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.actor_id HAVING count(*) > 30
What is the name of the artist who produced the shortest song?
SELECT T1.artist_name FROM song AS T1 JOIN files AS T2 ON T1.f_id = T2.f_id ORDER BY T2.duration LIMIT 1
What lane did Bronte Barratt, who had a rank larger than 4, swim in?
SELECT AVG(lane) FROM table_name_79 WHERE name = "bronte barratt" AND rank > 4
How many distinct incident type codes are there?
SELECT count(DISTINCT incident_type_code) FROM Behavior_Incident
What is No. 7, when No. 4 is Madison, and when No. 10 is Amelia?
SELECT no_7 FROM table_name_15 WHERE no_4 = "madison" AND no_10 = "amelia"
Which tournament has an opponent in the final of nadia petrova and a score of 6–3, 4–6, 6–1??
SELECT tournament FROM table_name_22 WHERE opponent_in_the_final = "nadia petrova" AND score = "6–3, 4–6, 6–1"
What was the location of the match that had a result of 3-3?
SELECT location FROM table_name_13 WHERE result = "3-3"
What are the names of patients who are staying in room 111 and have an undergoing treatment?
SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN patient AS T2 ON T1.patient = T2.SSN JOIN stay AS T3 ON T1.Stay = T3.StayID WHERE T3.room = 111
List all different genre types.
SELECT DISTINCT name FROM genres;
When the country of release is EU, what is the label name?
SELECT label FROM table_name_39 WHERE country_of_release = "eu"
What is the shipment duration for order number CA-2011-134103?
SELECT DISTINCT strftime('%J', `Ship Date`) - strftime('%J', `Order Date`) AS duration FROM central_superstore WHERE `Order ID` = 'CA-2011-134103'
What is the text tweet of Iron Man?
SELECT T2.text FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid where T1.name = "Iron Man"
What is the Status with a Name that is anas cheuen?
SELECT status FROM table_name_77 WHERE name = "anas cheuen"
Find the number of reviews.
SELECT count(*) FROM review
How many different colleges were represented at tryouts?
SELECT count(DISTINCT cName) FROM tryout
please check the table once more for the name of students not enrolled in any course | Do you need those students' Fname or Lname? | i need the students first name
SELECT Fname FROM STUDENT WHERE StuID NOT IN ( SELECT StuID FROM ENROLLED_IN )
What is Title, when Season is less than 1.8, and when First Broadcast is March 6, 1981?
SELECT title FROM table_name_2 WHERE season < 1.8 AND first_broadcast = "march 6, 1981"
What is the latest test completion date?
SELECT T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id order by T1.date_of_completion desc limit 1
Count the number of different complaint type codes.
SELECT count(DISTINCT complaint_type_code) FROM complaints
What is the Place of the Player with a Score of 67-76-74-67=284?
SELECT place FROM table_name_37 WHERE score = 67 - 76 - 74 - 67 = 284
What's the location of the school having the panthers as a mascot with an AAA for the IHSAA Class?
SELECT location FROM table_name_28 WHERE ihsaa_class = "aaa" AND mascot = "panthers"
Which documents have more than 1 draft copies? List document id and number of draft copies.
SELECT document_id , count(*) FROM Draft_Copies GROUP BY document_id HAVING count(*) > 1;
Who was the champion prior to Xix Xavant?
SELECT previous_champion_s_ FROM table_1272033_1 WHERE champion_s_ = "Xix Xavant"
In which year was the film with the highest replacement cost released?
SELECT DISTINCT release_year FROM film WHERE replacement_cost = ( SELECT MAX(replacement_cost) FROM film )
hi I was wondering how many policies Ellsworth Paucek has?
SELECT count ( * ) FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.Customer_id WHERE T1.customer_details = "Ellsworth Paucek"
Which area has a Name of william colenso college?
SELECT area FROM table_name_73 WHERE name = "william colenso college"
Find the total hours of the projects that scientists named Michael Rogers or Carol Smith are assigned to.
SELECT sum(T2.hours) FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T3.name = 'Michael Rogers' OR T3.name = 'Carol Smith'
What is the occupation of the candidate that resides in Windsor Junction?
SELECT occupation FROM table_name_38 WHERE residence = "windsor junction"
How many entries are there for team coxy for the air date of 24 january 2010 and team guest captain of gail porter?
SELECT COUNT(team_coxy) FROM table_25816476_2 WHERE air_date = "24 January 2010" AND team_guest_captain = "Gail Porter"
What is the most frequently ordered product? Tell me the detail of the product
SELECT t2.product_details FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id ORDER BY count(*) DESC LIMIT 1
Show all video games with type Collectible card game.
SELECT gname FROM Video_games WHERE gtype = "Collectible card game"
Find the year which offers the largest number of courses.
SELECT YEAR FROM SECTION GROUP BY YEAR ORDER BY count(*) DESC LIMIT 1
Which majors have between 2 and 20 students? Show me major and number of students
SELECT Major , count ( * ) FROM Student GROUP BY Major HAVING count ( Major ) BETWEEN 2 AND 20
Which student visited restaurant most often? List student's first name and last name.
SELECT Student.Fname, Student.Lname FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID GROUP BY Student.StuID ORDER BY COUNT(*) DESC LIMIT 1
Name the least lane for kasey giteau and rank less than 18
SELECT MIN(lane) FROM table_name_31 WHERE name = "kasey giteau" AND rank < 18
What is the total of professional courses available at the university? List out all the course id.
SELECT COUNT(course_id) FROM course WHERE courseLevel = 'Level_500'
What number last Runners-up where there when the Last win was 1999 and the Runners-up was bigger than 1?
SELECT COUNT(Last) AS runners_up FROM table_name_42 WHERE last_win = "1999" AND runners_up > 1
Show statement id, statement detail, account detail for accounts.
SELECT T1.statement_id , T2.statement_details , T1.account_details FROM Accounts AS T1 JOIN Statements AS T2 ON T1.statement_id = T2.statement_id
What is the short name of channel 5.5, KSTC-TV?
SELECT psip_short_name FROM table_name_95 WHERE station = "kstc-tv" AND channel = 5.5
What description does Livery of ews have?
SELECT description FROM table_name_61 WHERE livery = "ews"