MikeXydas/qr2t_benchmark huggingface dataset:
Table: journalist, news_report
Question: Find the average age and experience working length of journalists working on different role type.
SQL query:
SELECT AVG(t1.age) AS "average age", AVG(Years_working) AS "average Years_working", t2.work_type AS "news_report work_type" 
 FROM journalist AS t1 JOIN news_report AS t2 ON t1.journalist_id = t2.journalist_id 
 GROUP BY t2.work_type
Result:
,average age,average Years_working,news_report work_type
0,43.0,16.5,Host

Answer: For the work type of Host the average age of journalists is 43 and the average years working is 16.5
Table: home_game, team
Question: How many games in total did team Boston Red Stockings attend from 2000 to 2010?
SQL query:
SELECT SUM(T1.attendance) AS "sum of attendance", T2.name AS "team name", T1.year AS "home_game year" 
 FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br 
 WHERE T2.name = 'Boston Red Stockings' AND T1.year BETWEEN 2000 AND 2010
Result:
,team name,home_game year,sum of attendance
0,Boston Red Stockings,2000,156651355

Answer: Boston Red Stockings team attended 156651355 games from 2000 to 2010.
Table: chip_model
Question: Find the details for all chip models.
SQL query:
SELECT * 
 FROM chip_model
Result:
,WiFi,Slots,RAM_MiB,ROM_MiB,Bluetooth,Model_name,Launch_year
0,No,"1CFII,1SD",32.0,32.0,No,X5,2002.0

Answer: The X5 model does not have WiFi, it has 1CFII,1SD slots, 32 RAM MiB, 32 ROM MiB, it does not have Bluetooth and it was launched at 2002.
Table: actor, musical
Question: What are the names of actors and the musicals that they are in?
SQL query:
SELECT T1.Name AS "actor Name", T2.Name AS "musical Name" 
 FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID
Result:
,actor Name,musical Name
0,Ray Meagher,The Phantom of the Opera

Answer: The actor name is Ray Meagher and the musical name is The Phantom of the Opera
Table: party
Question: How many parties are there?
SQL query:
SELECT COUNT(*) AS "count of party" 
 FROM party
Result:
,count of party
0,8

Answer: 8 parties were hosted.
Table: All_documents
Question: When was the document named "Marry CV" stored? Give me the date.
SQL query:
SELECT date_stored, Document_name 
 FROM All_documents 
 WHERE Document_name = 'Marry CV'
Result:
,Date_Stored,Document_Name
0,1986-10-14 17:53:39,Marry CV

Answer: The document named Marry CV was stored on 1986-10-14 17:53:39
Table: Apartment_Bookings, Apartments
Question: Show the apartment numbers, start dates, and end dates of all the apartment bookings.
SQL query:
SELECT T2.apt_number AS "Apartments apt_number", T1.booking_start_date AS "Apartment_Bookings booking_start_date", T1.booking_start_date AS "Apartment_Bookings booking_start_date" 
 FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id
Result:
,Apartments apt_number,Apartment_Bookings booking_start_date
0,Apt. 859,2016-09-26 17:13:49

Answer: Apartment number 859 has a booking start date from 2016-09-26 17:13:49
Table: wrestler
Question: List the locations that are shared by more than two wrestlers.
SQL query:
SELECT LOCATION 
 FROM wrestler 
 GROUP BY LOCATION 
 HAVING COUNT(*) > 2
Result:
,Location
0,"Tijuana , Mexico"

Answer: Tijuana , Mexico is shared by more than two wrestlers.
Table: APPELLATIONS
Question: What are the areas and counties for all appelations?
SQL query:
SELECT Area, County 
 FROM APPELLATIONS
Result:
,Area,County
0,North Coast,Sonoma

Answer: The county of Sonoma is the North Coast area.
Table: Addresses
Question: How many staff live in state Georgia?
SQL query:
SELECT COUNT(*) AS "count of Addresses", state_province_county 
 FROM Addresses 
 WHERE state_province_county = 'Georgia'
Result:
,count of Addresses,state_province_county
0,2,Georgia

