Question:
List all the characteristic names and data types of product 'cumin'.
Additional table information: table: products_gen_characteristics

Answer: SELECT t3.characteristic_name, t3.characteristic_data_type FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = 'cumin'


Question:
What are the names and data types of the characteristics of the 'cumin' product?
Additional table information: table: products_gen_characteristics

Answer: SELECT t3.characteristic_name, t3.characteristic_data_type FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = 'cumin'


Question:
List all characteristics of product named 'sesame' with type code 'Grade'.
Additional table information: table: products_gen_characteristics

Answer: SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = 'sesame' AND t3.characteristic_type_code = 'Grade'


Question:
What are the names of the characteristics of the product 'sesame' that have the characteristic type code 'Grade'?
Additional table information: table: products_gen_characteristics

Answer: SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = 'sesame' AND t3.characteristic_type_code = 'Grade'


Question:
How many characteristics does the product named 'laurel' have?
Additional table information: table: products_gen_characteristics

Answer: SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = 'laurel'


Question:
Count the number of characteristics of the product named 'laurel'.
Additional table information: table: products_gen_characteristics

Answer: SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = 'laurel'


Question:
Find the number of characteristics that the product 'flax' has.
Additional table information: table: products_gen_characteristics

Answer: SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = 'flax'


Question:
Count the number of characteristics of the 'flax' product.
Additional table information: table: products_gen_characteristics

Answer: SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = 'flax'


Question:
Find the name of the products that have the color description 'red' and have the characteristic name 'fast'.
Additional table information: table: products_gen_characteristics

Answer: SELECT product_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = 'red' AND t3.characteristic_name = 'fast'


Question:
What are the names of the products that have a color description of 'red' and the 'fast' characteristic?
Additional table information: table: products_gen_characteristics

Answer: SELECT product_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = 'red' AND t3.characteristic_name = 'fast'


Question:
How many products have the characteristic named 'hot'?
Additional table information: table: products_gen_characteristics

Answer: SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t3.characteristic_name = 'hot'


Question:
Count the number of products with the 'hot' charactersitic.
Additional table information: table: products_gen_characteristics

Answer: SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t3.characteristic_name = 'hot'


Question:
List the all the distinct names of the products with the characteristic name 'warm'.
Additional table information: table: products_gen_characteristics

Answer: SELECT DISTINCT t1.product_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t3.characteristic_name = 'warm'


Question:
What are the different product names for products that have the 'warm' characteristic:?
Additional table information: table: products_gen_characteristics

Answer: SELECT DISTINCT t1.product_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t3.characteristic_name = 'warm'


Question:
Find the number of the products that have their color described as 'red' and have a characteristic named 'slow'.
Additional table information: table: products_gen_characteristics

Answer: SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = 'red' AND t3.characteristic_name = 'slow'


Question:
How many products have the color description 'red' and the characteristic name 'slow'?
Additional table information: table: products_gen_characteristics

Answer: SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = 'red' AND t3.characteristic_name = 'slow'


Question:
Count the products that have the color description 'white' or have the characteristic name 'hot'.
Additional table information: table: products_gen_characteristics

Answer: SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = 'white' OR t3.characteristic_name = 'hot'


Question:
How many products have their color described as 'white' or have a characteristic with the name 'hot'?
Additional table information: table: products_gen_characteristics

Answer: SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = 'white' OR t3.characteristic_name = 'hot'


Question:
What is the unit of measuerment of the product category code 'Herbs'?
Additional table information: table: products_gen_characteristics

Answer: SELECT unit_of_measure FROM ref_product_categories WHERE product_category_code = 'Herbs'


Question:
Return the unit of measure for 'Herb' products.
Additional table information: table: products_gen_characteristics

Answer: SELECT unit_of_measure FROM ref_product_categories WHERE product_category_code = 'Herbs'


Question:
Find the product category description of the product category with code 'Spices'.
Additional table information: table: products_gen_characteristics

Answer: SELECT product_category_description FROM ref_product_categories WHERE product_category_code = 'Spices'


Question:
What is the description of the product category with the code 'Spices'?
Additional table information: table: products_gen_characteristics

Answer: SELECT product_category_description FROM ref_product_categories WHERE product_category_code = 'Spices'


Question:
What is the product category description and unit of measurement of category 'Herbs'?
Additional table information: table: products_gen_characteristics

Answer: SELECT product_category_description, unit_of_measure FROM ref_product_categories WHERE product_category_code = 'Herbs'


Question:
Return the description and unit of measurement for products in the 'Herbs' category.
Additional table information: table: products_gen_characteristics

Answer: SELECT product_category_description, unit_of_measure FROM ref_product_categories WHERE product_category_code = 'Herbs'


Question:
What is the unit of measurement of product named 'cumin'?
Additional table information: table: products_gen_characteristics

Answer: SELECT t2.unit_of_measure FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code WHERE t1.product_name = 'cumin'


Question:
Give the unit of measure for the product with the name 'cumin'.
Additional table information: table: products_gen_characteristics

Answer: SELECT t2.unit_of_measure FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code WHERE t1.product_name = 'cumin'


Question:
Find the unit of measurement and product category code of product named 'chervil'.
Additional table information: table: products_gen_characteristics

Answer: SELECT t2.unit_of_measure, t2.product_category_code FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code WHERE t1.product_name = 'chervil'


Question:
What are the unit of measure and category code for the 'chervil' product?
Additional table information: table: products_gen_characteristics

Answer: SELECT t2.unit_of_measure, t2.product_category_code FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code WHERE t1.product_name = 'chervil'


Question:
Find the product names that are colored 'white' but do not have unit of measurement 'Handful'.
Additional table information: table: products_gen_characteristics

Answer: SELECT t1.product_name FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code JOIN ref_colors AS t3 ON t1.color_code = t3.color_code WHERE t3.color_description = 'white' AND t2.unit_of_measure <> 'Handful'


Question:
What are the names of products that are not 'white' in color and are not measured by the unit 'Handful'?
Additional table information: table: products_gen_characteristics

Answer: SELECT t1.product_name FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code JOIN ref_colors AS t3 ON t1.color_code = t3.color_code WHERE t3.color_description = 'white' AND t2.unit_of_measure <> 'Handful'


Question:
What is the description of the color for most products?
Additional table information: table: products_gen_characteristics

Answer: SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code GROUP BY t2.color_description ORDER BY COUNT(*) DESC LIMIT 1


Question:
Return the color description that is most common across all products.
Additional table information: table: products_gen_characteristics

Answer: SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code GROUP BY t2.color_description ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the description of the color used by least products?
Additional table information: table: products_gen_characteristics

Answer: SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code GROUP BY t2.color_description ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1


Question:
Give the color description that is least common across products.
Additional table information: table: products_gen_characteristics

Answer: SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code GROUP BY t2.color_description ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1


Question:
What is the characteristic name used by most number of the products?
Additional table information: table: products_gen_characteristics

Answer: SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id GROUP BY t3.characteristic_name ORDER BY COUNT(*) DESC LIMIT 1


Question:
Return the name of the characteristic that is most common across all products.
Additional table information: table: products_gen_characteristics

Answer: SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id GROUP BY t3.characteristic_name ORDER BY COUNT(*) DESC LIMIT 1


Question:
What are the names, details and data types of the characteristics which are never used by any product?
Additional table information: table: products_gen_characteristics

Answer: SELECT characteristic_name, other_characteristic_details, characteristic_data_type FROM CHARACTERISTICS EXCEPT SELECT t1.characteristic_name, t1.other_characteristic_details, t1.characteristic_data_type FROM CHARACTERISTICS AS t1 JOIN product_characteristics AS t2 ON t1.characteristic_id = t2.characteristic_id


Question:
Give the names, details, and data types of characteristics that are not found in any product.
Additional table information: table: products_gen_characteristics

Answer: SELECT characteristic_name, other_characteristic_details, characteristic_data_type FROM CHARACTERISTICS EXCEPT SELECT t1.characteristic_name, t1.other_characteristic_details, t1.characteristic_data_type FROM CHARACTERISTICS AS t1 JOIN product_characteristics AS t2 ON t1.characteristic_id = t2.characteristic_id


Question:
What are characteristic names used at least twice across all products?
Additional table information: table: products_gen_characteristics

Answer: SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id GROUP BY t3.characteristic_name HAVING COUNT(*) >= 2


Question:
Give the names of characteristics that are in two or more products?
Additional table information: table: products_gen_characteristics

Answer: SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id GROUP BY t3.characteristic_name HAVING COUNT(*) >= 2


Question:
How many colors are never used by any product?
Additional table information: table: products_gen_characteristics

Answer: SELECT COUNT(*) FROM Ref_colors WHERE NOT color_code IN (SELECT color_code FROM products)


Question:
Count the number of colors that are not used in any products.
Additional table information: table: products_gen_characteristics

Answer: SELECT COUNT(*) FROM Ref_colors WHERE NOT color_code IN (SELECT color_code FROM products)


Question:
How many events are there?
Additional table information: table: swimming

Answer: SELECT COUNT(*) FROM event


Question:
List all the event names by year from the most recent to the oldest.
Additional table information: table: swimming

Answer: SELECT name FROM event ORDER BY YEAR DESC


Question:
What is the name of the event that happened in the most recent year?
Additional table information: table: swimming

Answer: SELECT name FROM event ORDER BY YEAR DESC LIMIT 1


Question:
How many stadiums are there?
Additional table information: table: swimming

Answer: SELECT COUNT(*) FROM stadium


Question:
Find the name of the stadium that has the maximum capacity.
Additional table information: table: swimming

Answer: SELECT name FROM stadium ORDER BY capacity DESC LIMIT 1


Question:
Find the names of stadiums whose capacity is smaller than the average capacity.
Additional table information: table: swimming

Answer: SELECT name FROM stadium WHERE capacity < (SELECT AVG(capacity) FROM stadium)


