sentence
stringlengths 3
347
| sql
stringlengths 18
804
|
---|---|
Tell me the category for result of won and year more than 2009 | SELECT category FROM table_name_77 WHERE result = "won" AND year > 2009 |
what is the most recent year for a ligier gitanes blondes | SELECT MAX(year) FROM table_name_84 WHERE entrant = "ligier gitanes blondes" |
What is the description of document status code 'working'? | SELECT document_status_description FROM Ref_Document_Status WHERE document_status_code = "working"; |
What are the room name and base price of the room with the lowest base price? | SELECT roomName , basePrice FROM Rooms ORDER BY basePrice ASC LIMIT 1; |
On which date did episode # 18 air in the U.S.? | SELECT us_air_date FROM table_26464364_1 WHERE _number = 18 |
Name the hits for years before 1883 | SELECT hits FROM table_name_86 WHERE year < 1883 |
How many users are there in the Home Decoration category? | SELECT COUNT(T1.app_id) FROM app_labels AS T1 INNER JOIN label_categories AS T2 ON T2.label_id = T1.label_id WHERE T2.category = 'Home Decoration' |
How many proteins are associated with an institution founded after 1880 or an institution with type "Private"? | SELECT count(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id WHERE T1.founded > 1880 OR T1.type = 'Private' |
Which game did Bruesa GBC play in with fewer than 275 rebounds that is ranked less than 4? | SELECT SUM(games) FROM table_name_80 WHERE rank < 4 AND rebounds < 275 AND team = "bruesa gbc" |
What is the played number with points 1 is 80, and goals for is more than 77? | SELECT COUNT(played) FROM table_name_57 WHERE points_1 = "80" AND goals_for > 77 |
Give the id of "Center for World University Rankings". | SELECT id FROM ranking_system WHERE system_name = 'Center for World University Rankings' |
What is the rank of london borough in southwark? | SELECT rank FROM table_19149550_7 WHERE london_borough = "Southwark" |
create a table with a column for department id and a column for department name | select DEPARTMENT_ID,DEPARTMENT_NAME from departments |
Name the incelandic of the glossary for 218 | SELECT the_icelandic_of_the_glossary FROM table_13003460_1 WHERE word_number = "218" |
Show name, country, age for all singers ordered by age from the oldest to the youngest. | SELECT name , country , age FROM singer ORDER BY age DESC |
what is the heat when the athlete is anita pistone? | SELECT SUM(heat) FROM table_name_89 WHERE athlete = "anita pistone" |
What is the first name of every student who has a dog but does not have a cat? | SELECT T1.fname , T1.age FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'dog' AND T1.stuid NOT IN (SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid = T2.stuid JOIN pets AS T3 ON T3.petid = T2.petid WHERE T3.pettype = 'cat') |
Find the number of customers in total. | SELECT count(*) FROM customers |
What is the away team at corio oval? | SELECT away_team FROM table_name_26 WHERE venue = "corio oval" |
What is the result of the qf round? | SELECT result FROM table_21350934_2 WHERE round = "QF" |
How many students have cat allergies? | SELECT COUNT(*) FROM Has_allergy WHERE Allergy = "Cat" |
What is the name of the media type that is least common across all tracks? | SELECT T1.Name FROM MEDIATYPE AS T1 JOIN TRACK AS T2 ON T1.MediaTypeId = T2.MediaTypeId GROUP BY T2.MediaTypeId ORDER BY COUNT(*) ASC LIMIT 1 |
What is Week, when Semi Finalists is Sandrine Testud Yone Kamio? | SELECT week_of FROM table_name_53 WHERE semi_finalists = "sandrine testud yone kamio" |
How many people were in attendance on the game on April 8, 2007? | SELECT attendance FROM table_name_15 WHERE date = "april 8, 2007" |
What is the date of the label Alfa records, a CD format, and an alca-9201 catalog? | SELECT date FROM table_name_16 WHERE label = "alfa records" AND format = "cd" AND catalog = "alca-9201" |
Please give me a list of cities whose regional population is over 8000000 or under 5000000. | SELECT city FROM city WHERE regional_population > 10000000 UNION SELECT city FROM city WHERE regional_population < 5000000 |
Is Jasper being producted? | SELECT in_production FROM table_name_66 WHERE codename = "jasper" |
Which Ranking has a Season of 2009? | SELECT ranking FROM table_name_14 WHERE season = "2009" |
What is the University of Southern California's highest Round? | SELECT MAX(round) FROM table_name_92 WHERE school = "university of southern california" |
What is the second team's name in the match with the lowest winning margin? | SELECT T1.team_name FROM Team AS T1 INNER JOIN Match AS T2 ON T1.team_id = T2.team_2 ORDER BY T2.win_margin LIMIT 1 |
Among the books ordered by Lucas Wyldbore, how many of them are over 300 pages? | SELECT COUNT(*) FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id INNER JOIN cust_order AS T3 ON T3.order_id = T2.order_id INNER JOIN customer AS T4 ON T4.customer_id = T3.customer_id WHERE T4.first_name = 'Lucas' AND T4.last_name = 'Wyldbore' AND T1.num_pages > 300 |
In the 2010 season what club has 0 goals and more than 0 Apps? | SELECT club FROM table_name_43 WHERE goals = 0 AND apps > 0 AND season = "2010" |
Which Week has a TV Time of cbs 1:00pm, and an Attendance of 72,714? | SELECT week FROM table_name_44 WHERE tv_time = "cbs 1:00pm" AND attendance = "72,714" |
Which vocal type did the musician with first name "Solveig" played in the song with title "A Bar in Amsterdam"? | SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid JOIN band AS T3 ON T1.bandmate = T3.id WHERE T3.firstname = "Solveig" AND T2.title = "A Bar In Amsterdam" |
What is the Name of the Historic House of the 18th Century? | SELECT name FROM table_name_79 WHERE type = "historic house" AND date = "18th century" |
For the repository which got '8094' Stars, how many solutions does it contain? | SELECT COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Stars = 8094 |
What is the total number of electorates (2009) for Katol? | SELECT COUNT(number_of_electorates__2009_) FROM table_name_57 WHERE name = "katol" |
Which staff handled payments? | SELECT * FROM staff |
Which city has most number of departing flights? | SELECT T1.City FROM AIRPORTS AS T1 JOIN FLIGHTS AS T2 ON T1.AirportCode = T2.SourceAirport GROUP BY T1.City ORDER BY count(*) DESC LIMIT 1 |
What's the song of artist liam reilly? | SELECT song FROM table_name_8 WHERE artist = "liam reilly" |
find the code of the country where has the greatest number of players. | SELECT country_code FROM players GROUP BY country_code ORDER BY count(*) DESC LIMIT 1 |
Which college has a Pick # 1, Overall more than one, and Round is 7? | SELECT college FROM table_name_34 WHERE pick__number = 1 AND overall > 1 AND round = 7 |
How many Bangladeshi artists are listed? | SELECT count(*) FROM artist WHERE country = "Bangladesh" |
whats the average age of the hosts? | SELECT avg ( age ) FROM HOST |
Who won the Mixed Doubles in 2007? | SELECT mixed_doubles FROM table_name_49 WHERE year = "2007" |
Which batter has the last name Graham? | SELECT bats FROM table_name_61 WHERE surname = "graham" |
What was the result for director Fernando Meirelles | SELECT result FROM table_15277629_1 WHERE director = "Fernando Meirelles" |
Who was the coach in 1953? | SELECT coach FROM table_name_19 WHERE year = "1953" |
What are the types of the ships that have both shiips with tonnage more than 6000 and those with tonnage less than 4000? | SELECT TYPE FROM ship WHERE Tonnage > 6000 INTERSECT SELECT TYPE FROM ship WHERE Tonnage < 4000 |
Find the names of songs whose genre is modern or language is English. | SELECT song_name FROM song WHERE genre_is = "modern" OR languages = "english" |
What is the location code for the country "Canada"? | SELECT location_code FROM Ref_locations WHERE location_name = "Canada" |
What is the highest Km From Kingston, when Mi From Kingston is less than 108, and when Length Meters is 260.6? | SELECT MAX(km_from_kingston) FROM table_name_61 WHERE mi_from_kingston < 108 AND length_meters = 260.6 |
What are the distinct types of the companies that have operated any flights with velocity less than 200? | SELECT DISTINCT T1.type FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id WHERE T2.velocity < 200 |
Please list any three episodes that have an excellent rating. | SELECT title FROM Episode WHERE rating BETWEEN 7 AND 10 LIMIT 3; |
What building has a gym? | Do you mean the building ids of buildings with apartments that have gyms? | Yes please. | SELECT T2.building_id FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.facility_code = "Gym" |
What is the score when parkgate is at home? | SELECT score FROM table_name_38 WHERE home_team = "parkgate" |
From 1960 to 1965, which country has the lowest value of indicator belongs to Health: Population: Structure? | SELECT CountryName FROM Indicators WHERE Value = ( SELECT MIN(T1.Value) FROM Indicators AS T1 INNER JOIN Series AS T2 ON T1.IndicatorName = T2.IndicatorName WHERE T1.Year >= 1960 AND T1.Year < 1966 AND T2.Topic = 'Health: Population: Structure' ) |
Find the names of the swimmers who have both "win" and "loss" results in the record. | SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Win' INTERSECT SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Loss' |
how many staff are gender 1? | select count ( * ) from staff where gender = 1 |
What percentage of streets named 11th Street are in Alameda County? | SELECT CAST(SUM(IIF(T1.street_name = '11th st', 1, 0)) AS REAL) * 100 / COUNT(T1.id_restaurant) FROM location AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T2.County = 'alameda county' |
Which artist has the most albums? | SELECT T2.Name FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId GROUP BY T2.Name ORDER BY COUNT ( * ) DESC LIMIT 1 |
what is the sum of goals for when the position is less than 8, the losses is less than 10 the goals against is less than 35 and played is less than 38? | SELECT SUM(goals_for) FROM table_name_50 WHERE position < 8 AND losses < 10 AND goals_against < 35 AND played < 38 |
What is the Theme Song of Iryu -Team Medical Dragon-2? | SELECT theme_song_s_ FROM table_name_23 WHERE romaji_title = "iryu -team medical dragon-2" |
What is the maximum and minimum grade point of students who live in NYC? | SELECT max(T2.gradepoint) , min(T2.gradepoint) FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID WHERE T3.city_code = "NYC" |
What are the names of those airports? | SELECT name FROM airport WHERE id NOT IN ( SELECT airport_id FROM flight WHERE pilot = 'Thompson' ) |
What is the attendance of the match with rosso kumamoto as the away team? | SELECT attendance FROM table_name_82 WHERE away_team = "rosso kumamoto" |
Tell me the lowest ties played with a debut of 1936 | SELECT MIN(ties_played) FROM table_name_15 WHERE debut = 1936 |
How much Voltage (kV) has a Country of argentina, and a Power (MW) larger than 30, and a Supply point of yacyretá? | SELECT COUNT(voltage__kv_) FROM table_name_44 WHERE country = "argentina" AND power__mw_ > 30 AND supply_point = "yacyretá" |
When the team Heathmere of the South West DFL won more than 11 games, what is the maximum byes? | SELECT MAX(byes) FROM table_name_38 WHERE south_west_dfl = "heathmere" AND wins > 11 |
Show the players and years played for players from team "Columbus Crew". | SELECT T1.Player , T1.Years_Played FROM player AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = "Columbus Crew" |
What college or league did the round 2 pick with d position come from? | SELECT college_junior_club_team__league_ FROM table_name_12 WHERE round = 2 AND position = "d" |
What are the ratingDate of mID 101? | SELECT ratingDate FROM Rating WHERE mID = 101 |
Who were Petrova's opponents with Vania King? | SELECT opponents FROM table_27611593_5 WHERE partner = "Vania King" |
Which type of song did miriam yeung sing? | SELECT kind_of_the_song FROM table_name_66 WHERE singer = "miriam yeung" |
Show me all the restaurants. | SELECT ResName FROM Restaurant |
What was the actual attendance in number? | What do you mean by actual attendance | The attendance in home games for Altoona Mountain City | SELECT sum ( T1.attendance ) FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id group by T1.team_id ORDER BY sum ( T1.attendance ) asc limit 1 |
what is the city of Janessa | SELECT T1.city from addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = "Janessa" |
What was the average number of people born in other EU states in millions, when the total number of foreign-born people in millions was 0.5, and when the total population in millions was less than 5.534? | SELECT AVG(born_in_other_eu_state__millions_) FROM table_name_57 WHERE total_foreign_born__millions_ = 0.5 AND total_population__millions_ < 5.534 |
What are the names of games that were released in 2007? | SELECT T3.game_name FROM game_platform AS T1 INNER JOIN game_publisher AS T2 ON T1.game_publisher_id = T2.id INNER JOIN game AS T3 ON T2.game_id = T3.id WHERE T1.release_year = 2007 |
Which driver for Maserati has more laps than 23 and a grid greater than 7? | SELECT driver FROM table_name_61 WHERE constructor = "maserati" AND laps > 23 AND grid > 7 |
Identify the top customer of the store located in Gilbert, Arizona based on net profit associated with the customer relationship in 2019. | SELECT T1.`Customer Names` FROM Customers AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._CustomerID = T1.CustomerID INNER JOIN `Store Locations` AS T3 ON T3.StoreID = T2._StoreID WHERE T3.`City Name` = 'Gilbert' AND T2.ProcuredDate LIKE '%/%/19' ORDER BY REPLACE(T2.`Unit Price`, ',', '') - REPLACE(T2.`Unit Cost`, ',', '') DESC LIMIT 1 |
and the product ID that was ordered least often? | SELECT product_id FROM order_items GROUP BY product_id ORDER BY count ( * ) LIMIT 1 |
Which Giro di Lombardia has a Paris–Roubaix of servais knaven ( ned )? | SELECT giro_di_lombardia FROM table_name_38 WHERE paris_roubaix = "servais knaven ( ned )" |
What years did Eddie Hughes play for the Jazz? | SELECT years_for_jazz FROM table_name_53 WHERE player = "eddie hughes" |
Name the engine for year less than 1977 | SELECT engine FROM table_name_76 WHERE year < 1977 |
How many American food restaurants are unpopular in Carmel? | SELECT COUNT(id_restaurant) FROM generalinfo WHERE food_type = 'american' AND city = 'carmel' AND review = ( SELECT MIN(review) FROM generalinfo WHERE food_type = 'american' AND city = 'carmel' ) |
What city does Zach live in? | select city from person where name = "Zach" |
Now please list all colleges that have enrollment higher than the average. | LSU, OU, and FSU have enrollment higher than the average. | Please list the states where LSU, OU, and FSU are located. | SELECT DISTINCT state FROM college WHERE enr > ( SELECT avg ( enr ) FROM college ) |
What is the Lead when the Second was marc kennedy, in the 2012–13 season? | SELECT lead FROM table_name_66 WHERE second = "marc kennedy" AND season = "2012–13" |
What is the average base price of different bed type? List bed type and average base price. | SELECT bedType , avg(basePrice) FROM Rooms GROUP BY bedType; |
Which cohort had the higher percentage of students who graduated from Central Alabama Community College in 2011 within 150 percent of normal/expected time, female White students or male White students? | SELECT IIF(SUM(CASE WHEN T2.gender = 'F' THEN T2.grad_150 ELSE 0 END) > SUM(CASE WHEN T2.gender = 'M' THEN T2.grad_150 ELSE 0 END), 'female White students', 'male White students') FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.chronname = 'Central Alabama Community College' AND T2.year = 2011 AND T2.race = 'W' |
What is the lowest position for bruce taylor? | SELECT MIN(position) FROM table_name_6 WHERE pilot = "bruce taylor" |
What are the carriers of devices that are not in stock anywhere? | SELECT Carrier FROM device WHERE Device_ID NOT IN (SELECT Device_ID FROM stock) |
What nations are considered British Overseas Territories? | SELECT name FROM country WHERE CODE IN ( SELECT country FROM politics WHERE government = 'British Overseas Territories' ) |
Find names and ids of all documents with document type code BK. | SELECT document_name , document_id FROM Documents WHERE document_type_code = "BK" |
Great, what is the average number of followers for everyone in the data set? | SELECT avg ( followers ) FROM user_profiles |
What was Min Patel's bowling? | SELECT bowling FROM table_name_7 WHERE player = "min patel" |
Among the countries with note on the series code SM.POP.TOTL, how many of them are in the low-income group? | SELECT COUNT(T1.Countrycode) FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.Seriescode = 'SM.POP.TOTL' AND T1.IncomeGroup = 'Low income' |
What are the ages of Zach's friends? | SELECT t1.name,friend,year,age from PersonFriend as t1 join Person as t2 on t1.friend = t2.name
where t1.name = 'Zach' |
Could you please tell me the names on all accounts in the bank? | SELECT name from ACCOUNTS |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.