When I try to convert the natural language to SQL query , I am getting different queries for the same prompt.How to avoid this issue?
1)If I ask How many customers logged in today ?the model send a response as
SELECT COUNT(*)
FROM usage.Fact_DailyLogins
WHERE Date = GETDATE()"
If I execute this query , it has returned 0.
2)If I ask ,mention the customers who have logged in today?the model response as
“SELECT c.Name
FROM dbo.Customer c
JOIN usage.Fact_DailyLogins dl ON c.Id = dl.CustomerId
WHERE dl.Date = CAST(GETDATE() AS DATE)”
If I execute this query It has returned nine customers.
Table structure:
CustomerId - Unique Id for each customers
userId -Unique Id for each users
Date - Login data
Count - Number of times logged-in per day
llm #CONVERTING NATURAL LANGUAGE TO SQL QUERY #SQL QUERY GENERATOR