Question:
Find the country that has the most stadiums.
Additional table information: table: swimming

Answer: SELECT country FROM stadium GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1


Question:
Which country has at most 3 stadiums listed?
Additional table information: table: swimming

Answer: SELECT country FROM stadium GROUP BY country HAVING COUNT(*) <= 3


Question:
Which country has both stadiums with capacity greater than 60000 and stadiums with capacity less than 50000?
Additional table information: table: swimming

Answer: SELECT country FROM stadium WHERE capacity > 60000 INTERSECT SELECT country FROM stadium WHERE capacity < 50000


Question:
How many cities have a stadium that was opened before the year of 2006?
Additional table information: table: swimming

Answer: SELECT COUNT(DISTINCT city) FROM stadium WHERE opening_year < 2006


Question:
How many stadiums does each country have?
Additional table information: table: swimming

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


Question:
Which countries do not have a stadium that was opened after 2006?
Additional table information: table: swimming

Answer: SELECT country FROM stadium EXCEPT SELECT country FROM stadium WHERE opening_year > 2006


Question:
How many stadiums are not in country 'Russia'?
Additional table information: table: swimming

Answer: SELECT COUNT(*) FROM stadium WHERE country <> 'Russia'


Question:
Find the names of all swimmers, sorted by their 100 meter scores in ascending order.
Additional table information: table: swimming

Answer: SELECT name FROM swimmer ORDER BY meter_100 NULLS FIRST


Question:
How many different countries are all the swimmers from?
Additional table information: table: swimming

Answer: SELECT COUNT(DISTINCT nationality) FROM swimmer


Question:
List countries that have more than one swimmer.
Additional table information: table: swimming

Answer: SELECT nationality, COUNT(*) FROM swimmer GROUP BY nationality HAVING COUNT(*) > 1


Question:
Find all 200 meter and 300 meter results of swimmers with nationality 'Australia'.
Additional table information: table: swimming

Answer: SELECT meter_200, meter_300 FROM swimmer WHERE nationality = 'Australia'


Question:
Find the names of swimmers who has a result of 'win'.
Additional table information: table: swimming

Answer: SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Win'


Question:
What is the name of the stadium which held the most events?
Additional table information: table: swimming

Answer: SELECT t1.name FROM stadium AS t1 JOIN event AS t2 ON t1.id = t2.stadium_id GROUP BY t2.stadium_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
Find the name and capacity of the stadium where the event named 'World Junior' happened.
Additional table information: table: swimming

Answer: SELECT t1.name, t1.capacity FROM stadium AS t1 JOIN event AS t2 ON t1.id = t2.stadium_id WHERE t2.name = 'World Junior'


Question:
Find the names of stadiums which have never had any event.
Additional table information: table: swimming

Answer: SELECT name FROM stadium WHERE NOT id IN (SELECT stadium_id FROM event)


Question:
Find the name of the swimmer who has the most records.
Additional table information: table: swimming

Answer: SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id GROUP BY t2.swimmer_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
Find the name of the swimmer who has at least 2 records.
Additional table information: table: swimming

Answer: SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id GROUP BY t2.swimmer_id HAVING COUNT(*) >= 2


Question:
Find the name and nationality of the swimmer who has won (i.e., has a result of 'win') more than 1 time.
Additional table information: table: swimming

Answer: SELECT t1.name, t1.nationality FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Win' GROUP BY t2.swimmer_id HAVING COUNT(*) > 1


Question:
Find the names of the swimmers who have no record.
Additional table information: table: swimming

Answer: SELECT name FROM swimmer WHERE NOT id IN (SELECT swimmer_id FROM record)


Question:
Find the names of the swimmers who have both 'win' and 'loss' results in the record.
Additional table information: table: swimming

Answer: SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Win' INTERSECT SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Loss'


Question:
Find the names of stadiums that some Australian swimmers have been to.
Additional table information: table: swimming

Answer: SELECT t4.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id JOIN event AS t3 ON t2.event_id = t3.id JOIN stadium AS t4 ON t4.id = t3.stadium_id WHERE t1.nationality = 'Australia'


Question:
Find the names of stadiums that the most swimmers have been to.
Additional table information: table: swimming

Answer: SELECT t3.name FROM record AS t1 JOIN event AS t2 ON t1.event_id = t2.id JOIN stadium AS t3 ON t3.id = t2.stadium_id GROUP BY t2.stadium_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
Find all details for each swimmer.
Additional table information: table: swimming

Answer: SELECT * FROM swimmer


Question:
What is the average capacity of the stadiums that were opened in year 2005?
Additional table information: table: swimming

Answer: SELECT AVG(capacity) FROM stadium WHERE opening_year = 2005


Question:
How many railways are there?
Additional table information: table: railway

Answer: SELECT COUNT(*) FROM railway


Question:
List the builders of railways in ascending alphabetical order.
Additional table information: table: railway

Answer: SELECT Builder FROM railway ORDER BY Builder ASC NULLS FIRST


Question:
List the wheels and locations of the railways.
Additional table information: table: railway

Answer: SELECT Wheels, LOCATION FROM railway


Question:
What is the maximum level of managers in countries that are not 'Australia'?
Additional table information: table: railway

Answer: SELECT MAX(LEVEL) FROM manager WHERE Country <> 'Australia	'


Question:
What is the average age for all managers?
Additional table information: table: railway

Answer: SELECT AVG(Age) FROM manager


Question:
What are the names of managers in ascending order of level?
Additional table information: table: railway

Answer: SELECT Name FROM manager ORDER BY LEVEL ASC NULLS FIRST


Question:
What are the names and arrival times of trains?
Additional table information: table: railway

Answer: SELECT Name, Arrival FROM train


Question:
What is the name of the oldest manager?
Additional table information: table: railway

Answer: SELECT Name FROM manager ORDER BY Age DESC LIMIT 1


Question:
Show the names of trains and locations of railways they are in.
Additional table information: table: railway

Answer: SELECT T2.Name, T1.Location FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID


Question:
Show the builder of railways associated with the trains named 'Andaman Exp'.
Additional table information: table: railway

Answer: SELECT T1.Builder FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID WHERE T2.Name = 'Andaman Exp'


Question:
Show id and location of railways that are associated with more than one train.
Additional table information: table: railway

Answer: SELECT T2.Railway_ID, T1.Location FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID GROUP BY T2.Railway_ID HAVING COUNT(*) > 1


Question:
Show the id and builder of the railway that are associated with the most trains.
Additional table information: table: railway

Answer: SELECT T2.Railway_ID, T1.Builder FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID GROUP BY T2.Railway_ID ORDER BY COUNT(*) DESC LIMIT 1


Question:
Show different builders of railways, along with the corresponding number of railways using each builder.
Additional table information: table: railway

Answer: SELECT Builder, COUNT(*) FROM railway GROUP BY Builder


Question:
Show the most common builder of railways.
Additional table information: table: railway

Answer: SELECT Builder FROM railway GROUP BY Builder ORDER BY COUNT(*) DESC LIMIT 1


Question:
Show different locations of railways along with the corresponding number of railways at each location.
Additional table information: table: railway

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


Question:
Show the locations that have more than one railways.
Additional table information: table: railway

Answer: SELECT LOCATION FROM railway GROUP BY LOCATION HAVING COUNT(*) > 1


Question:
List the object number of railways that do not have any trains.
Additional table information: table: railway

Answer: SELECT ObjectNumber FROM railway WHERE NOT Railway_ID IN (SELECT Railway_ID FROM train)


Question:
Show the countries that have both managers of age above 50 and managers of age below 46.
Additional table information: table: railway

Answer: SELECT Country FROM manager WHERE Age > 50 INTERSECT SELECT Country FROM manager WHERE Age < 46


Question:
Show the distinct countries of managers.
Additional table information: table: railway

Answer: SELECT DISTINCT Country FROM manager


Question:
Show the working years of managers in descending order of their level.
Additional table information: table: railway

Answer: SELECT Working_year_starts FROM manager ORDER BY LEVEL DESC


Question:
Show the countries that have managers of age above 50 or below 46.
Additional table information: table: railway

Answer: SELECT Country FROM manager WHERE Age > 50 OR Age < 46


Question:
How many addresses are there in country USA?
Additional table information: table: customers_and_products_contacts

Answer: SELECT COUNT(*) FROM addresses WHERE country = 'USA'


Question:
Show all distinct cities in the address record.
Additional table information: table: customers_and_products_contacts

Answer: SELECT DISTINCT city FROM addresses


Question:
Show each state and the number of addresses in each state.
Additional table information: table: customers_and_products_contacts

Answer: SELECT state_province_county, COUNT(*) FROM addresses GROUP BY state_province_county


Question:
Show names and phones of customers who do not have address information.
Additional table information: table: customers_and_products_contacts

Answer: SELECT customer_name, customer_phone FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM customer_address_history)


Question:
Show the name of the customer who has the most orders.
Additional table information: table: customers_and_products_contacts

Answer: SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
Show the product type codes which have at least two products.
Additional table information: table: customers_and_products_contacts

Answer: SELECT product_type_code FROM products GROUP BY product_type_code HAVING COUNT(*) >= 2


Question:
Show the names of customers who have both an order in completed status and an order in part status.
Additional table information: table: customers_and_products_contacts

Answer: SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = 'Completed' INTERSECT SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = 'Part'


Question:
Show the name, phone, and payment method code for all customers in descending order of customer number.
Additional table information: table: customers_and_products_contacts

Answer: SELECT customer_name, customer_phone, payment_method_code FROM customers ORDER BY customer_number DESC


Question:
Show the product name and total order quantity for each product.
Additional table information: table: customers_and_products_contacts

Answer: SELECT T1.product_name, SUM(T2.order_quantity) FROM products AS T1 JOIN order_items AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_id


Question:
Show the minimum, maximum, average price for all products.
Additional table information: table: customers_and_products_contacts

