Question:
Show the names for all females from Canada having a wedding in year 2016.
Additional table information: table: wedding

Answer: SELECT T2.name FROM wedding AS T1 JOIN people AS T2 ON T1.female_id = T2.people_id WHERE T1.year = 2016 AND T2.is_male = 'F' AND T2.country = 'Canada'


Question:
How many weddings are there in year 2016?
Additional table information: table: wedding

Answer: SELECT COUNT(*) FROM wedding WHERE YEAR = 2016


Question:
Show the church names for the weddings of all people older than 30.
Additional table information: table: wedding

Answer: SELECT T4.name FROM wedding AS T1 JOIN people AS T2 ON T1.male_id = T2.people_id JOIN people AS T3 ON T1.female_id = T3.people_id JOIN church AS T4 ON T4.church_id = T1.church_id WHERE T2.age > 30 OR T3.age > 30


Question:
Show all countries and the number of people from each country.
Additional table information: table: wedding

Answer: SELECT country, COUNT(*) FROM people GROUP BY country


Question:
How many churches have a wedding in year 2016?
Additional table information: table: wedding

Answer: SELECT COUNT(DISTINCT church_id) FROM wedding WHERE YEAR = 2016


Question:
How many artists do we have?
Additional table information: table: theme_gallery

Answer: SELECT COUNT(*) FROM artist


Question:
Count the number of artists.
Additional table information: table: theme_gallery

Answer: SELECT COUNT(*) FROM artist


Question:
Show all artist name, age, and country ordered by the yeared they joined.
Additional table information: table: theme_gallery

Answer: SELECT name, age, country FROM artist ORDER BY Year_Join NULLS FIRST


Question:
What are the names, ages, and countries of artists, sorted by the year they joined?
Additional table information: table: theme_gallery

Answer: SELECT name, age, country FROM artist ORDER BY Year_Join NULLS FIRST


Question:
What are all distinct country for artists?
Additional table information: table: theme_gallery

Answer: SELECT DISTINCT country FROM artist


Question:
Return the different countries for artists.
Additional table information: table: theme_gallery

Answer: SELECT DISTINCT country FROM artist


Question:
Show all artist names and the year joined who are not from United States.
Additional table information: table: theme_gallery

Answer: SELECT name, year_join FROM artist WHERE country <> 'United States'


Question:
What are the names and year of joining for artists that do not have the country 'United States'?
Additional table information: table: theme_gallery

Answer: SELECT name, year_join FROM artist WHERE country <> 'United States'


Question:
How many artists are above age 46 and joined after 1990?
Additional table information: table: theme_gallery

Answer: SELECT COUNT(*) FROM artist WHERE age > 46 AND year_join > 1990


Question:
Count the number of artists who are older than 46 and joined after 1990.
Additional table information: table: theme_gallery

Answer: SELECT COUNT(*) FROM artist WHERE age > 46 AND year_join > 1990


Question:
What is the average and minimum age of all artists from United States.
Additional table information: table: theme_gallery

Answer: SELECT AVG(age), MIN(age) FROM artist WHERE country = 'United States'


Question:
Return the average and minimum ages across artists from the United States.
Additional table information: table: theme_gallery

Answer: SELECT AVG(age), MIN(age) FROM artist WHERE country = 'United States'


Question:
What is the name of the artist who joined latest?
Additional table information: table: theme_gallery

Answer: SELECT name FROM artist ORDER BY year_join DESC LIMIT 1


Question:
Return the name of the artist who has the latest join year.
Additional table information: table: theme_gallery

Answer: SELECT name FROM artist ORDER BY year_join DESC LIMIT 1


Question:
How many exhibition are there in year 2005 or after?
Additional table information: table: theme_gallery

Answer: SELECT COUNT(*) FROM exhibition WHERE YEAR >= 2005


Question:
Count the number of exhibitions that happened in or after 2005.
Additional table information: table: theme_gallery

Answer: SELECT COUNT(*) FROM exhibition WHERE YEAR >= 2005


Question:
Show theme and year for all exhibitions with ticket prices lower than 15.
Additional table information: table: theme_gallery

Answer: SELECT theme, YEAR FROM exhibition WHERE ticket_price < 15


Question:
What are the theme and year for all exhibitions that have a ticket price under 15?
Additional table information: table: theme_gallery

Answer: SELECT theme, YEAR FROM exhibition WHERE ticket_price < 15


Question:
Show all artist names and the number of exhibitions for each artist.
Additional table information: table: theme_gallery

