Unlock Database Insights Without Writing Code
PlainQuery transforms how you extract value from your databases. Use natural language to generate powerful queries — no SQL expertise required.
Find our top 5 customers by total order value this year
SELECT
c.customer_id,
c.name,
c.email,
SUM(o.total_amount) as total_spent
FROM customers c
JOIN orders o ON c.customer_id = o.customer_id
WHERE o.order_date >= DATE_TRUNC('year', CURRENT_DATE)
AND o.order_date <= CURRENT_DATE
AND o.status = 'completed'
GROUP BY c.customer_id, c.name, c.email
ORDER BY total_spent DESC
LIMIT 5;
Estimated rows: 5 | Execution time: ~0.15s