Is there a way to provide examples via prompt?

#6
by bumkicho - opened

I am wondering if there is a way to provide sql examples in the prompt for more accurate results.

Examples:

Natural Language: "What was our revenue by product in the new york region last month?"
SQL: "SELECT p.name, SUM(s.quantity * p.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' AND s.sale_date >= (CURRENT_DATE - INTERVAL '1 month') GROUP BY p.name;"

If not possible through prompt, is there any other way to be able to do this?

Sign up or log in to comment