Answer: SELECT T2.name, COUNT(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id GROUP BY T1.artist_id


Question:
How many exhibitions has each artist had?
Additional table information: table: theme_gallery

Answer: SELECT T2.name, COUNT(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id GROUP BY T1.artist_id


Question:
What is the name and country for the artist with most number of exhibitions?
Additional table information: table: theme_gallery

Answer: SELECT T2.name, T2.country FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id GROUP BY T1.artist_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
Return the name and country corresponding to the artist who has had the most exhibitions.
Additional table information: table: theme_gallery

Answer: SELECT T2.name, T2.country FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id GROUP BY T1.artist_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
Show names for artists without any exhibition.
Additional table information: table: theme_gallery

Answer: SELECT name FROM artist WHERE NOT artist_id IN (SELECT artist_id FROM exhibition)


Question:
What are the names of artists that have not had any exhibitions?
Additional table information: table: theme_gallery

Answer: SELECT name FROM artist WHERE NOT artist_id IN (SELECT artist_id FROM exhibition)


Question:
What is the theme and artist name for the exhibition with a ticket price higher than the average?
Additional table information: table: theme_gallery

Answer: SELECT T1.theme, T2.name FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id WHERE T1.ticket_price > (SELECT AVG(ticket_price) FROM exhibition)


Question:
Return the names of artists and the themes of their exhibitions that had a ticket price higher than average.
Additional table information: table: theme_gallery

Answer: SELECT T1.theme, T2.name FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id WHERE T1.ticket_price > (SELECT AVG(ticket_price) FROM exhibition)


Question:
Show the average, minimum, and maximum ticket prices for exhibitions for all years before 2009.
Additional table information: table: theme_gallery

Answer: SELECT AVG(ticket_price), MIN(ticket_price), MAX(ticket_price) FROM exhibition WHERE YEAR < 2009


Question:
What are the average, minimum, and maximum ticket prices for exhibitions that happened prior to 2009?
Additional table information: table: theme_gallery

Answer: SELECT AVG(ticket_price), MIN(ticket_price), MAX(ticket_price) FROM exhibition WHERE YEAR < 2009


Question:
Show theme and year for all exhibitions in an descending order of ticket price.
Additional table information: table: theme_gallery

Answer: SELECT theme, YEAR FROM exhibition ORDER BY ticket_price DESC


Question:
What are the themes and years for exhibitions, sorted by ticket price descending?
Additional table information: table: theme_gallery

Answer: SELECT theme, YEAR FROM exhibition ORDER BY ticket_price DESC


Question:
What is the theme, date, and attendance for the exhibition in year 2004?
Additional table information: table: theme_gallery

Answer: 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


Question:
Return the themes, dates, and attendance for exhibitions that happened in 2004.
Additional table information: table: theme_gallery

Answer: 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


Question:
Show all artist names who didn't have an exhibition in 2004.
Additional table information: table: theme_gallery

Answer: SELECT name FROM artist EXCEPT SELECT T2.name FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id WHERE T1.year = 2004


Question:
What are the names of artists who did not have an exhibition in 2004?
Additional table information: table: theme_gallery

Answer: SELECT name FROM artist EXCEPT SELECT T2.name FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id WHERE T1.year = 2004


Question:
Show the theme for exhibitions with both records of an attendance below 100 and above 500.
Additional table information: table: theme_gallery

Answer: 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


Question:
Which themes have had corresponding exhibitions that have had attendance both below 100 and above 500?
Additional table information: table: theme_gallery

Answer: 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


Question:
How many exhibitions have a attendance more than 100 or have a ticket price below 10?
Additional table information: table: theme_gallery

Answer: SELECT COUNT(*) FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T1.attendance > 100 OR T2.ticket_price < 10


Question:
Count the number of exhibitions that have had an attendnance of over 100 or a ticket prices under 10.
Additional table information: table: theme_gallery

Answer: SELECT COUNT(*) FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T1.attendance > 100 OR T2.ticket_price < 10


Question:
Show all artist names with an average exhibition attendance over 200.
Additional table information: table: theme_gallery

Answer: SELECT T3.name FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id JOIN artist AS T3 ON T3.artist_id = T2.artist_id GROUP BY T3.artist_id HAVING AVG(T1.attendance) > 200


Question:
What are the names of artist whose exhibitions draw over 200 attendees on average?
Additional table information: table: theme_gallery

Answer: SELECT T3.name FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id JOIN artist AS T3 ON T3.artist_id = T2.artist_id GROUP BY T3.artist_id HAVING AVG(T1.attendance) > 200


Question:
Find the id of the item whose title is 'orange'.
Additional table information: table: epinions_1

Answer: SELECT i_id FROM item WHERE title = 'orange'


Question:
List all information in the item table.
Additional table information: table: epinions_1

Answer: SELECT * FROM item


Question:
Find the number of reviews.
Additional table information: table: epinions_1

Answer: SELECT COUNT(*) FROM review


Question:
How many users are there?
Additional table information: table: epinions_1

Answer: SELECT COUNT(*) FROM useracct


Question:
Find the average and maximum rating of all reviews.
Additional table information: table: epinions_1

Answer: SELECT AVG(rating), MAX(rating) FROM review


Question:
Find the highest rank of all reviews.
Additional table information: table: epinions_1

Answer: SELECT MIN(rank) FROM review


Question:
How many different users wrote some reviews?
Additional table information: table: epinions_1

Answer: SELECT COUNT(DISTINCT u_id) FROM review


Question:
How many different items were reviewed by some users?
Additional table information: table: epinions_1

Answer: SELECT COUNT(DISTINCT i_id) FROM review


Question:
Find the number of items that did not receive any review.
Additional table information: table: epinions_1

Answer: SELECT COUNT(*) FROM item WHERE NOT i_id IN (SELECT i_id FROM review)


Question:
Find the names of users who did not leave any review.
Additional table information: table: epinions_1

Answer: SELECT name FROM useracct WHERE NOT u_id IN (SELECT u_id FROM review)


Question:
Find the names of goods that receive a rating of 10.
Additional table information: table: epinions_1

Answer: SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating = 10


Question:
Find the titles of items whose rating is higher than the average review rating of all items.
Additional table information: table: epinions_1

Answer: SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating > (SELECT AVG(rating) FROM review)


Question:
Find the titles of items that received any rating below 5.
Additional table information: table: epinions_1

Answer: SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating < 5


Question:
Find the titles of items that received both a rating higher than 8 and a rating below 5.
Additional table information: table: epinions_1

Answer: SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating > 8 INTERSECT SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating < 5


Question:
Find the names of items whose rank is higher than 3 and whose average rating is above 5.
Additional table information: table: epinions_1

Answer: SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rank > 3 INTERSECT SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id GROUP BY T2.i_id HAVING AVG(T2.rating) > 5


Question:
Find the name of the item with the lowest average rating.
Additional table information: table: epinions_1

Answer: SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id GROUP BY T2.i_id ORDER BY AVG(T2.rating) NULLS FIRST LIMIT 1


Question:
List the titles of all items in alphabetic order .
Additional table information: table: epinions_1

Answer: SELECT title FROM item ORDER BY title NULLS FIRST


Question:
Find the name of the user who gives the most reviews.
Additional table information: table: epinions_1

Answer: SELECT T1.name FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id GROUP BY T2.u_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
Find the name and id of the item with the highest average rating.
Additional table information: table: epinions_1

Answer: 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.rating) DESC LIMIT 1


Question:
Find the name and id of the good with the highest average rank.
Additional table information: table: epinions_1

Answer: 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


Question:
For each user, return the name and the average rating of reviews given by them.
Additional table information: table: epinions_1

Answer: SELECT T1.name, AVG(T2.rating) FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id GROUP BY T2.u_id


Question:
For each user, find their name and the number of reviews written by them.
Additional table information: table: epinions_1

Answer: SELECT T1.name, COUNT(*) FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id GROUP BY T2.u_id


Question:
Find the name of the user who gave the highest rating.
Additional table information: table: epinions_1

Answer: SELECT T1.name FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id ORDER BY T2.rating DESC LIMIT 1


Question:
Find the name of the source user with the highest average trust score.
Additional table information: table: epinions_1

Answer: SELECT T1.name FROM useracct AS T1 JOIN trust AS T2 ON T1.u_id = T2.source_u_id GROUP BY T2.source_u_id ORDER BY AVG(trust) DESC LIMIT 1


Question:
Find each target user's name and average trust score.
Additional table information: table: epinions_1

Answer: SELECT T1.name, AVG(trust) FROM useracct AS T1 JOIN trust AS T2 ON T1.u_id = T2.target_u_id GROUP BY T2.target_u_id


Question:
Find the name of the target user with the lowest trust score.
Additional table information: table: epinions_1

Answer: SELECT T1.name FROM useracct AS T1 JOIN trust AS T2 ON T1.u_id = T2.target_u_id ORDER BY trust NULLS FIRST LIMIT 1


Question:
Find the names of the items that did not receive any review.
Additional table information: table: epinions_1

Answer: SELECT title FROM item WHERE NOT i_id IN (SELECT i_id FROM review)


Question:
Find the names of users who did not leave any review.
Additional table information: table: epinions_1

Answer: SELECT name FROM useracct WHERE NOT u_id IN (SELECT u_id FROM review)


Question:
Find the number of users who did not write any review.
Additional table information: table: epinions_1

Answer: SELECT COUNT(*) FROM useracct WHERE NOT u_id IN (SELECT u_id FROM review)


Question:
Find the number of items without any review.
Additional table information: table: epinions_1

Answer: SELECT COUNT(*) FROM item WHERE NOT i_id IN (SELECT i_id FROM review)


Question:
How many players are there?
Additional table information: table: riding_club

Answer: SELECT COUNT(*) FROM player


Question:
List the names of players in ascending order of votes.
Additional table information: table: riding_club

Answer: SELECT Player_name FROM player ORDER BY Votes ASC NULLS FIRST


Question:
What are the gender and occupation of players?
Additional table information: table: riding_club

Answer: SELECT Gender, Occupation FROM player


Question:
List the name and residence for players whose occupation is not 'Researcher'.
Additional table information: table: riding_club

Answer: SELECT Player_name, residence FROM player WHERE Occupation <> 'Researcher'


Question:
Show the names of sponsors of players whose residence is either 'Brandon' or 'Birtle'.
Additional table information: table: riding_club

Answer: SELECT Sponsor_name FROM player WHERE Residence = 'Brandon' OR Residence = 'Birtle'


Question:
What is the name of the player with the largest number of votes?
Additional table information: table: riding_club

Answer: SELECT Player_name FROM player ORDER BY Votes DESC LIMIT 1


Question:
Show different occupations along with the number of players in each occupation.
Additional table information: table: riding_club

Answer: SELECT Occupation, COUNT(*) FROM player GROUP BY Occupation


Question:
Please show the most common occupation of players.
Additional table information: table: riding_club

Answer: SELECT Occupation FROM player GROUP BY Occupation ORDER BY COUNT(*) DESC LIMIT 1


Question:
Show the residences that have at least two players.
Additional table information: table: riding_club

Answer: SELECT Residence FROM player GROUP BY Residence HAVING COUNT(*) >= 2


Question:
Show the names of players and names of their coaches.
Additional table information: table: riding_club

Answer: SELECT T3.Player_name, T2.coach_name FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID


Question:
Show the names of players coached by the rank 1 coach.
Additional table information: table: riding_club

Answer: SELECT T3.Player_name FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID WHERE T2.Rank = 1


Question:
Show the names and genders of players with a coach starting after 2011.
Additional table information: table: riding_club

Answer: SELECT T3.Player_name, T3.gender FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID WHERE T1.Starting_year > 2011


Question:
Show the names of players and names of their coaches in descending order of the votes of players.
Additional table information: table: riding_club

Answer: SELECT T3.Player_name, T2.coach_name FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID ORDER BY T3.Votes DESC


Question:
List the names of players that do not have coaches.
Additional table information: table: riding_club

Answer: SELECT Player_name FROM player WHERE NOT Player_ID IN (SELECT Player_ID FROM player_coach)


Question:
Show the residences that have both a player of gender 'M' and a player of gender 'F'.
Additional table information: table: riding_club

Answer: SELECT Residence FROM player WHERE gender = 'M' INTERSECT SELECT Residence FROM player WHERE gender = 'F'


Question:
How many coaches does each club has? List the club id, name and the number of coaches.
Additional table information: table: riding_club

Answer: SELECT T1.club_id, T1.club_name, COUNT(*) FROM club AS T1 JOIN coach AS T2 ON T1.club_id = T2.club_id GROUP BY T1.club_id


Question:
How many gold medals has the club with the most coaches won?
Additional table information: table: riding_club

Answer: SELECT T1.club_id, T1.gold FROM match_result AS T1 JOIN coach AS T2 ON T1.club_id = T2.club_id GROUP BY T1.club_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
How many gymnasts are there?
Additional table information: table: gymnast

Answer: SELECT COUNT(*) FROM gymnast


Question:
Count the number of gymnasts.
Additional table information: table: gymnast

Answer: SELECT COUNT(*) FROM gymnast


Question:
List the total points of gymnasts in descending order.
Additional table information: table: gymnast

Answer: SELECT Total_Points FROM gymnast ORDER BY Total_Points DESC


Question:
What are the total points for all gymnasts, ordered by total points descending?
Additional table information: table: gymnast

Answer: SELECT Total_Points FROM gymnast ORDER BY Total_Points DESC


Question:
List the total points of gymnasts in descending order of floor exercise points.
Additional table information: table: gymnast

Answer: SELECT Total_Points FROM gymnast ORDER BY Floor_Exercise_Points DESC


Question:
What are the total points of gymnasts, ordered by their floor exercise points descending?
Additional table information: table: gymnast

Answer: SELECT Total_Points FROM gymnast ORDER BY Floor_Exercise_Points DESC


Question:
What is the average horizontal bar points for all gymnasts?
Additional table information: table: gymnast

Answer: SELECT AVG(Horizontal_Bar_Points) FROM gymnast


Question:
Return the average horizontal bar points across all gymnasts.
Additional table information: table: gymnast

Answer: SELECT AVG(Horizontal_Bar_Points) FROM gymnast


Question:
What are the names of people in ascending alphabetical order?
Additional table information: table: gymnast

Answer: SELECT Name FROM People ORDER BY Name ASC NULLS FIRST


Question:
Return the names of people, ordered alphabetically.
Additional table information: table: gymnast

Answer: SELECT Name FROM People ORDER BY Name ASC NULLS FIRST


Question:
What are the names of gymnasts?
Additional table information: table: gymnast

Answer: SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID


Question:
Return the names of the gymnasts.
Additional table information: table: gymnast

Answer: SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID


Question:
What are the names of gymnasts whose hometown is not 'Santo Domingo'?
Additional table information: table: gymnast

Answer: SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID WHERE T2.Hometown <> 'Santo Domingo'


Question:
Return the names of gymnasts who did not grow up in Santo Domingo.
Additional table information: table: gymnast

Answer: SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID WHERE T2.Hometown <> 'Santo Domingo'


Question:
What is the age of the tallest person?
Additional table information: table: gymnast

Answer: SELECT Age FROM people ORDER BY Height DESC LIMIT 1


Question:
Return the age of the person with the greatest height.
Additional table information: table: gymnast

Answer: SELECT Age FROM people ORDER BY Height DESC LIMIT 1


Question:
List the names of the top 5 oldest people.
Additional table information: table: gymnast

Answer: SELECT Name FROM People ORDER BY Age DESC LIMIT 5


Question:
What are the names of the five oldest people?
Additional table information: table: gymnast

Answer: SELECT Name FROM People ORDER BY Age DESC LIMIT 5


Question:
What is the total point count of the youngest gymnast?
Additional table information: table: gymnast

Answer: SELECT T1.Total_Points FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Age ASC NULLS FIRST LIMIT 1


Question:
Return the total points of the gymnast with the lowest age.
Additional table information: table: gymnast

Answer: SELECT T1.Total_Points FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Age ASC NULLS FIRST LIMIT 1


Question:
What is the average age of all gymnasts?
Additional table information: table: gymnast

Answer: SELECT AVG(T2.Age) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID


Question:
Return the average age across all gymnasts.
Additional table information: table: gymnast

Answer: SELECT AVG(T2.Age) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID


Question:
What are the distinct hometowns of gymnasts with total points more than 57.5?
Additional table information: table: gymnast

Answer: SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID WHERE T1.Total_Points > 57.5


Question:
Give the different hometowns of gymnasts that have a total point score of above 57.5.
Additional table information: table: gymnast

Answer: SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID WHERE T1.Total_Points > 57.5


Question:
What are the hometowns of gymnasts and the corresponding number of gymnasts?
Additional table information: table: gymnast

Answer: SELECT T2.Hometown, COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown


Question:
How many gymnasts are from each hometown?
Additional table information: table: gymnast

Answer: SELECT T2.Hometown, COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown


Question:
What is the most common hometown of gymnasts?
Additional table information: table: gymnast

Answer: SELECT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown ORDER BY COUNT(*) DESC LIMIT 1


Question:
Return the hometown that is most common among gymnasts.
Additional table information: table: gymnast

Answer: SELECT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown ORDER BY COUNT(*) DESC LIMIT 1


Question:
What are the hometowns that are shared by at least two gymnasts?
Additional table information: table: gymnast

Answer: SELECT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown HAVING COUNT(*) >= 2


Question:
Give the hometowns from which two or more gymnasts are from.
Additional table information: table: gymnast

Answer: SELECT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown HAVING COUNT(*) >= 2


Question:
List the names of gymnasts in ascending order by their heights.
Additional table information: table: gymnast

Answer: SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Height ASC NULLS FIRST


Question:
What are the names of gymnasts, ordered by their heights ascending?
Additional table information: table: gymnast

Answer: SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Height ASC NULLS FIRST


Question:
List the distinct hometowns that are not associated with any gymnast.
Additional table information: table: gymnast

Answer: SELECT DISTINCT Hometown FROM people EXCEPT SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID


Question:
From which hometowns did no gymnasts come from?
Additional table information: table: gymnast

Answer: SELECT DISTINCT Hometown FROM people EXCEPT SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID


Question:
Show the hometowns shared by people older than 23 and younger than 20.
Additional table information: table: gymnast

Answer: SELECT Hometown FROM people WHERE Age > 23 INTERSECT SELECT Hometown FROM people WHERE Age < 20


Question:
From which hometowns did both people older than 23 and younger than 20 come from?
Additional table information: table: gymnast

Answer: SELECT Hometown FROM people WHERE Age > 23 INTERSECT SELECT Hometown FROM people WHERE Age < 20


Question:
How many distinct hometowns did these people have?
Additional table information: table: gymnast

Answer: SELECT COUNT(DISTINCT Hometown) FROM people


Question:
Count the number of different hometowns of these people.
Additional table information: table: gymnast

Answer: SELECT COUNT(DISTINCT Hometown) FROM people


Question:
Show the ages of gymnasts in descending order of total points.
Additional table information: table: gymnast

Answer: SELECT T2.Age FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T1.Total_Points DESC


Question:
What are the ages of the gymnasts, ordered descending by their total points?
Additional table information: table: gymnast

Answer: SELECT T2.Age FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T1.Total_Points DESC


Question:
Find the total savings balance of all accounts except the account with name ‘Brown’.
Additional table information: table: small_bank_1

Answer: SELECT SUM(T2.balance) FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T1.name <> 'Brown'


Question:
What is the total balance of savings accounts not belonging to someone with the name Brown?
Additional table information: table: small_bank_1

Answer: SELECT SUM(T2.balance) FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T1.name <> 'Brown'


Question:
How many accounts are there in total?
Additional table information: table: small_bank_1

Answer: SELECT COUNT(*) FROM accounts


Question:
Count the number of accounts.
Additional table information: table: small_bank_1

Answer: SELECT COUNT(*) FROM accounts


Question:
What is the total checking balance in all accounts?
Additional table information: table: small_bank_1

Answer: SELECT SUM(balance) FROM checking


Question:
Find the total balance across checking accounts.
Additional table information: table: small_bank_1

Answer: SELECT SUM(balance) FROM checking


Question:
Find the average checking balance.
Additional table information: table: small_bank_1

Answer: SELECT AVG(balance) FROM checking


Question:
What is the average balance in checking accounts?
Additional table information: table: small_bank_1

Answer: SELECT AVG(balance) FROM checking


Question:
How many accounts have a savings balance above the average savings balance?
Additional table information: table: small_bank_1

Answer: SELECT COUNT(*) FROM savings WHERE balance > (SELECT AVG(balance) FROM savings)


Question:
Find the number of accounts with a savings balance that is higher than the average savings balance.
Additional table information: table: small_bank_1

Answer: SELECT COUNT(*) FROM savings WHERE balance > (SELECT AVG(balance) FROM savings)


Question:
Find the name and id of accounts whose checking balance is below the maximum checking balance.
Additional table information: table: small_bank_1

Answer: SELECT T1.custid, T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT MAX(balance) FROM checking)