Answer: SELECT MIN(product_price), MAX(product_price), AVG(product_price) FROM products


Question:
How many products have a price higher than the average?
Additional table information: table: customers_and_products_contacts

Answer: SELECT COUNT(*) FROM products WHERE product_price > (SELECT AVG(product_price) FROM products)


Question:
Show the customer name, customer address city, date from, and date to for each customer address history.
Additional table information: table: customers_and_products_contacts

Answer: SELECT T2.customer_name, T3.city, T1.date_from, T1.date_to FROM customer_address_history AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id JOIN addresses AS T3 ON T1.address_id = T3.address_id


Question:
Show the names of customers who use Credit Card payment method and have more than 2 orders.
Additional table information: table: customers_and_products_contacts

Answer: SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.payment_method_code = 'Credit Card' GROUP BY T1.customer_id HAVING COUNT(*) > 2


Question:
What are the name and phone of the customer with the most ordered product quantity?
Additional table information: table: customers_and_products_contacts

Answer: SELECT T1.customer_name, T1.customer_phone FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id JOIN order_items AS T3 ON T3.order_id = T2.order_id GROUP BY T1.customer_id ORDER BY SUM(T3.order_quantity) DESC LIMIT 1


Question:
Show the product type and name for the products with price higher than 1000 or lower than 500.
Additional table information: table: customers_and_products_contacts

Answer: SELECT product_type_code, product_name FROM products WHERE product_price > 1000 OR product_price < 500


Question:
Find the name of dorms only for female (F gender).
Additional table information: table: dorm_1

Answer: SELECT dorm_name FROM dorm WHERE gender = 'F'


Question:
What are the names of the all-female dorms?
Additional table information: table: dorm_1

Answer: SELECT dorm_name FROM dorm WHERE gender = 'F'


Question:
Find the name of dorms that can accommodate more than 300 students.
Additional table information: table: dorm_1

Answer: SELECT dorm_name FROM dorm WHERE student_capacity > 300


Question:
What are the names of all the dorms that can accomdate more than 300 students?
Additional table information: table: dorm_1

Answer: SELECT dorm_name FROM dorm WHERE student_capacity > 300


Question:
How many female students (sex is F) whose age is below 25?
Additional table information: table: dorm_1

Answer: SELECT COUNT(*) FROM student WHERE sex = 'F' AND age < 25


Question:
How many girl students who are younger than 25?
Additional table information: table: dorm_1

Answer: SELECT COUNT(*) FROM student WHERE sex = 'F' AND age < 25


Question:
Find the first name of students who is older than 20.
Additional table information: table: dorm_1

Answer: SELECT fname FROM student WHERE age > 20


Question:
What are the first names of all students who are older than 20?
Additional table information: table: dorm_1

Answer: SELECT fname FROM student WHERE age > 20


Question:
Find the first name of students living in city PHL whose age is between 20 and 25.
Additional table information: table: dorm_1

Answer: SELECT fname FROM student WHERE city_code = 'PHL' AND age BETWEEN 20 AND 25


Question:
What is the first name of the students who are in age 20 to 25 and living in PHL city?
Additional table information: table: dorm_1

Answer: SELECT fname FROM student WHERE city_code = 'PHL' AND age BETWEEN 20 AND 25


Question:
How many dorms are there?
Additional table information: table: dorm_1

Answer: SELECT COUNT(*) FROM dorm


Question:
How many dorms are in the database?
Additional table information: table: dorm_1

Answer: SELECT COUNT(*) FROM dorm


Question:
Find the number of distinct amenities.
Additional table information: table: dorm_1

Answer: SELECT COUNT(*) FROM dorm_amenity


Question:
How many diffrent dorm amenities are there?
Additional table information: table: dorm_1

Answer: SELECT COUNT(*) FROM dorm_amenity


Question:
Find the total capacity of all dorms.
Additional table information: table: dorm_1

Answer: SELECT SUM(student_capacity) FROM dorm


Question:
What is the total student capacity of all dorms?
Additional table information: table: dorm_1

Answer: SELECT SUM(student_capacity) FROM dorm


Question:
How many students are there?
Additional table information: table: dorm_1

Answer: SELECT COUNT(*) FROM student


Question:
How many students exist?
Additional table information: table: dorm_1

Answer: SELECT COUNT(*) FROM student


Question:
Find the average age of all students living in the each city.
Additional table information: table: dorm_1

Answer: SELECT AVG(age), city_code FROM student GROUP BY city_code


Question:
What is the average age for each city and what are those cities?
Additional table information: table: dorm_1

Answer: SELECT AVG(age), city_code FROM student GROUP BY city_code


Question:
Find the average and total capacity of dorms for the students with gender X.
Additional table information: table: dorm_1

Answer: SELECT AVG(student_capacity), SUM(student_capacity) FROM dorm WHERE gender = 'X'


Question:
What is the average and total capacity for all dorms who are of gender X?
Additional table information: table: dorm_1

Answer: SELECT AVG(student_capacity), SUM(student_capacity) FROM dorm WHERE gender = 'X'


Question:
Find the number of dorms that have some amenity.
Additional table information: table: dorm_1

Answer: SELECT COUNT(DISTINCT dormid) FROM has_amenity


Question:
How many dorms have amenities?
Additional table information: table: dorm_1

Answer: SELECT COUNT(DISTINCT dormid) FROM has_amenity


Question:
Find the name of dorms that do not have any amenity
Additional table information: table: dorm_1

Answer: SELECT dorm_name FROM dorm WHERE NOT dormid IN (SELECT dormid FROM has_amenity)


Question:
What are the names of all the dorms that don't have any amenities?
Additional table information: table: dorm_1

Answer: SELECT dorm_name FROM dorm WHERE NOT dormid IN (SELECT dormid FROM has_amenity)


Question:
Find the number of distinct gender for dorms.
Additional table information: table: dorm_1

Answer: SELECT COUNT(DISTINCT gender) FROM dorm


Question:
How many different genders are there in the dorms?
Additional table information: table: dorm_1

Answer: SELECT COUNT(DISTINCT gender) FROM dorm


Question:
Find the capacity and gender type of the dorm whose name has substring ‘Donor’.
Additional table information: table: dorm_1

Answer: SELECT student_capacity, gender FROM dorm WHERE dorm_name LIKE '%Donor%'


Question:
What is the student capacity and type of gender for the dorm whose name as the phrase Donor in it?
Additional table information: table: dorm_1

Answer: SELECT student_capacity, gender FROM dorm WHERE dorm_name LIKE '%Donor%'


Question:
Find the name and gender type of the dorms whose capacity is greater than 300 or less than 100.
Additional table information: table: dorm_1

Answer: SELECT dorm_name, gender FROM dorm WHERE student_capacity > 300 OR student_capacity < 100


Question:
What are the names and types of the dorms that have a capacity greater than 300 or less than 100?
Additional table information: table: dorm_1

Answer: SELECT dorm_name, gender FROM dorm WHERE student_capacity > 300 OR student_capacity < 100


Question:
Find the numbers of different majors and cities.
Additional table information: table: dorm_1

Answer: SELECT COUNT(DISTINCT major), COUNT(DISTINCT city_code) FROM student


Question:
How many different majors are there and how many different city codes are there for each student?
Additional table information: table: dorm_1

Answer: SELECT COUNT(DISTINCT major), COUNT(DISTINCT city_code) FROM student


Question:
Find the name of dorms which have both TV Lounge and Study Room as amenities.
Additional table information: table: dorm_1

Answer: SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge' INTERSECT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'Study Room'


Question:
What is the name of the dorm with both a TV Lounge and Study Room listed as amenities?
Additional table information: table: dorm_1

Answer: SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge' INTERSECT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'Study Room'


Question:
Find the name of dorms which have TV Lounge but no Study Room as amenity.
Additional table information: table: dorm_1

Answer: SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge' EXCEPT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'Study Room'


Question:
What is the name of each dorm that has a TV Lounge but no study rooms?
Additional table information: table: dorm_1

Answer: SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge' EXCEPT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'Study Room'


Question:
Find the last name of students who is either female (sex is F) and living in the city of code BAL or male (sex is M) and in age of below 20.
Additional table information: table: dorm_1

Answer: SELECT lname FROM student WHERE sex = 'F' AND city_code = 'BAL' UNION SELECT lname FROM student WHERE sex = 'M' AND age < 20


Question:
What is the last name of every student who is either female or living in a city with the code BAL or male and under 20?
Additional table information: table: dorm_1

Answer: SELECT lname FROM student WHERE sex = 'F' AND city_code = 'BAL' UNION SELECT lname FROM student WHERE sex = 'M' AND age < 20


Question:
Find the name of the dorm with the largest capacity.
Additional table information: table: dorm_1

Answer: SELECT dorm_name FROM dorm ORDER BY student_capacity DESC LIMIT 1


Question:
What are the names of the dorm with the largest capacity?
Additional table information: table: dorm_1

Answer: SELECT dorm_name FROM dorm ORDER BY student_capacity DESC LIMIT 1


Question:
List in alphabetic order all different amenities.
Additional table information: table: dorm_1

Answer: SELECT amenity_name FROM dorm_amenity ORDER BY amenity_name NULLS FIRST


Question:
What are the different dorm amenity names in alphabetical order?
Additional table information: table: dorm_1

Answer: SELECT amenity_name FROM dorm_amenity ORDER BY amenity_name NULLS FIRST


Question:
Find the code of city where most of students are living in.
Additional table information: table: dorm_1

Answer: SELECT city_code FROM student GROUP BY city_code ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the code of the city with the most students?
Additional table information: table: dorm_1

Answer: SELECT city_code FROM student GROUP BY city_code ORDER BY COUNT(*) DESC LIMIT 1


Question:
Find the first and last name of students whose age is younger than the average age.
Additional table information: table: dorm_1

Answer: SELECT fname, lname FROM student WHERE age < (SELECT AVG(age) FROM student)


