Link 🔗 https://bit.ly/4hEyHq4 In this video, I introduce Chat2DB, an AI-powered SQL generator simplifying database management. I cover how to connect various databases, set up AI data collections, and generate SQL queries using natural language. I also demonstrate creating tables and visualizing data effortlessly with built-in tools. Ideal for those looking to gain actionable insights from their data quickly. 00:00 Introduction to Chat2DB 00:10 Getting Started with Chat2DB 00:35 Connecting to a Database 01:21 Setting Up AI Data Collection 03:09 Generating SQL from Natural Language 04:34 Creating Tables with AI 05:30 Generating Test Data 05:45 Creating Custom Dashboards 08:04 AI-Driven Data Analysis 09:36 Working with Excel and CSV Files 10:09 Conclusion and Use Cases
--- type: transcript date: 2025-02-10 youtube_id: Nmxozp7FyvM --- # Transcript: Chat2DB: AI-Powered SQL Generator for Simplifying Database Management in this video I'm going to be showing you chat to DB which is an AIS SQL generator for easy database management I'm going to go through the platform show you what it can do as well as how you can get started with leveraging it to get started there are a few different options first up if you're interested in checking out their open source repository I encourage you to start it while you're on the page here and if you go down here you'll be able to see all of the different features that are within the open source version as well as compared to the local and pro version so in this video I'm going to show you the example with the desktop app that I have in this is what the interface looks like you see one of my connections to a postrest database that I have now if you want to add in a new connection what you can do is you can go ahead select new connection you'll see within this list I believe there's over 24 different options here they have both relational as well as non-relational databases within here if you want to use things like postgress MySQL they also have mongod DB so so pretty much regardless of the database that you're using there is a high likelihood that it will be natively supported within here in this example I'm going to connect to a MySQL server and what you can do within here you can just go ahead and connect to your host here I'm going to go ahead and plug in my information here and what you can do while you're within here you can go and test your connection before you save it out just to make sure that the connection is successful you can see at the top there it was successful so go ahead we'll save this out and then as soon as you're connected you'll have this modal popup that says would you like to set up the AI data collection now what you can do you can go ahead and click affirm what the AI data collection is is we see this folder here and within here you can create AI data collection if I just call this developers data I'll go ahead and I'll save that out what I can do within here is I can select the database that I want to use and then you can go ahead and select all the tables within that database that you want to sync to and you can just click sync to the AI data collection here I'll just select developers data I'll go ahead and I'll affirm that and so once it's all set I can go to our data on the left hand side here we have developers data now if I expand that what you can do is with each table if I go to the customers for instance and I double click on that you'll see within here we have the column name but we also can add in these AI column comments if you just double click on one of these fields you can say this is the customer's ID that XYZ where this is helpful is there's a great example on their homepage here where it shows a value of arpu where that's average revenue per user that can be helpful if you give that information to the language model that's under the hood to be able to understand what these values actually mean because sometimes they might seem arbitrary or they might not be clearly indicated within the column names that you have you can just go through these and say the name of the email address for the employee the age of the employee and so on and so forth if you're using this to get the best results I really encourage you to map and give the best descriptions that you can to the AI colum field because ultimately you will get better results next I want to show you how it can generate SQL from natural language what you can do is if I just rightclick on our database here you can go to query console and within here to invoke the AI you can just do a forward slash and within here you can just start writing in natural language what you'd like to query now what you can do is you can go ahead and select your data collection here if I select developers data I can affirm that and then I'll just go ahead and I'll say how many sales were there last month I'll submit that and very quickly you'll see it will generate the SQL for us you can edit it within here as well you can see all the syntax highlighting we can go ahead and test it right within here as well and then here we can see the number of sales last month were zero let's say the average price of an item I'll go ahead and I'll run this and we see that the average price of an item is 200 200 thereabouts something else that I want to highlight that is really helpful within the editor is as you start to write out your SQL queries it will actually start to autocomplete based on the tables and schema and everything that you have this makes it incredibly helpful for whatever you're trying to do because whether you like to write these things manually but oftentimes might forget what the name of a particular column is or what the schema is of your database this will definitely help you along the way with writing your queries by being able to map and see what's already within your existing schema next what I want to show you is the AI table creation if you go within your database and then you select a particular table let's go in our tables if we right click it here if we go to create table within here we'll see the table co-pilot let's just say we have a hypothetical table that's going to be called future items it's going to be products date arrival and the price I'll just go ahead and submit that and what you'll see here is the SQL to generate that table and within here you can see it generated The Columns for us it generated the type of each value so we can see the different types that it added for products as well as price the size even whether they're nullable and also even that natural language comment describing what each column is within here you can also add in some more columns and you could say something like date delayed you can manually add them in just like that another great thing that you can do is now we have this future items table but we don't actually have anything within here if I just right click on it with just one click we can click on generate test data and as soon as we do that it will go ahead and it will seed that table with some data that we can use if I go ahead and I run that we see that it successfully added all of this within our tables next I'm going to show you how you can generate a custom dashboard just with natural language based on whatever you have within your databases if I go and I click AI chart here what you can do is you can select your data collection in this case I'll select developers data again and within here I can ask questions specifically related to my data for instance if I send in a question like how has the total sales revenue trended for each product category month by month what it will do for us is it will go and it will determine what is an appropriate data visualization for us and it will map that data that we have within our database to the visualization we can see all of the revenue month by month you can also download these and Export them to images the neat thing with this is you can put in multiple different things that you want to visualize at once if I say which products are close to being out of stock Etc so on and so forth and I add in another query when the results come back now we have those two different pieces visualized here here we have the total value of assets that were purchased each year we can hover over them again you can export these as images if you'd like and then here we can see all of the different products that are close to being out of stock you can start to see how this is very helpful if you've ever had to generate reports before it can be pretty timec consuming to try and query the right data to be able to generate something like this but now in just a number of seconds you'll be able to easily generate all of the different visualizations that you might need you can also change the settings of the chart here if you want to change the chart type it's all within here you can group them by different aspects if you want you can also include a legend if you want have different labels you can also select your theme color as well if I just go ahead and I'll save that out it gives you these really rich visualizations of your own data and as you saw I just did this with natural language I didn't have to think about the SQL queries at all also what you can do within here is within the data configuration is you can edit this and this has the editor where you can put in natural language to generate your SQL you can also highlight things like I demonstrated where if you want to change certain aspects you can also write whatever your query is within here as well and within here the other nice thing is you can just click this share button and it will copy a link to your clipboard that you can go ahead and send to someone else if you want to show them whatever visualization that you created next what I want to show you is the aid driven data analysis feature on the Le hand side here if you go and you click the AI chat button you can go ahead and you can click create new chat as soon as you create a new chat there are two different options you can choose between the Excel type where you can upload a CSV or an XLS for instance or you can query your database in this case if I select developers data what I can say is something like create a pie chart of all of the products pricing I'll send that through now what it will do is it will go ahead it will write that SQL statement for us it will invoke that we'll get the results in this nice table and then finally it's going to go and analyze it and once that's done it's going to generate that chart for us in this case we asked for that pie chart and similar to the dashboard feature you can go with in here you can edit the settings say I want to show all the data labels for this chart and I want to change the theme I can go ahead and I can save that out here now the cool thing with this is there are also follow-up questions for instance if I click on what is the average price of all of the different products it will go ahead again write that SQL statement and quickly return the result for us we can see what the average price is so if I ask how many products are priced above the average price we can see quickly it returned that result after writing the SQL of there are eight products above the average price in addition to making these dashboards you can also have that text tosql functionality as well as the ability to explain SQL queries or optimize them next a really great feature is you can add in Excel files as well as csvs within here I have some example data of some YouTube metrics so as soon as you put in the data it will ask if your header is horizontal or vertical and you'll be able to see where it's highlighting respectively also if the headers are multiple rows you can indicate just like that in this case since it's just one I'm going to go ahead and confirm and then once that's there I can ask questions about my data I can say what video has the most views and there we go it wrote out that SQL for us and it was able to generate that response in just seconds I can check what video has the highest number of likes and similar thing we can get that here as well and you start to get an idea on how this can be helpful because whether it's your database or with a CSV or an Excel file you'll be able to just ask questions about just about anything this is just another great application that they have built in within here that's pretty much it for this video hopefully you found this video useful and you can see how you can leverage chat to DB within your business or your appli application there are a ton of different use cases like I demonstrated here from being able to generate reports and often times there are novel insights within your data you just have to visualize them and uncover them this is a really great tool that you can leverage on a product that you might have to be able to gain some insights connect to all of your different data sources to be able to have a unified platform with access to up-to-date information that's accurate that will overall improve your decision-making process if you're trying to find actionable items within your data if you found this video useful please like comment share and subscribe otherwise until the next one
Weekly deep dives on AI agents, coding tools, and building with LLMs - delivered to your inbox.
Free forever. No spam.
Subscribe FreeNew tutorials, open-source projects, and deep dives on coding agents - delivered weekly.
Technical content at the intersection of AI and development. Building with AI agents, Claude Code, and modern dev tools - then showing you exactly how it works.