niryuu/sni-each-converted huggingface dataset:
For each director, return the director's name together with the title of the movie they directed that received the highest rating among all of their movies, and the value of that rating. Ignore movies whose director is NULL.
Output: SELECT T2.title ,  T1.stars ,  T2.director ,  max(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID  =  T2.mID WHERE director != "null" GROUP BY director
How many degrees were conferred in "San Jose State University" in 2000?
Output: SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id  =  t2.campus WHERE t1.campus  =  "San Jose State University" AND t2.year  =  2000
Find the details for all chip models.
Output: SELECT * FROM chip_model
Find the average fee on a CSU campus in 1996
Output: SELECT avg(campusfee) FROM csu_fees WHERE YEAR  =  1996
How many lessons taught by staff whose first name has letter 'a' in it?
Output: SELECT count(*) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name LIKE "%a%"
Find the total number of rooms in the apartments that have facility code "Gym".
Output: SELECT sum(T2.room_count) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id  =  T2.apt_id WHERE T1.facility_code  =  "Gym"
What is the campus fee in the year 2000 for San Jose State University?
Output: SELECT t1.campusfee FROM csu_fees AS t1 JOIN campuses AS t2 ON t1.campus  =  t2.id WHERE t2.campus  =  "San Jose State University" AND t1.year  =  2000
What is the average pages per minute color?
Output: SELECT avg(pages_per_minute_color) FROM product
What are the top three apartment types in terms of the average room count? Give me the
Output: SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY avg(room_count) DESC LIMIT 3
List the hardware model name for the phons that were produced by "Nokia Corporation" but whose screen mode type is not Text.
Output: SELECT DISTINCT T2.Hardware_Model_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE t2.Company_name  =  "Nokia Corporation" AND T1.Type != "Text"
What are the chip model and screen mode of the phone with hardware model name "LG-P760"?
Output: SELECT chip_model ,  screen_mode FROM phone WHERE Hardware_Model_name = "LG-P760"
What are the names of all the different reviewers who rates Gone with the Wind?
Output: SELECT DISTINCT T3.name FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID  =  T2.mID JOIN Reviewer AS T3 ON T1.rID  =  T3.rID WHERE T2.title  =  'Gone with the Wind'
What are the names of all directors who made one movie?
Output: SELECT director FROM Movie GROUP BY director HAVING count(*)  =  1
How many reviewers are there?
Output: SELECT count(*) FROM Reviewer
Find the average ram mib size of the chip models that are never used by any phone.
Output: SELECT avg(RAM_MiB) FROM chip_model WHERE model_name NOT IN (SELECT chip_model FROM phone)
In which country and state does Janessa Sawayn live?
Output: SELECT T1.country ,  T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn"
What is the name of the movie that is rated by most of times?
Output: SELECT T2.title ,  T1.mID FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID  =  T2.mID GROUP BY T1.mID ORDER BY count(*) DESC LIMIT 1
List the first name middle name and last name of all staff.
Output: SELECT first_name ,  middle_name ,  last_name FROM Staff
Find all the stores in the district with the most population.
Output: SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id  =  t2.store_id WHERE district_id  =  (SELECT district_id FROM district ORDER BY city_population DESC LIMIT 1)
Return the apartment numbers of the apartments with type code "Flat".
Output: SELECT apt_number FROM Apartments WHERE apt_type_code  =  "Flat"
What is the first name of the staff who did not give any lesson?
Output: SELECT first_name FROM Staff EXCEPT SELECT T2.first_name FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id  =  T2.staff_id
Find the titles of all movies directed by steven spielberg.
Output: SELECT title FROM Movie WHERE director = 'Steven Spielberg'
How many universities have a campus fee higher than average?
Output: SELECT count(*) FROM csu_fees WHERE campusfee  >  (SELECT avg(campusfee) FROM csu_fees)
Find the name and population of district with population between 200000 and 2000000
Output: SELECT District_name ,  City_Population FROM district WHERE City_Population BETWEEN 200000 AND 2000000
Find the Char cells, Pixels and Hardware colours for the screen of the phone whose hardware model name is "LG-P760".
Output: SELECT T1.Char_cells ,  T1.Pixels ,  T1.Hardware_colours FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T2.Hardware_Model_name = "LG-P760"
What are the the lesson ids of all staff taught by Janessa Sawayn whose nickname has the letter s?
Output: SELECT T1.lesson_id FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn" AND nickname LIKE "%s%"
What are the names of the reviewers who have rated a movie more than 3 stars before?
Output: SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID  =  T2.rID WHERE T1.stars  >  3
List the names and origins of people who are not body builders.
Output: SELECT Name ,  birth_place FROM people EXCEPT SELECT T1.Name ,  T1.birth_place FROM people AS T1 JOIN body_builder AS T2 ON T1.people_id  =  T2.people_id
Which last names are both used by customers and by staff?
Output: SELECT last_name FROM Customers INTERSECT SELECT last_name FROM Staff
What are the start and end dates for incidents with incident type code "NOISE"?
Output: SELECT date_incident_start ,  date_incident_end FROM Behavior_Incident WHERE incident_type_code  =  "NOISE"
What is the reviewer id of Daniel Lewis?
Output: SELECT rID FROM Reviewer WHERE name  =  "Daniel Lewis"
How many faculty lines are there in the university that conferred the least number of degrees in year 2001?
Output: SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id  =  t2.campus JOIN degrees AS T3 ON T1.id  =  t3.campus AND t2.year  =  t3.year WHERE t2.year  =  2001 ORDER BY t3.degrees LIMIT 1
Show the unique first names, last names, and phone numbers for all customers with any account.
Output: SELECT DISTINCT T1.customer_first_name ,  T1.customer_last_name ,  T1.phone_number FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id  =  T2.customer_id
How many faculty lines are there at San Francisco State University in 2004?
Output: SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus  =  T2.id WHERE T1.year  =  2004 AND T2.campus  =  "San Francisco State University"
Show the order ids and the number of items in each order.
Output: SELECT order_id ,  count(*) FROM Order_items GROUP BY order_id
What is the name of the movie produced after 2000 and directed by James Cameron?
Output: SELECT title FROM Movie WHERE director = 'James Cameron' AND YEAR  >  2000
What campuses are located in Northridge, Los Angeles or in San Francisco, San Francisco?
Output: SELECT campus FROM campuses WHERE LOCATION  =  "Northridge" AND county  =  "Los Angeles" UNION SELECT campus FROM campuses WHERE LOCATION  =  "San Francisco" AND county  =  "San Francisco"
List email address and birthday of customer whose first name as Carole.
Output: SELECT email_address ,  date_of_birth FROM Customers WHERE first_name = "Carole"
In what years did a movie receive a 4 or 5 star rating, and list the years from oldest to most recently?
Output: SELECT DISTINCT YEAR FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID  =  T2.mID WHERE T2.stars  >=  4 ORDER BY T1.year
What are names of the movies that are either made before 1980 or directed by James Cameron?
Output: SELECT title FROM Movie WHERE director  =  "James Cameron" OR YEAR   <  1980
What are the names of all reviewers that have given 3 or 4 stars for reviews?
Output: SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID  =  T2.rID WHERE T1.stars  =  3 INTERSECT SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID  =  T2.rID WHERE T1.stars  =  4
How many transaction does each account have? Show the number and account id.
Output: SELECT count(*) ,  account_id FROM Financial_transactions
How many movie reviews does each director get?
Output: SELECT count(*) ,  T1.director FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID  =  T2.mID GROUP BY T1.director
What is the average room count of the apartments whose booking status code is "Provisional"?
Output: SELECT avg(room_count) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id  =  T2.apt_id WHERE T1.booking_status_code  =  "Provisional"
Return the order ids and details for orderes with two or more invoices.
Output: SELECT T2.order_id ,  T2.order_details FROM Invoices AS T1 JOIN Orders AS T2 ON T1.order_id  =  T2.order_id GROUP BY T2.order_id HAVING count(*)  >  2
What is the average number of rooms of apartments with type code "Studio"?
Output: SELECT avg(room_count) FROM Apartments WHERE apt_type_code  =  "Studio"
Find all information about student addresses, and sort by monthly rental in descending order.
Output: SELECT * FROM Student_Addresses ORDER BY monthly_rental DESC
Find the names of all directors whose movies are rated by Sarah Martinez.
Output: SELECT DISTINCT T2.director FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID  =  T2.mID JOIN Reviewer AS T3 ON T1.rID  =  T3.rID WHERE T3.name  =  'Sarah Martinez'
Find the dates of assessment notes for students with first name "Fanny".
Output: SELECT T1.date_of_notes FROM Assessment_Notes AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id WHERE T2.first_name  =  "Fanny"
What are teh names of the different products, as well as the number of customers who have ordered each product.
Output: SELECT T2.product_name ,  count(*) FROM Order_items AS T1 JOIN Products AS T2 ON T1.product_id  =  T2.product_id JOIN Orders AS T3 ON T3.order_id  =  T1.order_id GROUP BY T2.product_name
What are the different reviewer names, movie titles, and stars for every rating where the reviewer had the same name as the director?
Output: SELECT DISTINCT T3.name ,  T2.title ,  T1.stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID  =  T2.mID JOIN Reviewer AS T3 ON T1.rID  =  T3.rID WHERE T2.director  =  T3.name
How many invoices do we have?
Output: SELECT count(*) FROM Invoices
Find products with max page size as "A4" and pages per minute color smaller than 5.
Output: SELECT product FROM product WHERE max_page_size  =  "A4" AND pages_per_minute_color  <  5
List each birth place along with the number of people from there.
Output: SELECT Birth_Place ,  COUNT(*) FROM people GROUP BY Birth_Place
What are the birthdays of people in ascending order of height?
Output: SELECT Birth_Date FROM People ORDER BY Height ASC
List the hardware model name and company name for all the phones that were launched in year 2002 or have RAM size greater than 32.
Output: SELECT T2.Hardware_Model_name ,  T2.Company_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name  =  T2.chip_model WHERE T1.Launch_year = 2002 OR T1.RAM_MiB  >  32
How many lessons have been cancelled?
Output: SELECT count(*) FROM Lessons WHERE lesson_status_code = "Cancelled"
Which apartments have bookings with both status codes "Provisional" and "Confirmed"? Give me the apartment numbers.
Output: SELECT T2.apt_number FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id  =  T2.apt_id WHERE T1.booking_status_code  =  "Confirmed" INTERSECT SELECT T2.apt_number FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id  =  T2.apt_id WHERE T1.booking_status_code  =  "Provisional"
What is the customer id, first and last name with most number of accounts.
Output: SELECT T1.customer_id ,  T2.customer_first_name ,  T2.customer_last_name FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1
When did the staff member named Janessa Sawayn join the company?
Output: SELECT date_joined_staff FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn"
List all cities of addresses in alphabetical order.
Output: SELECT city FROM Addresses ORDER BY city
What is the date of birth for the staff member named Janessa Sawayn?
Output: SELECT date_of_birth FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn"
What are the titles and directors of all movies that have a rating higher than the average James Cameron film rating?
Output: SELECT T2.title ,  T2.director FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID  =  T2.mID WHERE T1.stars  >  (SELECT avg(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID  =  T2.mID WHERE T2.director  =  "James Cameron")
What are the titles of all movies that have not been rated?
Output: SELECT title FROM Movie WHERE mID NOT IN (SELECT mID FROM Rating)
What is the total time for all lessons taught by Janessa Sawayn?
Output: SELECT sum(lesson_time) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn"
What are the names of the districts that have both mall and village store style shops?
Output: SELECT t3.District_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id  =  t2.store_id JOIN district AS t3 ON t2.district_id  =  t3.district_id WHERE t1.Type  =  "City Mall" INTERSECT SELECT t3.District_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id  =  t2.store_id JOIN district AS t3 ON t2.district_id  =  t3.district_id WHERE t1.Type  =  "Village Store"
How many undergraduates are there at San Jose State
Output: SELECT sum(t1.undergraduate) FROM discipline_enrollments AS t1 JOIN campuses AS t2 ON t1.campus  =  t2.id WHERE t1.year  =  2004 AND t2.campus  =  "San Jose State University"
Return all distinct detention type codes.
Output: SELECT DISTINCT detention_type_code FROM Detention
Find the names of all stores in Khanewal District.
Output: SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id  =  t2.store_id JOIN district AS t3 ON t2.district_id  =  t3.district_id WHERE t3.district_name  =  "Khanewal District"
Which model has the least amount of RAM? List the model name and the amount of RAM.
Output: SELECT Model_name ,  RAM_MiB FROM chip_model ORDER BY RAM_MiB ASC LIMIT 1
Find the title and star rating of the movie that got the least rating star for each reviewer.
Output: SELECT T2.title ,  T1.rID ,  T1.stars ,  min(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID  =  T2.mID GROUP BY T1.rID
Show all product names without an order.
Output: SELECT product_name FROM Products EXCEPT SELECT T1.product_name FROM Products AS T1 JOIN Order_items AS T2 ON T1.product_id  =  T2.product_id
What are the wifi and screen mode type of the hardware model named "LG-P760"?
Output: SELECT T1.WiFi , T3.Type FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name  =  T2.chip_model JOIN screen_mode AS T3 ON T2.screen_mode = T3.Graphics_mode WHERE T2.Hardware_Model_name = "LG-P760"
Count the total number of apartment bookings.
Output: SELECT count(*) FROM Apartment_Bookings
Find the city with the most number of stores.
Output: SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id  =  t2.store_id JOIN district AS t3 ON t2.district_id  =  t3.district_id GROUP BY t3.headquartered_city ORDER BY count(*) DESC LIMIT 1
Who directed Avatar?
Output: SELECT director FROM Movie WHERE title  = 'Avatar'
When are the birthdays of customer who are classified as 'Good Customer' status?
Output: SELECT date_of_birth FROM Customers WHERE customer_status_code  =  'Good Customer'
Find the ids of reviewers who didn't only give 4 star.
Output: SELECT rID FROM Rating WHERE stars != 4
How much in total does customer with first name as Carole and last name as Bernhard paid?
Output: SELECT sum(T1.amount_payment) FROM Customer_Payments AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Carole" AND T2.last_name = "Bernhard"
How many products were not included in any order?
Output: SELECT count(*) FROM products WHERE product_id NOT IN ( SELECT product_id FROM Order_items )
List the height and weight of people in descending order of height.
Output: SELECT Height ,  Weight FROM people ORDER BY Height DESC
How many transactions do we have?
Output: SELECT count(*) FROM Financial_transactions
What is highest rating for the most recent movie and when was it released?
Output: SELECT max(T1.stars) ,  T2.year FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID  =  T2.mID WHERE T2.year  =  (SELECT max(YEAR) FROM Movie)
What are the names of the states that have 2 to 4 employees living there?
Output: SELECT T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.state_province_county HAVING count(*) BETWEEN 2 AND 4
What is the id and detail of the vehicle used in lessons for most of the times?
Output: SELECT T1.vehicle_id ,  T1.vehicle_details FROM Vehicles AS T1 JOIN Lessons AS T2 ON T1.vehicle_id  =  T2.vehicle_id GROUP BY T1.vehicle_id ORDER BY count(*) DESC LIMIT 1
How many faculty, in total, are there in the year 2002?
Output: SELECT sum(faculty) FROM faculty WHERE YEAR  =  2002
Find the name all districts with city area greater than 10 or population larger than 100000
Output: SELECT district_name FROM district WHERE city_area  >  10 OR City_Population  >  100000
List the weight of the body builders who have snatch score higher than 140 or have the height greater than 200.
Output: SELECT T2.weight FROM body_builder AS T1 JOIN people AS T2 ON T1.people_id  =  T2.people_id WHERE T1.snatch  >  140 OR T2.height  >  200
How many customers in total?
Output: SELECT count(*) FROM Customers
What are the ids, names, dates of opening, and other details for accounts corresponding to the customer with the first name "Meaghan"?
Output: SELECT T1.account_id ,  T1.date_account_opened ,  T1.account_name ,  T1.other_account_details FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.customer_first_name  =  'Meaghan'
Show order ids and the total quantity in each order.
Output: SELECT order_id ,  sum(product_quantity) FROM Order_items GROUP BY order_id
What is the zip code of the address where the teacher with first name "Lyla" lives?
Output: SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Teachers AS T2 ON T1.address_id  =  T2.address_id WHERE T2.first_name  =  "Lyla"
Find the pixels of the screen modes that are used by both phones with full accreditation types and phones with Provisional accreditation types.
Output: SELECT t1.pixels FROM screen_mode AS t1 JOIN phone AS t2 ON t1.Graphics_mode  =  t2.screen_mode WHERE t2.Accreditation_type  =  'Provisional' INTERSECT SELECT t1.pixels FROM screen_mode AS t1 JOIN phone AS t2 ON t1.Graphics_mode  =  t2.screen_mode WHERE t2.Accreditation_type  =  'Full'
Find the number of apartments that have no facility.
Output: SELECT count(*) FROM Apartments WHERE apt_id NOT IN (SELECT apt_id FROM Apartment_Facilities)
How many assessment notes are there in total?
Output: SELECT count(*) FROM ASSESSMENT_NOTES
How many different products correspond to each order id?
Output: SELECT order_id ,  count(DISTINCT product_id) FROM Order_items GROUP BY order_id
Find the id and last name of the student that has the most behavior incidents?
Output: SELECT T1.student_id ,  T2.last_name FROM Behavior_Incident AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1
What is the average price for a lesson taught by Janessa Sawayn?
Output: SELECT avg(price) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn"
What is the status code, mobile phone number and email address of customer with last name as Kohler or first name as Marina?
Output: SELECT customer_status_code ,  cell_mobile_phone_number ,  email_address FROM Customers WHERE first_name = "Marina" OR last_name  =  "Kohler"
Find the ids and first names of the 3 teachers that have the most number of assessment notes?
Output: SELECT T1.teacher_id ,  T2.first_name FROM Assessment_Notes AS T1 JOIN Teachers AS T2 ON T1.teacher_id  =  T2.teacher_id GROUP BY T1.teacher_id ORDER BY count(*) DESC LIMIT 3
What is the nickname of the employee named Janessa Sawayn?
Output: SELECT nickname FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn"
Which campus has the most faculties in year 2003?
Output: SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id  =  T2.campus WHERE T2.year  =  2003 ORDER BY T2.faculty DESC LIMIT 1
What are the line 1 and average monthly rentals of all student addresses?
Output: SELECT T1.line_1 ,  avg(T2.monthly_rental) FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id  =  T2.address_id GROUP BY T2.address_id
How many distinct birth places are there?
Output: SELECT count(DISTINCT Birth_Place) FROM people
What are the invoice dates, order ids, and order details for all invoices?
Output: SELECT T1.invoice_date ,  T1.order_id ,  T2.order_details FROM Invoices AS T1 JOIN Orders AS T2 ON T1.order_id  =  T2.order_id
List the number of customers that did not have any payment history.
Output: SELECT count(*) FROM Customers WHERE customer_id NOT IN ( SELECT customer_id FROM Customer_Payments )
What is the campus fee of "San Francisco State University" in year 2000?
Output: SELECT t1.campusfee FROM csu_fees AS t1 JOIN campuses AS t2 ON t1.campus  =  t2.id WHERE t2.campus  =  "San Francisco State University" AND t1.year  =  2000
For all directors who directed more than one movie, return the titles of all movies directed by them, along with the director name. Sort by director name, then movie title.
Output: SELECT T1.title ,  T1.director FROM Movie AS T1 JOIN Movie AS T2 ON T1.director  =  T2.director WHERE T1.title != T2.title ORDER BY T1.director ,  T1.title
Which apartment type has the largest number of total rooms? Return the apartment type code, its number of bathrooms and number of bedrooms.
Output: SELECT apt_type_code ,  bathroom_count ,  bedroom_count FROM Apartments GROUP BY apt_type_code ORDER BY sum(room_count) DESC LIMIT 1
Which district has the least area?
Output: SELECT district_name FROM district ORDER BY city_area ASC LIMIT 1
How many dogs went through any treatments?
Output: SELECT count(DISTINCT dog_id) FROM Treatments
What is the name of the high schooler who has the greatest number of friends?
Output: SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id  =  T2.id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1
what is the name and nation of the singer who have a song having 'Hey' in its name?
Output: SELECT name ,  country FROM singer WHERE song_name LIKE '%Hey%'
How many templates do we have?
Output: SELECT count(*) FROM Templates
What are the names of all cartoons directed by Ben Jones?
Output: SELECT Title FROM Cartoon WHERE Directed_by = "Ben Jones"
What are the major record formats of orchestras, sorted by their frequency?
Output: SELECT Major_Record_Format FROM orchestra GROUP BY Major_Record_Format ORDER BY COUNT(*) ASC
What are flight numbers of flights departing from Airport "APG"?
Output: SELECT FlightNo FROM FLIGHTS WHERE SourceAirport  =  "APG"
How many flights depart from City Aberdeen?
Output: SELECT count(*) FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.SourceAirport  =  T2.AirportCode WHERE T2.City  =  "Aberdeen"
List each charge type and its amount.
Output: SELECT charge_type ,  charge_amount FROM Charges
What are all the makers and models?
Output: SELECT Maker ,  Model FROM MODEL_LIST
What are the countries that have cartoons on TV that were written by Todd Casey?
Output: SELECT T1.country FROM TV_Channel AS T1 JOIN cartoon AS T2 ON T1.id = T2.Channel WHERE T2.written_by  =  'Todd Casey'
What is the number of cartoones written by Joseph Kuhr?
Output: SELECT count(*) FROM Cartoon WHERE Written_by = "Joseph Kuhr"
How many teachers are there?
Output: SELECT count(*) FROM teacher
Show the citizenship shared by singers with birth year before 1945 and after 1955.
Output: SELECT Citizenship FROM singer WHERE Birth_Year  <  1945 INTERSECT SELECT Citizenship FROM singer WHERE Birth_Year  >  1955
How many countries exist?
Output: SELECT count(*) FROM COUNTRIES
Show all paragraph ids and texts for the document with name 'Welcome to NY'.
Output: SELECT T1.paragraph_id ,   T1.paragraph_text FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id  =  T2.document_id WHERE T2.Document_Name  =  'Welcome to NY'
How many professionals have performed any treatment to dogs?
Output: SELECT count(DISTINCT professional_id) FROM Treatments
How many courses in total are listed?
Output: SELECT count(*) FROM Courses
What are the names of the employees who never received any evaluation?
Output: SELECT name FROM employee WHERE Employee_ID NOT IN (SELECT Employee_ID FROM evaluation)
Find the first names that are used for professionals or owners but are not used as dog names.
Output: SELECT first_name FROM Professionals UNION SELECT first_name FROM Owners EXCEPT SELECT name FROM Dogs
Show the ids of high schoolers who have friends and are also liked by someone else.
Output: SELECT student_id FROM Friend INTERSECT SELECT liked_id FROM Likes
Return the owner id, first name and last name of the owner who has the most dogs.
Output: SELECT T1.owner_id ,  T2.first_name ,  T2.last_name FROM Dogs AS T1 JOIN Owners AS T2 ON T1.owner_id  =  T2.owner_id GROUP BY T1.owner_id ORDER BY count(*) DESC LIMIT 1
How many likes correspond to each student id?
Output: SELECT student_id ,  count(*) FROM Likes GROUP BY student_id
What are the regions that use English or Dutch?
Output: SELECT DISTINCT T1.Region FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code  =  T2.CountryCode WHERE T2.Language  =  "English" OR T2.Language  =  "Dutch"
Which airports do not have departing or arriving flights?
Output: SELECT AirportName FROM Airports WHERE AirportCode NOT IN (SELECT SourceAirport FROM Flights UNION SELECT DestAirport FROM Flights)
Show all template type codes and the number of documents using each type.
Output: SELECT T1.template_type_code ,  count(*) FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id  =  T2.template_id GROUP BY T1.template_type_code
Which city has most number of arriving flights?
Output: SELECT T1.City FROM AIRPORTS AS T1 JOIN FLIGHTS AS T2 ON T1.AirportCode  =  T2.DestAirport GROUP BY T1.City ORDER BY count(*) DESC LIMIT 1
Give the code of the airport with the least flights.
Output: SELECT T1.AirportCode FROM AIRPORTS AS T1 JOIN FLIGHTS AS T2 ON T1.AirportCode  =  T2.DestAirport OR T1.AirportCode  =  T2.SourceAirport GROUP BY T1.AirportCode ORDER BY count(*) LIMIT 1
Return the names of the 3 countries with the fewest people.
Output: SELECT Name FROM country ORDER BY Population ASC LIMIT 3
List the title of all cartoon directed by "Ben Jones" or "Brandon Vietti".
Output: SELECT Title FROM Cartoon WHERE Directed_by = "Ben Jones" OR Directed_by = "Brandon Vietti"
Which language is the most popular on the Asian continent?
Output: SELECT T2.Language FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code  =  T2.CountryCode WHERE T1.Continent  =  "Asia" GROUP BY T2.Language ORDER BY COUNT (*) DESC LIMIT 1
How many different departments offer degrees?
Output: SELECT count(DISTINCT department_id) FROM Degree_Programs
Find the number of players for each hand type.
Output: SELECT count(*) ,  hand FROM players GROUP BY hand
Find the id of students who do not have a cat pet.
Output: SELECT stuid FROM student EXCEPT SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid  =  T2.stuid JOIN pets AS T3 ON T3.petid  =  T2.petid WHERE T3.pettype  =  'cat'
How many flights do we have?
Output: SELECT count(*) FROM FLIGHTS
What is the series name and country of all TV channels that are playing cartoons directed by Ben Jones and cartoons directed by Michael Chang?
Output: SELECT T1.series_name ,  T1.country FROM TV_Channel AS T1 JOIN cartoon AS T2 ON T1.id = T2.Channel WHERE T2.directed_by  =  'Michael Chang' INTERSECT SELECT T1.series_name ,  T1.country FROM TV_Channel AS T1 JOIN cartoon AS T2 ON T1.id = T2.Channel WHERE T2.directed_by  =  'Ben Jones'
How many flights have destination ATO?
Output: SELECT count(*) FROM FLIGHTS WHERE DestAirport  =  "ATO"
What is the total surface area of the continents Asia and Europe?
Output: SELECT sum(SurfaceArea) FROM country WHERE Continent  =  "Asia" OR Continent  =  "Europe"
Which template type code is used by most number of documents?
Output: SELECT T1.template_type_code FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id  =  T2.template_id GROUP BY T1.template_type_code ORDER BY count(*) DESC LIMIT 1
What is the average horsepower for all cards produced before 1980?
Output: SELECT avg(horsepower) FROM CARS_DATA WHERE YEAR  <  1980
Show the property type descriptions of properties belonging to that code.
Output: SELECT T2.property_type_description FROM Properties AS T1 JOIN Ref_Property_Types AS T2 ON T1.property_type_code  =  T2.property_type_code GROUP BY T1.property_type_code
How many documents are using the template with type code 'PPT'?
Output: SELECT count(*) FROM Documents AS T1 JOIN Templates AS T2 ON T1.Template_ID  =  T2.Template_ID WHERE T2.Template_Type_Code  =  'PPT'
What is the first name of the student whose permanent address is different from his or her current one?
Output: SELECT first_name FROM Students WHERE current_address_id != permanent_address_id
For model volvo, how many cylinders does the car with the least accelerate have?
Output: SELECT T1.cylinders FROM CARS_DATA AS T1 JOIN CAR_NAMES AS T2 ON T1.Id  =  T2.MakeId WHERE T2.Model  =  'volvo' ORDER BY T1.accelerate ASC LIMIT 1
What are the ids of the TV channels that do not have any cartoons directed by Ben Jones?
Output: SELECT id FROM TV_Channel EXCEPT SELECT channel FROM cartoon WHERE directed_by  =  'Ben Jones'
Show the names of conductors and the orchestras they have conducted.
Output: SELECT T1.Name ,  T2.Orchestra FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID  =  T2.Conductor_ID
Return the names and template ids for documents that contain the letter w in their description.
Output: SELECT document_name ,  template_id FROM Documents WHERE Document_Description LIKE "%w%"
What other details can you tell me about students in reverse alphabetical order?
Output: SELECT other_student_details FROM Students ORDER BY other_student_details DESC
What is the maximum number of times that a course shows up in different transcripts and what is that course's enrollment id?
Output: SELECT count(*) ,  student_course_id FROM Transcript_Contents GROUP BY student_course_id ORDER BY count(*) DESC LIMIT 1
Which airline has most number of flights?
Output: SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid  =  T2.Airline GROUP BY T1.Airline ORDER BY count(*) DESC LIMIT 1
Return the ids corresponding to templates with the description 'Presentation'.
Output: SELECT T2.template_id FROM Ref_template_types AS T1 JOIN Templates AS T2 ON T1.template_type_code  = T2.template_type_code WHERE T1.template_type_description  =  "Presentation"
What are the names of students who have 2 or more likes?
Output: SELECT T2.name FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id  =  T2.id GROUP BY T1.student_id HAVING count(*)  >=  2
Find the city with the largest population that uses English.
Output: SELECT T1.Name ,  T1.Population FROM city AS T1 JOIN countrylanguage AS T2 ON T1.CountryCode  =  T2.CountryCode WHERE T2.Language  =  "English" ORDER BY T1.Population DESC LIMIT 1
What are the names of the teachers whose courses have not been arranged?
Output: SELECT Name FROM teacher WHERE Teacher_id NOT IN (SELECT Teacher_id FROM course_arrange)
What is the smallest weight of the car produced with 8 cylinders on 1974?
Output: SELECT Weight FROM CARS_DATA WHERE Cylinders  =  4 AND YEAR  =  1974 ORDER BY Weight ASC LIMIT 1
What is the earliest date of a transcript release, and what details can you tell me?
Output: SELECT transcript_date ,  other_details FROM Transcripts ORDER BY transcript_date ASC LIMIT 1
How much does the most recent treatment cost?
Output: SELECT cost_of_treatment FROM Treatments ORDER BY date_of_treatment DESC LIMIT 1
What is the number of the cars with horsepower more than 150?
Output: SELECT count(*) FROM CARS_DATA WHERE horsepower  >  150
Show the names of singers and the total sales of their songs.
Output: SELECT T1.Name ,  sum(T2.Sales) FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID  =  T2.Singer_ID GROUP BY T1.Name
Find the average age of losers and winners of all matches.
Output: SELECT avg(loser_age) ,  avg(winner_age) FROM matches
how many countries are in Asia?
Output: SELECT count(*) FROM country WHERE continent  =  "Asia"
How many friends does the high school student Kyle have?
Output: SELECT count(*) FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id  =  T2.id WHERE T2.name  =  "Kyle"
What is the name of the conductor who has worked the greatest number of years?
Output: SELECT Name FROM conductor ORDER BY Year_of_Work DESC LIMIT 1
How many documents do we have?
Output: SELECT count(*) FROM Documents
Find the manager name and district of the shop whose number of products is the largest.
Output: SELECT manager_name ,  district FROM shop ORDER BY number_products DESC LIMIT 1
What is the semester which most student registered in? Show both the name and the id.
Output: SELECT T1.semester_name ,  T1.semester_id FROM Semesters AS T1 JOIN Student_Enrolment AS T2 ON T1.semester_id  =  T2.semester_id GROUP BY T1.semester_id ORDER BY count(*) DESC LIMIT 1
What are the names of the singers whose birth years are either 1948 or 1949?
Output: SELECT Name FROM singer WHERE Birth_Year  =  1948 OR Birth_Year  =  1949
Find the program which most number of students are enrolled in. List both the id and the summary.
Output: SELECT T1.degree_program_id ,  T1.degree_summary_name FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id  =  T2.degree_program_id GROUP BY T1.degree_program_id ORDER BY count(*) DESC LIMIT 1
Show the document id with paragraph text 'Brazil' and 'Ireland'.
Output: SELECT document_id FROM Paragraphs WHERE paragraph_text  =  'Brazil' INTERSECT SELECT document_id FROM Paragraphs WHERE paragraph_text  =  'Ireland'
What are the package options of all tv channels that are not playing any cartoons directed by Ben Jones?
Output: SELECT package_option FROM TV_Channel WHERE id NOT IN (SELECT channel FROM cartoon WHERE directed_by  =  'Ben Jones')
Show template ids, version numbers, and template type codes for all templates.
Output: SELECT template_id ,  version_number ,  template_type_code FROM Templates
How much surface area do the countires in the Carribean cover together?
Output: SELECT sum(SurfaceArea) FROM country WHERE Region  =  "Caribbean"
Show ids of all students who do not have any friends.
Output: SELECT id FROM Highschooler EXCEPT SELECT student_id FROM Friend
What is the name and capacity for the stadium with the highest average attendance?
Output: SELECT name ,  capacity FROM stadium ORDER BY average DESC LIMIT 1
How many paragraphs in total?
Output: SELECT count(*) FROM Paragraphs
What are the codes of countries with more than 50 players?
Output: SELECT country_code FROM players GROUP BY country_code HAVING count(*)  >  50
What are the names of the countries with no car makers?
Output: SELECT CountryName FROM countries EXCEPT SELECT T1.CountryName FROM countries AS T1 JOIN CAR_MAKERS AS T2 ON T1.countryId  =  T2.Country
What is the model of the car with the smallest amount of horsepower?
Output: SELECT T1.Model FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId  =  T2.Id ORDER BY T2.horsepower ASC LIMIT 1
Find all airlines that have flights from both airports 'APG' and 'CVO'.
Output: SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid  =  T2.Airline WHERE T2.SourceAirport  =  "APG" INTERSECT SELECT T1.Airline FROM AIRLINES AS T1 JOIN FLIGHTS AS T2 ON T1.uid  =  T2.Airline WHERE T2.SourceAirport  =  "CVO"
How many different forms of governments are there in Africa?
Output: SELECT count(DISTINCT GovernmentForm) FROM country WHERE Continent  =  "Africa"
How many likes does Kyle have?
Output: SELECT count(*) FROM Likes AS T1 JOIN Highschooler AS T2 ON T1.student_id  =  T2.id WHERE T2.name  =  "Kyle"
What are the different ids and names of the battles that lost any 'Brig' type shipes?
Output: SELECT DISTINCT T1.id ,  T1.name FROM battle AS T1 JOIN ship AS T2 ON T1.id  =  T2.lost_in_battle WHERE T2.ship_type  =  'Brig'
What is the pixel aspect ratio and country of origin for all TV channels that do not use English?
Output: SELECT Pixel_aspect_ratio_PAR ,  country FROM tv_channel WHERE LANGUAGE != 'English'
How long is the people’s average life expectancy in Central Africa?
Output: SELECT avg(LifeExpectancy) FROM country WHERE Region  =  "Central Africa"
What are the names of the teachers and how many courses do they teach?
Output: SELECT T2.Name ,  COUNT(*) FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID  =  T2.Teacher_ID GROUP BY T2.Name
What is the largest amount of horsepower for the models with 3 cylinders and what make is it?
Output: SELECT T2.horsepower ,  T1.Make FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId  =  T2.Id WHERE T2.cylinders  =  3 ORDER BY T2.horsepower DESC LIMIT 1
What is the version number and template type code for the template with version number later than 5?
Output: SELECT version_number ,  template_type_code FROM Templates WHERE version_number  >  5
What is the ship id and name that caused most total injuries?
Output: SELECT T2.id ,  T2.name FROM death AS T1 JOIN ship AS t2 ON T1.caused_by_ship_id  =  T2.id GROUP BY T2.id ORDER BY count(*) DESC LIMIT 1
What are the first name and last name of the professionals who have done treatment with cost below average?
Output: SELECT DISTINCT T1.first_name ,  T1.last_name FROM Professionals AS T1 JOIN Treatments AS T2 WHERE cost_of_treatment  <  ( SELECT avg(cost_of_treatment) FROM Treatments )
List each owner's first name, last name, and the size of his for her dog.
Output: SELECT T1.first_name ,  T1.last_name ,  T2.size_code FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id  =  T2.owner_id
What are the countries that are not playing cartoons written by Todd Casey?
Output: SELECT country FROM TV_Channel EXCEPT SELECT T1.country FROM TV_Channel AS T1 JOIN cartoon AS T2 ON T1.id = T2.Channel WHERE T2.written_by  =  'Todd Casey'
Find the first name and age of students who have a dog but do not have a cat as a pet.
Output: SELECT T1.fname ,  T1.age FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid  =  T2.stuid JOIN pets AS T3 ON T3.petid  =  T2.petid WHERE T3.pettype  =  'dog' AND T1.stuid NOT IN (SELECT T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid  =  T2.stuid JOIN pets AS T3 ON T3.petid  =  T2.petid WHERE T3.pettype  =  'cat')
Return the money rank of the poker player with the greatest height.
Output: SELECT T2.Money_Rank FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID  =  T2.People_ID ORDER BY T1.Height DESC LIMIT 1
Find the first names of owners living in Virginia and the names of dogs they own.
Output: SELECT T1.first_name ,  T2.name FROM Owners AS T1 JOIN Dogs AS T2 ON T1.owner_id  =  T2.owner_id WHERE T1.state  =  'Virginia'
Show name, country, age for all singers ordered by age from the oldest to the youngest.
Output: SELECT name ,  country ,  age FROM singer ORDER BY age DESC
Find the total number of matches.
Output: SELECT count(*) FROM matches
List all document ids with at least two paragraphs.
Output: SELECT document_id FROM Paragraphs GROUP BY document_id HAVING count(*)  >=  2
How many airports do we have?
Output: SELECT count(*) FROM AIRPORTS
How many available features are there in total?
Output: SELECT count(*) FROM Other_Available_Features
What is the best rank of losers across all matches?
Output: SELECT min(loser_rank) FROM matches
What are the details for the paragraph that includes the text 'Korea'?
Output: SELECT Other_Details FROM Paragraphs WHERE paragraph_text  =  'Korea'
What are the names and id of courses having at most 2 sections?
Output: SELECT T1.course_name ,  T1.course_id FROM Courses AS T1 JOIN Sections AS T2 ON T1.course_id  =  T2.course_id GROUP BY T1.course_id HAVING count(*)  <=  2
How many different series and contents are listed in the TV Channel table?
Output: SELECT count(DISTINCT series_name) ,  count(DISTINCT content) FROM TV_Channel
What are the region and population of Angola?
Output: SELECT Population ,  Region FROM country WHERE Name  =  "Angola"
How many singers do we have?
Output: SELECT count(*) FROM singer
How many flights arriving in Aberdeen city?
Output: SELECT count(*) FROM FLIGHTS AS T1 JOIN AIRPORTS AS T2 ON T1.DestAirport  =  T2.AirportCode WHERE T2.City  =  "Aberdeen"
Which professionals live in the state of Indiana or have done treatment on more than 2 treatments? List his or her id, last name and cell phone.
Output: SELECT professional_id ,  last_name ,  cell_number FROM Professionals WHERE state  =  'Indiana' UNION SELECT T1.professional_id ,  T1.last_name ,  T1.cell_number FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id  =  T2.professional_id GROUP BY T1.professional_id HAVING count(*)  >  2
What are the names of students who have no friends?
Output: SELECT name FROM Highschooler EXCEPT SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id  =  T2.id
Show the years in which orchestras that have given more than one performance are founded.
Output: SELECT Year_of_Founded FROM orchestra AS T1 JOIN performance AS T2 ON T1.Orchestra_ID  =  T2.Orchestra_ID GROUP BY T2.Orchestra_ID HAVING COUNT(*)  >  1
What is the number of car models created by the car maker American Motor Company?
Output: SELECT count(*) FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id  =  T2.Maker WHERE T1.FullName  =  'American Motor Company'
Count the number of orchestras that have CD or DVD as their record format.
Output: SELECT COUNT(*) FROM orchestra WHERE Major_Record_Format  =  "CD" OR Major_Record_Format  =  "DVD"
What are the names of all the countries that became independent after 1950?
Output: SELECT Name FROM country WHERE IndepYear  >  1950
Give me all the information about hiring.
Output: SELECT * FROM hiring
find the names of museums which have more staff than the minimum staff number of all museums opened after 2010.
Output: SELECT name FROM museum WHERE num_of_staff  >  (SELECT min(num_of_staff) FROM museum WHERE open_year  >  2010)
What are all the possible breed type and size type combinations?
Output: SELECT DISTINCT breed_code ,  size_code FROM dogs
What are the cost and treatment type description of each treatment?
Output: SELECT T1.cost_of_treatment ,  T2.treatment_type_description FROM Treatments AS T1 JOIN treatment_types AS T2 ON T1.treatment_type_code  =  T2.treatment_type_code
What is the name of the semester with no students enrolled?
Output: SELECT semester_name FROM Semesters WHERE semester_id NOT IN( SELECT semester_id FROM Student_Enrolment )
Which region is the city Kabul located in?
Output: SELECT Region FROM country AS T1 JOIN city AS T2 ON T1.Code  =  T2.CountryCode WHERE T2.Name  =  "Kabul"
How many paragraphs for the document with name 'Summer Show'?
Output: SELECT count(*) FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_ID  =  T2.document_ID WHERE T2.document_name  =  'Summer Show'
What are the date and the operating professional's first name of each treatment?
Output: SELECT T1.date_of_treatment ,  T2.first_name FROM Treatments AS T1 JOIN Professionals AS T2 ON T1.professional_id  =  T2.professional_id
What are the names of properties that are either houses or apartments with more than 1 room?
Output: SELECT property_name FROM Properties WHERE property_type_code  =  "House" UNION SELECT property_name FROM Properties WHERE property_type_code  =  "Apartment" AND room_count  >  1
What is the name of the breed with the most dogs?
Output: SELECT T1.breed_name FROM Breeds AS T1 JOIN Dogs AS T2 ON T1.breed_code  =  T2.breed_code GROUP BY T1.breed_name ORDER BY count(*) DESC LIMIT 1
Show all the grades of the high schoolers.
Output: SELECT grade FROM Highschooler
How many car makers are there in france?
Output: SELECT count(*) FROM CAR_MAKERS AS T1 JOIN COUNTRIES AS T2 ON T1.Country  =  T2.CountryId WHERE T2.CountryName  =  'france'
Give the language that is spoken in the most countries.
Output: SELECT LANGUAGE FROM countrylanguage GROUP BY LANGUAGE ORDER BY count(*) DESC LIMIT 1
What is the average miles per gallon(mpg) of the cars with 4 cylinders?
Output: SELECT avg(mpg) FROM CARS_DATA WHERE Cylinders  =  4
What is the average edispl of the cars of model volvo?
Output: SELECT avg(T2.edispl) FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId  =  T2.Id WHERE T1.Model  =  'volvo'
How many official languages are spoken in Afghanistan?
Output: SELECT COUNT(*) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code  =  T2.CountryCode WHERE T1.Name  =  "Afghanistan" AND IsOfficial  =  "T"
What are the ids, names, and descriptions for all documents?
Output: SELECT document_id ,  document_name ,  document_description FROM Documents
What is the number of distinct continents where Chinese is spoken?
Output: SELECT COUNT( DISTINCT Continent) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code  =  T2.CountryCode WHERE T2.Language  =  "Chinese"
What are the first names of all players, and their total ranking points?
Output: SELECT sum(ranking_points) ,  T1.first_name FROM players AS T1 JOIN rankings AS T2 ON T1.player_id  =  T2.player_id GROUP BY T1.first_name
What is the area code in which the most voters voted?
Output: SELECT T1.area_code FROM area_code_state AS T1 JOIN votes AS T2 ON T1.state  =  T2.state GROUP BY T1.area_code ORDER BY count(*) DESC LIMIT 1
How is the math course described?
Output: SELECT course_description FROM Courses WHERE course_name  =  'math'
Give the city and country for the Alton airport.
Output: SELECT City ,  Country FROM AIRPORTS WHERE AirportName  =  "Alton"
What are flight numbers of Airline "United Airlines"?
Output: SELECT T1.FlightNo FROM FLIGHTS AS T1 JOIN AIRLINES AS T2 ON T2.uid  =  T1.Airline WHERE T2.Airline  =  "United Airlines"
Count the number of templates of the type CV.
Output: SELECT count(*) FROM Templates WHERE template_type_code  =  "CV"
What is the number of cars with a greater accelerate than the one with the most horsepower?
Output: SELECT COUNT(*) FROM CARS_DATA WHERE Accelerate  >  ( SELECT Accelerate FROM CARS_DATA ORDER BY Horsepower DESC LIMIT 1 )
Return the names of the 3 most populated countries.
Output: SELECT Name FROM country ORDER BY Population DESC LIMIT 3
Show the record companies shared by orchestras founded before 2003 and after 2003.
Output: SELECT Record_Company FROM orchestra WHERE Year_of_Founded  <  2003 INTERSECT SELECT Record_Company FROM orchestra WHERE Year_of_Founded  >  2003
List the final tables made and the best finishes of poker players.
Output: SELECT Final_Table_Made ,  Best_Finish FROM poker_player
What are the country code and first name of the players who won in both tourney WTA Championships and Australian Open?
Output: SELECT T1.country_code ,  T1.first_name FROM players AS T1 JOIN matches AS T2 ON T1.player_id  =  T2.winner_id WHERE T2.tourney_name  =  'WTA Championships' INTERSECT SELECT T1.country_code ,  T1.first_name FROM players AS T1 JOIN matches AS T2 ON T1.player_id  =  T2.winner_id WHERE T2.tourney_name  =  'Australian Open'
List the section_name in reversed lexicographical order.
Output: SELECT section_name FROM Sections ORDER BY section_name DESC
Which employee received the most awards in evaluations? Give me the employee name.
Output: SELECT t1.name FROM employee AS t1 JOIN evaluation AS t2 ON t1.Employee_ID  =  t2.Employee_ID GROUP BY t2.Employee_ID ORDER BY count(*) DESC LIMIT 1
How many friends does each student have?
Output: SELECT student_id ,  count(*) FROM Friend GROUP BY student_id
Which owners live in the state whose name contains the substring 'North'? List his first name, last name and email.
Output: SELECT first_name ,  last_name ,  email_address FROM Owners WHERE state LIKE '%North%'
List the number of all matches who played in years of 2013 or 2016.
Output: SELECT count(*) FROM matches WHERE YEAR  =  2013 OR YEAR  =  2016
What is the average grade of students who have friends?
Output: SELECT avg(grade) FROM Highschooler WHERE id IN (SELECT T1.student_id FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id  =  T2.id)