File size: 2,906 Bytes
087b0d6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Few Shot Learnings
example = [
    {   'Question': "Top 10 stores with highest sales and the number of transactions",
        'SQLQuery': "SELECT store_number, COUNT(store_number) AS num_transactions FROM sales GROUP BY store_number ORDER BY SUM(sale_price) DESC;",
        'SQLResult': "Result of the SQL query",
        'Answer': "answer"
    },
    {   'Question': "List of all stores transactions for Sheri Williams",
        'SQLQuery': "SELECT customer_id, product, quantity, sale_price, sales_channel FROM sales WHERE name = 'Sheri Williams' AND sales_channel = 'st'",
        'SQLResult': "Result of the SQL Query",
        'Answer': "answer"
    },
    {   'Question': "Top customer who bought product7 the most in store",
        'SQLQuery': "SELECT customer_id, name, count(product) as total_product7_purchases from sales where product = 'Product7' and store_number = 1365 group by customer_id, name ORDER BY total_product7_purchases DESC LIMIT 10",
        'SQLResult': "Result of the SQL Query",
        'Answer': "answer"
    },
    {
        'Question': "List of all online transactions for Sheri Williams",
        'SQLQuery': "SELECT customer_id, product, quantity, sale_price, sales_channel FROM sales WHERE name = 'Sheri Williams' AND sales_channel = 'ol'",
        'SQLResult': "Result of the SQL query",
        'Answer': "answer"   
    },
        {
        'Question': "find the product with the highest sales in store 4057",
        'SQLQuery': "SELECT product, SUM(sale_price) as total_sales_amount FROM sales WHERE store_number = 4057 GROUP BY product ORDER BY total_sales_amount DESC LIMIT 1;",
        'SQLResult': "Result of the SQL query",
        'Answer': "answer"   
    },
    {
        'Question': "List of all sales transactions in the last 1 week",
        'SQLQuery': "SELECT customer_id, product, quantity, sale_price, sales_channel, date FROM sales WHERE date >= CURDATE() - INTERVAL 1 WEEK;",
        'SQLResult': "Result of the SQL query",
        'Answer': "answer"   
    },
    {
        'Question': "List of all sales transactions this week",
        'SQLQuery': "SELECT customer_id, product, quantity, sale_price, sales_channel, date FROM sales WHERE date >= CURDATE() - INTERVAL DAYOFWEEK(CURDATE())-1 DAY AND date < CURDATE() + INTERVAL 1 DAY;",
        'SQLResult': "Result of the SQL query",
        'Answer': "answer"   
    },
    {
        'Question': " Top 10 stores with highest sales and the number of transactions with sales amount & store associate name",
        'SQLQuery': "SELECT s.store_number, COUNT(s.store_number) AS num_transactions, SUM(s.sale_price) AS total_sales, st.store_associate FROM sales s JOIN stores st ON s.store_number = st.store_number GROUP BY s.store_number ORDER BY total_sales DESC;",
        'SQLResult': "Result of the SQL query",
        'Answer': "answer"   
    }
]