AI Execution Details

Execution #18

← Back to History Ask IntentSQL
Question
which customer spent the most in the year 2025. give customer details and the amount spent
Mode
Strict SQL
Response
[
  {
    "Id": 170,
    "Name": "Vikram Nair 170",
    "Email": "customer170@example.com",
    "City": "Vijayawada",
    "Country": "India",
    "AmountSpent": 123447.32
  }
]
Token Usage Think Disabled
Input Tokens
1,584
Output Tokens
161
Reasoning Tokens
0
Total Tokens
1,745
Performance
AI Response Time
4.98 seconds
Total Processing Time
5.24 seconds
SQL Attempts
1
Final SQL
SELECT "customers"."Id", "customers"."Name", "customers"."Email", "customers"."City", "customers"."Country", SUM("order_items"."Quantity" * "order_items"."UnitPrice") AS "AmountSpent"
FROM "customers"
JOIN "orders" ON "customers"."Id" = "orders"."CustomerId"
JOIN "order_items" ON "orders"."Id" = "order_items"."OrderId"
WHERE "orders"."Status" = 'Completed'
  AND EXTRACT(YEAR FROM "orders"."OrderDate") = 2025
GROUP BY "customers"."Id", "customers"."Name", "customers"."Email", "customers"."City", "customers"."Country"
ORDER BY "AmountSpent" DESC
LIMIT 1;
SQL Generation Attempts
Attempt 1
Success 4.98 seconds
Generated SQL
SELECT "customers"."Id", "customers"."Name", "customers"."Email", "customers"."City", "customers"."Country", SUM("order_items"."Quantity" * "order_items"."UnitPrice") AS "AmountSpent"
FROM "customers"
JOIN "orders" ON "customers"."Id" = "orders"."CustomerId"
JOIN "order_items" ON "orders"."Id" = "order_items"."OrderId"
WHERE "orders"."Status" = 'Completed'
  AND EXTRACT(YEAR FROM "orders"."OrderDate") = 2025
GROUP BY "customers"."Id", "customers"."Name", "customers"."Email", "customers"."City", "customers"."Country"
ORDER BY "AmountSpent" DESC
LIMIT 1;