Answer: There are 2 addresses in the county of Georgia.
Table: music_festival, volume
Question: Please show the songs that have result "nominated" at music festivals.
SQL query:
SELECT T2.Song AS "volume Song", T1.Result AS "music_festival Result" 
 FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume = T2.Volume_ID 
 WHERE T1.Result = 'Nominated'
Result:
,volume Song,music_festival Result
0, The Way,Nominated

Answer: The song The Way was Nominated at a music festival
Table: representative
Question: What parties have at least three representatives?
SQL query:
SELECT Party 
 FROM representative 
 GROUP BY Party 
 HAVING COUNT(*) >= 3
Result:
,Party
0,Democratic

Answer: The democratic party has at least three representatives.
Table: student
Question: Find the number of students for each department.
SQL query:
SELECT COUNT(*) AS "count of student", dept_code 
 FROM student 
 GROUP BY dept_code
Result:
,DEPT_CODE,count of student
0,ACCT,3

Answer: The number of students at the department ACCT is 3
Table: technician
Question: Please show the team that has the most number of technicians.
SQL query:
SELECT Team 
 FROM technician 
 GROUP BY Team ORDER BY COUNT(*) DESC
Result:
,Team
0,CLE

Answer: The team that has the most number of technicians is CLE
Table: journal_committee, editor, journal
Question: For each journal_committee, find the editor name and the journal theme.
SQL query:
SELECT T2.Name AS "editor Name", T3.Theme AS "journal Theme" 
 FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID
Result:
,editor Name,journal Theme
0,Kamila Porczyk,at Minnesota Vikings

Answer: A journal committee has the editor Kamila Porczyk and the journal theme at Minnesota Vikings.
Table: cinema
Question: Show name, opening year, and capacity for each cinema.
SQL query:
SELECT name, openning_year, capacity 
 FROM cinema
Result:
,Name,Capacity,Openning_year
0,Codling,1100,2010

Answer: The cinema named Codling has a capacity of 1100 and was opened in 2010.
Table: entrepreneur, people
Question: Return the weights of entrepreneurs, ordered descending by amount of money requested.
SQL query:
SELECT T2.Weight AS "people Weight", T1.Money_Requested AS "entrepreneur Money_Requested" 
 FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested DESC
Result:
,people Weight,entrepreneur Money_Requested
0,80.0,150000.0

Answer: The person with weight 80 is an entrepreneur who requested 150000.
Table: storm
Question: How many storms had death records?
SQL query:
SELECT COUNT(*) AS "count of storm", Number_Deaths 
 FROM storm 
 WHERE Number_Deaths > 0
Result:
,Number_Deaths,count of storm
0,7,6

Answer: 6 storms had 7 deaths
Table: student, department
Question: What is the name of the department with the student that has the lowest GPA?
SQL query:
SELECT T2.dept_name AS "department dept_name", stu_gpa 
 FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code ORDER BY stu_gpa
Result:
,STU_GPA,department dept_name
0,2.26,Accounting

Answer: The department of Accounting has a GPA of 2.26.
Table: instructor, teaches
Question: Find the names of all instructors who have taught some course and the course_id.
SQL query:
SELECT name, course_id 
 FROM instructor AS T1 JOIN teaches AS T2 ON T1.ID = T2.ID
Result:
,name,course_id
0,Bondi,747

Answer: The instructor named Bondi taught the course with id 747.
Table: ORDER_ITEMS, Products
Question: What are the total order quantities of photo products?
SQL query:
SELECT SUM(T1.Order_Quantity) AS "sum of Order_Quantity", T2.Product_Name AS "Products Product_Name" 
 FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID = T2.Product_ID 
 WHERE T2.Product_Name = 'photo'
Result:
,Products Product_Name,sum of Order_Quantity
0,photo,3

Answer: There are 3 orders for the product photo.
Table: game
Question: List the season, home team, away team of all the games.
SQL query:
SELECT season, home_team, away_team 
 FROM game
Result:
,Season,Away_team,Home_team
0,2007,Pakhtakor,Quruvchi