Question:
What is the first and last name of all students who are younger than average?
Additional table information: table: dorm_1

Answer: SELECT fname, lname FROM student WHERE age < (SELECT AVG(age) FROM student)


Question:
List the first and last name of students who are not living in the city with code HKG, and sorted the results by their ages.
Additional table information: table: dorm_1

Answer: SELECT fname, lname FROM student WHERE city_code <> 'HKG' ORDER BY age NULLS FIRST


Question:
What are the first and last names of all students who are not living in the city HKG and order the results by age?
Additional table information: table: dorm_1

Answer: SELECT fname, lname FROM student WHERE city_code <> 'HKG' ORDER BY age NULLS FIRST


Question:
List name of all amenities which Anonymous Donor Hall has, and sort the results in alphabetic order.
Additional table information: table: dorm_1

Answer: SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T2.amenid = T1.amenid JOIN dorm AS T3 ON T2.dormid = T3.dormid WHERE T3.dorm_name = 'Anonymous Donor Hall' ORDER BY T1.amenity_name NULLS FIRST


Question:
What are the amenities in alphabetical order that Anonymous Donor Hall has?
Additional table information: table: dorm_1

Answer: SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T2.amenid = T1.amenid JOIN dorm AS T3 ON T2.dormid = T3.dormid WHERE T3.dorm_name = 'Anonymous Donor Hall' ORDER BY T1.amenity_name NULLS FIRST


Question:
Find the number of dorms and total capacity for each gender.
Additional table information: table: dorm_1

Answer: SELECT COUNT(*), SUM(student_capacity), gender FROM dorm GROUP BY gender


Question:
How many dorms are there and what is the total capacity for each gender?
Additional table information: table: dorm_1

Answer: SELECT COUNT(*), SUM(student_capacity), gender FROM dorm GROUP BY gender


Question:
Find the average and oldest age for students with different sex.
Additional table information: table: dorm_1

Answer: SELECT AVG(age), MAX(age), sex FROM student GROUP BY sex


Question:
What is the average and oldest age for each gender of student?
Additional table information: table: dorm_1

Answer: SELECT AVG(age), MAX(age), sex FROM student GROUP BY sex


Question:
Find the number of students in each major.
Additional table information: table: dorm_1

Answer: SELECT COUNT(*), major FROM student GROUP BY major


Question:
How many students are there in each major?
Additional table information: table: dorm_1

Answer: SELECT COUNT(*), major FROM student GROUP BY major


Question:
Find the number and average age of students living in each city.
Additional table information: table: dorm_1

Answer: SELECT COUNT(*), AVG(age), city_code FROM student GROUP BY city_code


Question:
How many students live in each city and what are their average ages?
Additional table information: table: dorm_1

Answer: SELECT COUNT(*), AVG(age), city_code FROM student GROUP BY city_code


Question:
Find the average age and number of male students (with sex M) from each city.
Additional table information: table: dorm_1

Answer: SELECT COUNT(*), AVG(age), city_code FROM student WHERE sex = 'M' GROUP BY city_code


Question:
What is the average age and how many male students are there in each city?
Additional table information: table: dorm_1

Answer: SELECT COUNT(*), AVG(age), city_code FROM student WHERE sex = 'M' GROUP BY city_code


Question:
Find the number of students for the cities where have more than one student.
Additional table information: table: dorm_1

Answer: SELECT COUNT(*), city_code FROM student GROUP BY city_code HAVING COUNT(*) > 1


Question:
How many students are from each city, and which cities have more than one cities?
Additional table information: table: dorm_1

Answer: SELECT COUNT(*), city_code FROM student GROUP BY city_code HAVING COUNT(*) > 1


Question:
Find the first and last name of students who are not in the largest major.
Additional table information: table: dorm_1

Answer: SELECT fname, lname FROM student WHERE major <> (SELECT major FROM student GROUP BY major ORDER BY COUNT(*) DESC LIMIT 1)


Question:
What is the first and last name of the students who are not in the largest major?
Additional table information: table: dorm_1

Answer: SELECT fname, lname FROM student WHERE major <> (SELECT major FROM student GROUP BY major ORDER BY COUNT(*) DESC LIMIT 1)


Question:
Find the number of students whose age is older than the average age for each gender.
Additional table information: table: dorm_1

Answer: SELECT COUNT(*), sex FROM student WHERE age > (SELECT AVG(age) FROM student) GROUP BY sex


Question:
How many students are older than average for each gender?
Additional table information: table: dorm_1

Answer: SELECT COUNT(*), sex FROM student WHERE age > (SELECT AVG(age) FROM student) GROUP BY sex


Question:
Find the average age of students living in each dorm and the name of dorm.
Additional table information: table: dorm_1

Answer: SELECT AVG(T1.age), T3.dorm_name FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid GROUP BY T3.dorm_name


Question:
What is the average age for each dorm and what are the names of each dorm?
Additional table information: table: dorm_1

Answer: SELECT AVG(T1.age), T3.dorm_name FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid GROUP BY T3.dorm_name


Question:
Find the number of amenities for each of the dorms that can accommodate more than 100 students.
Additional table information: table: dorm_1

Answer: SELECT COUNT(*), T1.dormid FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid WHERE T1.student_capacity > 100 GROUP BY T1.dormid


Question:
For each dorm, how many amenities does it have?
Additional table information: table: dorm_1

Answer: SELECT COUNT(*), T1.dormid FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid WHERE T1.student_capacity > 100 GROUP BY T1.dormid


Question:
Find the number of students who is older than 20 in each dorm.
Additional table information: table: dorm_1

Answer: SELECT COUNT(*), T3.dorm_name FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T1.age > 20 GROUP BY T3.dorm_name


Question:
How many students are older than 20 in each dorm?
Additional table information: table: dorm_1

Answer: SELECT COUNT(*), T3.dorm_name FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T1.age > 20 GROUP BY T3.dorm_name


Question:
Find the first name of students who are living in the Smith Hall.
Additional table information: table: dorm_1

Answer: SELECT T1.fname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall'


Question:
What are the first names of all students in Smith Hall?
Additional table information: table: dorm_1

Answer: SELECT T1.fname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall'


Question:
Find the average age of students who are living in the dorm with the largest capacity.
Additional table information: table: dorm_1

Answer: SELECT AVG(T1.age) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.student_capacity = (SELECT MAX(student_capacity) FROM dorm)


Question:
What is the average age of students who are living in the dorm with the largest capacity?
Additional table information: table: dorm_1

Answer: SELECT AVG(T1.age) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.student_capacity = (SELECT MAX(student_capacity) FROM dorm)


Question:
Find the total number of students living in the male dorm (with gender M).
Additional table information: table: dorm_1

Answer: SELECT COUNT(*) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.gender = 'M'


Question:
What are the total number of students who are living in a male dorm?
Additional table information: table: dorm_1

Answer: SELECT COUNT(*) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.gender = 'M'


Question:
Find the number of female students (with F sex) living in Smith Hall
Additional table information: table: dorm_1

Answer: SELECT COUNT(*) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' AND T1.sex = 'F'


Question:
How many female students live in Smith Hall?
Additional table information: table: dorm_1

Answer: SELECT COUNT(*) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' AND T1.sex = 'F'


Question:
Find the name of amenities Smith Hall dorm have.
Additional table information: table: dorm_1

Answer: SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T1.dorm_name = 'Smith Hall'


Question:
What are the names of the amenities that Smith Hall has?
Additional table information: table: dorm_1

Answer: SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T1.dorm_name = 'Smith Hall'


Question:
Find the name of amenities Smith Hall dorm have. ordered the results by amenity names.
Additional table information: table: dorm_1

Answer: SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T1.dorm_name = 'Smith Hall' ORDER BY T3.amenity_name NULLS FIRST


Question:
What amenities does Smith Hall have in alphabetical order?
Additional table information: table: dorm_1

Answer: SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T1.dorm_name = 'Smith Hall' ORDER BY T3.amenity_name NULLS FIRST


Question:
Find the name of amenity that is most common in all dorms.
Additional table information: table: dorm_1

Answer: SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T1.amenid = T2.amenid GROUP BY T2.amenid ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the most common amenity in the dorms?
Additional table information: table: dorm_1

Answer: SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T1.amenid = T2.amenid GROUP BY T2.amenid ORDER BY COUNT(*) DESC LIMIT 1


Question:
Find the first name of students who are living in the dorm that has most number of amenities.
Additional table information: table: dorm_1

Answer: SELECT T1.fname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T2.dormid FROM dorm AS T3 JOIN has_amenity AS T4 ON T3.dormid = T4.dormid JOIN dorm_amenity AS T5 ON T4.amenid = T5.amenid GROUP BY T3.dormid ORDER BY COUNT(*) DESC LIMIT 1)


Question:
What are the first names of all students who live in the dorm with the most amenities?
Additional table information: table: dorm_1

Answer: SELECT T1.fname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T2.dormid FROM dorm AS T3 JOIN has_amenity AS T4 ON T3.dormid = T4.dormid JOIN dorm_amenity AS T5 ON T4.amenid = T5.amenid GROUP BY T3.dormid ORDER BY COUNT(*) DESC LIMIT 1)


Question:
Find the name and capacity of the dorm with least number of amenities.
Additional table information: table: dorm_1

Answer: SELECT T1.dorm_name, T1.student_capacity FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid GROUP BY T2.dormid ORDER BY COUNT(*) NULLS FIRST LIMIT 1


Question:
What is the name and capacity of the dorm with the fewest amount of amenities?
Additional table information: table: dorm_1

Answer: SELECT T1.dorm_name, T1.student_capacity FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid GROUP BY T2.dormid ORDER BY COUNT(*) NULLS FIRST LIMIT 1


Question:
Find the name of dorms that do not have amenity TV Lounge.
Additional table information: table: dorm_1

Answer: SELECT dorm_name FROM dorm EXCEPT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge'


