Log in
Log into community
Find answers from the community
View all posts
Related posts
Did this answer your question?
๐
๐
๐
Powered by
Hall
Inactive
Updated 3 months ago
0
Follow
Multiple tables
Multiple tables
Inactive
0
Follow
J
JonathanMugan
2 years ago
ยท
I'm interested in SQL with multiple tables. I did the tutorial at
https://gpt-index.readthedocs.io/en/latest/examples/query_engine/SQLAutoVectorQueryEngine.html
but that is only a single table, is there an example with multiple tables?
L
J
3 comments
Share
Open in Discord
L
Logan M
2 years ago
It handles multiple tables by default actually!
When you create the SQLDatabase object, you can specify which tables to include if you don't want to include them all
SQLDatabase(engine, include_tables=["table1", ...])
The
table_name
argument you see when constructing the SQL index is only used when you are ingesting new data
L
Logan M
2 years ago
It will automatically handle joins and whatnot between tables
You can also include extra text descriptions (in addition to the automatic schema description) to help improve the text2sql bit (which usually helps quite a bit actually)
J
JonathanMugan
2 years ago
Cool! Thanks!
Add a reply
Sign up and join the conversation on Discord
Join on Discord