sentence
stringlengths
3
347
sql
stringlengths
18
804
Show the names of phones and the districts of markets they are on, in ascending order of the ranking of the market.
SELECT T3.Name , T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID ORDER BY T2.Ranking
What was the home team when the away team was Frickley Athletic?
SELECT home_team FROM table_name_3 WHERE away_team = "frickley athletic"
How many of these people cancelled their lesson?
SELECT count ( DISTINCT T2.staff_id ) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T1.lesson_status_code = "Cancelled"
Which allergy has the most number of students affected?
SELECT Allergy FROM Has_allergy GROUP BY Allergy ORDER BY count ( * ) DESC LIMIT 1
List all the seas with which the deepest sea merges.
SELECT T2.Sea2 FROM sea AS T1 INNER JOIN mergesWith AS T2 ON T1.Name = T2.Sea1 WHERE T1.Name = ( SELECT Name FROM sea ORDER BY Depth DESC LIMIT 1 )
Among the clients in Middle Atlantic, how many are them are female and no more than 18 years old?
SELECT COUNT(T1.sex) FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.division = 'Middle Atlantic' AND T1.sex = 'Female' AND T1.age < 18
Show the type of school and the number of buses for each type.
SELECT T2.type , count(*) FROM school_bus AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id GROUP BY T2.type
Return the name of the marketing region the store Rob Dinning is located in.
SELECT T1.Marketing_Region_Name FROM Marketing_Regions AS T1 JOIN Stores AS T2 ON T1.Marketing_Region_Code = T2.Marketing_Region_Code WHERE T2.Store_Name = "Rob Dinning"
What is the grid total for cars that went 17 laps?
SELECT SUM(grid) FROM table_name_60 WHERE laps = 17
In what year was his money list rank 3?
SELECT MIN(year) FROM table_22839669_12 WHERE money_list_rank = 3
What is the commissioned for Vietnam?
SELECT commissioned FROM table_name_29 WHERE operator = "vietnam"
born on 1983-03-14, what is the cb's name?
SELECT name FROM table_name_28 WHERE pos = "cb" AND date_of_birth = "1983-03-14"
What is the Set 3 with a Score of 3–1, and has a Set 2 of 13–15?
SELECT set_3 FROM table_name_7 WHERE score = "3–1" AND set_2 = "13–15"
What squad plays at comunale in darfo boario terme?
SELECT name FROM table_name_40 WHERE home_venue = "comunale" AND city = "darfo boario terme"
What call sign is licensed in soledad, california?
SELECT call_sign FROM table_name_65 WHERE city_of_license = "soledad, california"
What is the home port of m40?
SELECT home_port FROM table_name_62 WHERE pennant = "m40"
Name the comprehension for non-fluent, effortful, slow
SELECT auditory_comprehension FROM table_2088_1 WHERE fluency = "non-fluent, effortful, slow"
What is the largest attendance that has December 16, 1962 as the date?
SELECT MAX(attendance) FROM table_name_84 WHERE date = "december 16, 1962"
Who's the Socialist Labor ticket with a Republican ticket of cuthbert w. pound?
SELECT socialist_labor_ticket FROM table_name_49 WHERE republican_ticket = "cuthbert w. pound"
What is the original air date of the episode with the production code 1115?
SELECT original_air_date FROM table_18367694_2 WHERE production_code = 1115
Which Points have a Record of 21–20–6?
SELECT SUM(points) FROM table_name_36 WHERE record = "21–20–6"
What is the organisation type and id of the organisation which has the most number of research staff?
SELECT T1.organisation_type , T1.organisation_id FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_id ORDER BY count(*) DESC LIMIT 1;
What is the highest pick of the back player from round 28?
SELECT MAX(pick) FROM table_name_42 WHERE position = "back" AND round = 28
What's the HR number when the LMS number is 14758?
SELECT hr_no FROM table_name_36 WHERE lms_no = 14758
How many road numbers are before 1922?
SELECT COUNT(road_number) FROM table_name_18 WHERE year < 1922
Show party names and the number of events for each party.
SELECT T2.party_name , count(*) FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id
Name the year for laps of 200 and rank of 24
SELECT year FROM table_name_14 WHERE laps = 200 AND rank = "24"
For the teacher who wrote the project 'ABC Read', which city was he/she in?
SELECT T2.school_city FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.title = 'ABC Read'
What team raced with a Foyt engine in the Texas Grand Prix?
SELECT team FROM table_1405704_1 WHERE race_name = "Texas Grand Prix" AND engine = "Foyt"
What is the place of player tom watson?
SELECT place FROM table_name_25 WHERE player = "tom watson"
What is the percentage of employees who work the night shift?
SELECT CAST(SUM(CASE WHEN T1.Name = 'Night' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.BusinessEntityID) FROM Shift AS T1 INNER JOIN EmployeeDepartmentHistory AS T2 ON T1.ShiftId = T2.ShiftId
What number of win% has a postseason of did not qualify and rank larger than 8?
SELECT COUNT(win_percentage) FROM table_name_89 WHERE postseason = "did not qualify" AND rank > 8
What is the name of the team that won the most number of matches in season 1?
SELECT Team_Name FROM Team WHERE Team_Id = ( SELECT Match_Winner FROM `Match` WHERE season_Id = 1 GROUP BY Match_Winner ORDER BY COUNT(Match_Winner) DESC LIMIT 1 )
What are the teams that have both wrestlers eliminated by Orton and wrestlers eliminated by Benjamin?
SELECT Team FROM Elimination WHERE Eliminated_By = "Orton" INTERSECT SELECT Team FROM Elimination WHERE Eliminated_By = "Benjamin"
List all the devices' brands and models of events on 5/7/2016 at 6:03:22 AM.
SELECT T1.phone_brand, T1.device_model FROM phone_brand_device_model2 AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id WHERE T2.timestamp = '2016-05-07 06:03:22'
How many drafts have they shown up in?
SELECT t1.employee_name, sum ( t2.draft_number ) FROM Employees as t1 JOIN Circulation_History as t2 ON t2.employee_id = t1.employee_id GROUP BY t2.document_id , t2.draft_number , t2.copy_number ORDER BY count ( * ) DESC LIMIT 1
How many ages for player Amy Cato?
SELECT COUNT(age) FROM table_24501530_1 WHERE candidate = "Amy Cato"
How about the names of different persons who have friends with age above 40 and under age 30?
SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN ( SELECT name FROM Person WHERE age > 40 ) union SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN ( SELECT name FROM Person WHERE age < 30 )
How many of Gary Trousdale's movies are adventure movies?
SELECT COUNT(T.name) FROM ( SELECT T1.name FROM director AS T1 INNER JOIN movies_total_gross AS T2 ON T1.name = T2.movie_title WHERE T1.director = 'Gary Trousdale' AND T2.genre = 'Adventure' GROUP BY T1.name ) T
What is the email for the employee whose first name does not contain the letter M with the highest salary.
SELECT email FROM employees WHERE first_name NOT LIKE '%M%' ORDER BY salary DESC LIMIT 1
What's the frequency when the identifier is cbf-fm-9?
SELECT frequency FROM table_name_47 WHERE identifier = "cbf-fm-9"
Name all the trip on the days when it rained. State the duration of the trip
SELECT T1.id, T1.duration FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code AND T2.date = SUBSTR(CAST(T1.start_date AS TEXT), 1, INSTR(T1.start_date, ' ') - 1) WHERE T2.events LIKE '%Rain%' OR T2.events LIKE '%rain%'
Which vocal type has the band mate with first name "Solveig" played the most?
SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE firstname = "Solveig" GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1
Thank you for that! Can you update the list with the job of each person as well? | Would you like me to show you the names of all persons and also their corresponding job? | Yes please!
SELECT name, job FROM Person
Who was the visiting team on December 17?
SELECT visitor FROM table_name_90 WHERE date = "december 17"
Show the theme for exhibitions with both records of an attendance below 100 and above 500.
SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T1.attendance < 100 INTERSECT SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T1.attendance > 500
What are the last names of faculty who are part of the computer science department?
SELECT T2.Lname FROM DEPARTMENT AS T1 JOIN FACULTY AS T2 ON T1.DNO = T3.DNO JOIN MEMBER_OF AS T3 ON T2.FacID = T3.FacID WHERE T1.DName = "Computer Science"
how many people are there?
SELECT count ( people_id ) from people
How many technicians are there?
SELECT count(*) FROM technician
What is the percentage of the object samples in the class of "man" in image no.1?
SELECT CAST(COUNT(CASE WHEN T1.OBJ_CLASS = 'man' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T1.OBJ_CLASS_ID) FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.IMG_ID = 1
How many restaurant is the Sandwich type restaurant?
SELECT count(*) FROM Restaurant JOIN Type_Of_Restaurant ON Restaurant.ResID = Type_Of_Restaurant.ResID JOIN Restaurant_Type ON Type_Of_Restaurant.ResTypeID = Restaurant_Type.ResTypeID GROUP BY Type_Of_Restaurant.ResTypeID HAVING Restaurant_Type.ResTypeName = 'Sandwich'
When winner is the status and 77 is the total days in pbb house what is the edition?
SELECT edition FROM table_19061741_3 WHERE total_days_in_pbb_house = 77 AND status = "Winner"
What is the last name of the musicians who has played back position the most?
SELECT T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id WHERE stageposition = "back" GROUP BY lastname ORDER BY count(*) DESC LIMIT 1
What are the ids and names of the medicine that can interact with two or more enzymes?
SELECT T1.id , T1.Name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id HAVING count(*) >= 2
Name the total number of televote points for cry on my shoulders
SELECT COUNT(televote_points) FROM table_21378339_5 WHERE song = "Cry on my shoulders"
tell me how many settlements each claim responds to | Did you mean to ask for the claim id and number of settlements that each claim responds to? | list the claim ids
SELECT Claim_ID FROM Claims
How many Indian restaurants are there in the Los Angeles area?
SELECT COUNT(T1.city) FROM geographic AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T2.food_type = 'indian' AND T1.region = 'los angeles area'
What's the authority when the roll is 40?
SELECT authority FROM table_name_7 WHERE roll = 40
What is the home leg who are opponents of rotor volgograd
SELECT home_leg FROM table_name_88 WHERE opponents = "rotor volgograd"
What was the second leg score from the group stage on matchday 5?
SELECT second_leg FROM table_name_35 WHERE phase = "group stage" AND round = "matchday 5"
Name the location of 64-74
SELECT location_attendance FROM table_17103729_8 WHERE score = "64-74"
Tyne and Wear County has what total membership for their metropolitan area?
SELECT metropolitan_area FROM table_2273738_1 WHERE county = "Tyne and Wear"
Which record has a score of 135–134?
SELECT record FROM table_name_7 WHERE score = "135–134"
What is that teacher's last name?
SELECT DISTINCT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 5
How many matches did Team 10 play in 2012?
SELECT SUM(CASE WHEN Team_1 = 10 OR Team_2 = 10 THEN 1 ELSE 0 END) FROM `Match` WHERE SUBSTR(Match_Date, 1, 4) = '2012'
How many flights depart from 'APG'?
SELECT count(*) FROM FLIGHTS WHERE SourceAirport = "APG"
What was the number of "The Word" segments for episode number 727?
SELECT COUNT(the_wørd) FROM table_25691838_6 WHERE episode__number = 727
What is Surface, when Score in Final is 3-6, 6-3, 6-2?
SELECT surface FROM table_name_23 WHERE score_in_final = "3-6, 6-3, 6-2"
On what date was the Opponent Chicago Bears?
SELECT date FROM table_name_84 WHERE opponent = "chicago bears"
What is the average attendance of shows?
SELECT avg(Attendance) FROM SHOW
What is the total number of rounds of the end player with a pick number greater than 303?
SELECT COUNT(round) FROM table_name_21 WHERE pick > 303 AND position = "end"
How many students received a yes from tryouts?
SELECT count(*) FROM tryout WHERE decision = 'yes'
List all media types.
SELECT name FROM media_types;
Tell me the catalog for date larger than 2004
SELECT catalog FROM table_name_72 WHERE date > 2004
Who is the opponent in the final of the Tournament of Blenheim?
SELECT opponent_in_the_final FROM table_name_42 WHERE tournament = "blenheim"
What was the game's points against Team 2 Deportivo Anzoátegui?
SELECT points FROM table_17282875_2 WHERE team__number2 = "Deportivo Anzoátegui"
Calculate the highest points where the win,loss, tie ratio is 28-12-6
SELECT MAX(points) FROM table_23308178_7 WHERE record = "28-12-6"
Show me the policy type code with policy id 257?
SELECT policy_type_code FROM available_policies where Policy_ID = 257
Which method was used in the welterweight class with a preliminary card?
SELECT method FROM table_name_58 WHERE weight_class = "welterweight" AND card = "preliminary"
What was the lowest FA Cup for a Malaysia Cup of 0?
SELECT MIN(fa_cup) FROM table_name_64 WHERE malaysia_cup < 0
Among the movies starring Tom Cruise, which one of them has the best quality?
SELECT T1.Title FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Name = 'Tom Cruise' ORDER BY T1.Rating DESC LIMIT 1
What was the pick number of Conor Jackson?
SELECT AVG(pick) FROM table_name_72 WHERE player = "conor jackson"
How many singers do we have?
SELECT count(*) FROM singer
what is the name of the product with color code 4?
SELECT product_name FROM products where color_code = 4
When did the project "Photojournalists Want to Exhibit Their Best Works" go live?
SELECT T1.date_posted FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T2.title LIKE 'Photojournalists Want to Exhibit Their Best Works'
Which clay has a Record of 2–0, and a Hard 1–0?
SELECT clay FROM table_name_36 WHERE record = "2–0" AND hard = "1–0"
What is the name of the aircraft that has won an award the most?
SELECT T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft ORDER BY COUNT(*) DESC LIMIT 1
Tell me the market share of safari?
SELECT market_share from browser where name = "Safari"
List all cartoon directed by "Ben Jones".
SELECT Title FROM Cartoon WHERE Directed_by = "Ben Jones";
How many school colors is there for the main campus location of highland?
SELECT COUNT(school_colors) FROM table_12434380_1 WHERE main_campus_location = "Highland"
Which vocal type has the band mate with last name "Heilo" played the most?
SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE lastname = "Heilo" GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1
Please list the cities of the Yelp_Businesses that have gotten a 5 in the Elitestar rating.
SELECT city FROM Business WHERE stars = 5 GROUP BY city
What is the opposition when the tally was 0-11?
SELECT opposition FROM table_name_25 WHERE tally = "0-11"
What is the highest numbered draft pick?
SELECT MAX(pick__number) FROM table_28059992_5
ok fine then list out the artists name
SELECT name FROM artist
what is the date when saros is more than 124, the type is total, the magnitude is more than 1.0535 and the time (greatest) is 20:55:28?
SELECT date FROM table_name_21 WHERE saros > 124 AND type = "total" AND magnitude > 1.0535 AND time__greatest_ = "20:55:28"
Find the name and id of the good with the highest average rank.
SELECT T1.title , T1.i_id FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id GROUP BY T2.i_id ORDER BY avg(T2.rank) DESC LIMIT 1
Which users have the most popular role? | Do you mean the user name of the users who have the most popular role? | Yes, can you list all the usernames and passwords of the users who have the most popular role?
SELECT user_name , password FROM users GROUP BY role_code ORDER BY count ( * ) DESC LIMIT 1
What is the number of voters in 1800 that have boroughs named Drogheda?
SELECT COUNT(voters_in_1800) FROM table_24329520_8 WHERE borough = "Drogheda"
List the name of the pilots who have flied for both a company that mainly provide 'Cargo' services and a company that runs 'Catering services' activities.
SELECT T2.pilot FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id WHERE T1.principal_activities = 'Cargo' INTERSECT SELECT T2.pilot FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id WHERE T1.principal_activities = 'Catering services'