Question:
What are the names of the dorm that does not have a TV Lounge?
Additional table information: table: dorm_1

Answer: SELECT dorm_name FROM dorm EXCEPT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge'


Question:
Find the first and last name of students who are living in the dorms that have amenity TV Lounge.
Additional table information: table: dorm_1

Answer: SELECT T1.fname, T1.lname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge')


Question:
What are the first and last names of all students who are living in a dorm with a TV Lounge?
Additional table information: table: dorm_1

Answer: SELECT T1.fname, T1.lname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge')


Question:
Find the first name and age of students who are living in the dorms that do not have amenity TV Lounge.
Additional table information: table: dorm_1

Answer: SELECT T1.fname, T1.age FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE NOT T2.dormid IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge')


Question:
What is the first name and age of every student who lives in a dorm with a TV Lounge?
Additional table information: table: dorm_1

Answer: SELECT T1.fname, T1.age FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE NOT T2.dormid IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge')


Question:
Find the name of amenities of the dorm where the student with last name Smith is living in.
Additional table information: table: dorm_1

Answer: SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid JOIN lives_in AS T4 ON T4.dormid = T1.dormid JOIN student AS T5 ON T5.stuid = T4.stuid WHERE T5.lname = 'Smith'


Question:
What are the amenities in the dorm that a student who has the last name of Smith lives in?
Additional table information: table: dorm_1

Answer: SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid JOIN lives_in AS T4 ON T4.dormid = T1.dormid JOIN student AS T5 ON T5.stuid = T4.stuid WHERE T5.lname = 'Smith'


Question:
How many customers are there?
Additional table information: table: customer_complaints

Answer: SELECT COUNT(*) FROM customers


Question:
Count the number of customers.
Additional table information: table: customer_complaints

Answer: SELECT COUNT(*) FROM customers


Question:
Find the emails and phone numbers of all the customers, ordered by email address and phone number.
Additional table information: table: customer_complaints

Answer: SELECT email_address, phone_number FROM customers ORDER BY email_address NULLS FIRST, phone_number NULLS FIRST


Question:
What are the emails and phone numbers of all customers, sorted by email address and phone number?
Additional table information: table: customer_complaints

Answer: SELECT email_address, phone_number FROM customers ORDER BY email_address NULLS FIRST, phone_number NULLS FIRST


Question:
Which city has the least number of customers whose type code is 'Good Credit Rating'?
Additional table information: table: customer_complaints

Answer: SELECT town_city FROM customers WHERE customer_type_code = 'Good Credit Rating' GROUP BY town_city ORDER BY COUNT(*) NULLS FIRST LIMIT 1


Question:
Return the city with the customer type code 'Good Credit Rating' that had the fewest customers.
Additional table information: table: customer_complaints

Answer: SELECT town_city FROM customers WHERE customer_type_code = 'Good Credit Rating' GROUP BY town_city ORDER BY COUNT(*) NULLS FIRST LIMIT 1


Question:
List the name of all products along with the number of complaints that they have received.
Additional table information: table: customer_complaints

Answer: SELECT t1.product_name, COUNT(*) FROM products AS t1 JOIN complaints AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_name


Question:
What are all the different product names, and how many complains has each received?
Additional table information: table: customer_complaints

Answer: SELECT t1.product_name, COUNT(*) FROM products AS t1 JOIN complaints AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_name


Question:
Find the emails of customers who has filed a complaints of the product with the most complaints.
Additional table information: table: customer_complaints

Answer: SELECT t1.email_address FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_id ORDER BY COUNT(*) NULLS FIRST LIMIT 1


Question:
What are the emails of customers who have filed complaints on the product which has had the greatest number of complaints?
Additional table information: table: customer_complaints

Answer: SELECT t1.email_address FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_id ORDER BY COUNT(*) NULLS FIRST LIMIT 1


Question:
Which products has been complained by the customer who has filed least amount of complaints?
Additional table information: table: customer_complaints

Answer: SELECT DISTINCT t1.product_name FROM products AS t1 JOIN complaints AS t2 ON t1.product_id = t2.product_id, customers AS t3 GROUP BY t3.customer_id ORDER BY COUNT(*) NULLS FIRST LIMIT 1


Question:
Return the names of products that have had complaints filed by the customer who has filed the fewest complaints.
Additional table information: table: customer_complaints

Answer: SELECT DISTINCT t1.product_name FROM products AS t1 JOIN complaints AS t2 ON t1.product_id = t2.product_id, customers AS t3 GROUP BY t3.customer_id ORDER BY COUNT(*) NULLS FIRST LIMIT 1


Question:
What is the phone number of the customer who has filed the most recent complaint?
Additional table information: table: customer_complaints

Answer: SELECT t1.phone_number FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id = t2.customer_id ORDER BY t2.date_complaint_raised DESC LIMIT 1


Question:
Return the phone number of the customer who filed the complaint that was raised most recently.
Additional table information: table: customer_complaints

Answer: SELECT t1.phone_number FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id = t2.customer_id ORDER BY t2.date_complaint_raised DESC LIMIT 1


Question:
Find the email and phone number of the customers who have never filed a complaint before.
Additional table information: table: customer_complaints

Answer: SELECT email_address, phone_number FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM complaints)


Question:
What are the emails and phone numbers of custoemrs who have never filed a complaint?
Additional table information: table: customer_complaints

Answer: SELECT email_address, phone_number FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM complaints)


Question:
Find the phone number of all the customers and staff.
Additional table information: table: customer_complaints

Answer: SELECT phone_number FROM customers UNION SELECT phone_number FROM staff


Question:
What are the phone numbers of all customers and all staff members?
Additional table information: table: customer_complaints

Answer: SELECT phone_number FROM customers UNION SELECT phone_number FROM staff


Question:
What is the description of the product named 'Chocolate'?
Additional table information: table: customer_complaints

Answer: SELECT product_description FROM products WHERE product_name = 'Chocolate'


Question:
Return the description of the product called 'Chocolate'.
Additional table information: table: customer_complaints

Answer: SELECT product_description FROM products WHERE product_name = 'Chocolate'


Question:
Find the name and category of the most expensive product.
Additional table information: table: customer_complaints

Answer: SELECT product_name, product_category_code FROM products ORDER BY product_price DESC LIMIT 1


Question:
What is the name and category code of the product with the highest price?
Additional table information: table: customer_complaints

Answer: SELECT product_name, product_category_code FROM products ORDER BY product_price DESC LIMIT 1


Question:
Find the prices of products which has never received a single complaint.
Additional table information: table: customer_complaints

Answer: SELECT product_price FROM products WHERE NOT product_id IN (SELECT product_id FROM complaints)


Question:
What are the prices of products that have never gotten a complaint?
Additional table information: table: customer_complaints

Answer: SELECT product_price FROM products WHERE NOT product_id IN (SELECT product_id FROM complaints)


Question:
What is the average price of the products for each category?
Additional table information: table: customer_complaints

Answer: SELECT AVG(product_price), product_category_code FROM products GROUP BY product_category_code


Question:
Return the average price of products that have each category code.
Additional table information: table: customer_complaints

Answer: SELECT AVG(product_price), product_category_code FROM products GROUP BY product_category_code


Question:
Find the last name of the staff member who processed the complaint of the cheapest product.
Additional table information: table: customer_complaints

Answer: SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id JOIN products AS t3 ON t2.product_id = t3.product_id ORDER BY t3.product_price NULLS FIRST LIMIT 1


Question:
What is the last name of the staff member in charge of the complaint on the product with the lowest price?
Additional table information: table: customer_complaints

Answer: SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id JOIN products AS t3 ON t2.product_id = t3.product_id ORDER BY t3.product_price NULLS FIRST LIMIT 1


Question:
Which complaint status has more than 3 records on file?
Additional table information: table: customer_complaints

Answer: SELECT complaint_status_code FROM complaints GROUP BY complaint_status_code HAVING COUNT(*) > 3


Question:
Return complaint status codes have more than 3 corresponding complaints?
Additional table information: table: customer_complaints

Answer: SELECT complaint_status_code FROM complaints GROUP BY complaint_status_code HAVING COUNT(*) > 3


Question:
Find the last name of the staff whose email address contains 'wrau'.
Additional table information: table: customer_complaints

Answer: SELECT last_name FROM staff WHERE email_address LIKE '%wrau%'


Question:
What are the last names of staff with email addressed containing the substring 'wrau'?
Additional table information: table: customer_complaints

Answer: SELECT last_name FROM staff WHERE email_address LIKE '%wrau%'


Question:
How many customers are there in the customer type with the most customers?
Additional table information: table: customer_complaints

Answer: SELECT COUNT(*) FROM customers GROUP BY customer_type_code ORDER BY COUNT(*) DESC LIMIT 1


Question:
Count the number of customers that have the customer type that is most common.
Additional table information: table: customer_complaints

Answer: SELECT COUNT(*) FROM customers GROUP BY customer_type_code ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the last name of the staff who has handled the first ever complaint?
Additional table information: table: customer_complaints

Answer: SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id ORDER BY t2.date_complaint_raised NULLS FIRST LIMIT 1


Question:
Return the last name of the staff member who handled the complaint with the earliest date raised.
Additional table information: table: customer_complaints

Answer: SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id ORDER BY t2.date_complaint_raised NULLS FIRST LIMIT 1


Question:
How many distinct complaint type codes are there in the database?
Additional table information: table: customer_complaints

Answer: SELECT COUNT(DISTINCT complaint_type_code) FROM complaints


Question:
Count the number of different complaint type codes.
Additional table information: table: customer_complaints

Answer: SELECT COUNT(DISTINCT complaint_type_code) FROM complaints


Question:
Find the address line 1 and 2 of the customer with email 'vbogisich@example.org'.
Additional table information: table: customer_complaints

Answer: SELECT address_line_1, address_line_2 FROM customers WHERE email_address = 'vbogisich@example.org'


