For question “What are our top 3 products by revenue in the New York region?”, SQLCoder-34B-Beta and sqlcoder-7b-2 generated different sql
otyyyywangwenbin-max opened this issue · 2 comments
same ddl same question “What are our top 3 products by revenue in the New York region?”
SQLCoder-34B-Beta generated -> "SELECT p.name,
SUM(s.quantity * s.price) AS total_revenue
FROM sales s
JOIN products p ON s.product_id = p.product_id
JOIN salespeople sp ON s.salesperson_id = sp.salesperson_id
WHERE sp.region = 'New York'
GROUP BY p.name
ORDER BY total_revenue DESC NULLS LAST
LIMIT 3;"
sqlcoder-7b-2 generated -> "SELECT p.name, SUM(s.quantity) AS total_quantity FROM sales s JOIN salespeople sp ON s.salesperson_id = sp.salesperson_id JOIN products p ON s.product_id = p.product_id WHERE sp.region = 'New York' GROUP BY p.name ORDER BY total_quantity DESC NULLS LAST LIMIT 3;"
the main difference is one is “ SUM(s.quantity * s.price) AS total_revenue”, the other is ”SUM(s.quantity) AS total_quantity“