db_id
stringclasses
40 values
query
stringlengths
22
608
question
stringlengths
22
185
online_exams
SELECT Exam_Date FROM Exams WHERE Subject_Code LIKE '%data%' ORDER BY Exam_Date DESC
What are the dates of the exams whose subject code contains the substring "data"? Return them in descending order of dates.
online_exams
SELECT Type_of_Question_Code , COUNT(*) FROM Questions GROUP BY Type_of_Question_Code
What are the type of questions and their counts?
online_exams
SELECT Type_of_Question_Code , COUNT(*) FROM Questions GROUP BY Type_of_Question_Code
For each question type, return its type code and its count of occurrence.
online_exams
SELECT DISTINCT Student_Answer_Text FROM Student_Answers WHERE Comments = "Normal"
What are the distinct student answer texts that received comments "Normal"?
online_exams
SELECT DISTINCT Student_Answer_Text FROM Student_Answers WHERE Comments = "Normal"
List all the distinct student answer texts to which comments "Normal" were given?
online_exams
SELECT count(DISTINCT Comments) FROM Student_Answers
How many different comments are there for student answers?
online_exams
SELECT count(DISTINCT Comments) FROM Student_Answers
Count the number of different comments for student answers.
online_exams
SELECT Student_Answer_Text FROM Student_Answers GROUP BY Student_Answer_Text ORDER BY COUNT(*) DESC
List all the student answer texts in descending order of count.
online_exams
SELECT Student_Answer_Text FROM Student_Answers GROUP BY Student_Answer_Text ORDER BY COUNT(*) DESC
Sort the student answer texts in descending order of their frequency of occurrence.
online_exams
SELECT T2.First_Name , T1.Date_of_Answer FROM Student_Answers AS T1 JOIN Students AS T2 ON T1.Student_ID = T2.Student_ID
Please show the first names of students and the dates of their answers.
online_exams
SELECT T2.First_Name , T1.Date_of_Answer FROM Student_Answers AS T1 JOIN Students AS T2 ON T1.Student_ID = T2.Student_ID
For each student answer, find the first name of the student and the date of the answer.
online_exams
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
Please show the email addresses of students and the dates of their answers in descending order of dates.
online_exams
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
For each student answer, find the email address of the student and the date of the answer. Sort them in descending order of dates.
online_exams
SELECT Assessment FROM Student_Assessments GROUP BY Assessment ORDER BY COUNT(*) ASC LIMIT 1
Please show the least common assessment for students.
online_exams
SELECT Assessment FROM Student_Assessments GROUP BY Assessment ORDER BY COUNT(*) ASC LIMIT 1
Which assessment has the smallest frequency count?
online_exams
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
Please show the first names of the students that have at least two answer records.
online_exams
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
Which students have 2 or more answer records? Give me their first names.
online_exams
SELECT Valid_Answer_Text FROM Valid_Answers GROUP BY Valid_Answer_Text ORDER BY COUNT(*) DESC LIMIT 1
What is the most common valid answer text?
online_exams
SELECT Valid_Answer_Text FROM Valid_Answers GROUP BY Valid_Answer_Text ORDER BY COUNT(*) DESC LIMIT 1
Find the valid answer text that appeared most frequently.
online_exams
SELECT Last_Name FROM Students WHERE Gender_MFU != "M"
List the last names of the students whose gender is not "M".
online_exams
SELECT Last_Name FROM Students WHERE Gender_MFU != "M"
What are the last names of the students with gender other than "M"?
online_exams
SELECT Gender_MFU , COUNT(*) FROM Students GROUP BY Gender_MFU
List each gender and the corresponding number of students.
online_exams
SELECT Gender_MFU , COUNT(*) FROM Students GROUP BY Gender_MFU
For each gender, return the gender code and the number of students who identify as that gender.
online_exams
SELECT Last_Name FROM Students WHERE Gender_MFU = "F" OR Gender_MFU = "M"
List the last names of the students whose gender is "F" or "M".
online_exams
SELECT Last_Name FROM Students WHERE Gender_MFU = "F" OR Gender_MFU = "M"
Which students identify their gender as "F" or "M"? Give me their last names.
online_exams
SELECT First_Name FROM Students WHERE Student_ID NOT IN (SELECT Student_ID FROM Student_Answers)
List the first names of the students who do not have any answers.
online_exams
SELECT First_Name FROM Students WHERE Student_ID NOT IN (SELECT Student_ID FROM Student_Answers)
Which students do not have any answers? Find their first names.
online_exams
SELECT Student_Answer_Text FROM Student_Answers WHERE Comments = "Normal" INTERSECT SELECT Student_Answer_Text FROM Student_Answers WHERE Comments = "Absent"
Show the student answer texts that received both "Normal" and "Absent" as comments.
online_exams
SELECT Student_Answer_Text FROM Student_Answers WHERE Comments = "Normal" INTERSECT SELECT Student_Answer_Text FROM Student_Answers WHERE Comments = "Absent"
Which student answer texts were given both "Normal" and "Absent" as comments?
online_exams
SELECT Type_of_Question_Code FROM Questions GROUP BY Type_of_Question_Code HAVING count(*) >= 3
Show the types of questions that have at least three questions.
online_exams
SELECT Type_of_Question_Code FROM Questions GROUP BY Type_of_Question_Code HAVING count(*) >= 3
Which types of questions have 3 or more questions? Return the questions type code.
online_exams
SELECT * FROM Students
Show all information on students.
online_exams
SELECT * FROM Students
What is al the available information of each student?
customers_and_orders
SELECT count(*) FROM Addresses
How many addresses do we have?
customers_and_orders
SELECT count(*) FROM Addresses
Count the number of addresses.
customers_and_orders
SELECT address_id , address_details FROM Addresses
List all address ids and address details.
customers_and_orders
SELECT address_id , address_details FROM Addresses
What are all the address ids and address details?
customers_and_orders
SELECT count(*) FROM Products
How many products do we have?
customers_and_orders
SELECT count(*) FROM Products
Count the number of products.
customers_and_orders
SELECT product_id , product_type_code , product_name FROM Products
Show all product ids, product type codes, and product name.
customers_and_orders
SELECT product_id , product_type_code , product_name FROM Products
What are the ids, type codes, and names for all products?
customers_and_orders
SELECT product_price FROM Products WHERE product_name = "Monitor"
What is the price for the product with name Monitor?
customers_and_orders
SELECT product_price FROM Products WHERE product_name = "Monitor"
Give the price of the Monitor product.
customers_and_orders
SELECT min(product_price) , avg(product_price) , max(product_price) FROM Products
Show the minimum, average, maximum price for all products.
customers_and_orders
SELECT min(product_price) , avg(product_price) , max(product_price) FROM Products
What are the minimum, average, and maximum prices across all products?
customers_and_orders
SELECT avg(product_price) FROM Products WHERE product_type_code = "Clothes"
What is the average price for products with type Clothes?
customers_and_orders
SELECT avg(product_price) FROM Products WHERE product_type_code = "Clothes"
Return the average price of Clothes.
customers_and_orders
SELECT count(*) FROM Products WHERE product_type_code = "Hardware"
How many hardware type products do we have?
customers_and_orders
SELECT count(*) FROM Products WHERE product_type_code = "Hardware"
Count the number of products of the type Hardware.
customers_and_orders
SELECT product_name FROM Products WHERE product_price > (SELECT avg(product_price) FROM Products)
Show all product names with price higher than the average.
customers_and_orders
SELECT product_name FROM Products WHERE product_price > (SELECT avg(product_price) FROM Products)
What are the names of products that have a price above the average for all products.
customers_and_orders
SELECT product_name FROM Products WHERE product_type_code = "Hardware" AND product_price > (SELECT avg(product_price) FROM Products WHERE product_type_code = "Hardware")
Show all hardware product names with price higher than the average price of hardware type products.
customers_and_orders
SELECT product_name FROM Products WHERE product_type_code = "Hardware" AND product_price > (SELECT avg(product_price) FROM Products WHERE product_type_code = "Hardware")
What are the names of Hardware product with prices above the average price of Hardware products.
customers_and_orders
SELECT product_name FROM Products WHERE product_type_code = "Clothes" ORDER BY product_price DESC LIMIT 1
What is the name of the most expensive product with type Clothes?
customers_and_orders
SELECT product_name FROM Products WHERE product_type_code = "Clothes" ORDER BY product_price DESC LIMIT 1
Give the name of the most expensive Clothes product.
customers_and_orders
SELECT product_id , product_name FROM Products WHERE product_type_code = "Hardware" ORDER BY product_price ASC LIMIT 1
What is the product id and product name for the cheapest Hardware type product?
customers_and_orders
SELECT product_id , product_name FROM Products WHERE product_type_code = "Hardware" ORDER BY product_price ASC LIMIT 1
Give the id and name of the cheapest Hardware product.
customers_and_orders
SELECT product_name FROM Products ORDER BY product_price DESC
List all product names in descending order of price.
customers_and_orders
SELECT product_name FROM Products ORDER BY product_price DESC
What are the names of the products, sorted by descending price?
customers_and_orders
SELECT product_name FROM Products WHERE product_type_code = "Hardware" ORDER BY product_price ASC
Show all hardware type products in ascending order of price.
customers_and_orders
SELECT product_name FROM Products WHERE product_type_code = "Hardware" ORDER BY product_price ASC
What are the names of all Hardware products, sorted by price ascending?
customers_and_orders
SELECT product_type_code , count(*) FROM Products GROUP BY product_type_code
List all product type codes and the number of products in each type.
customers_and_orders
SELECT product_type_code , count(*) FROM Products GROUP BY product_type_code
How many products are there for each product type?
customers_and_orders
SELECT product_type_code , avg(product_price) FROM Products GROUP BY product_type_code
Show all product type codes and the average price for each type.
customers_and_orders
SELECT product_type_code , avg(product_price) FROM Products GROUP BY product_type_code
What is the average price of products for each product type?
customers_and_orders
SELECT product_type_code FROM Products GROUP BY product_type_code HAVING count(*) >= 2
What are the product type code with at least two products?
customers_and_orders
SELECT product_type_code FROM Products GROUP BY product_type_code HAVING count(*) >= 2
Give the product type codes of product types that have two or more products.
customers_and_orders
SELECT product_type_code FROM Products GROUP BY product_type_code ORDER BY count(*) DESC LIMIT 1
What is the product type code with most number of products?
customers_and_orders
SELECT product_type_code FROM Products GROUP BY product_type_code ORDER BY count(*) DESC LIMIT 1
What is the most frequent product type code?
customers_and_orders
SELECT count(*) FROM Customers
How many customers do we have?
customers_and_orders
SELECT count(*) FROM Customers
Count the number of customers.
customers_and_orders
SELECT customer_id , customer_name FROM Customers
Show all customer ids and customer names.
customers_and_orders
SELECT customer_id , customer_name FROM Customers
What are the ids and names of all customers?
customers_and_orders
SELECT customer_address , customer_phone , customer_email FROM Customers WHERE customer_name = "Jeromy"
What is the customer address, customer phone, and customer email for Jeromy?
customers_and_orders
SELECT customer_address , customer_phone , customer_email FROM Customers WHERE customer_name = "Jeromy"
Give the address, phone, and email for customers with the name Jeromy.
customers_and_orders
SELECT payment_method_code , count(*) FROM Customers GROUP BY payment_method_code
Show all payment method codes and the number of customers in each code.
customers_and_orders
SELECT payment_method_code , count(*) FROM Customers GROUP BY payment_method_code
How many customers use each payment method?
customers_and_orders
SELECT payment_method_code FROM Customers GROUP BY payment_method_code ORDER BY count(*) DESC LIMIT 1
What is the payment method code used by most number of customers?
customers_and_orders
SELECT payment_method_code FROM Customers GROUP BY payment_method_code ORDER BY count(*) DESC LIMIT 1
Give the code of the payment method that is most commonly used.
customers_and_orders
SELECT customer_name FROM Customers WHERE payment_method_code = ( SELECT payment_method_code FROM Customers GROUP BY payment_method_code ORDER BY count(*) ASC LIMIT 1)
Show all customer names with the payment method code used by least number of customers.
customers_and_orders
SELECT customer_name FROM Customers WHERE payment_method_code = ( SELECT payment_method_code FROM Customers GROUP BY payment_method_code ORDER BY count(*) ASC LIMIT 1)
What are the names of customers who use the least common payment method?
customers_and_orders
SELECT payment_method_code , customer_number FROM Customers WHERE customer_name = "Jeromy"
What is the payment method and customer number for customer named Jeromy?
customers_and_orders
SELECT payment_method_code , customer_number FROM Customers WHERE customer_name = "Jeromy"
Give the payment method code and customer number corresponding to the customer named Jeromy.
customers_and_orders
SELECT DISTINCT payment_method_code FROM Customers
What are the distinct payment methods used by customers?
customers_and_orders
SELECT DISTINCT payment_method_code FROM Customers
Give the different payment method codes that customers use.
customers_and_orders
SELECT product_id , product_type_code FROM Products ORDER BY product_name
Show the id and the product type for all products, order by product name.
customers_and_orders
SELECT product_id , product_type_code FROM Products ORDER BY product_name
What are the ids and product types for all products, sorted alphabetically by product name?
customers_and_orders
SELECT product_type_code FROM Products GROUP BY product_type_code ORDER BY count(*) ASC LIMIT 1
What is the product type with least number of products?
customers_and_orders
SELECT product_type_code FROM Products GROUP BY product_type_code ORDER BY count(*) ASC LIMIT 1
What is the code of the product type that is least common?
customers_and_orders
SELECT count(*) FROM Customer_orders
How many customer orders do we have?
customers_and_orders
SELECT count(*) FROM Customer_orders
Count the number of customer orders.
customers_and_orders
SELECT order_id , order_date , order_status_code FROM Customer_orders AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_name = "Jeromy"
Show the order ids, order dates, and order status codes for all orders by customer Jeromy.
customers_and_orders
SELECT order_id , order_date , order_status_code FROM Customer_orders AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_name = "Jeromy"
What were the ids, dates, and status codes for orders made by Jeromy?
customers_and_orders
SELECT T2.customer_name , T1.customer_id , count(*) FROM Customer_orders AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id
Show all customer names, ids and the number of orders by each customer.
customers_and_orders
SELECT T2.customer_name , T1.customer_id , count(*) FROM Customer_orders AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id
What are the names, ids, and number of orders made for each customer?
customers_and_orders
SELECT T1.customer_id , T2.customer_name , T2.customer_phone , T2.customer_email FROM Customer_orders AS T1 JOIN Customers 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, name, phone, and email for the customer with most orders?
customers_and_orders
SELECT T1.customer_id , T2.customer_name , T2.customer_phone , T2.customer_email FROM Customer_orders AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1
Give the id, name, phone, and email corresponding to the customer who made the most orders.
customers_and_orders
SELECT order_status_code , count(*) FROM Customer_orders GROUP BY order_status_code
Show all order status and the number of orders in each status.
customers_and_orders
SELECT order_status_code , count(*) FROM Customer_orders GROUP BY order_status_code
How many orders have each order status code?
customers_and_orders
SELECT order_status_code FROM Customer_orders GROUP BY order_status_code ORDER BY count(*) DESC LIMIT 1
What is the order status code that is most common?