cnatale/presto-athena-txt-2-sql huggingface dataset:
Return the number of routes with destination airport in Italy operated by the airline with name 'American Airlines'.
Additional table information: table: flight_4
SQL: SELECT COUNT(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid JOIN airlines AS T3 ON T1.alid = T3.alid WHERE T2.country = 'Italy' AND T3.name = 'American Airlines'
What is the number of routes operated by the airline American Airlines whose destinations are in Italy?
Additional table information: table: flight_4
SQL: SELECT COUNT(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid JOIN airlines AS T3 ON T1.alid = T3.alid WHERE T2.country = 'Italy' AND T3.name = 'American Airlines'
Find the number of routes that have destination John F Kennedy International Airport.
Additional table information: table: flight_4
SQL: SELECT COUNT(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.name = 'John F Kennedy International Airport'
What is the number of routes that end at John F Kennedy International Airport?
Additional table information: table: flight_4
SQL: SELECT COUNT(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.name = 'John F Kennedy International Airport'
Find the number of routes from the United States to Canada.
Additional table information: table: flight_4
SQL: SELECT COUNT(*) FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country = 'Canada') AND src_apid IN (SELECT apid FROM airports WHERE country = 'United States')
How many routes go from the United States to Canada?
Additional table information: table: flight_4
SQL: SELECT COUNT(*) FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country = 'Canada') AND src_apid IN (SELECT apid FROM airports WHERE country = 'United States')
Find the id of routes whose source and destination airports are in the United States.
Additional table information: table: flight_4
SQL: SELECT rid FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country = 'United States') AND src_apid IN (SELECT apid FROM airports WHERE country = 'United States')
What is the id of the routes whose source and destination airports are in the United States?
Additional table information: table: flight_4
SQL: SELECT rid FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country = 'United States') AND src_apid IN (SELECT apid FROM airports WHERE country = 'United States')
Find the name of airline which runs the most number of routes.
Additional table information: table: flight_4
SQL: SELECT T1.name FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.name ORDER BY COUNT(*) DESC LIMIT 1
What is the name of the airline with the most routes?
Additional table information: table: flight_4
SQL: SELECT T1.name FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.name ORDER BY COUNT(*) DESC LIMIT 1
Find the busiest source airport that runs most number of routes in China.
Additional table information: table: flight_4
SQL: SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid WHERE T1.country = 'China' GROUP BY T1.name ORDER BY COUNT(*) DESC LIMIT 1
What is the name of the airport with the most number of routes that start in China?
Additional table information: table: flight_4
SQL: SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid WHERE T1.country = 'China' GROUP BY T1.name ORDER BY COUNT(*) DESC LIMIT 1
Find the busiest destination airport that runs most number of routes in China.
Additional table information: table: flight_4
SQL: SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.country = 'China' GROUP BY T1.name ORDER BY COUNT(*) DESC LIMIT 1
What is the name of the airport that is the destination of the most number of routes that start in China?
Additional table information: table: flight_4
SQL: SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.country = 'China' GROUP BY T1.name ORDER BY COUNT(*) DESC LIMIT 1
What is the id of the most recent order?
Additional table information: table: tracking_orders
SQL: SELECT order_id FROM orders ORDER BY date_order_placed DESC LIMIT 1
Find the id of the order made most recently.
Additional table information: table: tracking_orders
SQL: SELECT order_id FROM orders ORDER BY date_order_placed DESC LIMIT 1
what are the order id and customer id of the oldest order?
Additional table information: table: tracking_orders
SQL: SELECT order_id, customer_id FROM orders ORDER BY date_order_placed NULLS FIRST LIMIT 1
Find the order id and customer id associated with the oldest order.
Additional table information: table: tracking_orders
SQL: SELECT order_id, customer_id FROM orders ORDER BY date_order_placed NULLS FIRST LIMIT 1
Find the id of the order whose shipment tracking number is '3452'.
Additional table information: table: tracking_orders
SQL: SELECT order_id FROM shipments WHERE shipment_tracking_number = '3452'
Which order's shipment tracking number is '3452'? Give me the id of the order.
Additional table information: table: tracking_orders
SQL: SELECT order_id FROM shipments WHERE shipment_tracking_number = '3452'
Find the ids of all the order items whose product id is 11.
Additional table information: table: tracking_orders
SQL: SELECT order_item_id FROM order_items WHERE product_id = 11
Find all the order items whose product id is 11. What are the order item ids?
Additional table information: table: tracking_orders
SQL: SELECT order_item_id FROM order_items WHERE product_id = 11
List the name of all the distinct customers who have orders with status 'Packing'.
Additional table information: table: tracking_orders
SQL: SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = 'Packing'
Which customers have orders with status 'Packing'? Give me the customer names.
Additional table information: table: tracking_orders
SQL: SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = 'Packing'
Find the details of all the distinct customers who have orders with status 'On Road'.
Additional table information: table: tracking_orders
SQL: SELECT DISTINCT T1.customer_details FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = 'On Road'
What are the distinct customers who have orders with status 'On Road'? Give me the customer details?
Additional table information: table: tracking_orders
SQL: SELECT DISTINCT T1.customer_details FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = 'On Road'
What is the name of the customer who has the most orders?
Additional table information: table: tracking_orders
SQL: SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1
Which customer made the most orders? Find the customer name.
Additional table information: table: tracking_orders
SQL: SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1
What is the customer id of the customer who has the most orders?
Additional table information: table: tracking_orders
SQL: SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1
Find the id of the customer who made the most orders.
Additional table information: table: tracking_orders
SQL: SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1
Give me a list of id and status of orders which belong to the customer named 'Jeramie'.
Additional table information: table: tracking_orders
SQL: SELECT T2.order_id, T2.order_status FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = 'Jeramie'
Which orders are made by the customer named 'Jeramie'? Give me the order ids and status.
Additional table information: table: tracking_orders
SQL: SELECT T2.order_id, T2.order_status FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = 'Jeramie'
Find the dates of orders which belong to the customer named 'Jeramie'.
Additional table information: table: tracking_orders
SQL: SELECT T2.date_order_placed FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = 'Jeramie'
What are the dates of the orders made by the customer named 'Jeramie'?
Additional table information: table: tracking_orders
SQL: SELECT T2.date_order_placed FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = 'Jeramie'
Give me the names of customers who have placed orders between 2009-01-01 and 2010-01-01.
Additional table information: table: tracking_orders
SQL: SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.date_order_placed >= '2009-01-01' AND T2.date_order_placed <= '2010-01-01'
Which customers made orders between 2009-01-01 and 2010-01-01? Find their names.
Additional table information: table: tracking_orders
SQL: SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.date_order_placed >= '2009-01-01' AND T2.date_order_placed <= '2010-01-01'
Give me a list of distinct product ids from orders placed between 1975-01-01 and 1976-01-01?
Additional table information: table: tracking_orders
SQL: SELECT DISTINCT T2.product_id FROM orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id WHERE T1.date_order_placed >= '1975-01-01' AND T1.date_order_placed <= '1976-01-01'
What are the distinct ids of products ordered between 1975-01-01 and 1976-01-01??
Additional table information: table: tracking_orders
SQL: SELECT DISTINCT T2.product_id FROM orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id WHERE T1.date_order_placed >= '1975-01-01' AND T1.date_order_placed <= '1976-01-01'
Find the names of the customers who have order status both 'On Road' and 'Shipped'.
Additional table information: table: tracking_orders
SQL: SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = 'On Road' INTERSECT SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = 'Shipped'
Which customers have both 'On Road' and 'Shipped' as order status? List the customer names.
Additional table information: table: tracking_orders
SQL: SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = 'On Road' INTERSECT SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = 'Shipped'
Find the id of the customers who have order status both 'On Road' and 'Shipped'.
Additional table information: table: tracking_orders
SQL: SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = 'On Road' INTERSECT SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = 'Shipped'
Which customers have both 'On Road' and 'Shipped' as order status? List the customer ids.
Additional table information: table: tracking_orders
SQL: SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = 'On Road' INTERSECT SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = 'Shipped'
When was the order placed whose shipment tracking number is 3452? Give me the date.
Additional table information: table: tracking_orders
SQL: SELECT T1.date_order_placed FROM orders AS T1 JOIN shipments AS T2 ON T1.order_id = T2.order_id WHERE T2.shipment_tracking_number = 3452
On which day was the order placed whose shipment tracking number is 3452?
Additional table information: table: tracking_orders
SQL: SELECT T1.date_order_placed FROM orders AS T1 JOIN shipments AS T2 ON T1.order_id = T2.order_id WHERE T2.shipment_tracking_number = 3452
What is the placement date of the order whose invoice number is 10?
Additional table information: table: tracking_orders
SQL: SELECT T1.date_order_placed FROM orders AS T1 JOIN shipments AS T2 ON T1.order_id = T2.order_id WHERE T2.invoice_number = 10
On what day was the order with invoice number 10 placed?
Additional table information: table: tracking_orders
SQL: SELECT T1.date_order_placed FROM orders AS T1 JOIN shipments AS T2 ON T1.order_id = T2.order_id WHERE T2.invoice_number = 10
List the count and id of each product in all the orders.
Additional table information: table: tracking_orders
SQL: SELECT COUNT(*), T3.product_id FROM orders AS T1, order_items AS T2 JOIN products AS T3 ON T1.order_id = T2.order_id AND T2.product_id = T3.product_id GROUP BY T3.product_id
For each product, return its id and the number of times it was ordered.
Additional table information: table: tracking_orders
SQL: SELECT COUNT(*), T3.product_id FROM orders AS T1, order_items AS T2 JOIN products AS T3 ON T1.order_id = T2.order_id AND T2.product_id = T3.product_id GROUP BY T3.product_id
List the name and count of each product in all orders.
Additional table information: table: tracking_orders
SQL: SELECT T3.product_name, COUNT(*) FROM orders AS T1, order_items AS T2 JOIN products AS T3 ON T1.order_id = T2.order_id AND T2.product_id = T3.product_id GROUP BY T3.product_id
For each product, show its name and the number of times it was ordered.
Additional table information: table: tracking_orders
SQL: SELECT T3.product_name, COUNT(*) FROM orders AS T1, order_items AS T2 JOIN products AS T3 ON T1.order_id = T2.order_id AND T2.product_id = T3.product_id GROUP BY T3.product_id
Find the ids of orders which are shipped after 2000-01-01.
Additional table information: table: tracking_orders
SQL: SELECT order_id FROM shipments WHERE shipment_date > '2000-01-01'
Which orders have shipment after 2000-01-01? Give me the order ids.
Additional table information: table: tracking_orders
SQL: SELECT order_id FROM shipments WHERE shipment_date > '2000-01-01'
Find the id of the order which is shipped most recently.
Additional table information: table: tracking_orders
SQL: SELECT order_id FROM shipments WHERE shipment_date = (SELECT MAX(shipment_date) FROM shipments)
Which order has the most recent shipment? Give me the order id.
Additional table information: table: tracking_orders
SQL: SELECT order_id FROM shipments WHERE shipment_date = (SELECT MAX(shipment_date) FROM shipments)
List the names of all distinct products in alphabetical order.
Additional table information: table: tracking_orders
SQL: SELECT DISTINCT product_name FROM products ORDER BY product_name NULLS FIRST
Sort all the distinct products in alphabetical order.
Additional table information: table: tracking_orders
SQL: SELECT DISTINCT product_name FROM products ORDER BY product_name NULLS FIRST
List the ids of all distinct orders ordered by placed date.
Additional table information: table: tracking_orders
SQL: SELECT DISTINCT order_id FROM orders ORDER BY date_order_placed NULLS FIRST
What are ids of the all distinct orders, sorted by placement date?
Additional table information: table: tracking_orders
SQL: SELECT DISTINCT order_id FROM orders ORDER BY date_order_placed NULLS FIRST
What is the id of the order which has the most items?
Additional table information: table: tracking_orders
SQL: SELECT T1.order_id FROM orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id GROUP BY T1.order_id ORDER BY COUNT(*) DESC LIMIT 1
Which order deals with the most items? Return the order id.
Additional table information: table: tracking_orders
SQL: SELECT T1.order_id FROM orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id GROUP BY T1.order_id ORDER BY COUNT(*) DESC LIMIT 1
What is the name of the customer who has the largest number of orders?
Additional table information: table: tracking_orders
SQL: SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1
Find the name of the customer who made the most orders.
Additional table information: table: tracking_orders
SQL: SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1
Find the invoice numbers which are created before 1989-09-03 or after 2007-12-25.
Additional table information: table: tracking_orders
SQL: SELECT invoice_number FROM invoices WHERE invoice_date < '1989-09-03' OR invoice_date > '2007-12-25'
What are the invoice numbers created before 1989-09-03 or after 2007-12-25?
Additional table information: table: tracking_orders
SQL: SELECT invoice_number FROM invoices WHERE invoice_date < '1989-09-03' OR invoice_date > '2007-12-25'
Find the distinct details of invoices which are created before 1989-09-03 or after 2007-12-25.
Additional table information: table: tracking_orders
SQL: SELECT DISTINCT invoice_details FROM invoices WHERE invoice_date < '1989-09-03' OR invoice_date > '2007-12-25'
What are the distinct details of invoices created before 1989-09-03 or after 2007-12-25?
Additional table information: table: tracking_orders
SQL: SELECT DISTINCT invoice_details FROM invoices WHERE invoice_date < '1989-09-03' OR invoice_date > '2007-12-25'
For each customer who has at least two orders, find the customer name and number of orders made.
Additional table information: table: tracking_orders
SQL: SELECT T2.customer_name, COUNT(*) FROM orders AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id HAVING COUNT(*) >= 2
Which customers have made at least two orders? Give me each customer name and number of orders made.
Additional table information: table: tracking_orders
SQL: SELECT T2.customer_name, COUNT(*) FROM orders AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id HAVING COUNT(*) >= 2
Find the name of the customers who have at most two orders.
Additional table information: table: tracking_orders
SQL: SELECT T2.customer_name FROM orders AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id HAVING COUNT(*) <= 2
What are the names of the customers who have made two or less orders?
Additional table information: table: tracking_orders
SQL: SELECT T2.customer_name FROM orders AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id HAVING COUNT(*) <= 2
List the names of the customers who have once bought product 'food'.
Additional table information: table: tracking_orders
SQL: SELECT T1.customer_name FROM customers AS T1, orders AS T2, order_items AS T3 JOIN products AS T4 ON T1.customer_id = T2.customer_id AND T2.order_id = T3.order_id AND T3.product_id = T4.product_id WHERE T4.product_name = 'food' GROUP BY T1.customer_id HAVING COUNT(*) >= 1
What are the names of the customers who bought product 'food' at least once?
Additional table information: table: tracking_orders
SQL: SELECT T1.customer_name FROM customers AS T1, orders AS T2, order_items AS T3 JOIN products AS T4 ON T1.customer_id = T2.customer_id AND T2.order_id = T3.order_id AND T3.product_id = T4.product_id WHERE T4.product_name = 'food' GROUP BY T1.customer_id HAVING COUNT(*) >= 1
List the names of customers who have once canceled the purchase of the product 'food' (the item status is 'Cancel').
Additional table information: table: tracking_orders
SQL: SELECT T1.customer_name FROM customers AS T1, orders AS T2, order_items AS T3 JOIN products AS T4 ON T1.customer_id = T2.customer_id AND T2.order_id = T3.order_id AND T3.product_id = T4.product_id WHERE T3.order_item_status = 'Cancel' AND T4.product_name = 'food' GROUP BY T1.customer_id HAVING COUNT(*) >= 1
Which customers have ever canceled the purchase of the product 'food' (the item status is 'Cancel')?
Additional table information: table: tracking_orders
SQL: SELECT T1.customer_name FROM customers AS T1, orders AS T2, order_items AS T3 JOIN products AS T4 ON T1.customer_id = T2.customer_id AND T2.order_id = T3.order_id AND T3.product_id = T4.product_id WHERE T3.order_item_status = 'Cancel' AND T4.product_name = 'food' GROUP BY T1.customer_id HAVING COUNT(*) >= 1
How many architects are female?
Additional table information: table: architecture
SQL: SELECT COUNT(*) FROM architect WHERE gender = 'female'
List the name, nationality and id of all male architects ordered by their names lexicographically.
Additional table information: table: architecture
SQL: SELECT name, nationality, id FROM architect WHERE gender = 'male' ORDER BY name NULLS FIRST
What is the maximum length in meters for the bridges and what are the architects' names?
Additional table information: table: architecture
SQL: SELECT MAX(T1.length_meters), T2.name FROM bridge AS T1 JOIN architect AS T2 ON T1.architect_id = T2.id
What is the average length in feet of the bridges?
Additional table information: table: architecture
SQL: SELECT AVG(length_feet) FROM bridge
What are the names and year of construction for the mills of 'Grondzeiler' type?
Additional table information: table: architecture
SQL: SELECT name, built_year FROM mill WHERE TYPE = 'Grondzeiler'
What are the distinct names and nationalities of the architects who have ever built a mill?
Additional table information: table: architecture
SQL: SELECT DISTINCT T1.name, T1.nationality FROM architect AS T1 JOIN mill AS t2 ON T1.id = T2.architect_id
What are the names of the mills which are not located in 'Donceel'?
Additional table information: table: architecture
SQL: SELECT name FROM mill WHERE LOCATION <> 'Donceel'
What are the distinct types of mills that are built by American or Canadian architects?
Additional table information: table: architecture
SQL: SELECT DISTINCT T1.type FROM mill AS T1 JOIN architect AS t2 ON T1.architect_id = T2.id WHERE T2.nationality = 'American' OR T2.nationality = 'Canadian'
What are the ids and names of the architects who built at least 3 bridges ?
Additional table information: table: architecture
SQL: SELECT T1.id, T1.name FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id GROUP BY T1.id HAVING COUNT(*) >= 3
What is the id, name and nationality of the architect who built most mills?
Additional table information: table: architecture
SQL: SELECT T1.id, T1.name, T1.nationality FROM architect AS T1 JOIN mill AS T2 ON T1.id = T2.architect_id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1
What are the ids, names and genders of the architects who built two bridges or one mill?
Additional table information: table: architecture
SQL: SELECT T1.id, T1.name, T1.gender FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id GROUP BY T1.id HAVING COUNT(*) = 2 UNION SELECT T1.id, T1.name, T1.gender FROM architect AS T1 JOIN mill AS T2 ON T1.id = T2.architect_id GROUP BY T1.id HAVING COUNT(*) = 1
What is the location of the bridge named 'Kolob Arch' or 'Rainbow Bridge'?
Additional table information: table: architecture
SQL: SELECT LOCATION FROM bridge WHERE name = 'Kolob Arch' OR name = 'Rainbow Bridge'
Which of the mill names contains the french word 'Moulin'?
Additional table information: table: architecture
SQL: SELECT name FROM mill WHERE name LIKE '%Moulin%'
What are the distinct name of the mills built by the architects who have also built a bridge longer than 80 meters?
Additional table information: table: architecture
SQL: SELECT DISTINCT T1.name FROM mill AS T1 JOIN architect AS t2 ON T1.architect_id = T2.id JOIN bridge AS T3 ON T3.architect_id = T2.id WHERE T3.length_meters > 80
What is the most common mill type, and how many are there?
Additional table information: table: architecture
SQL: SELECT TYPE, COUNT(*) FROM mill GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1
How many architects haven't built a mill before year 1850?
Additional table information: table: architecture
SQL: SELECT COUNT(*) FROM architect WHERE NOT id IN (SELECT architect_id FROM mill WHERE built_year < 1850)
show the name of all bridges that was designed by american archtect, and sort the result by the bridge feet length.
Additional table information: table: architecture
SQL: SELECT t1.name FROM bridge AS t1 JOIN architect AS t2 ON t1.architect_id = t2.id WHERE t2.nationality = 'American' ORDER BY t1.length_feet NULLS FIRST
How many book clubs are there?
Additional table information: table: culture_company
SQL: SELECT COUNT(*) FROM book_club
Count the number of book clubs.
Additional table information: table: culture_company
SQL: SELECT COUNT(*) FROM book_club
show the titles, and authors or editors for all books made after the year 1989.
Additional table information: table: culture_company
SQL: SELECT book_title, author_or_editor FROM book_club WHERE YEAR > 1989
What are the titles and authors or editors that correspond to books made after 1989?
Additional table information: table: culture_company
SQL: SELECT book_title, author_or_editor FROM book_club WHERE YEAR > 1989
Show all distinct publishers for books.
Additional table information: table: culture_company
SQL: SELECT DISTINCT publisher FROM book_club
What are all the different book publishers?
Additional table information: table: culture_company
SQL: SELECT DISTINCT publisher FROM book_club
Show the years, book titles, and publishers for all books, in descending order by year.
Additional table information: table: culture_company
SQL: SELECT YEAR, book_title, publisher FROM book_club ORDER BY YEAR DESC
What are the years, titles, and publishers for all books, ordered by year descending?
Additional table information: table: culture_company
SQL: SELECT YEAR, book_title, publisher FROM book_club ORDER BY YEAR DESC
Show all publishers and the number of books for each publisher.
Additional table information: table: culture_company
SQL: SELECT publisher, COUNT(*) FROM book_club GROUP BY publisher
How many books are there for each publisher?
Additional table information: table: culture_company
SQL: SELECT publisher, COUNT(*) FROM book_club GROUP BY publisher
What is the publisher with most number of books?
Additional table information: table: culture_company
SQL: SELECT publisher FROM book_club GROUP BY publisher ORDER BY COUNT(*) DESC LIMIT 1
Return the publisher that has published the most books.
Additional table information: table: culture_company
SQL: SELECT publisher FROM book_club GROUP BY publisher ORDER BY COUNT(*) DESC LIMIT 1
Show all book categories and the number of books in each category.
Additional table information: table: culture_company
SQL: SELECT category, COUNT(*) FROM book_club GROUP BY category
How many books fall into each category?
Additional table information: table: culture_company
SQL: SELECT category, COUNT(*) FROM book_club GROUP BY category
List categories that have at least two books after year 1989.
Additional table information: table: culture_company
SQL: SELECT category FROM book_club WHERE YEAR > 1989 GROUP BY category HAVING COUNT(*) >= 2
What categories have two or more corresponding books that were made after 1989?
Additional table information: table: culture_company
SQL: SELECT category FROM book_club WHERE YEAR > 1989 GROUP BY category HAVING COUNT(*) >= 2
Show publishers with a book published in 1989 and a book in 1990.
Additional table information: table: culture_company
SQL: SELECT publisher FROM book_club WHERE YEAR = 1989 INTERSECT SELECT publisher FROM book_club WHERE YEAR = 1990
What are the publishers who have published a book in both 1989 and 1990?
Additional table information: table: culture_company
SQL: SELECT publisher FROM book_club WHERE YEAR = 1989 INTERSECT SELECT publisher FROM book_club WHERE YEAR = 1990
Show all publishers which do not have a book in 1989.
Additional table information: table: culture_company
SQL: SELECT publisher FROM book_club EXCEPT SELECT publisher FROM book_club WHERE YEAR = 1989
Which publishers did not publish a book in 1989?
Additional table information: table: culture_company
SQL: SELECT publisher FROM book_club EXCEPT SELECT publisher FROM book_club WHERE YEAR = 1989
Show all movie titles, years, and directors, ordered by budget.
Additional table information: table: culture_company
SQL: SELECT title, YEAR, director FROM movie ORDER BY budget_million NULLS FIRST
What are the titles, years, and directors of all movies, ordered by budget in millions?
Additional table information: table: culture_company
SQL: SELECT title, YEAR, director FROM movie ORDER BY budget_million NULLS FIRST
How many movie directors are there?
Additional table information: table: culture_company
SQL: SELECT COUNT(DISTINCT director) FROM movie
Count the number of different directors.
Additional table information: table: culture_company
SQL: SELECT COUNT(DISTINCT director) FROM movie
What is the title and director for the movie with highest worldwide gross in the year 2000 or before?
Additional table information: table: culture_company
SQL: SELECT title, director FROM movie WHERE YEAR <= 2000 ORDER BY gross_worldwide DESC LIMIT 1
Return the title and director of the movie released in the year 2000 or earlier that had the highest worldwide gross.
Additional table information: table: culture_company
SQL: SELECT title, director FROM movie WHERE YEAR <= 2000 ORDER BY gross_worldwide DESC LIMIT 1
Show all director names who have a movie in both year 1999 and 2000.
Additional table information: table: culture_company
SQL: SELECT director FROM movie WHERE YEAR = 2000 INTERSECT SELECT director FROM movie WHERE YEAR = 1999
Which directors had a movie both in the year 1999 and 2000?
Additional table information: table: culture_company
SQL: SELECT director FROM movie WHERE YEAR = 2000 INTERSECT SELECT director FROM movie WHERE YEAR = 1999
Show all director names who have a movie in the year 1999 or 2000.
Additional table information: table: culture_company
SQL: SELECT director FROM movie WHERE YEAR = 1999 OR YEAR = 2000
Which directors had a movie in either 1999 or 2000?
Additional table information: table: culture_company
SQL: SELECT director FROM movie WHERE YEAR = 1999 OR YEAR = 2000
What is the average, maximum, and minimum budget for all movies before 2000.
Additional table information: table: culture_company
SQL: SELECT AVG(budget_million), MAX(budget_million), MIN(budget_million) FROM movie WHERE YEAR < 2000
Return the average, maximum, and minimum budgets in millions for movies made before the year 2000.
Additional table information: table: culture_company
SQL: SELECT AVG(budget_million), MAX(budget_million), MIN(budget_million) FROM movie WHERE YEAR < 2000
List all company names with a book published by Alyson.
Additional table information: table: culture_company
SQL: SELECT T1.company_name FROM culture_company AS T1 JOIN book_club AS T2 ON T1.book_club_id = T2.book_club_id WHERE T2.publisher = 'Alyson'
What are all the company names that have a book published by Alyson?
Additional table information: table: culture_company
SQL: SELECT T1.company_name FROM culture_company AS T1 JOIN book_club AS T2 ON T1.book_club_id = T2.book_club_id WHERE T2.publisher = 'Alyson'
Show the movie titles and book titles for all companies in China.
Additional table information: table: culture_company
SQL: SELECT T1.title, T3.book_title FROM movie AS T1 JOIN culture_company AS T2 ON T1.movie_id = T2.movie_id JOIN book_club AS T3 ON T3.book_club_id = T2.book_club_id WHERE T2.incorporated_in = 'China'
What are the titles of movies and books corresponding to companies incorporated in China?
Additional table information: table: culture_company
SQL: SELECT T1.title, T3.book_title FROM movie AS T1 JOIN culture_company AS T2 ON T1.movie_id = T2.movie_id JOIN book_club AS T3 ON T3.book_club_id = T2.book_club_id WHERE T2.incorporated_in = 'China'
Show all company names with a movie directed in year 1999.
Additional table information: table: culture_company
SQL: SELECT T2.company_name FROM movie AS T1 JOIN culture_company AS T2 ON T1.movie_id = T2.movie_id WHERE T1.year = 1999
What are all company names that have a corresponding movie directed in the year 1999?
Additional table information: table: culture_company
SQL: SELECT T2.company_name FROM movie AS T1 JOIN culture_company AS T2 ON T1.movie_id = T2.movie_id WHERE T1.year = 1999
Tell me what the notes are for South Australia. 
Additional table information: table: regional_marketing
columns: state_territory, text_bg_color, format, current_slogan, current_series, Notes
SQL: SELECT Notes FROM "regional_marketing" WHERE current_slogan = 'SOUTH AUSTRALIA'
What is the current series where the new series began in June 2011? 
Additional table information: table: regional_marketing
columns: state_territory, text_bg_color, format, current_slogan, current_series, Notes
SQL: SELECT current_series FROM "regional_marketing" WHERE Notes = 'New series began in June 2011'
What is the format for South Australia?
Additional table information: table: regional_marketing
columns: state_territory, text_bg_color, format, current_slogan, current_series, Notes
SQL: SELECT format FROM "regional_marketing" WHERE state_territory = 'South Australia'
Name the background colour for the Australian Capital Territory. 
Additional table information: table: regional_marketing
columns: state_territory, text_bg_color, format, current_slogan, current_series, Notes
SQL: SELECT text_bg_color FROM "regional_marketing" WHERE State/territory = 'Australian Capital Territory'
how many times is the fuel propulsion is cng? 
Additional table information: table: "vehicles"."cars"
columns: order_year, manufacturer, model, fleet_series_quantity, powertrain, fuel_propulsion
SQL: SELECT COUNT fleet_series_quantity FROM "vehicles"."cars" WHERE fuel_propulsion = 'CNG'
what is the fuel propulsion where the fleet series (quantity) is 310-329 (20)? 
Additional table information: table: "vehicles"."cars"
columns: order_year, manufacturer, model, fleet_series_quantity, powertrain, fuel_propulsion
SQL: SELECT fuel_propulsion FROM "vehicles"."cars" WHERE fleet_series_quantity = '310-329 (20)'
who is the manufacturer for the order year 1998? 
Additional table information: table: "vehicles"."cars"
columns: order_year, manufacturer, model, fleet_series_quantity, powertrain, fuel_propulsion
SQL: SELECT manufacturer FROM "vehicles"."cars" WHERE order_year = '1998'
how many times is the model ge40lfr? 
Additional table information: table: "vehicles"."cars"
columns: order_year, manufacturer, model, fleet_series_quantity, powertrain, fuel_propulsion
SQL: SELECT COUNT manufacturer FROM "vehicles"."cars" WHERE model = 'GE40LFR'
how many times is the fleet series (quantity) is 468-473 (6)? 
Additional table information: table: "vehicles"."cars"
columns: order_year, manufacturer, model, fleet_series_quantity, powertrain, fuel_propulsion
SQL: SELECT COUNT order_year FROM "vehicles"."cars" WHERE fleet_series_quantity = '468-473 (6)'
what is the powertrain (engine/transmission) when the order year is 2000? 
Additional table information: table: "vehicles"."cars"
columns: order_year, manufacturer, model, fleet_series_quantity, powertrain, fuel_propulsion
SQL: SELECT powertrain FROM "vehicles"."cars" WHERE order_year = '2000'