Find answers from the community

Updated last year

SQL

At a glance
Using SQLTableRetrieverQueryEngine, Im following this demo: https://docs.llamaindex.ai/en/stable/examples/index_structs/struct_indices/SQLIndexDemo.html
the problem is I have to pass the exact keyword for the value, for example 'How many orders with status cancelled?' doesnt work but 'How many orders with status Cancelled?' works.
How can I improve/make it more generic
Attachment
image.png
W
T
4 comments
During SQL formation it is checking for status=cancelled maybe that's why it is failing as there are no records for this label.

One way would be You could insert the labels in the db in smallcase and before passing your query you pass it like query.lower() to the query_engine
won't this return supposedly capitalized labels as uncap too ? πŸ€”
Yeah, but since all the labels are in smallcase, there won't be any issue in there I guess!
Thanks, this method should do for now
Add a reply
Sign up and join the conversation on Discord