Question:
What are the customer id and name corresponding to accounts with a checking balance less than the largest checking balance?
Additional table information: table: small_bank_1

Answer: SELECT T1.custid, T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT MAX(balance) FROM checking)


Question:
What is the checking balance of the account whose owner’s name contains the substring ‘ee’?
Additional table information: table: small_bank_1

Answer: SELECT T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T1.name LIKE '%ee%'


Question:
Find the balance of the checking account belonging to an owner whose name contains 'ee'.
Additional table information: table: small_bank_1

Answer: SELECT T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T1.name LIKE '%ee%'


Question:
Find the checking balance and saving balance in the Brown’s account.
Additional table information: table: small_bank_1

Answer: SELECT T2.balance, T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T1.name = 'Brown'


Question:
What are the checking and savings balances in accounts belonging to Brown?
Additional table information: table: small_bank_1

Answer: SELECT T2.balance, T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T1.name = 'Brown'


Question:
Find the names of accounts whose checking balance is above the average checking balance, but savings balance is below the average savings balance.
Additional table information: table: small_bank_1

Answer: SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance > (SELECT AVG(balance) FROM checking) INTERSECT SELECT T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT AVG(balance) FROM savings)


Question:
What are the names of accounts with checking balances greater than the average checking balance and savings balances below the average savings balance?
Additional table information: table: small_bank_1

Answer: SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance > (SELECT AVG(balance) FROM checking) INTERSECT SELECT T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT AVG(balance) FROM savings)


Question:
Find the checking balance of the accounts whose savings balance is higher than the average savings balance.
Additional table information: table: small_bank_1

Answer: SELECT T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T1.name IN (SELECT T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T2.balance > (SELECT AVG(balance) FROM savings))


Question:
What are the balances of checking accounts belonging to people with savings balances greater than the average savings balance?
Additional table information: table: small_bank_1

Answer: SELECT T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T1.name IN (SELECT T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T2.balance > (SELECT AVG(balance) FROM savings))


Question:
List all customers’ names in the alphabetical order.
Additional table information: table: small_bank_1

Answer: SELECT name FROM accounts ORDER BY name NULLS FIRST


Question:
What are the names of all the customers in alphabetical order?
Additional table information: table: small_bank_1

Answer: SELECT name FROM accounts ORDER BY name NULLS FIRST


Question:
Find the name of account that has the lowest total checking and saving balance.
Additional table information: table: small_bank_1

Answer: SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T2.balance + T3.balance NULLS FIRST LIMIT 1


Question:
What is the name corresponding to the accoung with the lowest sum of checking and savings balances?
Additional table information: table: small_bank_1

Answer: SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T2.balance + T3.balance NULLS FIRST LIMIT 1


Question:
Find the names and total checking and savings balances of accounts whose savings balance is higher than the average savings balance.
Additional table information: table: small_bank_1

Answer: SELECT T1.name, T2.balance + T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T3.balance > (SELECT AVG(balance) FROM savings)


Question:
What are the names and sum of checking and savings balances for accounts with savings balances higher than the average savings balance?
Additional table information: table: small_bank_1

Answer: SELECT T1.name, T2.balance + T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T3.balance > (SELECT AVG(balance) FROM savings)


Question:
Find the name and checking balance of the account with the lowest savings balance.
Additional table information: table: small_bank_1

Answer: SELECT T1.name, T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T3.balance NULLS FIRST LIMIT 1


Question:
What are the names and balances of checking accounts belonging to the customer with the lowest savings balance?
Additional table information: table: small_bank_1

Answer: SELECT T1.name, T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T3.balance NULLS FIRST LIMIT 1


Question:
Find the number of checking accounts for each account name.
Additional table information: table: small_bank_1

Answer: SELECT COUNT(*), T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid GROUP BY T1.name


Question:
What are the names of customers with accounts, and how many checking accounts do each of them have?
Additional table information: table: small_bank_1

Answer: SELECT COUNT(*), T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid GROUP BY T1.name


Question:
Find the total saving balance for each account name.
Additional table information: table: small_bank_1

Answer: SELECT SUM(T2.balance), T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid GROUP BY T1.name


Question:
What are the names of customers with accounts, and what are the total savings balances for each?
Additional table information: table: small_bank_1

