minktn/spider-data huggingface dataset:
Database: soccer_3
Question: How many clubs are there?
SQL: SELECT count(*) FROM club
Database: soccer_3
Question: Count the number of clubs.
SQL: SELECT count(*) FROM club
Database: soccer_3
Question: List the name of clubs in ascending alphabetical order.
SQL: SELECT Name FROM club ORDER BY Name ASC
Database: soccer_3
Question: What are the names of clubs, ordered alphabetically?
SQL: SELECT Name FROM club ORDER BY Name ASC
Database: soccer_3
Question: What are the managers and captains of clubs?
SQL: SELECT Manager ,  Captain FROM club
Database: soccer_3
Question: Return the managers and captains of all clubs.
SQL: SELECT Manager ,  Captain FROM club
Database: soccer_3
Question: List the name of clubs whose manufacturer is not "Nike"
SQL: SELECT Name FROM club WHERE Manufacturer != "Nike"
Database: soccer_3
Question: What are the names of clubs who do not have the manufacturer Nike?
SQL: SELECT Name FROM club WHERE Manufacturer != "Nike"
Database: soccer_3
Question: What are the names of players in ascending order of wins count?
SQL: SELECT Name FROM player ORDER BY Wins_count ASC
Database: soccer_3
Question: Return the names of players in order of count of wins, ascending.
SQL: SELECT Name FROM player ORDER BY Wins_count ASC
Database: soccer_3
Question: What is the name of the player with the highest earnings?
SQL: SELECT Name FROM player ORDER BY Earnings DESC LIMIT 1
Database: soccer_3
Question: Return the name of the player who earns the most money.
SQL: SELECT Name FROM player ORDER BY Earnings DESC LIMIT 1
Database: soccer_3
Question: What are the distinct countries of players with earnings higher than 1200000?
SQL: SELECT DISTINCT Country FROM player WHERE Earnings  >  1200000
Database: soccer_3
Question: From which countries are players who make more than 1200000 from?
SQL: SELECT DISTINCT Country FROM player WHERE Earnings  >  1200000
Database: soccer_3
Question: What is the country of the player with the highest earnings among players that have more than 2 win counts?
SQL: SELECT Country FROM player WHERE Wins_count  >  2 ORDER BY Earnings DESC LIMIT 1
Database: soccer_3
Question: Of players who have more than 2 wins, what is the country of the player who makes the most?
SQL: SELECT Country FROM player WHERE Wins_count  >  2 ORDER BY Earnings DESC LIMIT 1
Database: soccer_3
Question: Show names of players and names of clubs they are in.
SQL: SELECT T2.Name ,  T1.Name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID  =  T2.Club_ID
Database: soccer_3
Question: What are the names of players and the corresponding clubs that they are in?
SQL: SELECT T2.Name ,  T1.Name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID  =  T2.Club_ID
Database: soccer_3
Question: Show names of clubs that have players with more than 2 win counts.
SQL: SELECT T1.Name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID  =  T2.Club_ID WHERE T2.Wins_count  >  2
Database: soccer_3
Question: What are the names of clubs that have players who have won more than twice?
SQL: SELECT T1.Name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID  =  T2.Club_ID WHERE T2.Wins_count  >  2
Database: soccer_3
Question: Show names of players from the club with manager "Sam Allardyce".
SQL: SELECT T2.Name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID  =  T2.Club_ID WHERE T1.Manager  =  "Sam Allardyce"
Database: soccer_3
Question: What are the names of players from the club managed by Sam Allardyce?
SQL: SELECT T2.Name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID  =  T2.Club_ID WHERE T1.Manager  =  "Sam Allardyce"
Database: soccer_3
Question: Show names of clubs in descending order of average earnings of players belonging.
SQL: SELECT T1.Name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID  =  T2.Club_ID GROUP BY T1.Club_ID ORDER BY avg(T2.Earnings) DESC
Database: soccer_3
Question: What are the names of clubs, ordered descending by the average earnings of players within each?
SQL: SELECT T1.Name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID  =  T2.Club_ID GROUP BY T1.Club_ID ORDER BY avg(T2.Earnings) DESC
Database: soccer_3
Question: Show different manufacturers and the number of clubs they are associated with.
SQL: SELECT Manufacturer ,  COUNT(*) FROM club GROUP BY Manufacturer
Database: soccer_3
Question: How many clubs use each manufacturer?
SQL: SELECT Manufacturer ,  COUNT(*) FROM club GROUP BY Manufacturer
Database: soccer_3
Question: Please show the most common manufacturer of clubs.
SQL: SELECT Manufacturer FROM club GROUP BY Manufacturer ORDER BY COUNT(*) DESC LIMIT 1
Database: soccer_3
Question: Which manufacturer is most common among clubs?
SQL: SELECT Manufacturer FROM club GROUP BY Manufacturer ORDER BY COUNT(*) DESC LIMIT 1
Database: soccer_3
Question: List the manufacturers that are associated with more than one club.
SQL: SELECT Manufacturer FROM club GROUP BY Manufacturer HAVING COUNT(*)  >  1
Database: soccer_3
Question: Which manufacturers work for more than 1 club?
SQL: SELECT Manufacturer FROM club GROUP BY Manufacturer HAVING COUNT(*)  >  1
Database: soccer_3
Question: List the country that have more than one player.
SQL: SELECT Country FROM player GROUP BY Country HAVING COUNT(*)  >  1
Database: soccer_3
Question: Which countries have produced more than one player?
SQL: SELECT Country FROM player GROUP BY Country HAVING COUNT(*)  >  1
Database: soccer_3
Question: List the name of clubs that do not have players.
SQL: SELECT Name FROM club WHERE Club_ID NOT IN (SELECT Club_ID FROM player)
Database: soccer_3
Question: What are the names of clubs that do not have any players?
SQL: SELECT Name FROM club WHERE Club_ID NOT IN (SELECT Club_ID FROM player)
Database: soccer_3
Question: Show the country of players with earnings more than 1400000 and players with earnings less than 1100000.
SQL: SELECT Country FROM player WHERE Earnings  >  1400000 INTERSECT SELECT Country FROM player WHERE Earnings  <  1100000
Database: soccer_3
Question: Which country has produced both players with earnings over 1400000 and players with earnings below 1100000?
SQL: SELECT Country FROM player WHERE Earnings  >  1400000 INTERSECT SELECT Country FROM player WHERE Earnings  <  1100000
Database: soccer_3
Question: What is the number of distinct countries of all players?
SQL: SELECT COUNT (DISTINCT Country) FROM player
Database: soccer_3
Question: How many different countries are players from?
SQL: SELECT COUNT (DISTINCT Country) FROM player
Database: soccer_3
Question: Show the earnings of players from country "Australia" or "Zimbabwe".
SQL: SELECT Earnings FROM player WHERE Country  =  "Australia" OR Country  =  "Zimbabwe"
Database: soccer_3
Question: What are the earnings of players from either of the countries of Australia or Zimbabwe?
SQL: SELECT Earnings FROM player WHERE Country  =  "Australia" OR Country  =  "Zimbabwe"
Database: e_commerce
Question: List the id, first name and last name of the customers who both have placed more than 2 orders and have bought at least 3 items.
SQL: SELECT T1.customer_id ,  T1.customer_first_name ,  T1.customer_last_name FROM Customers AS T1 JOIN Orders AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id HAVING count(*)  >  2 INTERSECT SELECT T1.customer_id ,  T1.customer_first_name ,  T1.customer_last_name FROM Customers AS T1 JOIN Orders AS T2 ON T1.customer_id  =  T2.customer_id JOIN Order_items AS T3 ON T2.order_id  =  T3.order_id GROUP BY T1.customer_id HAVING count(*)  >= 3
Database: e_commerce
Question: What are the ids, first and last names of the customers who have ordered more than twice and have bought at least 3 items?
SQL: SELECT T1.customer_id ,  T1.customer_first_name ,  T1.customer_last_name FROM Customers AS T1 JOIN Orders AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id HAVING count(*)  >  2 INTERSECT SELECT T1.customer_id ,  T1.customer_first_name ,  T1.customer_last_name FROM Customers AS T1 JOIN Orders AS T2 ON T1.customer_id  =  T2.customer_id JOIN Order_items AS T3 ON T2.order_id  =  T3.order_id GROUP BY T1.customer_id HAVING count(*)  >= 3
Database: e_commerce
Question: For the orders with any produts, how many products does each orders contain ? List the order id, status and the number.
SQL: SELECT T1.order_id ,  T1.order_status_code ,  count(*) FROM Orders AS T1 JOIN Order_items AS T2 ON T1.order_id  =  T2.order_id GROUP BY T1.order_id
Database: e_commerce
Question: For every order, how many products does it contain, and what are the orders' statuses and ids?
SQL: SELECT T1.order_id ,  T1.order_status_code ,  count(*) FROM Orders AS T1 JOIN Order_items AS T2 ON T1.order_id  =  T2.order_id GROUP BY T1.order_id
Database: e_commerce
Question: List the dates of the orders which were placed at the earliest time or have more than 1 items.
SQL: SELECT min(date_order_placed) FROM Orders UNION SELECT T1.date_order_placed FROM Orders AS T1 JOIN Order_items AS T2 ON T1.order_id  =  T2.order_id GROUP BY T1.order_id HAVING count(*)  >  1
Database: e_commerce
Question: What are the dates of the earliest order and the dates of all orders with more than 1 item?
SQL: SELECT min(date_order_placed) FROM Orders UNION SELECT T1.date_order_placed FROM Orders AS T1 JOIN Order_items AS T2 ON T1.order_id  =  T2.order_id GROUP BY T1.order_id HAVING count(*)  >  1
Database: e_commerce
Question: Which customers did not make any orders? List the first name, middle initial and last name.
SQL: SELECT customer_first_name ,  customer_middle_initial ,  customer_last_name FROM Customers EXCEPT SELECT T1.customer_first_name ,  T1.customer_middle_initial ,  T1.customer_last_name FROM Customers AS T1 JOIN Orders AS T2 ON T1.customer_id  =  T2.customer_id
Database: e_commerce
Question: WHat are the first and last names, and middle initials of all customers who did not make any orders?
SQL: SELECT customer_first_name ,  customer_middle_initial ,  customer_last_name FROM Customers EXCEPT SELECT T1.customer_first_name ,  T1.customer_middle_initial ,  T1.customer_last_name FROM Customers AS T1 JOIN Orders AS T2 ON T1.customer_id  =  T2.customer_id
Database: e_commerce
Question: What are the id, name, price and color of the products which have not been ordered for at least twice?
SQL: SELECT product_id ,  product_name ,  product_price ,  product_color FROM Products EXCEPT SELECT T1.product_id ,  T1.product_name ,  T1.product_price ,  T1.product_color FROM Products AS T1 JOIN Order_items AS T2 ON T1.product_id  =  T2.product_id JOIN Orders AS T3 ON T2.order_id  =  T3.order_id GROUP BY T1.product_id HAVING count(*)  >=  2
Database: e_commerce
Question: What are the ids , names , prices , and colors of all products that have been listed in less than two orders ?
SQL: select t1.product_id ,  t1.product_name ,  t1.product_price ,  t1.product_color from products as t1 join order_items as t2 on t1.product_id  =  t2.product_id join orders as t3 on t2.order_id  =  t3.order_id group by t1.product_id having count(*) < 2
Database: e_commerce
Question: Which orders have at least 2 products on it? List the order id and date.
SQL: SELECT T1.order_id ,  T1.date_order_placed FROM Orders AS T1 JOIN Order_items AS T2 ON T1.order_id  =  T2.order_id GROUP BY T1.order_id HAVING count(*)  >=  2
Database: e_commerce
Question: What are the ids and dates of the orders with at least two products?
SQL: SELECT T1.order_id ,  T1.date_order_placed FROM Orders AS T1 JOIN Order_items AS T2 ON T1.order_id  =  T2.order_id GROUP BY T1.order_id HAVING count(*)  >=  2
Database: e_commerce
Question: Which product are listed in orders most frequently? List the id, product name and price.
SQL: SELECT T1.product_id ,  T1.product_name ,  T1.product_price FROM Products AS T1 JOIN Order_items AS T2 ON T1.product_id  =  T2.product_id GROUP BY T1.product_id ORDER BY count(*) DESC LIMIT 1
Database: e_commerce
Question: What are the ids, names, and prices of all products that are ordered most frequently?
SQL: SELECT T1.product_id ,  T1.product_name ,  T1.product_price FROM Products AS T1 JOIN Order_items AS T2 ON T1.product_id  =  T2.product_id GROUP BY T1.product_id ORDER BY count(*) DESC LIMIT 1
Database: e_commerce
Question: Which order have the least sum of the product prices. List the order id and sum.
SQL: SELECT T1.order_id ,  sum(T2.product_price) FROM Order_items AS T1 JOIN Products AS T2 ON T1.product_id  =  T2.product_id GROUP BY T1.order_id ORDER BY sum(T2.product_price) ASC LIMIT 1
Database: e_commerce
Question: What is the order that total cost the least , and how much is the total cost ?
SQL: select t1.order_id ,  sum(t2.product_price) from order_items as t1 join products as t2 on t1.product_id  =  t2.product_id group by t1.order_id order by sum(t2.product_price) asc limit 1
Database: e_commerce
Question: What is the most popular payment method?
SQL: SELECT Payment_method_code FROM Customer_Payment_Methods GROUP BY Payment_method_code ORDER BY count(*) DESC LIMIT 1
Database: e_commerce
Question: What is the payment method that most customers use?
SQL: SELECT Payment_method_code FROM Customer_Payment_Methods GROUP BY Payment_method_code ORDER BY count(*) DESC LIMIT 1
Database: e_commerce
Question: How many number of products does each gender of customers buy? List the gender and the number
SQL: SELECT T1.gender_code ,  count(*) FROM Customers AS T1 JOIN Orders AS T2 ON T1.customer_id  =  T2.customer_id JOIN Order_items AS T3 ON T2.order_id  =  T3.order_id GROUP BY T1.gender_code
Database: e_commerce
Question: How many products does each gender buy?
SQL: SELECT T1.gender_code ,  count(*) FROM Customers AS T1 JOIN Orders AS T2 ON T1.customer_id  =  T2.customer_id JOIN Order_items AS T3 ON T2.order_id  =  T3.order_id GROUP BY T1.gender_code
Database: e_commerce
Question: How many orders has each gender of customers placed?
SQL: SELECT T1.gender_code ,  count(*) FROM Customers AS T1 JOIN Orders AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.gender_code
Database: e_commerce
Question: How many orders has each gender placed?
SQL: SELECT T1.gender_code ,  count(*) FROM Customers AS T1 JOIN Orders AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.gender_code
Database: e_commerce
Question: List the customers' first name, middle initial, last name and payment methods.
SQL: SELECT T1.customer_first_name ,  T1.customer_middle_initial ,  T1.customer_last_name ,  T2.Payment_method_code FROM Customers AS T1 JOIN Customer_Payment_Methods AS T2 ON T1.customer_id  =  T2.customer_id
Database: e_commerce
Question: What are the first names, middle initials, last names, and payment methods of all customers?
SQL: SELECT T1.customer_first_name ,  T1.customer_middle_initial ,  T1.customer_last_name ,  T2.Payment_method_code FROM Customers AS T1 JOIN Customer_Payment_Methods AS T2 ON T1.customer_id  =  T2.customer_id
Database: e_commerce
Question: List the invoices' status, date and the date of shipment.
SQL: SELECT T1.invoice_status_code ,  T1.invoice_date ,  T2.shipment_date FROM Invoices AS T1 JOIN Shipments AS T2 ON T1.invoice_number  =  T2.invoice_number
Database: e_commerce
Question: What are the statuses, dates, and shipment dates for all invoices?
SQL: SELECT T1.invoice_status_code ,  T1.invoice_date ,  T2.shipment_date FROM Invoices AS T1 JOIN Shipments AS T2 ON T1.invoice_number  =  T2.invoice_number
Database: e_commerce
Question: List the names of the products being shipped and the corresponding shipment date.
SQL: SELECT T1.product_name ,  T4.shipment_date FROM Products AS T1 JOIN Order_items AS T2 ON T1.product_id  =  T2.product_id JOIN Shipment_Items AS T3 ON T2.order_item_id  =  T3.order_item_id JOIN Shipments AS T4 ON T3.shipment_id  =  T4.shipment_id
Database: e_commerce
Question: What are the names of the products tht have been shipped, and on what days were they shipped?
SQL: SELECT T1.product_name ,  T4.shipment_date FROM Products AS T1 JOIN Order_items AS T2 ON T1.product_id  =  T2.product_id JOIN Shipment_Items AS T3 ON T2.order_item_id  =  T3.order_item_id JOIN Shipments AS T4 ON T3.shipment_id  =  T4.shipment_id
Database: e_commerce
Question: What is the status code of the items being ordered and shipped and its corresponding shipment tracking number?
SQL: SELECT T1.order_item_status_code ,  T3.shipment_tracking_number FROM Order_items AS T1 JOIN Shipment_Items AS T2 ON T1.order_item_id  =  T2.order_item_id JOIN Shipments AS T3 ON T2.shipment_id  =  T3.shipment_id
Database: e_commerce
Question: What is the status code of the items have been ordered and shipped, and also what are their shipment tracking numbers?
SQL: SELECT T1.order_item_status_code ,  T3.shipment_tracking_number FROM Order_items AS T1 JOIN Shipment_Items AS T2 ON T1.order_item_id  =  T2.order_item_id JOIN Shipments AS T3 ON T2.shipment_id  =  T3.shipment_id
Database: e_commerce
Question: What is the product name and the color of the ordered items which have been shipped?
SQL: SELECT T1.product_name ,  T1.product_color FROM Products AS T1 JOIN Order_items AS T2 ON T1.product_id  =  T2.product_id JOIN Shipment_Items AS T3 ON T2.order_item_id  =  T3.order_item_id JOIN Shipments AS T4 ON T3.shipment_id  =  T4.shipment_id
Database: e_commerce
Question: What are the names and colors of all products that have been shipped?
SQL: SELECT T1.product_name ,  T1.product_color FROM Products AS T1 JOIN Order_items AS T2 ON T1.product_id  =  T2.product_id JOIN Shipment_Items AS T3 ON T2.order_item_id  =  T3.order_item_id JOIN Shipments AS T4 ON T3.shipment_id  =  T4.shipment_id
Database: e_commerce
Question: List all the distinct product names, price and descriptions which are bought by female customers.
SQL: SELECT DISTINCT T1.product_name ,  T1.product_price ,  T1.product_description FROM Products AS T1 JOIN Order_items AS T2 ON T1.product_id  =  T2.product_id JOIN Orders AS T3 ON T2.order_id  =  T3.order_id JOIN Customers AS T4 ON T3.customer_id  =  T4.customer_id WHERE T4.gender_code  =  'Female'
Database: e_commerce
Question: What are the different names, prices, and descriptions for all products bought by female customers?
SQL: SELECT DISTINCT T1.product_name ,  T1.product_price ,  T1.product_description FROM Products AS T1 JOIN Order_items AS T2 ON T1.product_id  =  T2.product_id JOIN Orders AS T3 ON T2.order_id  =  T3.order_id JOIN Customers AS T4 ON T3.customer_id  =  T4.customer_id WHERE T4.gender_code  =  'Female'
Database: e_commerce
Question: What are invoices status of all the orders which have not been shipped?
SQL: SELECT invoice_status_code FROM Invoices WHERE invoice_number NOT IN ( SELECT invoice_number FROM Shipments )
Database: e_commerce
Question: What are the invoice statuses for all orderes that have not been shipped out yet?
SQL: SELECT invoice_status_code FROM Invoices WHERE invoice_number NOT IN ( SELECT invoice_number FROM Shipments )
Database: e_commerce
Question: What are the total cost of all the orders ? List the order id , date , and total cost .
SQL: select t1.order_id ,  t1.date_order_placed ,  sum(t3.product_price) from orders as t1 join order_items as t2 on t1.order_id  =  t2.order_id join products as t3 on t2.product_id  =  t3.product_id group by t1.order_id
Database: e_commerce
Question: For each order, what is its id, date, and total amount paid?
SQL: SELECT T1.order_id ,  T1.date_order_placed ,  sum(T3.product_price) FROM Orders AS T1 JOIN Order_items AS T2 ON T1.order_id  =  T2.order_id JOIN Products AS T3 ON T2.product_id  =  T3.product_id GROUP BY T1.order_id
Database: e_commerce
Question: How many customers have placed any order?
SQL: SELECT count(DISTINCT customer_id) FROM Orders
Database: e_commerce
Question: How many different customers have ordered things?
SQL: SELECT count(DISTINCT customer_id) FROM Orders
Database: e_commerce
Question: How many item states are there in the orders?
SQL: SELECT count(DISTINCT order_item_status_code) FROM Order_items
Database: e_commerce
Question: How many different item status codes are there listed in ordered items?
SQL: SELECT count(DISTINCT order_item_status_code) FROM Order_items
Database: e_commerce
Question: How many different payment methods are there?
SQL: SELECT count(DISTINCT Payment_method_code) FROM Customer_Payment_Methods
Database: e_commerce
Question: How many different payment methods can customers choose from?
SQL: SELECT count(DISTINCT Payment_method_code) FROM Customer_Payment_Methods
Database: e_commerce
Question: What are the login names and passwords of the customers whose phone number have the prefix '+12'?
SQL: SELECT login_name ,  login_password FROM Customers WHERE phone_number LIKE '+12%'
Database: e_commerce
Question: What are the usernames and passwords of all customers whose phone number starts with '+12'?
SQL: SELECT login_name ,  login_password FROM Customers WHERE phone_number LIKE '+12%'
Database: e_commerce
Question: What are the product sizes of the products whose name has the substring 'Dell'?
SQL: SELECT product_size FROM Products WHERE product_name LIKE '%Dell%'
Database: e_commerce
Question: What are the sizes of all products whose name includes the word 'Dell'?
SQL: SELECT product_size FROM Products WHERE product_name LIKE '%Dell%'
Database: e_commerce
Question: What are the product price and the product size of the products whose price is above average?
SQL: SELECT product_price ,  product_size FROM Products WHERE product_price  >  ( SELECT avg(product_price) FROM Products )
Database: e_commerce
Question: What are the prices and sizes of all products whose price is above the mean?
SQL: SELECT product_price ,  product_size FROM Products WHERE product_price  >  ( SELECT avg(product_price) FROM Products )
Database: e_commerce
Question: How many kinds of products have not been sold?
SQL: SELECT count(*) FROM Products WHERE product_id NOT IN ( SELECT product_id FROM Order_items )
Database: e_commerce
Question: What is the number of products that have not been ordered yet?
SQL: SELECT count(*) FROM Products WHERE product_id NOT IN ( SELECT product_id FROM Order_items )
Database: e_commerce
Question: How many customers do not have any payment method?
SQL: SELECT count(*) FROM Customers WHERE customer_id NOT IN ( SELECT customer_id FROM Customer_Payment_Methods )
Database: e_commerce
Question: How many customers do not have a listed payment method?
SQL: SELECT count(*) FROM Customers WHERE customer_id NOT IN ( SELECT customer_id FROM Customer_Payment_Methods )
Database: e_commerce
Question: What are all the order status and all the dates of orders?
SQL: SELECT order_status_code ,  date_order_placed FROM Orders
Database: e_commerce
Question: What are the status codes and dates placed for all of the orders?
SQL: SELECT order_status_code ,  date_order_placed FROM Orders
Database: e_commerce
Question: List the address, town and county information of the customers who live in the USA.
SQL: SELECT address_line_1 ,  town_city ,  county FROM Customers WHERE Country  =  'USA'
Database: e_commerce
Question: What are the addresses, towns, and county information for all customers who live in the United States?
SQL: SELECT address_line_1 ,  town_city ,  county FROM Customers WHERE Country  =  'USA'
Database: e_commerce
Question: List all the pairs of buyer first names and product names.
SQL: SELECT T1.customer_first_name ,  T4.product_name FROM Customers AS T1 JOIN Orders AS T2 ON T1.customer_id  =  T2.customer_id JOIN Order_items AS T3 ON T2.order_id  =  T3.order_id JOIN Products AS T4 ON T3.product_id  =  T4.product_id
Database: e_commerce
Question: What are the first names of all buyers and what products did they buy? List them in pairs.
SQL: SELECT T1.customer_first_name ,  T4.product_name FROM Customers AS T1 JOIN Orders AS T2 ON T1.customer_id  =  T2.customer_id JOIN Order_items AS T3 ON T2.order_id  =  T3.order_id JOIN Products AS T4 ON T3.product_id  =  T4.product_id
Database: e_commerce
Question: How many items are shipped?
SQL: SELECT count(*) FROM Shipment_Items
Database: e_commerce
Question: How many products have been shipped?
SQL: SELECT count(*) FROM Shipment_Items
Database: e_commerce
Question: What is the product average price?
SQL: SELECT avg(product_price) FROM Products
Database: e_commerce
Question: How much do the products cost on average?
SQL: SELECT avg(product_price) FROM Products
Database: e_commerce
Question: What is the average price of the products being ordered?
SQL: SELECT avg(T1.product_price) FROM Products AS T1 JOIN Order_items AS T2 ON T1.product_id  =  T2.product_id
Database: e_commerce
Question: What is the price of all products being ordered on average?
SQL: SELECT avg(T1.product_price) FROM Products AS T1 JOIN Order_items AS T2 ON T1.product_id  =  T2.product_id
Database: e_commerce
Question: What are the email address, town and county of the customers who are of the least common gender?
SQL: SELECT email_address ,  town_city ,  county FROM Customers WHERE gender_code  =  ( SELECT gender_code FROM Customers GROUP BY gender_code ORDER BY count(*) ASC LIMIT 1 )
Database: e_commerce
Question: What are the email addresses, cities, and counties listed for all cusomters who are from the gender that orders less often?
SQL: SELECT email_address ,  town_city ,  county FROM Customers WHERE gender_code  =  ( SELECT gender_code FROM Customers GROUP BY gender_code ORDER BY count(*) ASC LIMIT 1 )
Database: e_commerce
Question: List the order date of the orders who are placed by customers with at least 2 payment methods.
SQL: SELECT date_order_placed FROM Orders WHERE customer_id IN ( SELECT T1.customer_id FROM Customers AS T1 JOIN Customer_Payment_Methods AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id HAVING count(*)  >=  2 )
Database: e_commerce
Question: What is the date of all orders that have been placed by customers with at least 2 payment methods?
SQL: SELECT date_order_placed FROM Orders WHERE customer_id IN ( SELECT T1.customer_id FROM Customers AS T1 JOIN Customer_Payment_Methods AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id HAVING count(*)  >=  2 )
Database: e_commerce
Question: What is the most uncommon order status?
SQL: SELECT order_status_code FROM Orders GROUP BY order_status_code ORDER BY count(*) LIMIT 1
Database: e_commerce
Question: What is the least common order status?
SQL: SELECT order_status_code FROM Orders GROUP BY order_status_code ORDER BY count(*) LIMIT 1
Database: e_commerce
Question: For all the products sold for more than 3 times, list their id and description.
SQL: SELECT T1.product_id ,  T1.product_description FROM Products AS T1 JOIN Order_items AS T2 ON T1.product_id  =  T2.product_id GROUP BY T1.product_id HAVING count(*)  >  3
Database: e_commerce
Question: For all products sold more than 3 times, what are their ids and descriptions?
SQL: SELECT T1.product_id ,  T1.product_description FROM Products AS T1 JOIN Order_items AS T2 ON T1.product_id  =  T2.product_id GROUP BY T1.product_id HAVING count(*)  >  3
Database: e_commerce
Question: List the invoice dates and ids of the invoices causing at least 2 shipments.
SQL: SELECT T1.invoice_date ,  T1.invoice_number FROM Invoices AS T1 JOIN Shipments AS T2 ON T1.invoice_number  =  T2.invoice_number GROUP BY T1.invoice_number HAVING count(*)  >=  2
Database: e_commerce
Question: What are the dates and ids of the invoices that are related to at least 2 shipments?
SQL: SELECT T1.invoice_date ,  T1.invoice_number FROM Invoices AS T1 JOIN Shipments AS T2 ON T1.invoice_number  =  T2.invoice_number GROUP BY T1.invoice_number HAVING count(*)  >=  2
Database: e_commerce
Question: what are all shipment tracking numbers and shipment dates?
SQL: SELECT shipment_tracking_number ,  shipment_date FROM Shipments
Database: e_commerce
Question: What are the tracking numbers and dates for all shipments listed?
SQL: SELECT shipment_tracking_number ,  shipment_date FROM Shipments
Database: e_commerce
Question: What are the color, description and size of the products priced below the maximum price.
SQL: SELECT product_color ,  product_description ,  product_size FROM Products WHERE product_price  <  ( SELECT max(product_price) FROM products )
Database: e_commerce
Question: What are the colors , descriptions , and sizes for all products that are not at the maximum price ?
SQL: select product_color ,  product_description ,  product_size from products where product_price  !=  ( select max(product_price) from products )
Database: bbc_channels
Question: Return the names of directors who are older than the average age.
SQL: SELECT name FROM director WHERE age  >  (SELECT avg(age) FROM director)
Database: bbc_channels
Question: Find the the name of the oldest director.
SQL: SELECT name FROM director ORDER BY age DESC LIMIT 1
Database: bbc_channels
Question: How many channels have the word 'bbc' in their internet link?
SQL: SELECT count(*) FROM channel WHERE internet LIKE "%bbc%"
Database: bbc_channels
Question: How many different digital terrestrial channels are there?
SQL: SELECT count(DISTINCT Digital_terrestrial_channel) FROM channel
Database: bbc_channels
Question: List all program titles in the order of starting year. List the most recent one first.
SQL: SELECT title FROM program ORDER BY start_year DESC
Database: bbc_channels
Question: Which director is in charge of the most programs?
SQL: SELECT t2.name FROM program AS t1 JOIN director AS t2 ON t1.director_id  =  t2.director_id GROUP BY t1.director_id ORDER BY count(*) DESC LIMIT 1
Database: bbc_channels
Question: Find the name and age of the director who is in charge of the most programs?
SQL: SELECT t2.name ,  t2.age FROM program AS t1 JOIN director AS t2 ON t1.director_id  =  t2.director_id GROUP BY t1.director_id ORDER BY count(*) DESC LIMIT 1
Database: bbc_channels
Question: Return the title of the program that began most recently.
SQL: SELECT title FROM program ORDER BY start_year DESC LIMIT 1
Database: bbc_channels
Question: Find the name and website link of the channels that have more than one program.
SQL: SELECT t1.name ,  t1.internet FROM channel AS t1 JOIN program AS t2 ON t1.channel_id  =  t2.channel_id GROUP BY t1.channel_id HAVING count(*)  >  1
Database: bbc_channels
Question: Find the number of programs for each channel. Return the name of each channel as well.
SQL: SELECT t1.name ,  count(*) FROM channel AS t1 JOIN program AS t2 ON t1.channel_id  =  t2.channel_id GROUP BY t1.channel_id
Database: bbc_channels
Question: Find the number of channels that do not run any program.
SQL: SELECT count(*) FROM channel WHERE channel_id NOT IN (SELECT channel_id FROM program)
Database: bbc_channels
Question: What is the name of the director who is in the "Dracula" program?
SQL: SELECT t2.name FROM program AS t1 JOIN director AS t2 ON t1.director_id  =  t2.director_id WHERE t1.title  =  'Dracula'
Database: bbc_channels
Question: Find the name and internet web of the channel that is directed by the most directors.
SQL: SELECT t1.name ,  t1.internet FROM channel AS t1 JOIN director_admin AS t2 ON t1.channel_id  =  t2.channel_id GROUP BY t1.channel_id ORDER BY count(*) DESC LIMIT 1
Database: bbc_channels
Question: Find the name of the directors whose age is between 30 and 60.
SQL: SELECT name FROM director WHERE age BETWEEN 30 AND 60
Database: bbc_channels
Question: give me the name of channels that have both a director younger than 40 and a director older than 60.
SQL: SELECT t1.name FROM channel AS t1 JOIN director_admin AS t2 ON t1.channel_id  =  t2.channel_id JOIN director AS t3 ON t2.director_id  =  t3.director_id WHERE t3.age  <  40 INTERSECT SELECT t1.name FROM channel AS t1 JOIN director_admin AS t2 ON t1.channel_id  =  t2.channel_id JOIN director AS t3 ON t2.director_id  =  t3.director_id WHERE t3.age  >  60
Database: bbc_channels
Question: Find the id and name of the channel that is not directed by Hank Baskett.
SQL: SELECT t1.name ,  t1.channel_id FROM channel AS t1 JOIN director_admin AS t2 ON t1.channel_id  =  t2.channel_id JOIN director AS t3 ON t2.director_id  =  t3.director_id WHERE t3.name != "Hank Baskett"
Database: tv_shows
Question: How many radios are there?
SQL: SELECT count(*) FROM radio
Database: tv_shows
Question: List the transmitters of radios in ascending order of erp kw .
SQL: select transmitter from radio order by erp_kw asc
Database: tv_shows
Question: What are the names and original air dates of tv shows?
SQL: SELECT tv_show_name ,  Original_Airdate FROM tv_show
Database: tv_shows
Question: List the station names of city channels whose affiliation is not "ABC".
SQL: SELECT Station_name FROM city_channel WHERE Affiliation != "ABC"
Database: tv_shows
Question: Show the transmitters of radios whose ERP is bigger than 150 or smaller than 30.
SQL: SELECT Transmitter FROM radio WHERE ERP_kW  >  150 OR ERP_kW  <  30
Database: tv_shows
Question: What is the transmitter of the radio with the largest ERP_kW?
SQL: SELECT Transmitter FROM radio ORDER BY ERP_kW DESC LIMIT 1
Database: tv_shows
Question: What is the average ERP across all radios?
SQL: SELECT avg(ERP_kW) FROM radio
Database: tv_shows
Question: Show the different affiliations of city channels and the number of city channels with each affiliation.
SQL: SELECT Affiliation ,  COUNT(*) FROM city_channel GROUP BY Affiliation
Database: tv_shows
Question: Please show the most common affiliation for city channels.
SQL: SELECT Affiliation FROM city_channel GROUP BY Affiliation ORDER BY COUNT(*) DESC LIMIT 1
Database: tv_shows
Question: List the affiliations shared by more than three city channels.
SQL: SELECT Affiliation FROM city_channel GROUP BY Affiliation HAVING COUNT(*)  >  3
Database: tv_shows
Question: Show the cities and station names of city channels in ascending alphabetical order of station name.
SQL: SELECT City ,  Station_name FROM city_channel ORDER BY Station_name ASC
Database: tv_shows
Question: Show the transmitters of radios and the cities of the channels they are associated with.
SQL: SELECT T3.Transmitter ,  T2.City FROM city_channel_radio AS T1 JOIN city_channel AS T2 ON T1.City_channel_ID  =  T2.ID JOIN radio AS T3 ON T1.Radio_ID  =  T3.Radio_ID
Database: tv_shows
Question: Show the transmitters of radios and the station names of the channels they are associated with in descending order of the ERP of the radios.
SQL: SELECT T3.Transmitter ,  T2.Station_name FROM city_channel_radio AS T1 JOIN city_channel AS T2 ON T1.City_channel_ID  =  T2.ID JOIN radio AS T3 ON T1.Radio_ID  =  T3.Radio_ID ORDER BY T3.ERP_kW DESC
Database: tv_shows
Question: Show the transmitters of the radios and the number of city channels they are associated with.
SQL: SELECT T2.Transmitter ,  COUNT(*) FROM city_channel_radio AS T1 JOIN radio AS T2 ON T1.Radio_ID  =  T2.Radio_ID GROUP BY T2.Transmitter
Database: tv_shows
Question: Show the distinct transmitters of radios that are not associated with any city channel.
SQL: SELECT Transmitter FROM radio WHERE Radio_ID NOT IN (SELECT Radio_ID FROM city_channel_radio)
Database: vehicle_driver
Question: What is the model of the vehicle with maximum top speed whose power is higher than 6000?
SQL: SELECT model FROM vehicle WHERE power  >  6000 ORDER BY top_speed DESC LIMIT 1
Database: vehicle_driver
Question: Of vehicles with power over 6000, return the model of the vehicle with the greatest top speed.
SQL: SELECT model FROM vehicle WHERE power  >  6000 ORDER BY top_speed DESC LIMIT 1
Database: vehicle_driver
Question: What are the names of the drivers who are citizens of the 'United States'?
SQL: SELECT name FROM driver WHERE citizenship  =  'United States'
Database: vehicle_driver
Question: Return the names of drivers with citizenship from the United States.
SQL: SELECT name FROM driver WHERE citizenship  =  'United States'
Database: vehicle_driver
Question: How many vehicles has a driver driven at most, and what is the driver id of the driver who has driven this many vehicles?
SQL: SELECT count(*) ,  driver_id FROM vehicle_driver GROUP BY driver_id ORDER BY count(*) DESC LIMIT 1
Database: vehicle_driver
Question: What is the id of the driver who has driven the most vehicles, and how many vehicles is this?
SQL: SELECT count(*) ,  driver_id FROM vehicle_driver GROUP BY driver_id ORDER BY count(*) DESC LIMIT 1
Database: vehicle_driver
Question: What is the maximum and average power for the vehicles manufactured by 'Zhuzhou'?
SQL: SELECT max(power) ,  avg(power) FROM vehicle WHERE builder  =  'Zhuzhou'
Database: vehicle_driver
Question: Return the maximum and average power for the vehicles built by Zhuzhou.
SQL: SELECT max(power) ,  avg(power) FROM vehicle WHERE builder  =  'Zhuzhou'
Database: vehicle_driver
Question: What is the id of the vehicle driven for the least times for the vehicles ever used?
SQL: SELECT vehicle_id FROM vehicle_driver GROUP BY vehicle_id ORDER BY count(*) ASC LIMIT 1
Database: vehicle_driver
Question: Return the id of the vehicle that has been driven the fewest times.
SQL: SELECT vehicle_id FROM vehicle_driver GROUP BY vehicle_id ORDER BY count(*) ASC LIMIT 1
Database: vehicle_driver
Question: What is the top speed and power of the vehicle manufactured in the year of 1996?
SQL: SELECT top_speed ,  power FROM vehicle WHERE build_year  =  1996
Database: vehicle_driver
Question: Return the top speed and power of the vehicle that was built in the year 1996.
SQL: SELECT top_speed ,  power FROM vehicle WHERE build_year  =  1996
Database: vehicle_driver
Question: What are the build year, model name and builder of the vehicles?
SQL: SELECT build_year ,  model ,  builder FROM vehicle
Database: vehicle_driver
Question: Give the build year, model, and builder of each vehicle.
SQL: SELECT build_year ,  model ,  builder FROM vehicle
Database: vehicle_driver
Question: How many drivers have driven vehicles built in 2012?
SQL: SELECT count(DISTINCT T1.driver_id) FROM vehicle_driver AS T1 JOIN vehicle AS T2 ON T1.vehicle_id  =  T2.vehicle_id WHERE T2.build_year  =  2012
Database: vehicle_driver
Question: Count the number of different drivers who have driven vehicles built in 2012.
SQL: SELECT count(DISTINCT T1.driver_id) FROM vehicle_driver AS T1 JOIN vehicle AS T2 ON T1.vehicle_id  =  T2.vehicle_id WHERE T2.build_year  =  2012
Database: vehicle_driver
Question: How many drivers have raced in 'NASCAR'?
SQL: SELECT count(*) FROM driver WHERE Racing_Series  =  'NASCAR'
Database: vehicle_driver
Question: Count the number of drivers who have raced in NASCAR.
SQL: SELECT count(*) FROM driver WHERE Racing_Series  =  'NASCAR'
Database: vehicle_driver
Question: What is the average top speed of vehicles?
SQL: SELECT avg(top_speed) FROM vehicle
Database: vehicle_driver
Question: Return the average top speed across all vehicles.
SQL: SELECT avg(top_speed) FROM vehicle
Database: vehicle_driver
Question: What are the distinct driver names who have driven vehicles with power more than 5000 ?
SQL: select distinct t1.name from driver as t1 join vehicle_driver as t2 on t1.driver_id  =  t2.driver_id join vehicle as t3 on t2.vehicle_id  =  t3.vehicle_id where t3.power  >  5000
Database: vehicle_driver
Question: Return the names of drivers who have driven vehicles with power over 5000.
SQL: SELECT DISTINCT T1.Name FROM driver AS T1 JOIN vehicle_driver AS T2 ON T1.driver_id  =  T2.driver_id JOIN vehicle AS T3 ON T2.vehicle_id  =  T3.vehicle_id WHERE T3.power  >  5000
Database: vehicle_driver
Question: Which car models have total production larger than 100 or top speed higher than 150?
SQL: SELECT model FROM vehicle WHERE total_production  >  100 OR top_speed  >  150
Database: vehicle_driver
Question: Give the models of cars that have a total production of over 100 or a top speed over 150.
SQL: SELECT model FROM vehicle WHERE total_production  >  100 OR top_speed  >  150
Database: vehicle_driver
Question: What are the model names and build year of the cars with 'DJ' in its model name?
SQL: SELECT model ,  build_year FROM vehicle WHERE model LIKE '%DJ%'
Database: vehicle_driver
Question: Return the model and build year of cars that include "DJ" in their model names.
SQL: SELECT model ,  build_year FROM vehicle WHERE model LIKE '%DJ%'
Database: vehicle_driver
Question: What are the models which have not been driven by any drivers?
SQL: SELECT model FROM vehicle EXCEPT SELECT T1.model FROM vehicle AS T1 JOIN vehicle_driver AS T2 ON T1.vehicle_id  =  T2.vehicle_id
Database: vehicle_driver
Question: Return the models of vehicles that have never been driven.
SQL: SELECT model FROM vehicle EXCEPT SELECT T1.model FROM vehicle AS T1 JOIN vehicle_driver AS T2 ON T1.vehicle_id  =  T2.vehicle_id
Database: vehicle_driver
Question: What are the vehicle ids and models of the vehicle which have been driven by two drivers or been manufactured by 'Ziyang'.
SQL: SELECT T1.vehicle_id ,  T1.model FROM vehicle AS T1 JOIN vehicle_driver AS T2 ON T1.vehicle_id  =  T2.vehicle_id GROUP BY T2.vehicle_id HAVING count(*)  =  2 OR T1.builder  =  'Ziyang'
Database: vehicle_driver
Question: Return the ids and models of vehicles that have been driven by exactly two drivers or built by Ziyang.
SQL: SELECT T1.vehicle_id ,  T1.model FROM vehicle AS T1 JOIN vehicle_driver AS T2 ON T1.vehicle_id  =  T2.vehicle_id GROUP BY T2.vehicle_id HAVING count(*)  =  2 OR T1.builder  =  'Ziyang'
Database: vehicle_driver
Question: What are the vehicle ids and models which have been driven by more than 2 drivers or been driven by the driver named 'Jeff Gordon'?
SQL: SELECT T1.vehicle_id ,  T1.model FROM vehicle AS T1 JOIN vehicle_driver AS T2 ON T1.vehicle_id  =  T2.vehicle_id JOIN driver AS T3 ON T2.driver_id  =  T3.driver_id WHERE T3.name  =  'Jeff Gordon' UNION SELECT T1.vehicle_id ,  T1.model FROM vehicle AS T1 JOIN vehicle_driver AS T2 ON T1.vehicle_id  =  T2.vehicle_id GROUP BY T2.vehicle_id HAVING count(*)  >  2
Database: vehicle_driver
Question: Return the ids and models of vehicles that have been driven by more than 2 drivers or been driven by the Jeff Gordon.
SQL: SELECT T1.vehicle_id ,  T1.model FROM vehicle AS T1 JOIN vehicle_driver AS T2 ON T1.vehicle_id  =  T2.vehicle_id JOIN driver AS T3 ON T2.driver_id  =  T3.driver_id WHERE T3.name  =  'Jeff Gordon' UNION SELECT T1.vehicle_id ,  T1.model FROM vehicle AS T1 JOIN vehicle_driver AS T2 ON T1.vehicle_id  =  T2.vehicle_id GROUP BY T2.vehicle_id HAVING count(*)  >  2
Database: vehicle_driver
Question: How many vehicles have maximum top speed?
SQL: SELECT count(*) FROM vehicle WHERE top_speed  =  (SELECT max(top_speed) FROM vehicle)
Database: vehicle_driver
Question: Count the number of vehicles that have a top speed equal to the maximum across all vehicles.
SQL: SELECT count(*) FROM vehicle WHERE top_speed  =  (SELECT max(top_speed) FROM vehicle)
Database: vehicle_driver
Question: Show all driver names in the alphabetical order.
SQL: SELECT name FROM driver ORDER BY name
Database: vehicle_driver
Question: What are the names of drivers, returned in alphbetical order?
SQL: SELECT name FROM driver ORDER BY name
Database: vehicle_driver
Question: How many drivers have been racing in each racing series?
SQL: SELECT count(*) ,  racing_series FROM driver GROUP BY racing_series
Database: vehicle_driver
Question: Count the number of drivers that have raced in each series.
SQL: SELECT count(*) ,  racing_series FROM driver GROUP BY racing_series
Database: vehicle_driver
Question: What are the name and citizenship of the drivers who have driven the vehicle model 'DJ1'?
SQL: SELECT T1.name ,  T1.citizenship FROM driver AS T1 JOIN vehicle_driver AS T2 ON T1.driver_id  =  T2.driver_id JOIN vehicle AS T3 ON T2.vehicle_id  =  T3.vehicle_id WHERE T3.model  =  'DJ1'
Database: vehicle_driver
Question: Return the names and citizenships of drivers who have driven the vehicle with the model 'DJ1'.
SQL: SELECT T1.name ,  T1.citizenship FROM driver AS T1 JOIN vehicle_driver AS T2 ON T1.driver_id  =  T2.driver_id JOIN vehicle AS T3 ON T2.vehicle_id  =  T3.vehicle_id WHERE T3.model  =  'DJ1'
Database: vehicle_driver
Question: How many drivers have not driven any cars?
SQL: SELECT count(*) FROM driver WHERE driver_id NOT IN ( SELECT driver_id FROM vehicle_driver )
Database: vehicle_driver
Question: Count the number of drivers who have not driven any vehicles.
SQL: SELECT count(*) FROM driver WHERE driver_id NOT IN ( SELECT driver_id FROM vehicle_driver )
Database: online_exams
Question: How many exams are there?
SQL: SELECT count(*) FROM Exams
Database: online_exams
Question: Count the number of exams.
SQL: SELECT count(*) FROM Exams
Database: online_exams
Question: List the distinct subject code of exams in ascending alphabetical order .
SQL: select distinct subject_code from exams order by subject_code asc
Database: online_exams
Question: Give me an alphabetically ordered list of the distinct subject code for exams.
SQL: SELECT DISTINCT Subject_Code FROM Exams ORDER BY Subject_Code
Database: online_exams
Question: What are the names and dates of the exams with subject code that is not "Database"?
SQL: SELECT Exam_Date ,  Exam_Name FROM Exams WHERE Subject_Code != 'Database'
Database: online_exams
Question: Find the exams whose subject code is not "Database". What are the exam dates and exam names?
SQL: SELECT Exam_Date ,  Exam_Name FROM Exams WHERE Subject_Code != 'Database'
Database: online_exams
Question: List the dates of the exams with subject code containing the word "data", in descending order of dates.
SQL: SELECT Exam_Date FROM Exams WHERE Subject_Code LIKE '%data%' ORDER BY Exam_Date DESC
Database: online_exams
Question: What are the dates of the exams whose subject code contains the substring "data"? Return them in descending order of dates.
SQL: SELECT Exam_Date FROM Exams WHERE Subject_Code LIKE '%data%' ORDER BY Exam_Date DESC
Database: online_exams
Question: What are the type of questions and their counts?
SQL: SELECT Type_of_Question_Code ,  COUNT(*) FROM Questions GROUP BY Type_of_Question_Code
Database: online_exams
Question: For each question type, return its type code and its count of occurrence.
SQL: SELECT Type_of_Question_Code ,  COUNT(*) FROM Questions GROUP BY Type_of_Question_Code
Database: online_exams
Question: What are the distinct student answer texts that received comments "Normal"?
SQL: SELECT DISTINCT Student_Answer_Text FROM Student_Answers WHERE Comments  =  "Normal"
Database: online_exams
Question: List all the distinct student answer texts to which comments "Normal" were given?
SQL: SELECT DISTINCT Student_Answer_Text FROM Student_Answers WHERE Comments  =  "Normal"
Database: online_exams
Question: How many different comments are there for student answers?
SQL: SELECT count(DISTINCT Comments) FROM Student_Answers
Database: online_exams
Question: Count the number of different comments for student answers.
SQL: SELECT count(DISTINCT Comments) FROM Student_Answers
Database: online_exams
Question: List all the student answer texts in descending order of count.
SQL: SELECT Student_Answer_Text FROM Student_Answers GROUP BY Student_Answer_Text ORDER BY COUNT(*) DESC
Database: online_exams
Question: Sort the student answer texts in descending order of their frequency of occurrence.
SQL: SELECT Student_Answer_Text FROM Student_Answers GROUP BY Student_Answer_Text ORDER BY COUNT(*) DESC
Database: online_exams
Question: Please show the first names of students and the dates of their answers.
SQL: SELECT T2.First_Name ,  T1.Date_of_Answer FROM Student_Answers AS T1 JOIN Students AS T2 ON T1.Student_ID  =  T2.Student_ID
Database: online_exams
Question: For each student answer, find the first name of the student and the date of the answer.
SQL: SELECT T2.First_Name ,  T1.Date_of_Answer FROM Student_Answers AS T1 JOIN Students AS T2 ON T1.Student_ID  =  T2.Student_ID
Database: online_exams
Question: Please show the email addresses of students and the dates of their answers in descending order of dates.
SQL: SELECT T2.Email_Adress ,  T1.Date_of_Answer FROM Student_Answers AS T1 JOIN Students AS T2 ON T1.Student_ID  =  T2.Student_ID ORDER BY T1.Date_of_Answer DESC
Database: online_exams
Question: For each student answer, find the email address of the student and the date of the answer. Sort them in descending order of dates.
SQL: SELECT T2.Email_Adress ,  T1.Date_of_Answer FROM Student_Answers AS T1 JOIN Students AS T2 ON T1.Student_ID  =  T2.Student_ID ORDER BY T1.Date_of_Answer DESC
Database: online_exams
Question: Please show the least common assessment for students.
SQL: SELECT Assessment FROM Student_Assessments GROUP BY Assessment ORDER BY COUNT(*) ASC LIMIT 1
Database: online_exams
Question: Which assessment has the smallest frequency count?
SQL: SELECT Assessment FROM Student_Assessments GROUP BY Assessment ORDER BY COUNT(*) ASC LIMIT 1
Database: online_exams
Question: Please show the first names of the students that have at least two answer records.
SQL: SELECT T2.First_Name FROM Student_Answers AS T1 JOIN Students AS T2 ON T1.Student_ID  =  T2.Student_ID GROUP BY T1.Student_ID HAVING COUNT(*)  >=  2