Chain-of-Table: How to Talk to Your Data Directly? š
The idea of Text2SQL isnāt groundbreaking: instead of crafting SQL queries yourself, you pose a regular English question, and AI translates it into SQL queries customized to your databaseās data frame and schema. This translation process is facilitated by Large Language Models (LLMs).
We successfully deployed Text2SQL internally at our previous company, promoting data self-service and facilitating the onboarding process for new data scientists. This implementation showed substantial potential in reducing the workload for the data BI team.
In addition to Text2SQL, there are alternative methods for interacting with your data without manual coding or relying on BI tools. One such method is through the use of the DataDM tool, which weāve previously introduced:
In todayās discussion, weāll introduce the latest solution, using the āChain-of-Tableā technique. This approach enables a step-by-step table reasoning process, allowing operations like adding columns, row selection, grouping, and sorting. It mirrors the concise data representation methods used by data scientists. š
What is Chain-of-Table?
As the name suggests, in addition to your input table, there exists a āchain of tables.ā These tables serve as intermediate steps generated through the Large Language Model (LLM) reasoning process. They are interconnected in a āchainā because they play a role in a series of operations determined by the LLM, addressing your user query about the dataset.
Letās walk through an example query to understand the full process: āWhich country had the most cyclists finish within the top 3?ā While the source input data may be simple, constructing a query to solve this problem is not straightforward. The ācountryā information is embedded in the āCyclistā column within parentheses.
How would you approach solving this question?


Essentially, this illustrates how the LLM tackles the challenge through a sequence of reasoning steps.
Curious to delve deeper into this method?
Watch Professor Mehdi explain the āchain-of-tableā method in real-time in the video below!š
Subscribe to Our YouTube Channel!
We are kicking off our YouTube channel in the new year, and we invite you on board as we walk you through some of these intricacies about AI, fueled by the feedback from our readers, friends and colleagues!
We want to make our channel about AI for everyone. Similar to this newsletter, weāll talk about new AI products, the latest trends, the nitty-gritty engineering stuff, career insights for AI enthusiasts, and, of course, one of our favorite topics ā the entrepreneurial side of AI ā š„³
weāre here to show you how you can ride the AI wave and be your own entrepreneur using the cool tools available in the market.