Question:
What are lines 1 and 2 of the addressed of the customer with the email 'vbogisich@example.org'?
Additional table information: table: customer_complaints

Answer: SELECT address_line_1, address_line_2 FROM customers WHERE email_address = 'vbogisich@example.org'


Question:
Find the number of complaints with Product Failure type for each complaint status.
Additional table information: table: customer_complaints

Answer: SELECT complaint_status_code, COUNT(*) FROM complaints WHERE complaint_type_code = 'Product Failure' GROUP BY complaint_status_code


Question:
Of complaints with the type code 'Product Failure', how many had each different status code?
Additional table information: table: customer_complaints

Answer: SELECT complaint_status_code, COUNT(*) FROM complaints WHERE complaint_type_code = 'Product Failure' GROUP BY complaint_status_code


Question:
What is first names of the top 5 staff who have handled the greatest number of complaints?
Additional table information: table: customer_complaints

Answer: SELECT t1.first_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id GROUP BY t2.staff_id ORDER BY COUNT(*) NULLS FIRST LIMIT 5


Question:
Return the first names of the 5 staff members who have handled the most complaints.
Additional table information: table: customer_complaints

Answer: SELECT t1.first_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id GROUP BY t2.staff_id ORDER BY COUNT(*) NULLS FIRST LIMIT 5


Question:
Which state has the most customers?
Additional table information: table: customer_complaints

Answer: SELECT state FROM customers GROUP BY state ORDER BY COUNT(*) NULLS FIRST LIMIT 1


Question:
Give the state that has the most customers.
Additional table information: table: customer_complaints

Answer: SELECT state FROM customers GROUP BY state ORDER BY COUNT(*) NULLS FIRST LIMIT 1


Question:
How many submissions are there?
Additional table information: table: workshop_paper

Answer: SELECT COUNT(*) FROM submission


Question:
Count the number of submissions.
Additional table information: table: workshop_paper

Answer: SELECT COUNT(*) FROM submission


Question:
List the authors of submissions in ascending order of scores.
Additional table information: table: workshop_paper

Answer: SELECT Author FROM submission ORDER BY Scores ASC NULLS FIRST


Question:
Find the author for each submission and list them in ascending order of submission score.
Additional table information: table: workshop_paper

Answer: SELECT Author FROM submission ORDER BY Scores ASC NULLS FIRST


Question:
What are the authors of submissions and their colleges?
Additional table information: table: workshop_paper

Answer: SELECT Author, College FROM submission


Question:
For each submission, show the author and their affiliated college.
Additional table information: table: workshop_paper

Answer: SELECT Author, College FROM submission


Question:
Show the names of authors from college 'Florida' or 'Temple'
Additional table information: table: workshop_paper

Answer: SELECT Author FROM submission WHERE College = 'Florida' OR College = 'Temple'


Question:
Which authors with submissions are from college 'Florida' or 'Temple'?
Additional table information: table: workshop_paper

Answer: SELECT Author FROM submission WHERE College = 'Florida' OR College = 'Temple'


Question:
What is the average score of submissions?
Additional table information: table: workshop_paper

Answer: SELECT AVG(Scores) FROM submission


Question:
Compute the average score of submissions.
Additional table information: table: workshop_paper

Answer: SELECT AVG(Scores) FROM submission


Question:
What is the author of the submission with the highest score?
Additional table information: table: workshop_paper

Answer: SELECT Author FROM submission ORDER BY Scores DESC LIMIT 1


Question:
Find the author who achieved the highest score in a submission.
Additional table information: table: workshop_paper

Answer: SELECT Author FROM submission ORDER BY Scores DESC LIMIT 1


Question:
Show different colleges along with the number of authors of submission from each college.
Additional table information: table: workshop_paper

Answer: SELECT College, COUNT(*) FROM submission GROUP BY College


Question:
For each college, return the college name and the count of authors with submissions from that college.
Additional table information: table: workshop_paper

Answer: SELECT College, COUNT(*) FROM submission GROUP BY College


Question:
Show the most common college of authors of submissions.
Additional table information: table: workshop_paper

Answer: SELECT College FROM submission GROUP BY College ORDER BY COUNT(*) DESC LIMIT 1


Question:
Which college has the most authors with submissions?
Additional table information: table: workshop_paper

Answer: SELECT College FROM submission GROUP BY College ORDER BY COUNT(*) DESC LIMIT 1


Question:
Show the colleges that have both authors with submission score larger than 90 and authors with submission score smaller than 80.
Additional table information: table: workshop_paper

Answer: SELECT College FROM submission WHERE Scores > 90 INTERSECT SELECT College FROM submission WHERE Scores < 80


Question:
Which colleges have both authors with submission score above 90 and authors with submission score below 80?
Additional table information: table: workshop_paper

Answer: SELECT College FROM submission WHERE Scores > 90 INTERSECT SELECT College FROM submission WHERE Scores < 80


Question:
Show the authors of submissions and the acceptance results of their submissions.
Additional table information: table: workshop_paper

Answer: SELECT T2.Author, T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID


Question:
For each submission, find its author and acceptance result.
Additional table information: table: workshop_paper

Answer: SELECT T2.Author, T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID


Question:
Show the result of the submission with the highest score.
Additional table information: table: workshop_paper

Answer: SELECT T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID ORDER BY T2.Scores DESC LIMIT 1


Question:
Which submission received the highest score in acceptance result. Show me the result.
Additional table information: table: workshop_paper

Answer: SELECT T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID ORDER BY T2.Scores DESC LIMIT 1


Question:
Show each author and the number of workshops they submitted to.
Additional table information: table: workshop_paper

Answer: SELECT T2.Author, COUNT(DISTINCT T1.workshop_id) FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID GROUP BY T2.Author


Question:
How many workshops did each author submit to? Return the author name and the number of workshops.
Additional table information: table: workshop_paper

Answer: SELECT T2.Author, COUNT(DISTINCT T1.workshop_id) FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID GROUP BY T2.Author


Question:
Show the authors who have submissions to more than one workshop.
Additional table information: table: workshop_paper

Answer: SELECT T2.Author FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID GROUP BY T2.Author HAVING COUNT(DISTINCT T1.workshop_id) > 1


Question:
Which authors have submitted to more than one workshop?
Additional table information: table: workshop_paper

Answer: SELECT T2.Author FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID GROUP BY T2.Author HAVING COUNT(DISTINCT T1.workshop_id) > 1


Question:
Show the date and venue of each workshop in ascending alphabetical order of the venue.
Additional table information: table: workshop_paper

Answer: SELECT Date, Venue FROM workshop ORDER BY Venue NULLS FIRST


Question:
Sort the each workshop in alphabetical order of the venue. Return the date and venue of each workshop.
Additional table information: table: workshop_paper

Answer: SELECT Date, Venue FROM workshop ORDER BY Venue NULLS FIRST


Question:
List the authors who do not have submission to any workshop.
Additional table information: table: workshop_paper

Answer: SELECT Author FROM submission WHERE NOT Submission_ID IN (SELECT Submission_ID FROM acceptance)


Question:
Which authors did not submit to any workshop?
Additional table information: table: workshop_paper

Answer: SELECT Author FROM submission WHERE NOT Submission_ID IN (SELECT Submission_ID FROM acceptance)


Question:
Find the number of investors in total.
Additional table information: table: tracking_share_transactions

Answer: SELECT COUNT(*) FROM INVESTORS


Question:
Show all investor details.
Additional table information: table: tracking_share_transactions

Answer: SELECT Investor_details FROM INVESTORS


Question:
Show all distinct lot details.
Additional table information: table: tracking_share_transactions

Answer: SELECT DISTINCT lot_details FROM LOTS


Question:
Show the maximum amount of transaction.
Additional table information: table: tracking_share_transactions

Answer: SELECT MAX(amount_of_transaction) FROM TRANSACTIONS


Question:
Show all date and share count of transactions.
Additional table information: table: tracking_share_transactions

Answer: SELECT date_of_transaction, share_count FROM TRANSACTIONS


Question:
What is the total share of transactions?
Additional table information: table: tracking_share_transactions

Answer: SELECT SUM(share_count) FROM TRANSACTIONS


Question:
Show all transaction ids with transaction code 'PUR'.
Additional table information: table: tracking_share_transactions

Answer: SELECT transaction_id FROM TRANSACTIONS WHERE transaction_type_code = 'PUR'


Question:
Show all dates of transactions whose type code is 'SALE'.
Additional table information: table: tracking_share_transactions

Answer: SELECT date_of_transaction FROM TRANSACTIONS WHERE transaction_type_code = 'SALE'


Question:
Show the average amount of transactions with type code 'SALE'.
Additional table information: table: tracking_share_transactions

Answer: SELECT AVG(amount_of_transaction) FROM TRANSACTIONS WHERE transaction_type_code = 'SALE'


Question:
Show the description of transaction type with code 'PUR'.
Additional table information: table: tracking_share_transactions

Answer: SELECT transaction_type_description FROM Ref_Transaction_Types WHERE transaction_type_code = 'PUR'


Question:
Show the minimum amount of transactions whose type code is 'PUR' and whose share count is bigger than 50.
Additional table information: table: tracking_share_transactions

Answer: SELECT MIN(amount_of_transaction) FROM TRANSACTIONS WHERE transaction_type_code = 'PUR' AND share_count > 50


Question:
Show the maximum share count of transactions where the amount is smaller than 10000
Additional table information: table: tracking_share_transactions

Answer: SELECT MAX(share_count) FROM TRANSACTIONS WHERE amount_of_transaction < 10000


Question:
Show the dates of transactions if the share count is bigger than 100 or the amount is bigger than 1000.
Additional table information: table: tracking_share_transactions

Answer: SELECT date_of_transaction FROM TRANSACTIONS WHERE share_count > 100 OR amount_of_transaction > 1000


Question:
Show the transaction type descriptions and dates if the share count is smaller than 10.
Additional table information: table: tracking_share_transactions