Answer: The game with home team "Quruvchi" and away team "Pakhtakor" was in season 2007.
Table: Customers
Question: What is the status code, mobile phone number and email address of customer with last name as Kohler or first name as Marina?
SQL query:
SELECT customer_status_code, cell_mobile_phone_number, email_address, last_name, first_name 
 FROM Customers 
 WHERE first_name = 'Marina' OR last_name = 'Kohler'
Result:
,last_name,first_name,email_address,customer_status_code,cell_mobile_phone_number
0,Koelpin,Marina,mayert.judy@example.com,Bad Customer,848-099-2095x785

Answer: The customer named Marina Koelpin has the email address mayert.judy@example.com, the mobile phone number 848-099-2095x785 and status code of Bad Customer
Table: checking
Question: What is the average balance in checking accounts?
SQL query:
SELECT AVG(balance) AS "average balance" 
 FROM checking
Result:
,average balance
0,4583.428571428572

Answer: The average balance is 4583.428571428572.
Table: products, ref_product_categories
Question: Find the unit of measurement and product category code of product named "chervil".
SQL query:
SELECT t2.unit_of_measure AS "ref_product_categories unit_of_measure", t2.product_category_code AS "ref_product_categories product_category_code", t1.product_name AS "products product_name" 
 FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code 
 WHERE t1.product_name = 'chervil'
Result:
,products product_name,ref_product_categories unit_of_measure,ref_product_categories product_category_code
0,chervil,Handful             ,Herbs

Answer: For the product named chervil, the unit of measurement is Handful and the product category code is Herbs
Table: Apartment_Bookings, Guests
Question: What are the guest first name, start date, and end date of each apartment booking?
SQL query:
SELECT T2.guest_first_name AS "Guests guest_first_name", T1.booking_start_date AS "Apartment_Bookings booking_start_date", T1.booking_start_date AS "Apartment_Bookings booking_start_date" 
 FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id
Result:
,Guests guest_first_name,Apartment_Bookings booking_start_date
0,Rebeca,2016-09-26 17:13:49

Answer: Rebeca booked an apartment on 2016-09-26 time 17:13:49.
Table: mailshot_customers
Question: Show the outcome code of mailshots along with the number of mailshots in each outcome code.
SQL query:
SELECT outcome_code, COUNT(*) AS "count of mailshot_customers" 
 FROM mailshot_customers 
 GROUP BY outcome_code
Result:
,outcome_code,count of mailshot_customers
0,No Response,5

Answer: The outcome code No Response has 5 mailshot customers.
Table: chip_model, phone
Question: What is maximum and minimum RAM size of phone produced by company named "Nokia Corporation"?
SQL query:
SELECT MAX(T1.RAM_MiB) AS "maximum RAM_MiB", MIN(T1.RAM_MiB) AS "minimum RAM_MiB", T2.Company_name AS "phone Company_name" 
 FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model 
 WHERE T2.Company_name = 'Nokia Corporation'
Result:
,maximum RAM_MiB,minimum RAM_MiB,phone Company_name
0,32.0,32.0,Nokia Corporation

Answer: The phone produced by company named Nokia Corporation has a maximum RAM of 32 and a minimum RAM of 32
Table: tweets
Question: Find the number of tweets in record.
SQL query:
SELECT COUNT(*) AS "count of tweets" 
 FROM tweets
Result:
,count of tweets
0,8

Answer: There are 8 tweets.
Table: stadium
Question: What is the average attendance of stadiums with capacity percentage higher than 100%?
SQL query:
SELECT average_attendance, capacity_percentage 
 FROM stadium 
 WHERE capacity_percentage > 100
Result:
,Average_Attendance,Capacity_Percentage
0,87047.0,108.8

Answer: The average attendance was 87047 with a capacity percentage of 108.8.
Table: party_events
Question: How many party events do we have?
SQL query:
SELECT COUNT(*) AS "count of party_events" 
 FROM party_events
Result:
,count of party_events
0,8

