query_id
int64
0
2.15k
database_id
stringclasses
40 values
table_id
sequencelengths
1
4
query
stringlengths
22
185
answer
stringlengths
22
608
difficulty
stringclasses
4 values
200
online_exams
[ "Exams" ]
What are the dates of the exams whose subject code contains the substring "data"? Return them in descending order of dates.
SELECT Exam_Date FROM Exams WHERE Subject_Code LIKE '%data%' ORDER BY Exam_Date DESC
hard
201
online_exams
[ "Questions" ]
What are the type of questions and their counts?
SELECT Type_of_Question_Code , COUNT(*) FROM Questions GROUP BY Type_of_Question_Code
medium
202
online_exams
[ "Questions" ]
For each question type, return its type code and its count of occurrence.
SELECT Type_of_Question_Code , COUNT(*) FROM Questions GROUP BY Type_of_Question_Code
medium
203
online_exams
[ "Student_Answers" ]
What are the distinct student answer texts that received comments "Normal"?
SELECT DISTINCT Student_Answer_Text FROM Student_Answers WHERE Comments = "Normal"
easy
204
online_exams
[ "Student_Answers" ]
List all the distinct student answer texts to which comments "Normal" were given?
SELECT DISTINCT Student_Answer_Text FROM Student_Answers WHERE Comments = "Normal"
easy
205
online_exams
[ "Student_Answers" ]
How many different comments are there for student answers?
SELECT count(DISTINCT Comments) FROM Student_Answers
easy
206
online_exams
[ "Student_Answers" ]
Count the number of different comments for student answers.
SELECT count(DISTINCT Comments) FROM Student_Answers
easy
207
online_exams
[ "Student_Answers" ]
List all the student answer texts in descending order of count.
SELECT Student_Answer_Text FROM Student_Answers GROUP BY Student_Answer_Text ORDER BY COUNT(*) DESC
medium
208
online_exams
[ "Student_Answers" ]
Sort the student answer texts in descending order of their frequency of occurrence.
SELECT Student_Answer_Text FROM Student_Answers GROUP BY Student_Answer_Text ORDER BY COUNT(*) DESC
medium
209
online_exams
[ "Student_Answers", "Students" ]
Please show the first names of students and the dates of their answers.
SELECT T2.First_Name , T1.Date_of_Answer FROM Student_Answers AS T1 JOIN Students AS T2 ON T1.Student_ID = T2.Student_ID
medium
210
online_exams
[ "Student_Answers", "Students" ]
For each student answer, find the first name of the student and the date of the answer.
SELECT T2.First_Name , T1.Date_of_Answer FROM Student_Answers AS T1 JOIN Students AS T2 ON T1.Student_ID = T2.Student_ID
medium
211
online_exams
[ "Student_Answers", "Students" ]
Please show the email addresses of students and the dates of their answers in descending order of dates.
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
medium
212
online_exams
[ "Student_Answers", "Students" ]
For each student answer, find the email address of the student and the date of the answer. Sort them in descending order of dates.
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
medium
213
online_exams
[ "Student_Assessments" ]
Please show the least common assessment for students.
SELECT Assessment FROM Student_Assessments GROUP BY Assessment ORDER BY COUNT(*) ASC LIMIT 1
hard
214
online_exams
[ "Student_Assessments" ]
Which assessment has the smallest frequency count?
SELECT Assessment FROM Student_Assessments GROUP BY Assessment ORDER BY COUNT(*) ASC LIMIT 1
hard
215
online_exams
[ "Student_Answers", "Students" ]
Please show the first names of the students that have at least two answer records.
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
medium
216
online_exams
[ "Student_Answers", "Students" ]
Which students have 2 or more answer records? Give me their first names.
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
medium
217
online_exams
[ "Valid_Answers" ]
What is the most common valid answer text?
SELECT Valid_Answer_Text FROM Valid_Answers GROUP BY Valid_Answer_Text ORDER BY COUNT(*) DESC LIMIT 1
hard
218
online_exams
[ "Valid_Answers" ]
Find the valid answer text that appeared most frequently.
SELECT Valid_Answer_Text FROM Valid_Answers GROUP BY Valid_Answer_Text ORDER BY COUNT(*) DESC LIMIT 1
hard
219
online_exams
[ "Students" ]
List the last names of the students whose gender is not "M".
SELECT Last_Name FROM Students WHERE Gender_MFU != "M"
easy
220
online_exams
[ "Students" ]
What are the last names of the students with gender other than "M"?
SELECT Last_Name FROM Students WHERE Gender_MFU != "M"
easy
221
online_exams
[ "Students" ]
List each gender and the corresponding number of students.
SELECT Gender_MFU , COUNT(*) FROM Students GROUP BY Gender_MFU
medium
222
online_exams
[ "Students" ]
For each gender, return the gender code and the number of students who identify as that gender.
SELECT Gender_MFU , COUNT(*) FROM Students GROUP BY Gender_MFU
medium
223
online_exams
[ "Students" ]
List the last names of the students whose gender is "F" or "M".
SELECT Last_Name FROM Students WHERE Gender_MFU = "F" OR Gender_MFU = "M"
medium
224
online_exams
[ "Students" ]
Which students identify their gender as "F" or "M"? Give me their last names.
SELECT Last_Name FROM Students WHERE Gender_MFU = "F" OR Gender_MFU = "M"
medium
225
online_exams
[ "Student_Answers", "Students" ]
List the first names of the students who do not have any answers.
SELECT First_Name FROM Students WHERE Student_ID NOT IN (SELECT Student_ID FROM Student_Answers)
hard
226
online_exams
[ "Student_Answers", "Students" ]
Which students do not have any answers? Find their first names.
SELECT First_Name FROM Students WHERE Student_ID NOT IN (SELECT Student_ID FROM Student_Answers)
hard
227
online_exams
[ "Student_Answers" ]
Show the student answer texts that received both "Normal" and "Absent" as comments.
SELECT Student_Answer_Text FROM Student_Answers WHERE Comments = "Normal" INTERSECT SELECT Student_Answer_Text FROM Student_Answers WHERE Comments = "Absent"
hard
228
online_exams
[ "Student_Answers" ]
Which student answer texts were given both "Normal" and "Absent" as comments?
SELECT Student_Answer_Text FROM Student_Answers WHERE Comments = "Normal" INTERSECT SELECT Student_Answer_Text FROM Student_Answers WHERE Comments = "Absent"
hard
229
online_exams
[ "Questions" ]
Show the types of questions that have at least three questions.
SELECT Type_of_Question_Code FROM Questions GROUP BY Type_of_Question_Code HAVING count(*) >= 3
easy
230
online_exams
[ "Questions" ]
Which types of questions have 3 or more questions? Return the questions type code.
SELECT Type_of_Question_Code FROM Questions GROUP BY Type_of_Question_Code HAVING count(*) >= 3
easy
231
online_exams
[ "Students" ]
Show all information on students.
SELECT * FROM Students
easy
232
online_exams
[ "Students" ]
What is al the available information of each student?
SELECT * FROM Students
easy
233
customers_and_orders
[ "Addresses" ]
How many addresses do we have?
SELECT count(*) FROM Addresses
easy
234
customers_and_orders
[ "Addresses" ]
Count the number of addresses.
SELECT count(*) FROM Addresses
easy
235
customers_and_orders
[ "Addresses" ]
List all address ids and address details.
SELECT address_id , address_details FROM Addresses
medium
236
customers_and_orders
[ "Addresses" ]
What are all the address ids and address details?
SELECT address_id , address_details FROM Addresses
medium
237
customers_and_orders
[ "Products" ]
How many products do we have?
SELECT count(*) FROM Products
easy
238
customers_and_orders
[ "Products" ]
Count the number of products.
SELECT count(*) FROM Products
easy
239
customers_and_orders
[ "Products" ]
Show all product ids, product type codes, and product name.
SELECT product_id , product_type_code , product_name FROM Products
medium
240
customers_and_orders
[ "Products" ]
What are the ids, type codes, and names for all products?
SELECT product_id , product_type_code , product_name FROM Products
medium
241
customers_and_orders
[ "Products" ]
What is the price for the product with name Monitor?
SELECT product_price FROM Products WHERE product_name = "Monitor"
easy
242
customers_and_orders
[ "Products" ]
Give the price of the Monitor product.
SELECT product_price FROM Products WHERE product_name = "Monitor"
easy
243
customers_and_orders
[ "Products" ]
Show the minimum, average, maximum price for all products.
SELECT min(product_price) , avg(product_price) , max(product_price) FROM Products
medium
244
customers_and_orders
[ "Products" ]
What are the minimum, average, and maximum prices across all products?
SELECT min(product_price) , avg(product_price) , max(product_price) FROM Products
medium
245
customers_and_orders
[ "Products" ]
What is the average price for products with type Clothes?
SELECT avg(product_price) FROM Products WHERE product_type_code = "Clothes"
easy
246
customers_and_orders
[ "Products" ]
Return the average price of Clothes.
SELECT avg(product_price) FROM Products WHERE product_type_code = "Clothes"
easy
247
customers_and_orders
[ "Products" ]
How many hardware type products do we have?
SELECT count(*) FROM Products WHERE product_type_code = "Hardware"
easy
248
customers_and_orders
[ "Products" ]
Count the number of products of the type Hardware.
SELECT count(*) FROM Products WHERE product_type_code = "Hardware"
easy
249
customers_and_orders
[ "Products" ]
Show all product names with price higher than the average.
SELECT product_name FROM Products WHERE product_price > (SELECT avg(product_price) FROM Products)
hard
250
customers_and_orders
[ "Products" ]
What are the names of products that have a price above the average for all products.
SELECT product_name FROM Products WHERE product_price > (SELECT avg(product_price) FROM Products)
hard
251
customers_and_orders
[ "Products" ]
Show all hardware product names with price higher than the average price of hardware type products.
SELECT product_name FROM Products WHERE product_type_code = "Hardware" AND product_price > (SELECT avg(product_price) FROM Products WHERE product_type_code = "Hardware")
extra
252
customers_and_orders
[ "Products" ]
What are the names of Hardware product with prices above the average price of Hardware products.
SELECT product_name FROM Products WHERE product_type_code = "Hardware" AND product_price > (SELECT avg(product_price) FROM Products WHERE product_type_code = "Hardware")
extra
253
customers_and_orders
[ "Products" ]
What is the name of the most expensive product with type Clothes?
SELECT product_name FROM Products WHERE product_type_code = "Clothes" ORDER BY product_price DESC LIMIT 1
hard
254
customers_and_orders
[ "Products" ]
Give the name of the most expensive Clothes product.
SELECT product_name FROM Products WHERE product_type_code = "Clothes" ORDER BY product_price DESC LIMIT 1
hard
255
customers_and_orders
[ "Products" ]
What is the product id and product name for the cheapest Hardware type product?
SELECT product_id , product_name FROM Products WHERE product_type_code = "Hardware" ORDER BY product_price ASC LIMIT 1
hard
256
customers_and_orders
[ "Products" ]
Give the id and name of the cheapest Hardware product.
SELECT product_id , product_name FROM Products WHERE product_type_code = "Hardware" ORDER BY product_price ASC LIMIT 1
hard
257
customers_and_orders
[ "Products" ]
List all product names in descending order of price.
SELECT product_name FROM Products ORDER BY product_price DESC
easy
258
customers_and_orders
[ "Products" ]
What are the names of the products, sorted by descending price?
SELECT product_name FROM Products ORDER BY product_price DESC
easy
259
customers_and_orders
[ "Products" ]
Show all hardware type products in ascending order of price.
SELECT product_name FROM Products WHERE product_type_code = "Hardware" ORDER BY product_price ASC
medium
260
customers_and_orders
[ "Products" ]
What are the names of all Hardware products, sorted by price ascending?
SELECT product_name FROM Products WHERE product_type_code = "Hardware" ORDER BY product_price ASC
medium
261
customers_and_orders
[ "Products" ]
List all product type codes and the number of products in each type.
SELECT product_type_code , count(*) FROM Products GROUP BY product_type_code
medium
262
customers_and_orders
[ "Products" ]
How many products are there for each product type?
SELECT product_type_code , count(*) FROM Products GROUP BY product_type_code
medium
263
customers_and_orders
[ "Products" ]
Show all product type codes and the average price for each type.
SELECT product_type_code , avg(product_price) FROM Products GROUP BY product_type_code
medium
264
customers_and_orders
[ "Products" ]
What is the average price of products for each product type?
SELECT product_type_code , avg(product_price) FROM Products GROUP BY product_type_code
medium
265
customers_and_orders
[ "Products" ]
What are the product type code with at least two products?
SELECT product_type_code FROM Products GROUP BY product_type_code HAVING count(*) >= 2
easy
266
customers_and_orders
[ "Products" ]
Give the product type codes of product types that have two or more products.
SELECT product_type_code FROM Products GROUP BY product_type_code HAVING count(*) >= 2
easy
267
customers_and_orders
[ "Products" ]
What is the product type code with most number of products?
SELECT product_type_code FROM Products GROUP BY product_type_code ORDER BY count(*) DESC LIMIT 1
hard
268
customers_and_orders
[ "Products" ]
What is the most frequent product type code?
SELECT product_type_code FROM Products GROUP BY product_type_code ORDER BY count(*) DESC LIMIT 1
hard
269
customers_and_orders
[ "Customers" ]
How many customers do we have?
SELECT count(*) FROM Customers
easy
270
customers_and_orders
[ "Customers" ]
Count the number of customers.
SELECT count(*) FROM Customers
easy
271
customers_and_orders
[ "Customers" ]
Show all customer ids and customer names.
SELECT customer_id , customer_name FROM Customers
medium
272
customers_and_orders
[ "Customers" ]
What are the ids and names of all customers?
SELECT customer_id , customer_name FROM Customers
medium
273
customers_and_orders
[ "Customers" ]
What is the customer address, customer phone, and customer email for Jeromy?
SELECT customer_address , customer_phone , customer_email FROM Customers WHERE customer_name = "Jeromy"
medium
274
customers_and_orders
[ "Customers" ]
Give the address, phone, and email for customers with the name Jeromy.
SELECT customer_address , customer_phone , customer_email FROM Customers WHERE customer_name = "Jeromy"
medium
275
customers_and_orders
[ "Customers" ]
Show all payment method codes and the number of customers in each code.
SELECT payment_method_code , count(*) FROM Customers GROUP BY payment_method_code
medium
276
customers_and_orders
[ "Customers" ]
How many customers use each payment method?
SELECT payment_method_code , count(*) FROM Customers GROUP BY payment_method_code
medium
277
customers_and_orders
[ "Customers" ]
What is the payment method code used by most number of customers?
SELECT payment_method_code FROM Customers GROUP BY payment_method_code ORDER BY count(*) DESC LIMIT 1
hard
278
customers_and_orders
[ "Customers" ]
Give the code of the payment method that is most commonly used.
SELECT payment_method_code FROM Customers GROUP BY payment_method_code ORDER BY count(*) DESC LIMIT 1
hard
279
customers_and_orders
[ "Customers" ]
Show all customer names with the payment method code used by least number of customers.
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)
hard
280
customers_and_orders
[ "Customers" ]
What are the names of customers who use the least common payment method?
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)
hard
281
customers_and_orders
[ "Customers" ]
What is the payment method and customer number for customer named Jeromy?
SELECT payment_method_code , customer_number FROM Customers WHERE customer_name = "Jeromy"
medium
282
customers_and_orders
[ "Customers" ]
Give the payment method code and customer number corresponding to the customer named Jeromy.
SELECT payment_method_code , customer_number FROM Customers WHERE customer_name = "Jeromy"
medium
283
customers_and_orders
[ "Customers" ]
What are the distinct payment methods used by customers?
SELECT DISTINCT payment_method_code FROM Customers
easy
284
customers_and_orders
[ "Customers" ]
Give the different payment method codes that customers use.
SELECT DISTINCT payment_method_code FROM Customers
easy
285
customers_and_orders
[ "Products" ]
Show the id and the product type for all products, order by product name.
SELECT product_id , product_type_code FROM Products ORDER BY product_name
medium
286
customers_and_orders
[ "Products" ]
What are the ids and product types for all products, sorted alphabetically by product name?
SELECT product_id , product_type_code FROM Products ORDER BY product_name
medium
287
customers_and_orders
[ "Products" ]
What is the product type with least number of products?
SELECT product_type_code FROM Products GROUP BY product_type_code ORDER BY count(*) ASC LIMIT 1
hard
288
customers_and_orders
[ "Products" ]
What is the code of the product type that is least common?
SELECT product_type_code FROM Products GROUP BY product_type_code ORDER BY count(*) ASC LIMIT 1
hard
289
customers_and_orders
[ "Customer_orders" ]
How many customer orders do we have?
SELECT count(*) FROM Customer_orders
easy
290
customers_and_orders
[ "Customer_orders" ]
Count the number of customer orders.
SELECT count(*) FROM Customer_orders
easy
291
customers_and_orders
[ "Customer_orders", "Customers" ]
Show the order ids, order dates, and order status codes for all orders by customer Jeromy.
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"
medium
292
customers_and_orders
[ "Customer_orders", "Customers" ]
What were the ids, dates, and status codes for orders made by Jeromy?
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"
medium
293
customers_and_orders
[ "Customer_orders", "Customers" ]
Show all customer names, ids and the number of orders by each customer.
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
medium
294
customers_and_orders
[ "Customer_orders", "Customers" ]
What are the names, ids, and number of orders made for each customer?
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
medium
295
customers_and_orders
[ "Customer_orders", "Customers" ]
What is the customer id, name, phone, and email for the customer with most 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
extra
296
customers_and_orders
[ "Customer_orders", "Customers" ]
Give the id, name, phone, and email corresponding to the customer who made the most 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
extra
297
customers_and_orders
[ "Customer_orders" ]
Show all order status and the number of orders in each status.
SELECT order_status_code , count(*) FROM Customer_orders GROUP BY order_status_code
medium
298
customers_and_orders
[ "Customer_orders" ]
How many orders have each order status code?
SELECT order_status_code , count(*) FROM Customer_orders GROUP BY order_status_code
medium
299
customers_and_orders
[ "Customer_orders" ]
What is the order status code that is most common?
SELECT order_status_code FROM Customer_orders GROUP BY order_status_code ORDER BY count(*) DESC LIMIT 1
hard