Answer: SELECT T1.transaction_type_description, T2.date_of_transaction FROM Ref_Transaction_Types AS T1 JOIN TRANSACTIONS AS T2 ON T1.transaction_type_code = T2.transaction_type_code WHERE T2.share_count < 10


Question:
Show details of all investors if they make any transaction with share count greater than 100.
Additional table information: table: tracking_share_transactions

Answer: SELECT T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id WHERE T2.share_count > 100


Question:
How many distinct transaction types are used in the transactions?
Additional table information: table: tracking_share_transactions

Answer: SELECT COUNT(DISTINCT transaction_type_code) FROM TRANSACTIONS


Question:
Return the lot details and investor ids.
Additional table information: table: tracking_share_transactions

Answer: SELECT lot_details, investor_id FROM LOTS


Question:
Return the lot details of lots that belong to investors with details 'l'?
Additional table information: table: tracking_share_transactions

Answer: SELECT T2.lot_details FROM INVESTORS AS T1 JOIN LOTS AS T2 ON T1.investor_id = T2.investor_id WHERE T1.Investor_details = 'l'


Question:
What are the purchase details of transactions with amount bigger than 10000?
Additional table information: table: tracking_share_transactions

Answer: SELECT T1.purchase_details FROM PURCHASES AS T1 JOIN TRANSACTIONS AS T2 ON T1.purchase_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction > 10000


Question:
What are the sale details and dates of transactions with amount smaller than 3000?
Additional table information: table: tracking_share_transactions

Answer: SELECT T1.sales_details, T2.date_of_transaction FROM SALES AS T1 JOIN TRANSACTIONS AS T2 ON T1.sales_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction < 3000


Question:
What are the lot details of lots associated with transactions with share count smaller than 50?
Additional table information: table: tracking_share_transactions

Answer: SELECT T1.lot_details FROM LOTS AS T1 JOIN TRANSACTIONS_LOTS AS T2 ON T1.lot_id = T2.transaction_id JOIN TRANSACTIONS AS T3 ON T2.transaction_id = T3.transaction_id WHERE T3.share_count < 50


Question:
What are the lot details of lots associated with transactions whose share count is bigger than 100 and whose type code is 'PUR'?
Additional table information: table: tracking_share_transactions

Answer: SELECT T1.lot_details FROM LOTS AS T1 JOIN TRANSACTIONS_LOTS AS T2 ON T1.lot_id = T2.transaction_id JOIN TRANSACTIONS AS T3 ON T2.transaction_id = T3.transaction_id WHERE T3.share_count > 100 AND T3.transaction_type_code = 'PUR'


Question:
Show the average transaction amount for different transaction types.
Additional table information: table: tracking_share_transactions

Answer: SELECT transaction_type_code, AVG(amount_of_transaction) FROM TRANSACTIONS GROUP BY transaction_type_code


Question:
Show the maximum and minimum share count of different transaction types.
Additional table information: table: tracking_share_transactions

Answer: SELECT transaction_type_code, MAX(share_count), MIN(share_count) FROM TRANSACTIONS GROUP BY transaction_type_code


Question:
Show the average share count of transactions for different investors.
Additional table information: table: tracking_share_transactions

Answer: SELECT investor_id, AVG(share_count) FROM TRANSACTIONS GROUP BY investor_id


Question:
Show the average share count of transactions each each investor, ordered by average share count.
Additional table information: table: tracking_share_transactions

Answer: SELECT investor_id, AVG(share_count) FROM TRANSACTIONS GROUP BY investor_id ORDER BY AVG(share_count) NULLS FIRST


Question:
Show the average amount of transactions for different investors.
Additional table information: table: tracking_share_transactions

Answer: SELECT investor_id, AVG(amount_of_transaction) FROM TRANSACTIONS GROUP BY investor_id


Question:
Show the average amount of transactions for different lots.
Additional table information: table: tracking_share_transactions

Answer: SELECT T2.lot_id, AVG(amount_of_transaction) FROM TRANSACTIONS AS T1 JOIN Transactions_Lots AS T2 ON T1.transaction_id = T2.transaction_id GROUP BY T2.lot_id


Question:
Show the average amount of transactions for different lots, ordered by average amount of transactions.
Additional table information: table: tracking_share_transactions

Answer: SELECT T2.lot_id, AVG(amount_of_transaction) FROM TRANSACTIONS AS T1 JOIN Transactions_Lots AS T2 ON T1.transaction_id = T2.transaction_id GROUP BY T2.lot_id ORDER BY AVG(amount_of_transaction) NULLS FIRST


Question:
Show the number of transactions with transaction type code 'SALE' for different investors if it is larger than 0.
Additional table information: table: tracking_share_transactions

Answer: SELECT investor_id, COUNT(*) FROM TRANSACTIONS WHERE transaction_type_code = 'SALE' GROUP BY investor_id


Question:
Show the number of transactions for different investors.
Additional table information: table: tracking_share_transactions

Answer: SELECT investor_id, COUNT(*) FROM TRANSACTIONS GROUP BY investor_id


Question:
Show the transaction type code that occurs the fewest times.
Additional table information: table: tracking_share_transactions

Answer: SELECT transaction_type_code FROM TRANSACTIONS GROUP BY transaction_type_code ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1


Question:
Show the transaction type code that occurs the most frequently.
Additional table information: table: tracking_share_transactions

Answer: SELECT transaction_type_code FROM TRANSACTIONS GROUP BY transaction_type_code ORDER BY COUNT(*) DESC LIMIT 1


Question:
Show the description of the transaction type that occurs most frequently.
Additional table information: table: tracking_share_transactions

Answer: SELECT T1.transaction_type_description FROM Ref_Transaction_Types AS T1 JOIN TRANSACTIONS AS T2 ON T1.transaction_type_code = T2.transaction_type_code GROUP BY T1.transaction_type_code ORDER BY COUNT(*) DESC LIMIT 1


Question:
Show the id and details of the investor that has the largest number of transactions.
Additional table information: table: tracking_share_transactions

Answer: SELECT T2.investor_id, T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id GROUP BY T2.investor_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
Show the id and details for the investors who have the top 3 number of transactions.
Additional table information: table: tracking_share_transactions

Answer: SELECT T2.investor_id, T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id GROUP BY T2.investor_id ORDER BY COUNT(*) DESC LIMIT 3


Question:
Show the ids of the investors who have at least two transactions.
Additional table information: table: tracking_share_transactions

Answer: SELECT T2.investor_id FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id GROUP BY T2.investor_id HAVING COUNT(*) >= 2


Question:
Show the ids and details of the investors who have at least two transactions with type code 'SALE'.
Additional table information: table: tracking_share_transactions

Answer: SELECT T2.investor_id, T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id WHERE T2.transaction_type_code = 'SALE' GROUP BY T2.investor_id HAVING COUNT(*) >= 2


Question:
What are the dates of transactions with at least 100 share count or amount bigger than 100?
Additional table information: table: tracking_share_transactions

Answer: SELECT date_of_transaction FROM TRANSACTIONS WHERE share_count >= 100 OR amount_of_transaction >= 100


Question:
What are the details of all sales and purchases?
Additional table information: table: tracking_share_transactions

Answer: SELECT sales_details FROM sales UNION SELECT purchase_details FROM purchases


Question:
What are the details of the lots which are not used in any transactions?
Additional table information: table: tracking_share_transactions

Answer: SELECT lot_details FROM Lots EXCEPT SELECT T1.lot_details FROM Lots AS T1 JOIN transactions_lots AS T2 ON T1.lot_id = T2.lot_id


Question:
How many available hotels are there in total?
Additional table information: table: cre_Theme_park

Answer: SELECT COUNT(*) FROM HOTELS


Question:
Find the total number of available hotels.
Additional table information: table: cre_Theme_park

Answer: SELECT COUNT(*) FROM HOTELS


Question:
What are the price ranges of hotels?
Additional table information: table: cre_Theme_park

Answer: SELECT price_range FROM HOTELS


Question:
Tell me the price ranges for all the hotels.
Additional table information: table: cre_Theme_park

Answer: SELECT price_range FROM HOTELS


Question:
Show all distinct location names.
Additional table information: table: cre_Theme_park

Answer: SELECT DISTINCT Location_Name FROM LOCATIONS


Question:
What are the distinct location names?
Additional table information: table: cre_Theme_park

Answer: SELECT DISTINCT Location_Name FROM LOCATIONS


Question:
Show the names and details of all the staff members.
Additional table information: table: cre_Theme_park

Answer: SELECT Name, Other_Details FROM Staff


Question:
What is the name and detail of each staff member?
Additional table information: table: cre_Theme_park

Answer: SELECT Name, Other_Details FROM Staff


Question:
Show details of all visitors.
Additional table information: table: cre_Theme_park

Answer: SELECT Tourist_Details FROM VISITORS


Question:
What is the detail of each visitor?
Additional table information: table: cre_Theme_park

Answer: SELECT Tourist_Details FROM VISITORS


Question:
Show the price ranges of hotels with 5 star ratings.
Additional table information: table: cre_Theme_park

Answer: SELECT price_range FROM HOTELS WHERE star_rating_code = '5'


Question:
What are the price ranges of five star hotels?
Additional table information: table: cre_Theme_park

Answer: SELECT price_range FROM HOTELS WHERE star_rating_code = '5'


Question:
Show the average price range of hotels that have 5 star ratings and allow pets.
Additional table information: table: cre_Theme_park

Answer: SELECT AVG(price_range) FROM HOTELS WHERE star_rating_code = '5' AND pets_allowed_yn = 1


Question:
What is the average price range of five star hotels that allow pets?
Additional table information: table: cre_Theme_park

Answer: SELECT AVG(price_range) FROM HOTELS WHERE star_rating_code = '5' AND pets_allowed_yn = 1


Question:
What is the address of the location 'UK Gallery'?
Additional table information: table: cre_Theme_park

