We are excited to introduce Chat2Query (beta), a revolutionary natural language query generator powered by Pre-trained Transformer 3 (GPT-3), the technology behind ChatGPT, and TiDB, the distributed SQL database.
With Chat2Query, you don’t need to be an SQL expert to extract insights from your data. Simply ask a question and the AI tool will do the rest, generating a powerful SQL query to retrieve the insights. By combining OpenAI and TiDB, we utilize AI to innovate the database and aid in data exploration, providing real-time and actionable insights for instant business decisions.
In this post, we’ll show you how to get started with the AI-powered Chat2Query and explore insights through sample datasets and your own datasets.
Yes, there are several AI-powered SQL generators available that can help users generate SQL queries without needing to have extensive knowledge of the SQL language. However, these AI tools are best suited for generating simple queries. This means they may not be suitable for more complex tasks or production use.
Chat2Query is powered by:
By using these two technologies, Chat2Query can handle even the most complex queries and offer real-time insights into dynamic datasets.
In the following examples, we use Chat2Query to generate two queries against different datasets:
Chat2Query is an integrated feature in TiDB Cloud Serverless Tier. You can take the following steps to get started:
Sign up for a TiDB Cloud account using your email, Google account, or GitHub account. Your Serverless Tier cluster will be created automatically in less than 20 seconds, and you will be directed to the Chat2Query interface.
You can either use the sample datasets to quickly explore Chat2Query or explore insights on your own datasets.
Using the sample datasets
By default, you will query against the sample_data
table with four preset datasets – github_events
, global_fortune_500
, imdb_movie_ratings
, and sold_car_orders
.
Using your datasets
For starters, get your target datasets ready. If you don’t have any, you can get one from free dataset hosting websites such as Kaggle.
Under the Schemas tab, click ...
to the right of the target database, and click Import Data to start importing your dataset either in local CSV format or from Amazon S3. In our case, we use eth-usdt
, the Ethereum/Tether crypto price dataset in CSV.
Follow the prompts to configure the import source and target and start importing. The time it takes varies depending on the size of the data. When the import is done, the import detail window is displayed.
The privacy and security of user data is our top priority. We understand that our users trust us to protect their information and we take that responsibility seriously. As a query service on TiDB Cloud, Chat2Query only needs to access your database schema to generate SQL, and not your actual data.
As a beta project, Chat2Query is still in development with a lot of room for improvement.
Therefore, there are two limitations to keep in mind:
CREATE TABLE
and DROP TABLE
are not supported yet.You can obtain early access here. We’d love to hear your feedback so we can make this query tool even better.
In the meantime, Chat2Query is in rapid development. Please follow us on Twitter to stay up-to-date on its progress.
Have a question or comment about the article? Visit the TiDB Forum
Also Published Here