Answer: SELECT SUM(T2.balance), T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid GROUP BY T1.name


Question:
Find the name of accounts whose checking balance is below the average checking balance.
Additional table information: table: small_bank_1

Answer: SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT AVG(balance) FROM checking)


Question:
What are the names of customers with checking balances lower than the average checking balance?
Additional table information: table: small_bank_1

Answer: SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT AVG(balance) FROM checking)


Question:
Find the saving balance of the account with the highest checking balance.
Additional table information: table: small_bank_1

Answer: SELECT T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T2.balance DESC LIMIT 1


Question:
What is the savings balance of the account belonging to the customer with the highest checking balance?
Additional table information: table: small_bank_1

Answer: SELECT T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T2.balance DESC LIMIT 1


Question:
Find the total checking and saving balance of all accounts sorted by the total balance in ascending order.
Additional table information: table: small_bank_1

Answer: SELECT T1.balance + T2.balance FROM checking AS T1 JOIN savings AS T2 ON T1.custid = T2.custid ORDER BY T1.balance + T2.balance NULLS FIRST


Question:
What is the sum of checking and savings balances for all customers, ordered by the total balance?
Additional table information: table: small_bank_1

Answer: SELECT T1.balance + T2.balance FROM checking AS T1 JOIN savings AS T2 ON T1.custid = T2.custid ORDER BY T1.balance + T2.balance NULLS FIRST


Question:
Find the name and checking balance of the account with the lowest saving balance.
Additional table information: table: small_bank_1

Answer: SELECT T2.balance, T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T3.balance NULLS FIRST LIMIT 1


Question:
What is the name and checking balance of the account which has the lowest savings balance?
Additional table information: table: small_bank_1

Answer: SELECT T2.balance, T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T3.balance NULLS FIRST LIMIT 1


Question:
Find the name, checking balance and saving balance of all accounts in the bank.
Additional table information: table: small_bank_1

Answer: SELECT T2.balance, T3.balance, T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid


Question:
What are the names, checking balances, and savings balances for all customers?
Additional table information: table: small_bank_1

Answer: SELECT T2.balance, T3.balance, T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid


Question:
Find the name, checking balance and savings balance of all accounts in the bank sorted by their total checking and savings balance in descending order.
Additional table information: table: small_bank_1

Answer: SELECT T2.balance, T3.balance, T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T2.balance + T3.balance DESC


Question:
What are the names, checking balances, and savings balances of customers, ordered by the total of checking and savings balances descending?
Additional table information: table: small_bank_1

Answer: SELECT T2.balance, T3.balance, T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T2.balance + T3.balance DESC


Question:
Find the name of accounts whose checking balance is higher than corresponding saving balance.
Additional table information: table: small_bank_1

Answer: SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T2.balance > T3.balance


Question:
What are the names of customers with a higher checking balance than savings balance?
Additional table information: table: small_bank_1

Answer: SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T2.balance > T3.balance


Question:
Find the name and total checking and savings balance of the accounts whose savings balance is lower than corresponding checking balance.
Additional table information: table: small_bank_1

Answer: SELECT T1.name, T3.balance + T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T3.balance < T2.balance


Question:
What are the names of customers who have a savings balance lower than their checking balance, and what is the total of their checking and savings balances?
Additional table information: table: small_bank_1

Answer: SELECT T1.name, T3.balance + T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T3.balance < T2.balance


Question:
Find the name and savings balance of the top 3 accounts with the highest saving balance sorted by savings balance in descending order.
Additional table information: table: small_bank_1

Answer: SELECT T1.name, T2.balance FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid ORDER BY T2.balance DESC LIMIT 3


Question:
What are names and savings balances of the three accounts with the highest savings balances?
Additional table information: table: small_bank_1

Answer: SELECT T1.name, T2.balance FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid ORDER BY T2.balance DESC LIMIT 3


Question:
How many main stream browsers whose market share is at least 5 exist?
Additional table information: table: browser_web

Answer: SELECT COUNT(*) FROM browser WHERE market_share >= 5


Question:
List the name of browsers in descending order by market share.
Additional table information: table: browser_web

Answer: SELECT name FROM browser ORDER BY market_share DESC


Question:
List the ids, names and market shares of all browsers.
Additional table information: table: browser_web

Answer: SELECT id, name, market_share FROM browser


Question:
What is the maximum, minimum and average market share of the listed browsers?
Additional table information: table: browser_web

Answer: SELECT MAX(market_share), MIN(market_share), AVG(market_share) FROM browser


Question:
What is the id and market share of the browser Safari?
Additional table information: table: browser_web

Answer: SELECT id, market_share FROM browser WHERE name = 'Safari'


Question:
What are the name and os of web client accelerators that do not work with only a 'Broadband' type connection?
Additional table information: table: browser_web

Answer: SELECT name, operating_system FROM web_client_accelerator WHERE CONNECTION <> 'Broadband'


Question:
What is the name of the browser that became compatible with the accelerator 'CProxy' after year 1998 ?
Additional table information: table: browser_web

Answer: SELECT T1.name FROM browser AS T1 JOIN accelerator_compatible_browser AS T2 ON T1.id = T2.browser_id JOIN web_client_accelerator AS T3 ON T2.accelerator_id = T3.id WHERE T3.name = 'CProxy' AND T2.compatible_since_year > 1998


Question:
What are the ids and names of the web accelerators that are compatible with two or more browsers?
Additional table information: table: browser_web

Answer: SELECT T1.id, T1.Name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id GROUP BY T1.id HAVING COUNT(*) >= 2


Question:
What is the id and name of the browser that is compatible with the most web accelerators?
Additional table information: table: browser_web

Answer: SELECT T1.id, T1.name 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


Question:
When did the web accelerator 'CACHEbox' and browser 'Internet Explorer' become compatible?
Additional table information: table: browser_web

Answer: SELECT T1.compatible_since_year FROM accelerator_compatible_browser AS T1 JOIN browser AS T2 ON T1.browser_id = T2.id JOIN web_client_accelerator AS T3 ON T1.accelerator_id = T3.id WHERE T3.name = 'CACHEbox' AND T2.name = 'Internet Explorer'


Question:
How many different kinds of clients are supported by the web clients accelerators?
Additional table information: table: browser_web

Answer: SELECT COUNT(DISTINCT client) FROM web_client_accelerator


Question:
How many accelerators are not compatible with the browsers listed ?
Additional table information: table: browser_web

Answer: SELECT COUNT(*) FROM web_client_accelerator WHERE NOT id IN (SELECT accelerator_id FROM accelerator_compatible_browser)


Question:
What distinct accelerator names are compatible with the browswers that have market share higher than 15?
Additional table information: table: browser_web

Answer: SELECT DISTINCT T1.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T3.market_share > 15


Question:
List the names of the browser that are compatible with both 'CACHEbox' and 'Fasterfox'.
Additional table information: table: browser_web

Answer: SELECT T3.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T1.name = 'CACHEbox' INTERSECT SELECT T3.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T1.name = 'Fasterfox'


Question:
Show the accelerator names and supporting operating systems that are not compatible with the browser named 'Opera'.
Additional table information: table: browser_web

Answer: SELECT name, operating_system FROM web_client_accelerator EXCEPT SELECT T1.name, T1.operating_system FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id JOIN browser AS T3 ON T2.browser_id = T3.id WHERE T3.name = 'Opera'


Question:
Which accelerator name contains substring 'Opera'?
Additional table information: table: browser_web

Answer: SELECT name FROM web_client_accelerator WHERE name LIKE '%Opera%'


Question:
Find the number of web accelerators used for each Operating system.
Additional table information: table: browser_web

Answer: SELECT Operating_system, COUNT(*) FROM web_client_accelerator GROUP BY Operating_system


Question:
give me names of all compatible browsers and accelerators in the descending order of compatible year
Additional table information: table: browser_web

Answer: SELECT T2.name, T3.name FROM accelerator_compatible_browser AS T1 JOIN browser AS T2 ON T1.browser_id = T2.id JOIN web_client_accelerator AS T3 ON T1.accelerator_id = T3.id ORDER BY T1.compatible_since_year DESC


Question:
How many wrestlers are there?
Additional table information: table: wrestler

Answer: SELECT COUNT(*) FROM wrestler


Question:
Count the number of wrestlers.
Additional table information: table: wrestler

Answer: SELECT COUNT(*) FROM wrestler


Question:
List the names of wrestlers in descending order of days held.
Additional table information: table: wrestler

Answer: SELECT Name FROM wrestler ORDER BY Days_held DESC


Question:
What are the names of the wrestlers, ordered descending by days held?
Additional table information: table: wrestler

Answer: SELECT Name FROM wrestler ORDER BY Days_held DESC


Question:
What is the name of the wrestler with the fewest days held?
Additional table information: table: wrestler

Answer: SELECT Name FROM wrestler ORDER BY Days_held ASC NULLS FIRST LIMIT 1


Question:
Return the name of the wrestler who had the lowest number of days held.
Additional table information: table: wrestler

Answer: SELECT Name FROM wrestler ORDER BY Days_held ASC NULLS FIRST LIMIT 1


Question:
What are the distinct reigns of wrestlers whose location is not 'Tokyo,Japan' ?
Additional table information: table: wrestler

Answer: SELECT DISTINCT Reign FROM wrestler WHERE LOCATION <> 'Tokyo , Japan'


Question:
Give the different reigns of wrestlers who are not located in Tokyo, Japan.
Additional table information: table: wrestler

Answer: SELECT DISTINCT Reign FROM wrestler WHERE LOCATION <> 'Tokyo , Japan'


Question:
What are the names and location of the wrestlers?
Additional table information: table: wrestler

Answer: SELECT Name, LOCATION FROM wrestler


Question:
Give the names and locations of all wrestlers.
Additional table information: table: wrestler

Answer: SELECT Name, LOCATION FROM wrestler


Question:
What are the elimination moves of wrestlers whose team is 'Team Orton'?
Additional table information: table: wrestler