Answer: SELECT Address FROM LOCATIONS WHERE Location_Name = 'UK Gallery'


Question:
Find the address of the location named 'UK Gallery'.
Additional table information: table: cre_Theme_park

Answer: SELECT Address FROM LOCATIONS WHERE Location_Name = 'UK Gallery'


Question:
What is the detail of the location UK Gallery?
Additional table information: table: cre_Theme_park

Answer: SELECT Other_Details FROM LOCATIONS WHERE Location_Name = 'UK Gallery'


Question:
Return the detail of the location named 'UK Gallery'.
Additional table information: table: cre_Theme_park

Answer: SELECT Other_Details FROM LOCATIONS WHERE Location_Name = 'UK Gallery'


Question:
Which location names contain the word 'film'?
Additional table information: table: cre_Theme_park

Answer: SELECT Location_Name FROM LOCATIONS WHERE Location_Name LIKE '%film%'


Question:
Find all the locations whose names contain the word 'film'.
Additional table information: table: cre_Theme_park

Answer: SELECT Location_Name FROM LOCATIONS WHERE Location_Name LIKE '%film%'


Question:
How many distinct names are associated with all the photos?
Additional table information: table: cre_Theme_park

Answer: SELECT COUNT(DISTINCT Name) FROM PHOTOS


Question:
Count the number of distinct names associated with the photos.
Additional table information: table: cre_Theme_park

Answer: SELECT COUNT(DISTINCT Name) FROM PHOTOS


Question:
What are the distinct visit dates?
Additional table information: table: cre_Theme_park

Answer: SELECT DISTINCT Visit_Date FROM VISITS


Question:
Find all the distinct visit dates.
Additional table information: table: cre_Theme_park

Answer: SELECT DISTINCT Visit_Date FROM VISITS


Question:
What are the names of the tourist attractions that can be accessed by bus?
Additional table information: table: cre_Theme_park

Answer: SELECT Name FROM TOURIST_ATTRACTIONS WHERE How_to_Get_There = 'bus'


Question:
Which tourist attractions can we get to by bus? Tell me the names of the attractions.
Additional table information: table: cre_Theme_park

Answer: SELECT Name FROM TOURIST_ATTRACTIONS WHERE How_to_Get_There = 'bus'


Question:
What are the names and opening hours of the tourist attractions that can be accessed by bus or walk?
Additional table information: table: cre_Theme_park

Answer: SELECT Name, Opening_Hours FROM TOURIST_ATTRACTIONS WHERE How_to_Get_There = 'bus' OR How_to_Get_There = 'walk'


Question:
Find the names and opening hours of the tourist attractions that we get to by bus or walk.
Additional table information: table: cre_Theme_park

Answer: SELECT Name, Opening_Hours FROM TOURIST_ATTRACTIONS WHERE How_to_Get_There = 'bus' OR How_to_Get_There = 'walk'


Question:
What are the star rating descriptions of the hotels with price above 10000?
Additional table information: table: cre_Theme_park

Answer: SELECT T2.star_rating_description FROM HOTELS AS T1 JOIN Ref_Hotel_Star_Ratings AS T2 ON T1.star_rating_code = T2.star_rating_code WHERE T1.price_range > 10000


Question:
Give me the star rating descriptions of the hotels that cost more than 10000.
Additional table information: table: cre_Theme_park

Answer: SELECT T2.star_rating_description FROM HOTELS AS T1 JOIN Ref_Hotel_Star_Ratings AS T2 ON T1.star_rating_code = T2.star_rating_code WHERE T1.price_range > 10000


Question:
What are the details and opening hours of the museums?
Additional table information: table: cre_Theme_park

Answer: SELECT T1.Museum_Details, T2.Opening_Hours FROM MUSEUMS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Museum_ID = T2.Tourist_Attraction_ID


Question:
Give me the detail and opening hour for each museum.
Additional table information: table: cre_Theme_park

Answer: SELECT T1.Museum_Details, T2.Opening_Hours FROM MUSEUMS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Museum_ID = T2.Tourist_Attraction_ID


Question:
What is the name of the tourist attraction that is associated with the photo 'game1'?
Additional table information: table: cre_Theme_park

Answer: SELECT T2.Name FROM PHOTOS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T1.Name = 'game1'


Question:
Which tourist attraction is associated with the photo 'game1'? Return its name.
Additional table information: table: cre_Theme_park

Answer: SELECT T2.Name FROM PHOTOS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T1.Name = 'game1'


Question:
What are the names and descriptions of the photos taken at the tourist attraction 'film festival'?
Additional table information: table: cre_Theme_park

Answer: SELECT T1.Name, T1.Description FROM PHOTOS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T2.Name = 'film festival'


Question:
Find the names and descriptions of the photos taken at the tourist attraction called 'film festival'.
Additional table information: table: cre_Theme_park

Answer: SELECT T1.Name, T1.Description FROM PHOTOS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T2.Name = 'film festival'


Question:
What are the details and ways to get to tourist attractions related to royal family?
Additional table information: table: cre_Theme_park

Answer: SELECT T1.Royal_Family_Details, T2.How_to_Get_There FROM ROYAL_FAMILY AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Royal_Family_ID = T2.Tourist_Attraction_ID


Question:
Which tourist attractions are related to royal family? Tell me their details and how we can get there.
Additional table information: table: cre_Theme_park

Answer: SELECT T1.Royal_Family_Details, T2.How_to_Get_There FROM ROYAL_FAMILY AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Royal_Family_ID = T2.Tourist_Attraction_ID


Question:
What are the details of the shops that can be accessed by walk?
Additional table information: table: cre_Theme_park

Answer: SELECT T1.Shop_Details FROM SHOPS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Shop_ID = T2.Tourist_Attraction_ID WHERE T2.How_to_Get_There = 'walk'


Question:
Find the details of the shops that can be reached by walk.
Additional table information: table: cre_Theme_park

Answer: SELECT T1.Shop_Details FROM SHOPS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Shop_ID = T2.Tourist_Attraction_ID WHERE T2.How_to_Get_There = 'walk'


Question:
What is the name of the staff that is in charge of the attraction named 'US museum'?
Additional table information: table: cre_Theme_park

Answer: SELECT T1.Name FROM STAFF AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T2.Name = 'US museum'


Question:
Tell me the name of the staff in charge of the attraction called 'US museum'.
Additional table information: table: cre_Theme_park

Answer: SELECT T1.Name FROM STAFF AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T2.Name = 'US museum'


Question:
What are the details of the markets that can be accessed by walk or bus?
Additional table information: table: cre_Theme_park

Answer: SELECT T1.Market_Details FROM Street_Markets AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Market_ID = T2.Tourist_Attraction_ID WHERE T2.How_to_Get_There = 'walk' OR T2.How_to_Get_There = 'bus'


Question:
Find the details of all the markets that are accessible by walk or bus.
Additional table information: table: cre_Theme_park

Answer: SELECT T1.Market_Details FROM Street_Markets AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Market_ID = T2.Tourist_Attraction_ID WHERE T2.How_to_Get_There = 'walk' OR T2.How_to_Get_There = 'bus'


Question:
What are the visit date and details of the visitor whose detail is 'Vincent'?
Additional table information: table: cre_Theme_park

Answer: SELECT T2.Visit_Date, T2.Visit_Details FROM VISITORS AS T1 JOIN VISITS AS T2 ON T1.Tourist_ID = T2.Tourist_ID WHERE T1.Tourist_Details = 'Vincent'


Question:
Find the visit date and details of the tourist whose detail is 'Vincent'
Additional table information: table: cre_Theme_park

Answer: SELECT T2.Visit_Date, T2.Visit_Details FROM VISITORS AS T1 JOIN VISITS AS T2 ON T1.Tourist_ID = T2.Tourist_ID WHERE T1.Tourist_Details = 'Vincent'


Question:
Which tourist attractions does the visitor with detail 'Vincent' visit?
Additional table information: table: cre_Theme_park

Answer: SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID JOIN VISITORS AS T3 ON T2.Tourist_ID = T3.Tourist_ID WHERE T3.Tourist_Details = 'Vincent'


Question:
Show the tourist attractions visited by the tourist whose detail is 'Vincent'.
Additional table information: table: cre_Theme_park

Answer: SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID JOIN VISITORS AS T3 ON T2.Tourist_ID = T3.Tourist_ID WHERE T3.Tourist_Details = 'Vincent'


Question:
What are the names of the tourist attractions and the dates when the tourists named Vincent or Vivian visited there?
Additional table information: table: cre_Theme_park

Answer: SELECT T1.Name, T3.Visit_Date FROM Tourist_Attractions AS T1, VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = 'Vincent' OR T2.Tourist_Details = 'Vivian'


Question:
For each tourist attraction, return its name and the date when the tourists named Vincent or Vivian visited there.
Additional table information: table: cre_Theme_park

Answer: SELECT T1.Name, T3.Visit_Date FROM Tourist_Attractions AS T1, VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = 'Vincent' OR T2.Tourist_Details = 'Vivian'


Question:
Show the average price of hotels for each star rating code.
Additional table information: table: cre_Theme_park

Answer: SELECT star_rating_code, AVG(price_range) FROM HOTELS GROUP BY star_rating_code


Question:
What is the average price range of hotels for each each star rating code?
Additional table information: table: cre_Theme_park

Answer: SELECT star_rating_code, AVG(price_range) FROM HOTELS GROUP BY star_rating_code


Question:
Show the average price of hotels for different pet policy.
Additional table information: table: cre_Theme_park

Answer: SELECT pets_allowed_yn, AVG(price_range) FROM HOTELS GROUP BY pets_allowed_yn


Question:
What are the average prices of hotels grouped by their pet policy.
Additional table information: table: cre_Theme_park

Answer: SELECT pets_allowed_yn, AVG(price_range) FROM HOTELS GROUP BY pets_allowed_yn