defog-ai / sqlcoder

SoTA LLM for converting natural language questions to SQL queries
Apache License 2.0
3.42k stars 218 forks source link

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 #90

Closed otyyyywangwenbin-max closed 7 months ago

otyyyywangwenbin-max commented 8 months ago

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“

github-actions[bot] commented 7 months ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 7 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.