Answer: There are 8 party events.
Table: employees
Question: display the full name (first and last), hire date, salary, and department number for those employees whose first name does not containing the letter M.
SQL query:
SELECT first_name, last_name, hire_date, salary, department_id 
 FROM employees 
 WHERE first_name NOT LIKE '%M%'
Result:
,SALARY,HIRE_DATE,LAST_NAME,FIRST_NAME,DEPARTMENT_ID
0,24000,1987-06-17,King,Steven,90

Answer: The employee named King Steven had a salary of 24000, a hire date of 1987-06-17 and his department id is 90.
Table: products
Question: What is the average price across all products?
SQL query:
SELECT AVG(price) AS "average price" 
 FROM products
Result:
,average price
0,153.72727272727272

Answer: The average price is 153.72727272727272.
Table: aircraft, airport_aircraft, airport
Question: What are the names and descriptions of aircrafts associated with an airport that has more total passengers than 10000000?
SQL query:
SELECT T1.Aircraft AS "aircraft Aircraft", T1.Description AS "aircraft Description", T3.Total_Passengers AS "airport Total_Passengers" 
 FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID 
 WHERE T3.Total_Passengers > 10000000
Result:
,aircraft Aircraft,aircraft Description,airport Total_Passengers
0,Bell 206B3 JetRanger,Turboshaft utility helicopter,67054745.0

Answer: The aircraft named Bell 206B3 JetRanger with the description of Turboshaft utility helicopter is associated with an airport that has 67054745 total passengers
Table: tracks
Question: What is the composer who created the track "Fast As a Shark"?
SQL query:
SELECT composer, name 
 FROM tracks 
 WHERE name = 'Fast As a Shark'
Result:
,name,composer
0,Fast As a Shark,"F. Baltes, S. Kaufman, U. Dirkscneider & W. Hoffman"

Answer: Song "Fast as a Shark" was composed by F. Baltes, S. Kaufman, U. Dirkscneider & W. Hoffman
Table: teachers
Question: Find the first names of all the teachers that teach in classroom 110.
SQL query:
SELECT firstname, classroom 
 FROM teachers 
 WHERE classroom = 110
Result:
,Classroom,FirstName
0,110, GEORGETTA

Answer: The first name of the teacherthat teach in classroom 110 is GEORGETTA
Table: driver
Question: Show the name, home city, and age for all drivers.
SQL query:
SELECT name, home_city, age 
 FROM driver
Result:
,Age,Name,Home_city
0,40,Matthew Ritter,Hartford

Answer: Matthew Ritter is 40 years old and lives in Hartford.
Table: ref_product_categories
Question: What is the description of the product category with the code 'Spices'?
SQL query:
SELECT product_category_description, product_category_code 
 FROM ref_product_categories 
 WHERE product_category_code = 'Spices'
Result:
,product_category_code,product_category_description
0,Spices,Spices

Answer: The description of the product category with the code 'Spices' is Spices
Table: EMPLOYEE
Question: What are the first names and last names of the employees who live in Calgary city.
SQL query:
SELECT FirstName, LastName, City 
 FROM EMPLOYEE 
 WHERE City = 'Calgary'
Result:
,City,LastName,FirstName
0,Calgary,Edwards,Nancy

Answer: The FirstNames and LastNames of the employees who live in Calgary city are Nancy Edwards resepctively
Table: region
Question: Show names for all regions except for Denmark.
SQL query:
SELECT region_name 
 FROM region 
 WHERE region_name <> 'Denmark'
Result:
,Region_name
0,Afghanistan

Answer: The region name is Afghanistan
Table: products, Manufacturers
Question: Select the average price of each manufacturer's products, showing the manufacturer's name.
SQL query:
SELECT AVG(T1.Price) AS "average Price", T2.name AS "Manufacturers name" 
 FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code 
 GROUP BY T2.name
Result:
,average Price,Manufacturers name
0,150.0,Creative Labs

Answer: The Creative Labs manufacturer has an average price of 150 of products
Table: aircraft, MATCH
Question: What is the location and name of the winning aircraft?
SQL query:
SELECT T2.Location AS "MATCH Location", T1.Aircraft AS "aircraft Aircraft" 
 FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft
Result:
,MATCH Location,aircraft Aircraft
0,"Mina' Zayid , Abu Dhabi",Robinson R-22

Answer: In Mina' Zayid , Abu Dhabi the aircraft Robinson R-22 won.
Table: projects
Question: Find the average hours of all projects.
SQL query:
SELECT AVG(hours) AS "average hours" 
 FROM projects
Result:
,average hours
0,1441.642857142857

Answer: The average hours of projects is 1441.642857142857.
Table: affected_region, region, storm
Question: Show all storm names affecting region "Denmark".
SQL query:
SELECT T3.name AS "storm name", T2.region_name AS "region region_name" 
 FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id 
 WHERE T2.region_name = 'Denmark'
Result:
,storm name,region region_name
0,Five,Denmark

Answer: The storm name affecting region Denmark is Five
Table: Ref_Document_Status
Question: What is the description of document status code 'working'?
SQL query:
SELECT document_status_description, document_status_code 
 FROM Ref_Document_Status 
 WHERE document_status_code = 'working'
Result:
,document_status_code,document_status_description
0,working,currently working on

Answer: The document with status code working has the status description currently working on.
Table: ship
Question: What are the type and nationality of ships?
SQL query:
SELECT TYPE, Nationality 
 FROM ship
Result:
,Type,Nationality
0,Cargo ship,United Kingdom

Answer: Cargo ship is from United Kingdom.
Table: school_bus
Question: What is the maximum, minimum and average years spent working on a school bus?
SQL query:
SELECT MAX(years_working) AS "maximum years_working", MIN(years_working) AS "minimum years_working", AVG(years_working) AS "average years_working" 
 FROM school_bus
Result:
,average years_working,maximum years_working,minimum years_working
0,5.8,10.0,2.0

Answer: The maximum is 10, the minimum is 2 and average is 5.8 of years spent working on a school bus
Table: bank, loan
Question: Find the city and name of bank branches that provide business loans.
SQL query:
SELECT T1.bname AS "bank bname", T1.city AS "bank city", T2.loan_type AS "loan loan_type" 
 FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id 
 WHERE T2.loan_type = 'Business'
Result:
,bank city,bank bname,loan loan_type
0,New York City,broadway,Business

Answer: The bank named broadway in New York City provides business loans.
Table: mountain
Question: What are the average prominence of the mountains in country 'Morocco'?
SQL query:
SELECT AVG(prominence) AS "average prominence", country 
 FROM mountain 
 WHERE country = 'Morocco'
Result:
,Country,average prominence
0,Morocco,1316.5

Answer: The mountains in Morocco have an average prominence of 1316.5
Table: Apartment_Facilities, Apartments
Question: Show the total number of rooms of all apartments with facility code "Gym".
SQL query:
SELECT SUM(T2.room_count) AS "sum of room_count", T1.facility_code AS "Apartment_Facilities facility_code" 
 FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id 
 WHERE T1.facility_code = 'Gym'
Result:
,sum of room_count,Apartment_Facilities facility_code
0,15,Gym

Answer: The facility with code Gym has 15 rooms.
Table: airlines
Question: Find the country of the airlines whose name starts with 'Orbit'.
SQL query:
SELECT country, name 
 FROM airlines 
 WHERE name LIKE 'Orbit%'
Result:
,name,country
0,Orbit Express Airlines,Turkey

Answer: Orbit Express Airlines is in Turkey.
Table: elimination, wrestler
Question: List the names of wrestlers and the teams in elimination in descending order of days held.
SQL query:
SELECT T2.Name AS "wrestler Name", T1.Team AS "elimination Team", T2.Days_held AS "wrestler Days_held" 
 FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID ORDER BY T2.Days_held DESC
Result:
,wrestler Name,elimination Team,wrestler Days_held
0,Gran Hamada,Team Batista,960

Answer: The wrestler named Gran Hamada is on the elimination team Team Batista and was held for 960 days
Table: Addresses, Student_Addresses
Question: What are the line 1 and average monthly rentals of all student addresses?
SQL query:
SELECT T1.line_1 AS "Addresses line_1", AVG(T2.monthly_rental) AS "average monthly_rental", T2.address_id AS "Student_Addresses address_id" 
 FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id 
 GROUP BY T2.address_id
