sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
Count the number of distinct claim outcome codes. | SELECT count(DISTINCT claim_outcome_code) FROM claims_processing |
Show the name and service for all trains in order by time. | SELECT name , service FROM train ORDER BY TIME |
What source system code includes the sub string 'en'? | SELECT DISTINCT source_system_code FROM cmi_cross_references WHERE source_system_code LIKE '%en%' |
Which market segment does the customer with the highest amount of debt belongs to? | SELECT c_mktsegment FROM customer WHERE c_acctbal = ( SELECT MIN(c_acctbal) FROM customer ) |
Which Mission has a Apogee of 705 km? | SELECT mission FROM table_name_3 WHERE apogee = "705 km" |
What is the name of the procedure that has the lowest cost? | SELECT Name FROM procedures order by cost asc limit 1 |
Give the flight numbers of flights leaving from APG. | SELECT FlightNo FROM FLIGHTS WHERE SourceAirport = "APG" |
If the position is 12th, what was the series? | SELECT series FROM table_21795846_1 WHERE position = "12th" |
First names of the proffesors teaching course ACCT-211? | SELECT DISTINCT T1.EMP_FNAME FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM = T2.PROF_NUM WHERE CRS_CODE = "ACCT-211" |
Tell me singles W-L that has years larger than 1 and highest singles ranking of 1346 | SELECT singles_w_l FROM table_name_7 WHERE years_played > 1 AND highest_singles_ranking = "1346" |
How many dates did the episode with a production code of 804 originally air on? | SELECT COUNT(original_air_date) FROM table_27988559_1 WHERE production_code = 804 |
When michele pirro is the pole position what is the date? | SELECT date FROM table_21191496_1 WHERE pole_position = "Michele Pirro" |
Which film has the most copies in the inventory? List both title and id. | SELECT T1.title , T1.film_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id ORDER BY count(*) DESC LIMIT 1 |
What is the outcome type of match ID 392195? | SELECT T2.Outcome_Type FROM Match AS T1 INNER JOIN Outcome AS T2 ON T1.Outcome_type = T2.Outcome_Id WHERE T1.Match_Id = '392195' |
How many games did player Id "vanbijo01" win in the 1990 season? | SELECT W FROM Goalies WHERE playerID = 'vanbijo01' AND year = 1990 |
Which authors did not submit to any workshop? | SELECT Author FROM submission WHERE Submission_ID NOT IN (SELECT Submission_ID FROM acceptance) |
What was the score of the game against the phoenix suns? | SELECT score FROM table_name_18 WHERE opponent = "phoenix suns" |
What number does the player who was with the grizzles in 1999 wear? | SELECT MIN(no) FROM table_16494599_4 WHERE years_for_grizzlies = "1999" |
What are the names of the course authors who teach the course with the name "operating system" or "data structure" please? | do you want to return their personal, middle, and family names? | All of those, please? | SELECT T1.personal_name, t1.middle_name, t1.family_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T2.course_name = "operating system" OR T2.course_name = "data structure" |
Which Grid has a Rider of randy de puniet, and Laps smaller than 24? | SELECT MAX(grid) FROM table_name_11 WHERE rider = "randy de puniet" AND laps < 24 |
yes | Here are all the candidates' ids who got assessed. | which of those most recently had an assessment? | SELECT candidate_id FROM candidate_assessments ORDER BY assessment_date DESC LIMIT 1 |
What is the time/retired if the driver is Marco Andretti? | SELECT time_retired FROM table_17693171_1 WHERE driver = "Marco Andretti" |
Which 1997 has sf as the 2002? | SELECT 1997 FROM table_name_74 WHERE 2002 = "sf" |
How many times does Bob show up in the friend column? | SELECT count ( * ) FROM PersonFriend where friend = 'Bob' |
Find the total number of matches. | SELECT count(*) FROM matches |
How many allergies are there? | SELECT COUNT(DISTINCT allergy) FROM Allergy_type |
What is the average rating star for each reviewer? | SELECT T2.name , avg(T1.stars) FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T2.name |
Which away team is from junction oval? | SELECT away_team FROM table_name_38 WHERE venue = "junction oval" |
Name the total number of lost when goals scored is less than 22 and goals conceded is more than 27 | SELECT COUNT(lost) FROM table_name_82 WHERE goals_scored < 22 AND goals_conceded > 27 |
On what ground was the game on 31 Jul 2007? | SELECT ground FROM table_name_60 WHERE date = "31 jul 2007" |
Name the fifth district for steve rudoni | SELECT fifth_district FROM table_15442974_1 WHERE fourth_district = "Steve Rudoni" |
What is the url of solution 1? | SELECT T1.Url FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.Id = 1 |
What is the total of the cultural and educational panel when the industrial and commercial panel is 0 and the agricultural panel is greater than 0? | SELECT SUM(cultural_and_educational_panel) FROM table_name_90 WHERE industrial_and_commercial_panel = 0 AND agricultural_panel > 0 |
How many laps did the car do that had a final position of 17? | SELECT laps FROM table_name_79 WHERE fin_pos = "17" |
What are the investors that have invested in at least two entrepreneurs? | SELECT Investor FROM entrepreneur GROUP BY Investor HAVING COUNT(*) >= 2 |
What is the average number of laps for a grid of 6? | SELECT AVG(laps) FROM table_name_31 WHERE grid = 6 |
Could you please find the products with the max page size as "A4"? | SELECT product FROM product WHERE max_page_size = "A4" |
What is the result for 2006 of a tournament that is 107 in 2010? | SELECT 2006 FROM table_name_73 WHERE 2010 = "107" |
What are first and last names of players participating in all star game in 1998? | SELECT name_first , name_last FROM player AS T1 JOIN all_star AS T2 ON T1.player_id = T2.player_id WHERE YEAR = 1998 |
How many department stores does the store chain South have? | SELECT count(*) FROM department_stores AS T1 JOIN department_store_chain AS T2 ON T1.dept_store_chain_id = T2.dept_store_chain_id WHERE T2.dept_store_chain_name = "South" |
What is the GDP of Shanghai? | SELECT GDP FROM city where city = "Shanghai" |
Can you list the number of airports whose names contain the word "International"? | SELECT count ( * ) FROM airports WHERE name LIKE '%International%' |
What is the North American release date of the remake with a European release date on 2013-03-20? | SELECT north_american_release_date FROM table_name_25 WHERE european_release_date = "2013-03-20" |
Great! Could you update this list to show me Meaghan's email address and phone number as well? | SELECT T2.customer_first_name , T2.customer_last_name, T2.email_address, T2.phone_number FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.account_name = "900" |
Who was the driver that had all rounds and a f399 chassis? | SELECT driver FROM table_name_53 WHERE rounds = "all" AND chassis = "f399" |
Can you show me the top 3 highest room counts? | SELECT room_count FROM Apartments order by room_count DESC LIMIT 3 |
How many times is the rank higher than 3 and bronze more than 1? | SELECT COUNT(gold) FROM table_name_82 WHERE rank > 3 AND bronze > 1 |
Which Result has a Home team of portland, and a Date of may 31? | SELECT result FROM table_name_30 WHERE home_team = "portland" AND date = "may 31" |
Show the name of colleges that have at least two players in descending alphabetical order. | SELECT College FROM match_season GROUP BY College HAVING count(*) >= 2 ORDER BY College DESC |
could you tell me those four customer's details and their ID? | SELECT T1.customer_details , T1.customer_id FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_id = T2.Customer_id GROUP BY T1.customer_id HAVING count ( * ) > 1 |
How many films have a duration between 100 to 110 minutes? | SELECT COUNT(film_id) FROM film WHERE length BETWEEN 100 AND 110 |
What is the Tie no when the away team was Burnley? | SELECT tie_no FROM table_name_30 WHERE away_team = "burnley" |
What are the first name and department name of all employees? | SELECT T1.first_name , T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id |
Return the lowest version number, along with its corresponding template type code. | SELECT min(Version_Number) , template_type_code FROM Templates |
What was the outcome when Jing-Jing Lu was the opponent? | SELECT outcome FROM table_name_81 WHERE opponent = "jing-jing lu" |
How many Votes, when the Residence is Halifax? | SELECT votes FROM table_name_81 WHERE residence = "halifax" |
How many female students (sex is F) whose age is below 25? | SELECT count(*) FROM student WHERE sex = 'F' AND age < 25 |
Find the department name that is in Building "Mergenthaler". | SELECT DName FROM DEPARTMENT WHERE Building = "Mergenthaler" |
What are the names of tourist attractions that can be reached by walk or is at address 660 Shea Crescent? | SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID WHERE T1.Address = "660 Shea Crescent" OR T2.How_to_Get_There = "walk" |
Among all the teams that made the playoffs in the 2007-2008 season, identify the percentage that played over 20 games. | SELECT CAST(COUNT(CASE WHEN GP > 20 THEN TEAM ELSE NULL END) AS REAL) * 100 / COUNT(TEAM) FROM SeasonStatus WHERE SEASON = '2007-2008' AND GAMETYPE = 'Playoffs' |
what is the average for 2005 when 1995 is more than 3, 1996 is less than 4, and 2011 is more than 5? | SELECT AVG(2005) FROM table_name_77 WHERE 1995 > 3 AND 1996 < 4 AND 2011 > 5 |
Who was Constructor for rider Marco Melandri? | SELECT constructor FROM table_name_76 WHERE rider = "marco melandri" |
Find the title and score of the movie with the lowest rating among all movies directed by each director. | SELECT T2.title , T1.stars , T2.director , min(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.director |
How many users are followed by Mary? | SELECT count ( * ) FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid = T2.f2 WHERE T1.name = "Mary" |
which district has the least area? | SELECT district_name FROM district ORDER BY city_area ASC LIMIT 1 |
Who is the 44-year-old patient diagnosed with drug overdose? | SELECT T2.first, T2.last FROM conditions AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T1.DESCRIPTION = 'Drug overdose' AND ROUND((strftime('%J', T2.deathdate) - strftime('%J', T2.birthdate)) / 365) = 44 |
what is the Id of the browser that is compatible with most web accelerators? | SELECT T1.id FROM browser AS T1 JOIN accelerator_compatible_browser AS T2 ON T1.id = T2.browser_id GROUP BY T1.id ORDER BY count ( * ) DESC LIMIT 1 |
What is the air date of the episode with the production code 6acx19? | SELECT original_air_date FROM table_22261877_1 WHERE production_code = "6ACX19" |
What is Score, when Player is "Jeff Maggert"? | SELECT score FROM table_name_76 WHERE player = "jeff maggert" |
From which branch does the sales representative employee who made the most sales in 2005? Please indicates its full address and phone number. | SELECT T3.addressLine1, T3.addressLine2, T3.phone FROM orderdetails AS T1 INNER JOIN orders AS T2 ON T1.orderNumber = T2.orderNumber INNER JOIN customers AS T3 ON T2.customerNumber = T3.customerNumber INNER JOIN employees AS T4 ON T3.salesRepEmployeeNumber = T4.employeeNumber INNER JOIN offices AS T5 ON T4.officeCode = T5.officeCode WHERE STRFTIME('%Y', T2.orderDate) = '2005' AND T4.jobTitle = 'Sales Rep' ORDER BY T1.quantityOrdered DESC LIMIT 1 |
Name the total number of drawn for danish and mathias | SELECT COUNT(draw) FROM table_name_37 WHERE language = "danish" AND artist = "mathias" |
Who was in the original broadway cast while jake epstein was in the original 1st us tour cast? | SELECT original_broadway_cast FROM table_24353141_1 WHERE original_1st_us_tour_cast = "Jake Epstein" |
How many orders in 2022 have Iran as their destinations? | SELECT COUNT(*) FROM country AS T1 INNER JOIN address AS T2 ON T1.country_id = T2.country_id INNER JOIN cust_order AS T3 ON T3.dest_address_id = T2.address_id WHERE T1.country_name = 'Iran' AND STRFTIME('%Y', T3.order_date) = '2022' |
How to pay the donation of the project that teacher "822b7b8768c17456fdce78b65abcc18e" created? | SELECT T2.payment_method FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.teacher_acctid = '822b7b8768c17456fdce78b65abcc18e' |
Return all the apartment numbers sorted by the room count in ascending order. | SELECT apt_number FROM Apartments ORDER BY room_count |
Can you show me dates of all visits before the year 2013 only? | SELECT Visit_Date FROM visits where visit_date < "2013-01-01 00:00:00" |
Which Rank is Highest for Yoshiazuma? | SELECT highest_rank FROM table_name_44 WHERE name = "yoshiazuma" |
What is the minimum attendance of all events? | SELECT min ( Event_Attendance ) FROM event |
What is the news frequency for the show Locker Room? | SELECT news_freq FROM table_name_73 WHERE show_name = "locker room" |
Which Date has an Away team of south melbourne? | SELECT date FROM table_name_42 WHERE away_team = "south melbourne" |
What is the average number of papers published in the World Computer Congress each year? | SELECT CAST(SUM(CASE WHEN T2.FullName = 'International Congress Series' THEN 1 ELSE 0 END) AS REAL) / COUNT(T1.Id) AS Div1, T1.Year FROM Paper AS T1 INNER JOIN Journal AS T2 ON T1.JournalId = T2.Id GROUP BY T1.YEAR HAVING Div1 != 0 |
What is the unit of measuerment of the product category code "Herbs"? | SELECT unit_of_measure FROM ref_product_categories WHERE product_category_code = "Herbs" |
Which Surface had an Opponent of chris evert-lloyd? | SELECT surface FROM table_name_45 WHERE opponent = "chris evert-lloyd" |
Find the average salary of the professors of each department? | SELECT avg ( salary ) , dept_name FROM instructor GROUP BY dept_name |
What are all the section titles of the document named "David CV"? | SELECT t2.section_title FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code WHERE t1.document_name = "David CV" |
What is the most popular first name of the actors? | SELECT first_name FROM actor GROUP BY first_name ORDER BY count(*) DESC LIMIT 1 |
How much space does page 1 of the menu "Zentral Theater Terrace" cover? | SELECT T2.full_height * T2.full_width FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id WHERE T1.name = 'Zentral Theater Terrace' AND T2.page_number = 1 |
Give the number of "drive-thru" businesses in "Scottsdale" with business ID number less than "1000". | SELECT T2.business_id FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id WHERE T3.business_id < 1000 AND T3.city LIKE 'Scottsdale' AND T1.attribute_name LIKE 'Drive-Thru' AND T2.attribute_value LIKE 'TRUE' |
WHAT ARE THE NAMES OF AIRCRAFT WHICH FEWEST PEOPLE HAVE ITS CERTIFICATE | SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid GROUP BY T1.aid ORDER BY count ( * ) ASC LIMIT 1 |
What are the task details, task id and project id for the projects which are detailed as 'omnis' or have more than 2 outcomes? | SELECT T1.task_details , T1.task_id , T2.project_id FROM Tasks AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id WHERE T2.project_details = 'omnis' UNION SELECT T1.task_details , T1.task_id , T2.project_id FROM Tasks AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id JOIN Project_outcomes AS T3 ON T2.project_id = T3.project_id GROUP BY T2.project_id HAVING count(*) > 2 |
I'm looking for the things with Close status before 2017-06-19 02:59:21 | Do you want things that satisfy both criteria or at least at of them? And do you want the ids or other? | I want the number of things in a close status | SELECT count ( distinct thing_id ) from Timed_Status_of_Things WHERE Status_of_Thing_Code = "Close" |
How many regions do we have? | SELECT COUNT(*) FROM region |
Please list the top 3 countries with the highest inflation rate. | SELECT T1.Name FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country ORDER BY T2.Inflation DESC LIMIT 3 |
what location are the clemson teams? | SELECT t1.location FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id WHERE team_name = 'Clemson' |
What award was nominated in 2007? | SELECT award FROM table_name_76 WHERE result = "nominated" AND year = 2007 |
How many research assistants of Ogdon Zywicki have an average salary? | SELECT COUNT(T1.prof_id) FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id WHERE T2.first_name = 'Ogdon' AND T1.salary = 'med' AND T2.last_name = 'Zywicki' |
Hmm, please tell me the course ids that do not have any prerequisite. | SELECT course_id FROM course EXCEPT SELECT course_id FROM prereq |
For the model/engine of 1.8 Duratec HE, what is the torque? | SELECT torque__nm__rpm FROM table_1212189_1 WHERE model_engine = "1.8 Duratec HE" |
What is the description of the color used by least products? | SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code GROUP BY t2.color_description ORDER BY count(*) ASC LIMIT 1 |
Name the casualities for kabul area | SELECT casualties FROM table_name_74 WHERE location = "kabul area" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.