# How to pass table structure to LLM model

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-pass-table-structure-to-llm-model%2F84530%3E%5C
**Category:** Intermediate\
**Created:** [April 30, 2024, 2:04pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-pass-table-structure-to-llm-model%2F84530 "2024-04-30T14:04:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jupetanaveen](https://avatars.discourse-cdn.com/v4/letter/j/e19adc/32.png) [@jupetanaveen](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fjupetanaveen)%5C
**Post date:** [April 30, 2024, 2:04pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-pass-table-structure-to-llm-model%2F84530%2F1 "2024-04-30T14:04:00Z")

</div>

Can anyone know how to get table structure and pass it to LLM model for generating SQL queries.

I want to pass table structure (not entire table) to LLM model and generate sql queries

---

<div class="post-metadata">

**Author:** ![nielsr](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/nielsr/32/39617_2.png) [@nielsr](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fnielsr)%5C
**Post date:** [May 1, 2024, 1:51pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-pass-table-structure-to-llm-model%2F84530%2F2 "2024-05-01T13:51:30Z")

</div>

Sure,

I’d recommend taking a look at the SQLCoder project: [GitHub - defog-ai/sqlcoder: SoTA LLM for converting natural language questions to SQL queries](https://github.com/defog-ai/sqlcoder). They fine-tune open-source LLMs for natural language → SQL and are able to outperform closed-source models such as GPT-4.

---

<div class="post-metadata">

**Author:** ![jupetanaveen](https://avatars.discourse-cdn.com/v4/letter/j/e19adc/32.png) [@jupetanaveen](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fjupetanaveen)%5C
**Post date:** [May 1, 2024, 2:09pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-pass-table-structure-to-llm-model%2F84530%2F3 "2024-05-01T14:09:36Z")

</div>

Thank you for responding,

Currently i’m working on this but i have a doubt here, Everytime we need to pass the table structure and relationship to model. Inseated of passing structure everytime can we automate this process for all the tables