Answer: SELECT Elimination_Move FROM Elimination WHERE Team = 'Team Orton'


Question:
Return the elimination movies of wrestlers on Team Orton.
Additional table information: table: wrestler

Answer: SELECT Elimination_Move FROM Elimination WHERE Team = 'Team Orton'


Question:
What are the names of wrestlers and the elimination moves?
Additional table information: table: wrestler

Answer: SELECT T2.Name, T1.Elimination_Move FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID


Question:
Give the names of wrestlers and their elimination moves.
Additional table information: table: wrestler

Answer: SELECT T2.Name, T1.Elimination_Move FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID


Question:
List the names of wrestlers and the teams in elimination in descending order of days held.
Additional table information: table: wrestler

Answer: SELECT T2.Name, T1.Team FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID ORDER BY T2.Days_held DESC


Question:
What are the names of wrestlers and their teams in elimination, ordered descending by days held?
Additional table information: table: wrestler

Answer: SELECT T2.Name, T1.Team FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID ORDER BY T2.Days_held DESC


Question:
List the time of elimination of the wrestlers with largest days held.
Additional table information: table: wrestler

Answer: SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID ORDER BY T2.Days_held DESC LIMIT 1


Question:
What is the time of elimination for the wrestler with the most days held?
Additional table information: table: wrestler

Answer: SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID ORDER BY T2.Days_held DESC LIMIT 1


Question:
Show times of elimination of wrestlers with days held more than 50.
Additional table information: table: wrestler

Answer: SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID WHERE T2.Days_held > 50


Question:
What are the times of elimination for wrestlers with over 50 days held?
Additional table information: table: wrestler

Answer: SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID WHERE T2.Days_held > 50


Question:
Show different teams in eliminations and the number of eliminations from each team.
Additional table information: table: wrestler

Answer: SELECT Team, COUNT(*) FROM elimination GROUP BY Team


Question:
How many eliminations did each team have?
Additional table information: table: wrestler

Answer: SELECT Team, COUNT(*) FROM elimination GROUP BY Team


Question:
Show teams that have suffered more than three eliminations.
Additional table information: table: wrestler

Answer: SELECT Team FROM elimination GROUP BY Team HAVING COUNT(*) > 3


Question:
Which teams had more than 3 eliminations?
Additional table information: table: wrestler

Answer: SELECT Team FROM elimination GROUP BY Team HAVING COUNT(*) > 3


Question:
Show the reign and days held of wrestlers.
Additional table information: table: wrestler

Answer: SELECT Reign, Days_held FROM wrestler


Question:
What are the reigns and days held of all wrestlers?
Additional table information: table: wrestler

Answer: SELECT Reign, Days_held FROM wrestler


Question:
What are the names of wrestlers days held less than 100?
Additional table information: table: wrestler

Answer: SELECT Name FROM wrestler WHERE Days_held < 100


Question:
Return the names of wrestlers with fewer than 100 days held.
Additional table information: table: wrestler

Answer: SELECT Name FROM wrestler WHERE Days_held < 100


Question:
Please show the most common reigns of wrestlers.
Additional table information: table: wrestler

Answer: SELECT Reign FROM wrestler GROUP BY Reign ORDER BY COUNT(*) DESC LIMIT 1


Question:
Which reign is the most common among wrestlers?
Additional table information: table: wrestler

Answer: SELECT Reign FROM wrestler GROUP BY Reign ORDER BY COUNT(*) DESC LIMIT 1


Question:
List the locations that are shared by more than two wrestlers.
Additional table information: table: wrestler

Answer: SELECT LOCATION FROM wrestler GROUP BY LOCATION HAVING COUNT(*) > 2


Question:
Which locations are shared by more than two wrestlers?
Additional table information: table: wrestler

Answer: SELECT LOCATION FROM wrestler GROUP BY LOCATION HAVING COUNT(*) > 2


Question:
List the names of wrestlers that have not been eliminated.
Additional table information: table: wrestler

Answer: SELECT Name FROM wrestler WHERE NOT Wrestler_ID IN (SELECT Wrestler_ID FROM elimination)


Question:
What are the names of wrestlers who have never been eliminated?
Additional table information: table: wrestler

Answer: SELECT Name FROM wrestler WHERE NOT Wrestler_ID IN (SELECT Wrestler_ID FROM elimination)


Question:
Show the teams that have both wrestlers eliminated by 'Orton' and wrestlers eliminated by 'Benjamin'.
Additional table information: table: wrestler

Answer: SELECT Team FROM Elimination WHERE Eliminated_By = 'Orton' INTERSECT SELECT Team FROM Elimination WHERE Eliminated_By = 'Benjamin'


Question:
What are the teams that have both wrestlers eliminated by Orton and wrestlers eliminated by Benjamin?
Additional table information: table: wrestler

Answer: SELECT Team FROM Elimination WHERE Eliminated_By = 'Orton' INTERSECT SELECT Team FROM Elimination WHERE Eliminated_By = 'Benjamin'


Question:
What is the number of distinct teams that suffer elimination?
Additional table information: table: wrestler

Answer: SELECT COUNT(DISTINCT team) FROM elimination


Question:
How many different teams have had eliminated wrestlers?
Additional table information: table: wrestler

Answer: SELECT COUNT(DISTINCT team) FROM elimination


Question:
Show the times of elimination by 'Punk' or 'Orton'.
Additional table information: table: wrestler

Answer: SELECT TIME FROM elimination WHERE Eliminated_By = 'Punk' OR Eliminated_By = 'Orton'


Question:
What are the times of elimination for any instances in which the elimination was done by Punk or Orton?
Additional table information: table: wrestler

Answer: SELECT TIME FROM elimination WHERE Eliminated_By = 'Punk' OR Eliminated_By = 'Orton'


Question:
How many schools are there?
Additional table information: table: school_finance

Answer: SELECT COUNT(*) FROM school


Question:
Count the number of schools.
Additional table information: table: school_finance

Answer: SELECT COUNT(*) FROM school


Question:
Show all school names in alphabetical order.
Additional table information: table: school_finance

Answer: SELECT school_name FROM school ORDER BY school_name NULLS FIRST


Question:
List the name, location, mascot for all schools.
Additional table information: table: school_finance

Answer: SELECT school_name, LOCATION, mascot FROM school


Question:
What are the total and average enrollment of all schools?
Additional table information: table: school_finance

Answer: SELECT SUM(enrollment), AVG(enrollment) FROM school


Question:
What are the mascots for schools with enrollments above the average?
Additional table information: table: school_finance

Answer: SELECT mascot FROM school WHERE enrollment > (SELECT AVG(enrollment) FROM school)


Question:
List the name of the school with the smallest enrollment.
Additional table information: table: school_finance

Answer: SELECT school_name FROM school ORDER BY enrollment NULLS FIRST LIMIT 1


Question:
Show the average, maximum, minimum enrollment of all schools.
Additional table information: table: school_finance

Answer: SELECT AVG(enrollment), MAX(enrollment), MIN(enrollment) FROM school


Question:
Show each county along with the number of schools and total enrollment in each county.
Additional table information: table: school_finance

Answer: SELECT county, COUNT(*), SUM(enrollment) FROM school GROUP BY county


Question:
How many donors have endowment for school named 'Glenn'?
Additional table information: table: school_finance

Answer: SELECT COUNT(DISTINCT T1.donator_name) FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = 'Glenn'


Question:
List each donator name and the amount of endowment in descending order of the amount of endowment.
Additional table information: table: school_finance

Answer: SELECT donator_name, SUM(amount) FROM endowment GROUP BY donator_name ORDER BY SUM(amount) DESC


Question:
List the names of the schools without any endowment.
Additional table information: table: school_finance

Answer: SELECT school_name FROM school WHERE NOT school_id IN (SELECT school_id FROM endowment)


Question:
List all the names of schools with an endowment amount smaller than or equal to 10.
Additional table information: table: school_finance

Answer: SELECT T2.school_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id GROUP BY T1.school_id HAVING SUM(T1.amount) <= 10


Question:
Show the names of donors who donated to both school 'Glenn' and 'Triton.'
Additional table information: table: school_finance

Answer: SELECT T1.donator_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = 'Glenn' INTERSECT SELECT T1.donator_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = 'Triton'


Question:
Show the names of all the donors except those whose donation amount less than 9.
Additional table information: table: school_finance

Answer: SELECT donator_name FROM endowment EXCEPT SELECT donator_name FROM endowment WHERE amount < 9


Question:
List the amount and donor name for the largest amount of donation.
Additional table information: table: school_finance

Answer: SELECT amount, donator_name FROM endowment ORDER BY amount DESC LIMIT 1


Question:
How many budgets are above 3000 in year 2001 or before?
Additional table information: table: school_finance

Answer: SELECT COUNT(*) FROM budget WHERE budgeted > 3000 AND YEAR <= 2001


Question:
Count the number of budgets in year 2001 or before whose budgeted amount is greater than 3000
Additional table information: table: school_finance

Answer: SELECT COUNT(*) FROM budget WHERE budgeted > 3000 AND YEAR <= 2001


Question:
Show each school name, its budgeted amount, and invested amount in year 2002 or after.
Additional table information: table: school_finance

Answer: SELECT T2.school_name, T1.budgeted, T1.invested FROM budget AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T1.year >= 2002


Question:
Show all donor names.
Additional table information: table: school_finance

Answer: SELECT DISTINCT donator_name FROM endowment


Question:
How many budget record has a budget amount smaller than the invested amount?
Additional table information: table: school_finance

Answer: SELECT COUNT(*) FROM budget WHERE budgeted < invested


Question:
What is the total budget amount for school 'Glenn' in all years?
Additional table information: table: school_finance

Answer: SELECT SUM(T1.budgeted) FROM budget AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = 'Glenn'


Question:
Show the names of schools with a total budget amount greater than 100 or a total endowment greater than 10.
Additional table information: table: school_finance