Result:
,Addresses line_1,average monthly_rental,Student_Addresses address_id
0,020 Orie Canyon,1028.9549333333334,1

Answer: The address 020 Orie Canyon has a montlhy rental of 1028.9549333333334.
Table: Apartments
Question: Find the average number of bedrooms of all the apartments.
SQL query:
SELECT AVG(bedroom_count) AS "average bedroom_count" 
 FROM Apartments
Result:
,average bedroom_count
0,4.466666666666667

Answer: The average number of bedrooms is 4.466666666666667.
Table: Employees
Question: Show the name, role code, and date of birth for the employee with name 'Armani'.
SQL query:
SELECT employee_name, role_code, date_of_birth, employee_Name 
 FROM Employees 
 WHERE employee_Name = 'Armani'
Result:
,Role_Code,Date_of_Birth,Employee_Name
0,ED,1988-12-08 06:13:33,Armani

Answer: The employee named Armani was born in 1988-12-08 06:13:33 and his role code is ED.
Table: building
Question: List the names of buildings with at least 200 feet of height and with at least 20 floors.
SQL query:
SELECT name, height_feet, floors 
 FROM building 
 WHERE height_feet >= 200 AND floors >= 20
Result:
,Name,Floors,Height_feet
0,Franklin Exchange Building,22,280

Answer: The building	Franklin Exchange Building has 22 floors and is 280 feet high.
Table: authors, authorship, papers
Question: Find the last names of all the authors that have written a paper with title containing the word "Monadic".
SQL query:
SELECT t1.lname AS "authors lname", t3.title AS "papers title" 
 FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid 
 WHERE t3.title LIKE '%Monadic%'
Result:
,papers title,authors lname
0,Just do it: Simple Monadic Equational Reasoning,Gibbons

Answer: The author Gibbons has written the paper titled Just do it: Simple Monadic Equational Reasoning
Table: Bookings, Drama_Workshop_Groups
Question: Which workshop groups have bookings with status code "stop"? Give me the names.
SQL query:
SELECT T2.Store_Name AS "Drama_Workshop_Groups Store_Name", T1.Status_Code AS "Bookings Status_Code" 
 FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID 
 WHERE T1.Status_Code = 'stop'
Result:
,Bookings Status_Code,Drama_Workshop_Groups Store_Name
0,stop,Bednar Film

Answer: "Bednar Film" workshop group has bookings with status code "stop".
Table: Elimination
Question: Return the elimination movies of wrestlers on Team Orton.
SQL query:
SELECT Elimination_Move, Team 
 FROM Elimination 
 WHERE Team = 'Team Orton'
Result:
,Team,Elimination_Move
0,Team Orton,Go To Sleep

Answer: The elimination move of Team Orton is Go To Sleep.
Table: dorm
Question: Find the average and total capacity of dorms for the students with gender X.
SQL query:
SELECT AVG(student_capacity) AS "average student_capacity", SUM(student_capacity) AS "sum of student_capacity", gender 
 FROM dorm 
 WHERE gender = 'X'
Result:
,gender,sum of student_capacity,average student_capacity
0,X,1136,227.2

Answer: The dorm for gender X has 1136 total student capacity and 227.2 average student capacity.
Table: Student
Question: What is the minimum, mean, and maximum age across all students?
SQL query:
SELECT MIN(age) AS "minimum age", AVG(age) AS "average age", MAX(age) AS "maximum age" 
 FROM Student
Result:
,average age,maximum age,minimum age
0,19.558823529411764,27.0,16.0

Answer: The average age of students is 19.58, the maximum age is 27 and the minimum age is 16
Table: airports
Question: Find the name of airports whose altitude is between -50 and 50.
SQL query:
SELECT name, elevation 
 FROM airports 
 WHERE elevation BETWEEN -50 AND 50
Result:
,name,elevation
0,Madang Airport,20

Answer: The airport name is Madang Airport and the elevation is 20