sentence
stringlengths
3
347
sql
stringlengths
18
804
What is the ratio of the number of app users that belong to the Securities category to the number of app users that belong to the Finance category?
SELECT SUM(IIF(T2.category = 'Securities', 1, 0)) / SUM(IIF(T2.category = 'Finance', 1, 0)) AS per FROM app_labels AS T1 INNER JOIN label_categories AS T2 ON T1.label_id = T2.label_id
Can you show me the corresponding party id and host id to each theme?
SELECT T1.party_id , T1.host_id, T3.party_theme FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID
What is the average duration of songs that have mp3 format and resolution below 800?
SELECT avg(T1.duration) FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.formats = "mp3" AND T2.resolution < 800
Who was the entrant before 1988?
SELECT entrant FROM table_name_41 WHERE year < 1988
Among the calls from California, what percentage are priority 1?
SELECT CAST(SUM(CASE WHEN T1.priority = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.priority) FROM callcenterlogs AS T1 INNER JOIN client AS T2 ON T1.`rand client` = T2.client_id INNER JOIN district AS T3 ON T2.district_id = T3.district_id INNER JOIN state AS T4 ON T3.state_abbrev = T4.StateCode WHERE T4.State = 'California'
Please show different types of artworks with the corresponding number of artworks of each type.
SELECT TYPE, COUNT(*) FROM artwork GROUP BY TYPE
Show all director names who have a movie in the year 1999 or 2000.
SELECT director FROM movie WHERE YEAR = 1999 OR YEAR = 2000
How many contestants did not get voted?
SELECT COUNT(*) FROM contestants WHERE NOT contestant_number IN (SELECT contestant_number FROM votes)
What company collaborated in SBI-087 for rheumatoid arthritis?
SELECT collaboration FROM table_name_7 WHERE name = "sbi-087" AND indication = "rheumatoid arthritis"
What is the earliest year that the discus throw event occur?
SELECT MIN(year) FROM table_name_2 WHERE event = "discus throw"
March 0.41 in July?
SELECT july FROM table_15945862_1 WHERE march = "0.41"
Show each student's first name and last name.
SELECT DISTINCT firstname , lastname FROM list
Show all headquarters without a company in banking industry.
SELECT headquarters FROM company EXCEPT SELECT headquarters FROM company WHERE main_industry = 'Banking'
List down the labels' IDs and categories of the app ID "5758400314709850000".
SELECT T1.label_id, T2.category FROM app_labels AS T1 INNER JOIN label_categories AS T2 ON T1.label_id = T2.label_id WHERE T1.app_id = 5758400314709850000
List the directors of movies that feature a song.
SELECT T2.director FROM characters AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE T1.song IS NOT NULL GROUP BY T2.director
Which line is the Geumjeong tunnel?
SELECT line FROM table_name_82 WHERE name = "geumjeong tunnel"
Which airports do not have departing or arriving flights?
SELECT AirportName FROM Airports WHERE AirportCode NOT IN (SELECT SourceAirport FROM Flights UNION SELECT DestAirport FROM Flights)
What are the different names for each station that has ever had 7 bikes available?
SELECT DISTINCT T1.name FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id WHERE T2.bikes_available = 7
What is the earliest season with an advertising account manager profile?
SELECT MIN(season) FROM table_name_38 WHERE profile = "advertising account manager"
Where was the former private member that was founded in 1891 and left in 1975?
SELECT location FROM table_name_98 WHERE left = 1975 AND type = "private" AND founded = 1891
What is the maximum page size for everything that has more than 3 products listed?
SELECT max_page_size FROM product GROUP BY max_page_size HAVING count(*) > 3
How many movies are in the list?
SELECT count ( * ) FROM Movie
Score F–A of 3–0, and a Date of 31 july 2007 had what opponents?
SELECT opponents FROM table_name_13 WHERE score_f_a = "3–0" AND date = "31 july 2007"
When was the most recent game that he partnered with nicklas kulti and they scored 3–6, 7–6, 6–4?
SELECT MAX(date) FROM table_name_19 WHERE partner = "nicklas kulti" AND score = "3–6, 7–6, 6–4"
What other companies are located in Corporativo BBVA Bancomer?
SELECT T3.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 where T2.name = "Corporativo BBVA Bancomer" and T3.name ! = "General Electric"
Hello Yes, I'm interested to know which college has two players
SELECT College FROM match_season GROUP BY College HAVING count ( * ) = 2
Where was the cup on 07.02.2009 held?
SELECT location FROM table_20462111_1 WHERE date = "07.02.2009"
Which name has notes b and the game of tennis?
SELECT name FROM table_name_13 WHERE sport = "tennis" AND notes = "b"
What Dutch word has the same meaning as the Greek word πλέω (pléō)?
SELECT dutch FROM table_name_1 WHERE greek = "πλέω (pléō)"
Age and sex of Smith Linda? | The age and sex of the student whose last name is Smith and first name is Linda are 18 and F respectively. | What type of game is 'The Vanishing of Eric Calder'?
SELECT GType from Video_games where GName = 'The Vanishing of Eric Calder'
Provide the name, model, sweep volume, and introduced year of the car with the best crash protection.
SELECT T1.car_name, T1.model, T1.displacement / T1.cylinders, T2.model_year FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID ORDER BY T1.weight DESC LIMIT 1
Show the institution type with an institution founded after 1990 and an institution with at least 1000 enrollment.
SELECT TYPE FROM institution WHERE founded > 1990 AND enrollment >= 1000
Wat episode number had 5.46 million viewers?
SELECT episode__number FROM table_27846651_1 WHERE viewers__millions_ = "5.46"
Which operating system did the client End user, ISP have?
SELECT Operating_system FROM web_client_accelerator WHERE client = 'End user, ISP'
What is the theme, date, and attendance for the exhibition in year 2004?
SELECT T2.theme , T1.date , T1.attendance FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T2.year = 2004
What is City, when IATA is "LAO"?
SELECT city FROM table_name_75 WHERE iata = "lao"
What is the total laps for grid 19?
SELECT COUNT(laps) FROM table_name_24 WHERE grid = 19
And what is his occupation?
SELECT occupation from player WHERE Player_name LIKE "Jim%"
Hiw many losses have 30 for the goals with points greater than 24?
SELECT COUNT(losses) FROM table_name_71 WHERE goals_for = 30 AND points > 24
Which Year is the highest one that has a Next Highest Spender of aarp, and a US Cham Spending of $39,805,000, and a US Cham Rank larger than 1?
SELECT MAX(year) FROM table_name_16 WHERE next_highest_spender = "aarp" AND us_cham_spending = "$39,805,000" AND us_cham_rank > 1
what are the different address type?
SELECT DISTINCT address_type FROM customer_addresses
Which GNU/Linux had no haiku and a client of airdc++?
SELECT gnu_linux FROM table_name_60 WHERE haiku = "no" AND client = "airdc++"
Return the account details with the greatest value, as well as those that include the character 5.
SELECT max(Account_details) FROM Accounts UNION SELECT Account_details FROM Accounts WHERE Account_details LIKE "%5%"
Among undergraduate students, list the name of the course with the highest student satisfaction.
SELECT T3.name FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T1.type = 'UG' ORDER BY T2.sat DESC LIMIT 1
How many womens doubles had champions the years broddi kristjánsson drífa harðardóttir won mixed doubles
SELECT COUNT(womens_doubles) FROM table_14903999_1 WHERE mixed_doubles = "Broddi Kristjánsson Drífa Harðardóttir"
How many cars are there on train no.1?
SELECT COUNT(id) FROM cars WHERE train_id = 1
What competition has a result of W on June 30, 1966?
SELECT competition FROM table_name_31 WHERE result = "w" AND date = "june 30, 1966"
What is the most widely used shipping company in the United States of America?
SELECT T2.CompanyName FROM Orders AS T1 INNER JOIN Shippers AS T2 ON T1.ShipVia = T2.ShipperID WHERE T1.ShipCountry = 'USA' GROUP BY T2.CompanyName ORDER BY COUNT(T2.CompanyName) DESC LIMIT 1
What was the record on November 1?
SELECT record FROM table_17288869_5 WHERE date = "November 1"
What are the names of the campus that have more faculties in 2002 than the maximum number in Orange county?
SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND faculty > (SELECT max(faculty) FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND T1.county = "Orange")
What are the names of the songs whose rating is below the rating of all songs in English?
SELECT song_name FROM song WHERE rating < (SELECT min(rating) FROM song WHERE languages = 'english')
What is the top speed of a 4-speed automatic with production in 2002-2005?
SELECT top_speed FROM table_1857216_1 WHERE transmission = "4-speed automatic" AND production = "2002-2005"
What address was the document with id 4 mailed to?
SELECT Addresses.address_details FROM Addresses JOIN Documents_Mailed ON Documents_Mailed.mailed_to_address_id = Addresses.address_id WHERE document_id = 4;
What Event is at the Time 1:16?
SELECT event FROM table_name_70 WHERE time = "1:16"
What is the pick number for the player(s) drafted in round 8?
SELECT pick__number FROM table_name_31 WHERE round = "round 8"
What are the different reviewer names, movie titles, and stars for every rating where the reviewer had the same name as the director?
SELECT DISTINCT T3.name , T2.title , T1.stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T2.director = T3.name
What are all the different food allergies?
SELECT DISTINCT allergy FROM Allergy_type WHERE allergytype = "food"
What are the countries of perpetrators? Show each country and the corresponding number of perpetrators there.
SELECT Country , COUNT(*) FROM perpetrator GROUP BY Country
List down the keyword and crew member's name for episode id S20-E1.
SELECT T1.keyword, T2.person FROM Keyword AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.episode_id = 'S20-E1';
Who is the player with a score of 68-71=139?
SELECT player FROM table_name_84 WHERE score = 68 - 71 = 139
Write down the ID, active status and city of the business which are in CA state.
SELECT business_id, active, city FROM Business WHERE state = 'CA' AND active = 'true'
Who is the person whose age is below 30?
SELECT name FROM Person WHERE age < 30
Among the competitors of the 1994 Winter Olympic Game, what is the percentage of those from Finland?
SELECT CAST(COUNT(CASE WHEN T5.region_name = 'Finland' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T3.id) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id INNER JOIN person_region AS T4 ON T3.id = T4.person_id INNER JOIN noc_region AS T5 ON T4.region_id = T5.id WHERE T1.games_name = '1994 Winter'
Show the name of the sport with the most events.
SELECT T1.sport_name FROM sport AS T1 INNER JOIN event AS T2 ON T1.id = T2.sport_id GROUP BY T1.sport_name ORDER BY COUNT(T2.event_name) DESC LIMIT 1
What is the lowest against for games played in the stade colombes, paris venue?
SELECT MIN(against) FROM table_name_51 WHERE venue = "stade colombes, paris"
What was the nationality of the player ranking 3?
SELECT nationality FROM table_name_13 WHERE ranking = "3"
List the names of people that are not perpetrators.
SELECT Name FROM people WHERE People_ID NOT IN (SELECT People_ID FROM perpetrator);
What date is the record 4-3-0?
SELECT date FROM table_name_94 WHERE record = "4-3-0"
Find the average age of students who live in the city with code "NYC" and have secretary votes in the spring election cycle.
SELECT AVG(T1.Age) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = SECRETARY_Vote WHERE T1.city_code = "NYC" AND T2.Election_Cycle = "Spring"
How many cars were released in the USA in 1981?
SELECT COUNT(*) FROM production AS T1 INNER JOIN country AS T2 ON T1.country = T2.origin WHERE T2.country = 'USA' AND T1.model_year = 1981
How many losses have points against less than 15?
SELECT COUNT(lost) FROM table_name_1 WHERE against < 15
Name the Venue which has a Score of 8 – 1?
SELECT venue FROM table_name_61 WHERE score = "8 – 1"
What is the margin of victory when the tournament is konica san jose classic?
SELECT margin_of_victory FROM table_name_23 WHERE tournament = "konica san jose classic"
how many screen modes on the table
select count ( * ) from screen_mode
What nationality is mark eaton, center position?
SELECT nationality FROM table_name_51 WHERE position = "center" AND player = "mark eaton"
Show the maximum share count of transactions where the amount is smaller than 10000
SELECT max(share_count) FROM TRANSACTIONS WHERE amount_of_transaction < 10000
Describe category name which had above 10% in comparing with all business and categories.
SELECT T1.category_name FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id GROUP BY T2.category_id HAVING COUNT(T2.business_id) > ( SELECT COUNT(T3.business_id) FROM Business_Categories AS T3 ) * 0.1
Name the Report has a Name of lyon grand prix?
SELECT report FROM table_name_70 WHERE name = "lyon grand prix"
What is the Time/Retired for less than 52 laps in grid 19?
SELECT time_retired FROM table_name_52 WHERE laps < 52 AND grid = 19
Who was the Manchester performer of Lisa Davina Phillip's character?
SELECT original_manchester_performer FROM table_22460085_1 WHERE original_west_end_performer = "Lisa Davina Phillip"
Who was the director of the film with the original title of "The Patience Stone"?
SELECT director FROM table_17155250_1 WHERE original_title = "The Patience Stone"
Among the users who uses a vivo device, how many of them are female and under 30?
SELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.gender = 'F' AND T2.phone_brand = 'vivo' AND T1.age < 30
how many student of there
SELECT count ( * ) from student
Which Record has a Score of 105-115?
SELECT record FROM table_name_91 WHERE score = "105-115"
Who drove the dodge with a car # less than 5?
SELECT driver FROM table_name_42 WHERE car__number < 5 AND make = "dodge"
What is the area of drummond village?
SELECT MAX(area_km_2) FROM table_name_45 WHERE status = "village" AND official_name = "drummond"
When the match lasted 2:16 how was it decided?
SELECT method FROM table_name_12 WHERE time = "2:16"
What are the meanings of the flag whose name transliterates to dvojka?
SELECT meaning FROM table_29997112_3 WHERE transliteration = "dvojka"
Which opponent had 38,642 attendance?
SELECT opponent FROM table_name_69 WHERE attendance = "38,642"
What is the name, address, and number of students in the departments that have the 3 most students?
SELECT T2.dept_name , T2.dept_address , count(*) FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY count(*) DESC LIMIT 3
From 1962 to 2011, how many coaches received both NBA and ABA awards?
SELECT COUNT(DISTINCT coachID) FROM awards_coaches WHERE year BETWEEN 1962 AND 2011 AND award = 'ABA Coach of the Year' AND coachID IN ( SELECT coachID FROM awards_coaches WHERE year BETWEEN 1962 AND 2011 AND award = 'NBA Coach of the Year' )
How many wins did he have when he had $95,180 in winnings?
SELECT COUNT(wins) FROM table_2216245_2 WHERE winnings = "$95,180"
Than what is it's typical selling price?
SELECT typical_selling_price FROM products where product_name = "laurel"
What is the lowest attendance on October 3, 1965?
SELECT MIN(attendance) FROM table_name_17 WHERE date = "october 3, 1965"
What is the name of the ship with the largest tonnage?
SELECT Name FROM ship ORDER BY Tonnage DESC LIMIT 1
Tell me the least amount of democratic colation
SELECT MIN(democratic_coalition) FROM table_15306124_1
What is the birth place for someone elevated by Lucius III, and has the Cardinalatial title of Deacon of S. Giorgio in Velabro?
SELECT place_of_birth FROM table_name_65 WHERE elevator = "lucius iii" AND cardinalatial_title = "deacon of s. giorgio in velabro"
Flags of ships not steered by any captain with Midshipman rank?
SELECT flag FROM ship WHERE ship_id NOT IN ( SELECT ship_id FROM captain WHERE rank = 'Midshipman' )
What is the id and detail of the vehicle used in lessons for most of the times?
SELECT T1.vehicle_id , T1.vehicle_details FROM Vehicles AS T1 JOIN Lessons AS T2 ON T1.vehicle_id = T2.vehicle_id GROUP BY T1.vehicle_id ORDER BY count(*) DESC LIMIT 1
What is the name of the most followed list?
SELECT list_title FROM lists ORDER BY list_followers DESC LIMIT 1