Answer: SELECT T2.school_name FROM budget AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id JOIN endowment AS T3 ON T2.school_id = T3.school_id GROUP BY T2.school_name HAVING SUM(T1.budgeted) > 100 OR SUM(T3.amount) > 10


Question:
Find the names of schools that have more than one donator with donation amount above 8.5.
Additional table information: table: school_finance

Answer: SELECT T2.School_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T1.amount > 8.5 GROUP BY T1.school_id HAVING COUNT(*) > 1


Question:
Find the number of schools that have more than one donator whose donation amount is less than 8.5.
Additional table information: table: school_finance

Answer: SELECT COUNT(*) FROM (SELECT * FROM endowment WHERE amount > 8.5 GROUP BY school_id HAVING COUNT(*) > 1)


Question:
List the name, IHSAA Football Class, and Mascot of the schools that have more than 6000 of budgeted amount or were founded before 2003, in the order of percent of total invested budget and total budgeted budget.
Additional table information: table: school_finance

Answer: SELECT T1.School_name, T1.Mascot, T1.IHSAA_Football_Class FROM school AS T1 JOIN budget AS T2 ON T1.school_id = T2.school_id WHERE Budgeted > 6000 OR YEAR < 2003 ORDER BY T2.total_budget_percent_invested NULLS FIRST, T2.total_budget_percent_budgeted NULLS FIRST


Question:
How many buildings are there?
Additional table information: table: protein_institute

Answer: SELECT COUNT(*) FROM building


Question:
Show the name, street address, and number of floors for all buildings ordered by the number of floors.
Additional table information: table: protein_institute

Answer: SELECT name, street_address, floors FROM building ORDER BY floors NULLS FIRST


Question:
What is the name of the tallest building?
Additional table information: table: protein_institute

Answer: SELECT name FROM building ORDER BY height_feet DESC LIMIT 1


Question:
What are the average, maximum, and minimum number of floors for all buildings?
Additional table information: table: protein_institute

Answer: SELECT AVG(floors), MAX(floors), MIN(floors) FROM building


Question:
Show the number of buildings with a height above the average or a number of floors above the average.
Additional table information: table: protein_institute

Answer: SELECT COUNT(*) FROM building WHERE height_feet > (SELECT AVG(height_feet) FROM building) OR floors > (SELECT AVG(floors) FROM building)


Question:
List the names of buildings with at least 200 feet of height and with at least 20 floors.
Additional table information: table: protein_institute

Answer: SELECT name FROM building WHERE height_feet >= 200 AND floors >= 20


Question:
Show the names and locations of institutions that are founded after 1990 and have the type 'Private'.
Additional table information: table: protein_institute

Answer: SELECT institution, LOCATION FROM institution WHERE founded > 1990 AND TYPE = 'Private'


Question:
Show institution types, along with the number of institutions and total enrollment for each type.
Additional table information: table: protein_institute

Answer: SELECT TYPE, COUNT(*), SUM(enrollment) FROM institution GROUP BY TYPE


Question:
Show the institution type with the largest number of institutions.
Additional table information: table: protein_institute

Answer: SELECT TYPE FROM institution GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1


Question:
Show the institution type with an institution founded after 1990 and an institution with at least 1000 enrollment.
Additional table information: table: protein_institute

Answer: SELECT TYPE FROM institution WHERE founded > 1990 AND enrollment >= 1000


Question:
Show the name of buildings that do not have any institution.
Additional table information: table: protein_institute

Answer: SELECT name FROM building WHERE NOT building_id IN (SELECT building_id FROM institution)


Question:
Show the names of buildings except for those having an institution founded in 2003.
Additional table information: table: protein_institute

Answer: SELECT name FROM building EXCEPT SELECT T1.name FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id WHERE T2.founded = 2003


Question:
For each building, show the name of the building and the number of institutions in it.
Additional table information: table: protein_institute

Answer: SELECT T1.name, COUNT(*) FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id GROUP BY T1.building_id


Question:
Show the names and heights of buildings with at least two institutions founded after 1880.
Additional table information: table: protein_institute

Answer: SELECT T1.name, T1.height_feet FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id WHERE T2.founded > 1880 GROUP BY T1.building_id HAVING COUNT(*) >= 2


Question:
Show all the distinct institution types.
Additional table information: table: protein_institute

Answer: SELECT DISTINCT TYPE FROM institution


Question:
Show institution names along with the number of proteins for each institution.
Additional table information: table: protein_institute

