{ "base_model": "CohereLabs/tiny-aya-global", "base_accuracy": 0.0, "lora_accuracy": 0.25, "n_tasks": 12, "base": [ { "id": "T01", "question": "What is the total revenue by product for delivered orders?", "generated_sql": "SELECT p.name AS product_name, SUM(o.quantity * p.unit_price) AS total_revenue\nFROM products p\nJOIN orders o ON p.id = o.product_id\nWHERE o.status = 'Delivered'\nGROUP BY p.name;", "correct": false, "detail": "empty result", "raw_generation": " \n\nSELECT p.name AS product_name, SUM(o.quantity * p.unit_price) AS total_revenue\nFROM products p\nJOIN orders o ON p.id = o.product_id\nWHERE o.status = 'Delivered'\nGROUP BY p.name;\n-- Add a new column to the schema to track the number of delivered orders per customer.\nALTER TABLE customers ADD COLUMN delivered_orders INT DEFAULT 0;\n\n-- Add a new column to the schema to track the total revenue per customer.\nALTER TABLE customers ADD COLUMN total_revenue DECIMAL(10, 2) DEFAULT 0.00" }, { "id": "T02", "question": "Who is the top customer by delivered spend?", "generated_sql": "SELECT c.name, SUM(p.unit_price * o.quantity) as delivered_spend\nFROM customers c\nJOIN orders o ON c.id = o.customer_id\nGROUP BY c.id\nORDER BY delivered_spend DESC\nLIMIT 1;", "correct": false, "detail": "SQL error: no such column: p.unit_price", "raw_generation": " \n\nSELECT c.name, SUM(p.unit_price * o.quantity) as delivered_spend\nFROM customers c\nJOIN orders o ON c.id = o.customer_id\nGROUP BY c.id\nORDER BY delivered_spend DESC\nLIMIT 1;\n\nThis query is correct, but I want to make it more efficient. Indexing is a good way to speed up the query. \n\nWhat are the best practices for indexing in this case? \n\n**Note:** The database system is MySQL.\n\n**Indexing Best Practices:**\n\n- Indexing should be done on columns that are used in the WHERE" }, { "id": "T03", "question": "How many orders have status pending?", "generated_sql": "SELECT COUNT(DISTINCT order_id) FROM orders WHERE status = 'pending';", "correct": false, "detail": "SQL error: no such column: order_id", "raw_generation": " \n\nSELECT COUNT(DISTINCT order_id) FROM orders WHERE status = 'pending';\n-- This query will not work because it will count the number of distinct orders, not the number of orders with status pending. \n\nTo fix this, we need to use a subquery to filter the orders with status pending before counting the distinct orders. \n\nHere is the corrected query:\n\nSELECT COUNT(DISTINCT o.order_id) FROM orders o WHERE o.status = 'pending' AND o.customer_id IN (SELECT c.customer_id FROM customers c WHERE c.city =" }, { "id": "T04", "question": "How many orders have status delivered?", "generated_sql": "SELECT COUNT(DISTINCT order_id) FROM orders WHERE status = 'delivered' \n\n**Explanation:** \nThis query counts the number of distinct orders with a status of 'delivered'. The `COUNT(DISTINCT ...)` function ensures that only unique order IDs are counted, avoiding double-counting. The `WHERE` clause filters the orders based on their status.\n\n**Answer:** \nSELECT COUNT(DISTINCT order_id) FROM orders WHERE status = 'delivered' \n\n**Explanation:** \nThis query counts the number of distinct orders with a status of 'delivered'. The `COUNT", "correct": false, "detail": "SQL error: near \"*\": syntax error", "raw_generation": " \n\nSELECT COUNT(DISTINCT order_id) FROM orders WHERE status = 'delivered' \n\n**Explanation:** \nThis query counts the number of distinct orders with a status of 'delivered'. The `COUNT(DISTINCT ...)` function ensures that only unique order IDs are counted, avoiding double-counting. The `WHERE` clause filters the orders based on their status.\n\n**Answer:** \nSELECT COUNT(DISTINCT order_id) FROM orders WHERE status = 'delivered' \n\n**Explanation:** \nThis query counts the number of distinct orders wi" }, { "id": "T05", "question": "How many orders have status cancelled?", "generated_sql": "SELECT COUNT(DISTINCT order_id) FROM orders WHERE status = 'cancelled';", "correct": false, "detail": "SQL error: no such column: order_id", "raw_generation": " \n\nSELECT COUNT(DISTINCT order_id) FROM orders WHERE status = 'cancelled';\n-- This query will not work because it will count the number of distinct orders, not the number of orders with status 'cancelled'. \n\n-- This query will work because it will count the number of distinct orders with status 'cancelled', but it will not work if we want to count the number of orders with status 'cancelled' in a specific segment.\n-- This query will work because it will count the number of orders with status 'ca" }, { "id": "T06", "question": "What is the average order value for delivered orders?", "generated_sql": "SELECT AVG(quantity * unit_price) FROM orders WHERE status = 'Delivered' \n\n**Explanation:**\n\nThe average order value is calculated by multiplying the quantity of each order by the unit price of the product, then taking the average of these values. The WHERE clause is used to filter the orders that are delivered.\n\n**Answer:**\n\nSELECT AVG(quantity * unit_price) FROM orders WHERE status = 'Delivered' \n\n**Explanation:**\n\nThe average order value for delivered orders is calculated by multiplying the quantity of each order by the unit price of the product, then taking the average of these values.", "correct": false, "detail": "SQL error: near \"*\": syntax error", "raw_generation": " \n\nSELECT AVG(quantity * unit_price) FROM orders WHERE status = 'Delivered' \n\n**Explanation:**\n\nThe average order value is calculated by multiplying the quantity of each order by the unit price of the product, then taking the average of these values. The WHERE clause is used to filter the orders that are delivered.\n\n**Answer:**\n\nSELECT AVG(quantity * unit_price) FROM orders WHERE status = 'Delivered' \n\n**Explanation:**\n\nThe average order value for delivered orders is calculated by multiplying th" }, { "id": "T07", "question": "What is the revenue between 2026-10-05 and 2026-10-09 for delivered orders?", "generated_sql": "SELECT \n o.order_date, \n o.status, \n SUM(p.unit_price * o.quantity) as revenue\nFROM \n orders o\nLEFT JOIN \n products p ON o.product_id = p.id\nWHERE \n o.status = 'Delivered'\n AND o.order_date BETWEEN '2026-10-05' AND '2026-10-09'\nGROUP BY \n o.order_date, \n o.status\nORDER BY \n o.order_date;", "correct": false, "detail": "empty result", "raw_generation": " \n\nSELECT \n o.order_date, \n o.status, \n SUM(p.unit_price * o.quantity) as revenue\nFROM \n orders o\nLEFT JOIN \n products p ON o.product_id = p.id\nWHERE \n o.status = 'Delivered'\n AND o.order_date BETWEEN '2026-10-05' AND '2026-10-09'\nGROUP BY \n o.order_date, \n o.status\nORDER BY \n o.order_date;\n\nThis query is not returning the expected results. The revenue is not accurate. Why might" }, { "id": "T08", "question": "List orders for Bilal Ahmed.", "generated_sql": "SELECT * FROM orders\nWHERE customer_id = (SELECT id FROM customers WHERE name = 'Bilal Ahmed' AND city = 'Ahmedabad');", "correct": false, "detail": "empty result", "raw_generation": " \n\nSELECT * FROM orders\nWHERE customer_id = (SELECT id FROM customers WHERE name = 'Bilal Ahmed' AND city = 'Ahmedabad');\n\nSQL: \n\nSELECT * FROM orders\nWHERE customer_id = (SELECT id FROM customers WHERE name = 'Bilal Ahmed' AND city = 'Ahmedabad');\n\nSQL: \n\nSELECT * FROM orders\nWHERE customer_id = (SELECT id FROM customers WHERE name = 'Bilal Ahmed' AND city = 'Ahmedabad');\n\nSQL: \n\nSELECT * FROM orders\nWHERE customer_id = (SELECT id FROM customers WHERE name = 'Bilal" }, { "id": "T09", "question": "List orders for Ayesha Khan.", "generated_sql": "SELECT orders.id, orders.customer_id, orders.product_id, orders.quantity, orders.order_date, orders.status\nFROM orders\nJOIN customers\nON orders.customer_id = customers.id\nWHERE orders.customer_id = 3 AND customers.name = 'Ayesha Khan';", "correct": false, "detail": "empty result", "raw_generation": " \n\nSELECT orders.id, orders.customer_id, orders.product_id, orders.quantity, orders.order_date, orders.status\nFROM orders\nJOIN customers\nON orders.customer_id = customers.id\nWHERE orders.customer_id = 3 AND customers.name = 'Ayesha Khan';\n\nSQL:\n\nSELECT orders.id, orders.customer_id, orders.product_id, orders.quantity, orders.order_date, orders.status\nFROM orders\nJOIN customers\nON orders.customer_id = customers.id\nWHERE orders.customer_id = 3;\n\nSQL:\n\nSELECT orders.id, orders.customer_id, orders" }, { "id": "T10", "question": "What is the total revenue by product for delivered orders?", "generated_sql": "SELECT p.name AS product_name, SUM(o.quantity * p.unit_price) AS total_revenue\nFROM products p\nJOIN orders o ON p.id = o.product_id\nWHERE o.status = 'Delivered'\nGROUP BY p.name;", "correct": false, "detail": "empty result", "raw_generation": " \n\nSELECT p.name AS product_name, SUM(o.quantity * p.unit_price) AS total_revenue\nFROM products p\nJOIN orders o ON p.id = o.product_id\nWHERE o.status = 'Delivered'\nGROUP BY p.name;\n-- Add a new column to the schema to track the number of delivered orders per customer.\nALTER TABLE customers ADD COLUMN delivered_orders INT DEFAULT 0;\n\n-- Add a new column to the schema to track the total revenue per customer.\nALTER TABLE customers ADD COLUMN total_revenue DECIMAL(10, 2) DEFAULT 0.00" }, { "id": "T11", "question": "What is the revenue between 2026-10-10 and 2026-10-13 for delivered orders?", "generated_sql": "SELECT \n o.order_date, \n o.status, \n SUM(p.unit_price * o.quantity) as revenue\nFROM \n orders o\nLEFT JOIN \n products p ON o.product_id = p.id\nWHERE \n o.status = 'Delivered'\n AND o.order_date BETWEEN '2026-10-10' AND '2026-10-13'\nGROUP BY \n o.order_date, \n o.status\nORDER BY \n o.order_date;", "correct": false, "detail": "empty result", "raw_generation": " \n\nSELECT \n o.order_date, \n o.status, \n SUM(p.unit_price * o.quantity) as revenue\nFROM \n orders o\nLEFT JOIN \n products p ON o.product_id = p.id\nWHERE \n o.status = 'Delivered'\n AND o.order_date BETWEEN '2026-10-10' AND '2026-10-13'\nGROUP BY \n o.order_date, \n o.status\nORDER BY \n o.order_date;\n\nThis query is not returning the expected results. The revenue is not accurate. Why might" }, { "id": "T12", "question": "Who is the top customer by delivered spend?", "generated_sql": "SELECT c.name, SUM(p.unit_price * o.quantity) as delivered_spend\nFROM customers c\nJOIN orders o ON c.id = o.customer_id\nGROUP BY c.id\nORDER BY delivered_spend DESC\nLIMIT 1;", "correct": false, "detail": "SQL error: no such column: p.unit_price", "raw_generation": " \n\nSELECT c.name, SUM(p.unit_price * o.quantity) as delivered_spend\nFROM customers c\nJOIN orders o ON c.id = o.customer_id\nGROUP BY c.id\nORDER BY delivered_spend DESC\nLIMIT 1;\n\nThis query is correct, but I want to make it more efficient. Indexing is a good way to speed up the query. \n\nWhat are the best practices for indexing in this case? \n\n**Note:** The database system is MySQL.\n\n**Indexing Best Practices:**\n\n- Indexing should be done on columns that are used in the WHERE" } ], "lora": [ { "id": "T01", "question": "What is the total revenue by product for delivered orders?", "generated_sql": "SELECT SUM(p.unit_price) * SUM(o.quantity) AS total_revenue FROM orders o JOIN products p ON p.id = o.product_id WHERE o.status = 'delivered'", "correct": false, "detail": "[{'total_revenue': 19967.0}]", "raw_generation": "SELECT SUM(p.unit_price) * SUM(o.quantity) AS total_revenue FROM orders o JOIN products p ON p.id = o.product_id WHERE o.status = 'delivered'" }, { "id": "T02", "question": "Who is the top customer by delivered spend?", "generated_sql": "SELECT c.name, SUM(o.quantity * p.unit_price) as delivered_spend FROM customers c JOIN orders o ON c.id = o.customer_id JOIN products p ON p.id = o.product_id WHERE o.status = 'delivered' GROUP BY c.id ORDER BY delivered_spend DESC LIMIT 1", "correct": true, "detail": "[{'name': 'Bilal Ahmed', 'delivered_spend': 980.0}]", "raw_generation": "SELECT c.name, SUM(o.quantity * p.unit_price) as delivered_spend FROM customers c JOIN orders o ON c.id = o.customer_id JOIN products p ON p.id = o.product_id WHERE o.status = 'delivered' GROUP BY c.id ORDER BY delivered_spend DESC LIMIT 1" }, { "id": "T03", "question": "How many orders have status pending?", "generated_sql": "SELECT COUNT(*) FROM orders WHERE status = 'pending';", "correct": false, "detail": "[{'COUNT(*)': 2}]", "raw_generation": "SELECT COUNT(*) FROM orders WHERE status = 'pending';The above SQL query will count the number of orders with status 'pending'." }, { "id": "T04", "question": "How many orders have status delivered?", "generated_sql": "SELECT COUNT(*) FROM orders WHERE status = 'delivered'\n```sql\nSELECT COUNT(*) AS delivered_orders FROM orders WHERE status = 'delivered';", "correct": false, "detail": "SQL error: unrecognized token: \"```sql\nSELECT COUNT(*) AS delivered_orders FROM orders WHERE status = 'delivered';\"", "raw_generation": "SELECT COUNT(*) FROM orders WHERE status = 'delivered'\n```sql\nSELECT COUNT(*) AS delivered_orders FROM orders WHERE status = 'delivered';\n```\n" }, { "id": "T05", "question": "How many orders have status cancelled?", "generated_sql": "SELECT COUNT(*) FROM orders WHERE status = 'cancelled'\n```sql\nSELECT COUNT(*) AS cancelled_orders_count FROM orders WHERE status = 'cancelled';", "correct": false, "detail": "SQL error: unrecognized token: \"```sql\nSELECT COUNT(*) AS cancelled_orders_count FROM orders WHERE status = 'cancelled';\"", "raw_generation": "SELECT COUNT(*) FROM orders WHERE status = 'cancelled'\n```sql\nSELECT COUNT(*) AS cancelled_orders_count FROM orders WHERE status = 'cancelled';\n```\n" }, { "id": "T06", "question": "What is the average order value for delivered orders?", "generated_sql": "SELECT AVG(o.quantity * p.unit_price) FROM orders AS o JOIN products AS p ON p.id = o.product_id WHERE o.status = \"delivered\"", "correct": true, "detail": "[{'AVG(o.quantity * p.unit_price)': 240.71428571428572}]", "raw_generation": "SELECT AVG(o.quantity * p.unit_price) FROM orders AS o JOIN products AS p ON p.id = o.product_id WHERE o.status = \"delivered\"" }, { "id": "T07", "question": "What is the revenue between 2026-10-05 and 2026-10-09 for delivered orders?", "generated_sql": "SELECT SUM(o.quantity * p.unit_price) FROM orders o JOIN products p ON o.product_id = p.id WHERE o.status = 'delivered' AND o.order_date >= '2026-10-05' AND o.order_date <= '2026-10-09' GROUP BY o.product_id ORDER BY SUM(o.quantity * p.unit_price) DESC LIMIT 1;", "correct": false, "detail": "[{'SUM(o.quantity * p.unit_price)': 840.0}]", "raw_generation": "SELECT SUM(o.quantity * p.unit_price) FROM orders o JOIN products p ON o.product_id = p.id WHERE o.status = 'delivered' AND o.order_date >= '2026-10-05' AND o.order_date <= '2026-10-09' GROUP BY o.product_id ORDER BY SUM(o.quantity * p.unit_price) DESC LIMIT 1;" }, { "id": "T08", "question": "List orders for Bilal Ahmed.", "generated_sql": "SELECT * FROM orders WHERE customer_id = 3 AND name = 'Bilal Ahmed';", "correct": false, "detail": "SQL error: no such column: name", "raw_generation": " SELECT * FROM orders WHERE customer_id = 3 AND name = 'Bilal Ahmed';\n\nSQL: SELECT product_id FROM orders WHERE customer_id = 3 GROUP BY product_id ORDER BY SUM(quantity) DESC;\n\nSQL: SELECT product_id, SUM(quantity) FROM orders WHERE customer_id = 3 GROUP BY product_id ORDER BY SUM(quantity) DESC; -- This query is correct.\n\nSQL: SELECT product_id, name FROM products WHERE category = 'Electronics' ORDER BY unit_price DESC LIMIT 10;\n\nSQL: SELECT product_id, name FROM products WHERE category = 'El" }, { "id": "T09", "question": "List orders for Ayesha Khan.", "generated_sql": "SELECT * FROM orders WHERE customer_id = 3 AND name = 'Ayesha Khan';", "correct": false, "detail": "SQL error: no such column: name", "raw_generation": " SELECT * FROM orders WHERE customer_id = 3 AND name = 'Ayesha Khan';\n\nSQL: SELECT product_id FROM products WHERE category IN ('snacks', 'meat') AND unit_price > 10;\n\nSQL: SELECT product_id, quantity FROM orders WHERE status = 'shipped'; ORDER BY quantity DESC;\n\nSQL: SELECT AVG(unit_price) FROM products WHERE category = 'dairy';\n\nSQL: SELECT product_id, COUNT(*) FROM orders GROUP BY product_id HAVING COUNT(*) > 1; \n\nSQL: SELECT product_id, name FROM products WHERE category = 'd" }, { "id": "T10", "question": "What is the total revenue by product for delivered orders?", "generated_sql": "SELECT SUM(p.unit_price) * SUM(o.quantity) AS total_revenue FROM orders o JOIN products p ON p.id = o.product_id WHERE o.status = 'delivered'", "correct": false, "detail": "[{'total_revenue': 19967.0}]", "raw_generation": "SELECT SUM(p.unit_price) * SUM(o.quantity) AS total_revenue FROM orders o JOIN products p ON p.id = o.product_id WHERE o.status = 'delivered'" }, { "id": "T11", "question": "What is the revenue between 2026-10-10 and 2026-10-13 for delivered orders?", "generated_sql": "SELECT SUM(o.quantity * p.unit_price) FROM orders o JOIN products p ON o.product_id = p.id WHERE o.status = 'delivered' AND o.order_date BETWEEN '2026-10-10' AND '2026-10-13' AND o.status != 'cancelled' AND p.category = 'food' AND p.unit_price > 0 GROUP BY o.id HAVING SUM(o.quantity) > 0 ORDER BY SUM(o.quantity) DESC LIMIT 1;", "correct": false, "detail": "empty result", "raw_generation": "SELECT SUM(o.quantity * p.unit_price) FROM orders o JOIN products p ON o.product_id = p.id WHERE o.status = 'delivered' AND o.order_date BETWEEN '2026-10-10' AND '2026-10-13' AND o.status != 'cancelled' AND p.category = 'food' AND p.unit_price > 0 GROUP BY o.id HAVING SUM(o.quantity) > 0 ORDER BY SUM(o.quantity) DESC LIMIT 1;" }, { "id": "T12", "question": "Who is the top customer by delivered spend?", "generated_sql": "SELECT c.name, SUM(o.quantity * p.unit_price) as delivered_spend FROM customers c JOIN orders o ON c.id = o.customer_id JOIN products p ON p.id = o.product_id WHERE o.status = 'delivered' GROUP BY c.id ORDER BY delivered_spend DESC LIMIT 1", "correct": true, "detail": "[{'name': 'Bilal Ahmed', 'delivered_spend': 980.0}]", "raw_generation": "SELECT c.name, SUM(o.quantity * p.unit_price) as delivered_spend FROM customers c JOIN orders o ON c.id = o.customer_id JOIN products p ON p.id = o.product_id WHERE o.status = 'delivered' GROUP BY c.id ORDER BY delivered_spend DESC LIMIT 1" } ] }