Answer: SELECT T1.institution, COUNT(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id GROUP BY T1.institution_id


Question:
How many proteins are associated with an institution founded after 1880 or an institution with type 'Private'?
Additional table information: table: protein_institute

Answer: 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'


Question:
Show the protein name and the institution name.
Additional table information: table: protein_institute

Answer: SELECT T2.protein_name, T1.institution FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id


Question:
How many proteins are associated with an institution in a building with at least 20 floors?
Additional table information: table: protein_institute

Answer: SELECT COUNT(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id JOIN building AS T3 ON T3.building_id = T1.building_id WHERE T3.floors >= 20


Question:
How many institutions do not have an associated protein in our record?
Additional table information: table: protein_institute

Answer: SELECT COUNT(*) FROM institution WHERE NOT institution_id IN (SELECT institution_id FROM protein)


Question:
Show all the locations where no cinema has capacity over 800.
Additional table information: table: cinema

Answer: SELECT LOCATION FROM cinema EXCEPT SELECT LOCATION FROM cinema WHERE capacity > 800


Question:
Show all the locations where some cinemas were opened in both year 2010 and year 2011.
Additional table information: table: cinema

Answer: SELECT LOCATION FROM cinema WHERE openning_year = 2010 INTERSECT SELECT LOCATION FROM cinema WHERE openning_year = 2011


Question:
How many cinema do we have?
Additional table information: table: cinema

Answer: SELECT COUNT(*) FROM cinema


Question:
Count the number of cinemas.
Additional table information: table: cinema

Answer: SELECT COUNT(*) FROM cinema


Question:
Show name, opening year, and capacity for each cinema.
Additional table information: table: cinema

Answer: SELECT name, openning_year, capacity FROM cinema


Question:
Show the cinema name and location for cinemas with capacity above average.
Additional table information: table: cinema

Answer: SELECT name, LOCATION FROM cinema WHERE capacity > (SELECT AVG(capacity) FROM cinema)


Question:
What are all the locations with a cinema?
Additional table information: table: cinema

Answer: SELECT DISTINCT LOCATION FROM cinema


Question:
Find the distinct locations that has a cinema.
Additional table information: table: cinema

Answer: SELECT DISTINCT LOCATION FROM cinema


Question:
Show all the cinema names and opening years in descending order of opening year.
Additional table information: table: cinema

Answer: SELECT name, openning_year FROM cinema ORDER BY openning_year DESC


Question:
What are the name and location of the cinema with the largest capacity?
Additional table information: table: cinema

Answer: SELECT name, LOCATION FROM cinema ORDER BY capacity DESC LIMIT 1


Question:
Show the average, minimum, and maximum capacity for all the cinemas opened in year 2011 or later.
Additional table information: table: cinema

Answer: SELECT AVG(capacity), MIN(capacity), MAX(capacity) FROM cinema WHERE openning_year >= 2011


Question:
Show each location and the number of cinemas there.
Additional table information: table: cinema

Answer: SELECT LOCATION, COUNT(*) FROM cinema GROUP BY LOCATION


Question:
What is the location with the most cinemas opened in year 2010 or later?
Additional table information: table: cinema

Answer: SELECT LOCATION FROM cinema WHERE openning_year >= 2010 GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1


Question:
Show all the locations with at least two cinemas with capacity above 300.
Additional table information: table: cinema

Answer: SELECT LOCATION FROM cinema WHERE capacity > 300 GROUP BY LOCATION HAVING COUNT(*) >= 2


Question:
Which locations have 2 or more cinemas with capacity over 300?
Additional table information: table: cinema

Answer: SELECT LOCATION FROM cinema WHERE capacity > 300 GROUP BY LOCATION HAVING COUNT(*) >= 2


Question:
Show the title and director for all films.
Additional table information: table: cinema

Answer: SELECT title, directed_by FROM film


Question:
What are the title and director of each film?
Additional table information: table: cinema

Answer: SELECT title, directed_by FROM film


Question:
Show all directors.
Additional table information: table: cinema

Answer: SELECT DISTINCT directed_by FROM film


Question:
Who are all the directors?
Additional table information: table: cinema

Answer: SELECT DISTINCT directed_by FROM film


Question:
List all directors along with the number of films directed by each director.
Additional table information: table: cinema

Answer: SELECT directed_by, COUNT(*) FROM film GROUP BY directed_by


Question:
What is total number of show times per dat for each cinema?
Additional table information: table: cinema

Answer: SELECT T2.name, SUM(T1.show_times_per_day) FROM schedule AS T1 JOIN cinema AS T2 ON T1.cinema_id = T2.cinema_id GROUP BY T1.cinema_id


Question:
What are the title and maximum price of each film?
Additional table information: table: cinema

Answer: SELECT T2.title, MAX(T1.price) FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id


Question:
Give me the title and highest price for each film.
Additional table information: table: cinema

Answer: SELECT T2.title, MAX(T1.price) FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id


Question:
Show cinema name, film title, date, and price for each record in schedule.
Additional table information: table: cinema

Answer: SELECT T3.name, T2.title, T1.date, T1.price FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id JOIN cinema AS T3 ON T1.cinema_id = T3.cinema_id


Question:
What are the title and director of the films without any schedule?
Additional table information: table: cinema

Answer: SELECT title, directed_by FROM film WHERE NOT film_id IN (SELECT film_id FROM schedule)


Question:
Show director with the largest number of show times in total.
Additional table information: table: cinema

Answer: SELECT T2.directed_by FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T2.directed_by ORDER BY SUM(T1.show_times_per_day) DESC LIMIT 1


Question:
Find the locations that have more than one movie theater with capacity above 300.
Additional table information: table: cinema

Answer: SELECT LOCATION FROM cinema WHERE capacity > 300 GROUP BY LOCATION HAVING COUNT(*) > 1


Question:
In which locations are there more than one movie theater with capacity above 300?
Additional table information: table: cinema

Answer: SELECT LOCATION FROM cinema WHERE capacity > 300 GROUP BY LOCATION HAVING COUNT(*) > 1


Question:
How many films have the word 'Dummy' in their titles?
Additional table information: table: cinema

Answer: SELECT COUNT(*) FROM film WHERE title LIKE '%Dummy%'


Question:
Count the number of films whose title contains the word 'Dummy'.
Additional table information: table: cinema

Answer: SELECT COUNT(*) FROM film WHERE title LIKE '%Dummy%'


Question:
Are the customers holding coupons with amount 500 bad or good?
Additional table information: table: products_for_hire

Answer: SELECT T1.good_or_bad_customer FROM customers AS T1 JOIN discount_coupons AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.coupon_amount = 500


Question:
How many bookings did each customer make? List the customer id, first name, and the count.
Additional table information: table: products_for_hire

Answer: SELECT T1.customer_id, T1.first_name, COUNT(*) FROM Customers AS T1 JOIN bookings AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id


Question:
What is the maximum total amount paid by a customer? List the customer id and amount.
Additional table information: table: products_for_hire

Answer: SELECT customer_id, SUM(amount_paid) FROM Payments GROUP BY customer_id ORDER BY SUM(amount_paid) DESC LIMIT 1


Question:
What are the id and the amount of refund of the booking that incurred the most times of payments?
Additional table information: table: products_for_hire

Answer: SELECT T1.booking_id, T1.amount_of_refund FROM Bookings AS T1 JOIN Payments AS T2 ON T1.booking_id = T2.booking_id GROUP BY T1.booking_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the id of the product that is booked for 3 times?
Additional table information: table: products_for_hire

Answer: SELECT product_id FROM products_booked GROUP BY product_id HAVING COUNT(*) = 3


Question:
What is the product description of the product booked with an amount of 102.76?
Additional table information: table: products_for_hire

Answer: SELECT T2.product_description FROM products_booked AS T1 JOIN products_for_hire AS T2 ON T1.product_id = T2.product_id WHERE T1.booked_amount = 102.76


Question:
What are the start date and end date of the booking that has booked the product named 'Book collection A'?
Additional table information: table: products_for_hire

Answer: SELECT T3.booking_start_date, T3.booking_end_date FROM Products_for_hire AS T1 JOIN products_booked AS T2 ON T1.product_id = T2.product_id JOIN bookings AS T3 ON T2.booking_id = T3.booking_id WHERE T1.product_name = 'Book collection A'


Question:
What are the names of products whose availability equals to 1?
Additional table information: table: products_for_hire

Answer: SELECT T2.product_name FROM view_product_availability AS T1 JOIN products_for_hire AS T2 ON T1.product_id = T2.product_id WHERE T1.available_yn = 1


Question:
How many different product types are there?
Additional table information: table: products_for_hire

Answer: SELECT COUNT(DISTINCT product_type_code) FROM products_for_hire


Question:
What are the first name, last name, and gender of all the good customers? Order by their last name.
Additional table information: table: products_for_hire

Answer: SELECT first_name, last_name, gender_mf FROM customers WHERE good_or_bad_customer = 'good' ORDER BY last_name NULLS FIRST


Question:
What is the average amount due for all the payments?
Additional table information: table: products_for_hire

Answer: SELECT AVG(amount_due) FROM payments


Question:
What are the maximum, minimum, and average booked count for the products booked?
Additional table information: table: products_for_hire

Answer: SELECT MAX(booked_count), MIN(booked_count), AVG(booked_count) FROM products_booked


Question:
What are all the distinct payment types?
Additional table information: table: products_for_hire

Answer: SELECT DISTINCT payment_type_code FROM payments


Question:
What are the daily hire costs for the products with substring 'Book' in its name?
Additional table information: table: products_for_hire

Answer: SELECT daily_hire_cost FROM Products_for_hire WHERE product_name LIKE '%Book%'


Question:
How many products are never booked with amount higher than 200?
Additional table information: table: products_for_hire

Answer: SELECT COUNT(*) FROM Products_for_hire WHERE NOT product_id IN (SELECT product_id FROM products_booked WHERE booked_amount > 200)


Question:
What are the coupon amount of the coupons owned by both good and bad customers?
Additional table information: table: products_for_hire

Answer: SELECT T1.coupon_amount FROM Discount_Coupons AS T1 JOIN customers AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.good_or_bad_customer = 'good' INTERSECT SELECT T1.coupon_amount FROM Discount_Coupons AS T1 JOIN customers AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.good_or_bad_customer = 'bad'


Question:
What are the payment date of the payment with amount paid higher than 300 or with payment type is 'Check'
Additional table information: table: products_for_hire

Answer: SELECT payment_date FROM payments WHERE amount_paid > 300 OR payment_type_code = 'Check'


Question:
What are the names and descriptions of the products that are of 'Cutlery' type and have daily hire cost lower than 20?
Additional table information: table: products_for_hire

Answer: SELECT product_name, product_description FROM products_for_hire WHERE product_type_code = 'Cutlery' AND daily_hire_cost < 20


Question:
How many phones are there?
Additional table information: table: phone_market

Answer: SELECT COUNT(*) FROM phone


Question:
List the names of phones in ascending order of price.
Additional table information: table: phone_market

Answer: SELECT Name FROM phone ORDER BY Price ASC NULLS FIRST


Question:
What are the memories and carriers of phones?
Additional table information: table: phone_market

Answer: SELECT Memory_in_G, Carrier FROM phone


Question:
List the distinct carriers of phones with memories bigger than 32.
Additional table information: table: phone_market

Answer: SELECT DISTINCT Carrier FROM phone WHERE Memory_in_G > 32


Question:
Show the names of phones with carrier either 'Sprint' or 'TMobile'.
Additional table information: table: phone_market

Answer: SELECT Name FROM phone WHERE Carrier = 'Sprint' OR Carrier = 'TMobile'


Question:
What is the carrier of the most expensive phone?
Additional table information: table: phone_market

Answer: SELECT Carrier FROM phone ORDER BY Price DESC LIMIT 1


Question:
Show different carriers of phones together with the number of phones with each carrier.
Additional table information: table: phone_market

Answer: SELECT Carrier, COUNT(*) FROM phone GROUP BY Carrier


Question:
Show the most frequently used carrier of the phones.
Additional table information: table: phone_market

Answer: SELECT Carrier FROM phone GROUP BY Carrier ORDER BY COUNT(*) DESC LIMIT 1


Question:
Show the carriers that have both phones with memory smaller than 32 and phones with memory bigger than 64.
Additional table information: table: phone_market

Answer: SELECT Carrier FROM phone WHERE Memory_in_G < 32 INTERSECT SELECT Carrier FROM phone WHERE Memory_in_G > 64


Question:
Show the names of phones and the districts of markets they are on.
Additional table information: table: phone_market

Answer: 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


Question:
Show the names of phones and the districts of markets they are on, in ascending order of the ranking of the market.
Additional table information: table: phone_market

Answer: 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 NULLS FIRST


Question:
Show the names of phones that are on market with number of shops greater than 50.
Additional table information: table: phone_market

Answer: SELECT T3.Name 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 WHERE T2.Num_of_shops > 50


Question:
For each phone, show its names and total number of stocks.
Additional table information: table: phone_market

Answer: SELECT T2.Name, SUM(T1.Num_of_stock) FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name


Question:
Show the names of phones that have total number of stocks bigger than 2000, in descending order of the total number of stocks.
Additional table information: table: phone_market

Answer: SELECT T2.Name FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name HAVING SUM(T1.Num_of_stock) >= 2000 ORDER BY SUM(T1.Num_of_stock) DESC


Question:
List the names of phones that are not on any market.
Additional table information: table: phone_market

Answer: SELECT Name FROM phone WHERE NOT Phone_id IN (SELECT Phone_ID FROM phone_market)


Question:
How many gas companies are there?
Additional table information: table: gas_company

Answer: SELECT COUNT(*) FROM company


Question:
What is the total number of companies?
Additional table information: table: gas_company

Answer: SELECT COUNT(*) FROM company


Question:
List the company name and rank for all companies in the decreasing order of their sales.
Additional table information: table: gas_company

Answer: SELECT company, rank FROM company ORDER BY Sales_billion DESC


Question:
What is the name and rank of every company ordered by descending number of sales?
Additional table information: table: gas_company

Answer: SELECT company, rank FROM company ORDER BY Sales_billion DESC


Question:
Show the company name and the main industry for all companies whose headquarters are not from USA.
Additional table information: table: gas_company

Answer: SELECT company, main_industry FROM company WHERE headquarters <> 'USA'


Question:
What are the companies and main industries of all companies that are not headquartered in the United States?
Additional table information: table: gas_company

Answer: SELECT company, main_industry FROM company WHERE headquarters <> 'USA'


Question:
Show all company names and headquarters in the descending order of market value.
Additional table information: table: gas_company

Answer: SELECT company, headquarters FROM company ORDER BY market_value DESC


Question:
What are the names and headquarters of all companies ordered by descending market value?
Additional table information: table: gas_company

Answer: SELECT company, headquarters FROM company ORDER BY market_value DESC


Question:
Show minimum, maximum, and average market value for all companies.
Additional table information: table: gas_company

Answer: SELECT MIN(market_value), MAX(market_value), AVG(market_value) FROM company


Question:
What is the minimum, maximum, and average market value for every company?
Additional table information: table: gas_company

Answer: SELECT MIN(market_value), MAX(market_value), AVG(market_value) FROM company


Question:
Show all main industry for all companies.
Additional table information: table: gas_company

Answer: SELECT DISTINCT main_industry FROM company


Question:
What are the different main industries for all companies?
Additional table information: table: gas_company

Answer: SELECT DISTINCT main_industry FROM company


Question:
List all headquarters and the number of companies in each headquarter.
Additional table information: table: gas_company

Answer: SELECT headquarters, COUNT(*) FROM company GROUP BY headquarters


Question:
For each headquarter, what are the headquarter and how many companies are centered there?
Additional table information: table: gas_company

Answer: SELECT headquarters, COUNT(*) FROM company GROUP BY headquarters


Question:
Show all main industry and total market value in each industry.
Additional table information: table: gas_company

Answer: SELECT main_industry, SUM(market_value) FROM company GROUP BY main_industry


Question:
What are the main indstries and total market value for each industry?
Additional table information: table: gas_company

Answer: SELECT main_industry, SUM(market_value) FROM company GROUP BY main_industry


Question:
List the main industry with highest total market value and its number of companies.
Additional table information: table: gas_company

Answer: SELECT main_industry, COUNT(*) FROM company GROUP BY main_industry ORDER BY SUM(market_value) DESC LIMIT 1


Question:
For each main industry, what is the total number of companies for the industry with the highest total market value?
Additional table information: table: gas_company

Answer: SELECT main_industry, COUNT(*) FROM company GROUP BY main_industry ORDER BY SUM(market_value) DESC LIMIT 1


Question:
Show headquarters with at least two companies in the banking industry.
Additional table information: table: gas_company

Answer: SELECT headquarters FROM company WHERE main_industry = 'Banking' GROUP BY headquarters HAVING COUNT(*) >= 2


Question:
What are the headquarters with at least two companies in the banking industry?
Additional table information: table: gas_company

Answer: SELECT headquarters FROM company WHERE main_industry = 'Banking' GROUP BY headquarters HAVING COUNT(*) >= 2


Question:
Show gas station id, location, and manager_name for all gas stations ordered by open year.
Additional table information: table: gas_company

Answer: SELECT station_id, LOCATION, manager_name FROM gas_station ORDER BY open_year NULLS FIRST


Question:
What are the gas station ids, locations, and manager names for the gas stations ordered by opening year?
Additional table information: table: gas_company

Answer: SELECT station_id, LOCATION, manager_name FROM gas_station ORDER BY open_year NULLS FIRST


Question:
How many gas station are opened between 2000 and 2005?
Additional table information: table: gas_company

Answer: SELECT COUNT(*) FROM gas_station WHERE open_year BETWEEN 2000 AND 2005


Question:
What is the total number of gas stations that opened between 2000 and 2005?
Additional table information: table: gas_company

Answer: SELECT COUNT(*) FROM gas_station WHERE open_year BETWEEN 2000 AND 2005


Question:
Show all locations and the number of gas stations in each location ordered by the count.
Additional table information: table: gas_company

Answer: SELECT LOCATION, COUNT(*) FROM gas_station GROUP BY LOCATION ORDER BY COUNT(*) NULLS FIRST


Question:
For each location, how many gas stations are there in order?
Additional table information: table: gas_company

Answer: SELECT LOCATION, COUNT(*) FROM gas_station GROUP BY LOCATION ORDER BY COUNT(*) NULLS FIRST


Question:
Show all headquarters with both a company in banking industry and a company in Oil and gas.
Additional table information: table: gas_company

Answer: SELECT headquarters FROM company WHERE main_industry = 'Banking' INTERSECT SELECT headquarters FROM company WHERE main_industry = 'Oil and gas'


Question:
What are the headquarters that have both a company in the banking and 'oil and gas' industries?
Additional table information: table: gas_company

Answer: SELECT headquarters FROM company WHERE main_industry = 'Banking' INTERSECT SELECT headquarters FROM company WHERE main_industry = 'Oil and gas'


Question:
Show all headquarters without a company in banking industry.
Additional table information: table: gas_company

Answer: SELECT headquarters FROM company EXCEPT SELECT headquarters FROM company WHERE main_industry = 'Banking'


Question:
What are the headquarters without companies that are in the banking industry?
Additional table information: table: gas_company

Answer: SELECT headquarters FROM company EXCEPT SELECT headquarters FROM company WHERE main_industry = 'Banking'


Question:
Show the company name with the number of gas station.
Additional table information: table: gas_company

Answer: SELECT T2.company, COUNT(*) FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id GROUP BY T1.company_id


Question:
For each company id, what are the companies and how many gas stations does each one operate?
Additional table information: table: gas_company

Answer: SELECT T2.company, COUNT(*) FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id GROUP BY T1.company_id


Question:
Show company name and main industry without a gas station.
Additional table information: table: gas_company

Answer: SELECT company, main_industry FROM company WHERE NOT company_id IN (SELECT company_id FROM station_company)


Question:
What are the main industries of the companies without gas stations and what are the companies?
Additional table information: table: gas_company

Answer: SELECT company, main_industry FROM company WHERE NOT company_id IN (SELECT company_id FROM station_company)


Question:
Show the manager name for gas stations belonging to the ExxonMobil company.
Additional table information: table: gas_company

Answer: SELECT T3.manager_name FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id WHERE T2.company = 'ExxonMobil'


Question:
What are the names of the managers for gas stations that are operated by the ExxonMobil company?
Additional table information: table: gas_company

Answer: SELECT T3.manager_name FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id WHERE T2.company = 'ExxonMobil'


Question:
Show all locations where a gas station for company with market value greater than 100 is located.
Additional table information: table: gas_company

Answer: SELECT T3.location FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id WHERE T2.market_value > 100


Question:
What are the locations that have gas stations owned by a company with a market value greater than 100?
Additional table information: table: gas_company

Answer: SELECT T3.location FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id WHERE T2.market_value > 100


Question:
Show the manager name with most number of gas stations opened after 2000.
Additional table information: table: gas_company

Answer: SELECT manager_name FROM gas_station WHERE open_year > 2000 GROUP BY manager_name ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the name of the manager with the most gas stations that opened after 2000?
Additional table information: table: gas_company

Answer: SELECT manager_name FROM gas_station WHERE open_year > 2000 GROUP BY manager_name ORDER BY COUNT(*) DESC LIMIT 1


Question:
order all gas station locations by the opening year.
Additional table information: table: gas_company

Answer: SELECT LOCATION FROM gas_station ORDER BY open_year NULLS FIRST


Question:
What are the locations of all the gas stations ordered by opening year?
Additional table information: table: gas_company

Answer: SELECT LOCATION FROM gas_station ORDER BY open_year NULLS FIRST


Question:
find the rank, company names, market values of the companies in the banking industry order by their sales and profits in billion.
Additional table information: table: gas_company

Answer: SELECT rank, company, market_value FROM company WHERE main_industry = 'Banking' ORDER BY sales_billion NULLS FIRST, profits_billion NULLS FIRST


Question:
What is the rank, company, and market value of every comapny in the banking industry ordered by sales and profits?
Additional table information: table: gas_company

Answer: SELECT rank, company, market_value FROM company WHERE main_industry = 'Banking' ORDER BY sales_billion NULLS FIRST, profits_billion NULLS FIRST


Question:
find the location and Representative name of the gas stations owned by the companies with top 3 Asset amounts.
Additional table information: table: gas_company

Answer: SELECT T3.location, T3.Representative_Name FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id ORDER BY T2.Assets_billion DESC LIMIT 3


Question:
What are the locations and representatives' names of the gas stations owned by the companies with the 3 largest amounts of assets?
Additional table information: table: gas_company

Answer: SELECT T3.location, T3.Representative_Name FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id ORDER BY T2.Assets_billion DESC LIMIT 3


Question:
How many regions do we have?
Additional table information: table: party_people

Answer: SELECT COUNT(*) FROM region


Question:
Count the number of regions.
Additional table information: table: party_people

Answer: SELECT COUNT(*) FROM region


Question:
Show all distinct region names ordered by their labels.
Additional table information: table: party_people

Answer: SELECT DISTINCT region_name FROM region ORDER BY Label NULLS FIRST


Question:
What are the different region names, ordered by labels?
Additional table information: table: party_people

Answer: SELECT DISTINCT region_name FROM region ORDER BY Label NULLS FIRST


Question:
How many parties do we have?
Additional table information: table: party_people

Answer: SELECT COUNT(DISTINCT party_name) FROM party


Question:
Count the number of different parties.
Additional table information: table: party_people

Answer: SELECT COUNT(DISTINCT party_name) FROM party


Question:
Show the ministers and the time they took and left office, listed by the time they left office.
Additional table information: table: party_people

Answer: SELECT minister, took_office, left_office FROM party ORDER BY left_office NULLS FIRST


Question:
Who are the ministers, when did they take office, and when did they leave office, ordered by when they left office?
Additional table information: table: party_people

Answer: SELECT minister, took_office, left_office FROM party ORDER BY left_office NULLS FIRST


Question:
Show the minister who took office after 1961 or before 1959.
Additional table information: table: party_people

Answer: SELECT minister FROM party WHERE took_office > 1961 OR took_office < 1959


Question:
Who are the ministers who took office after 1961 or before 1959?
Additional table information: table: party_people

Answer: SELECT minister FROM party WHERE took_office > 1961 OR took_office < 1959


Question:
Show all ministers who do not belong to Progress Party.
Additional table information: table: party_people

Answer: SELECT minister FROM party WHERE party_name <> 'Progress Party'


Question:
Which ministers are not a part of the Progress Party?
Additional table information: table: party_people

Answer: SELECT minister FROM party WHERE party_name <> 'Progress Party'


Question:
Show all ministers and parties they belong to in descending order of the time they took office.
Additional table information: table: party_people

Answer: SELECT minister, party_name FROM party ORDER BY took_office DESC


Question:
Who are the ministers and what parties do they belong to, listed descending by the times they took office?
Additional table information: table: party_people

Answer: SELECT minister, party_name FROM party ORDER BY took_office DESC


Question:
Return the minister who left office at the latest time.
Additional table information: table: party_people

Answer: SELECT minister FROM party ORDER BY left_office DESC LIMIT 1


Question:
Which minister left office the latest?
Additional table information: table: party_people

Answer: SELECT minister FROM party ORDER BY left_office DESC LIMIT 1