{"id":2360,"date":"2024-10-04T15:20:20","date_gmt":"2024-10-04T20:20:20","guid":{"rendered":"https:\/\/www.rodaportal.net\/?p=2360"},"modified":"2024-10-04T15:20:27","modified_gmt":"2024-10-04T20:20:27","slug":"using_llms_to_analyze_sql_data_with_streamlit","status":"publish","type":"post","link":"http:\/\/18.220.63.61\/?p=2360","title":{"rendered":"Using LLMs to Analyze SQL Data with Streamlit"},"content":{"rendered":"\n<figure class=\"wp-block-embed is-type-rich is-provider-embed-handler wp-block-embed-embed-handler wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<div class=\"youtube-embed\" data-video_id=\"UyDVbQkkb-0\"><iframe loading=\"lazy\" title=\"How to point a Large Language Model (LLM) to an SQL Database and ask Questions on it | FREE API\" width=\"696\" height=\"392\" src=\"https:\/\/www.youtube.com\/embed\/UyDVbQkkb-0?feature=oembed&#038;enablejsapi=1\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/div>\n<\/div><\/figure>\n\n\n\n<p>Welcome to an exciting journey into the world of data analysis using Large Language Models (LLMs) and SQL databases! This guide will walk you through the entire process of building a Streamlit app that utilizes the GROQ API to efficiently analyze relational data stored in SQL tables. With a focus on user-friendly interaction, we\u2019ll enable natural language queries on SQL data, making it accessible and intuitive for everyone.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>What You\u2019ll Learn<\/strong><\/h2>\n\n\n\n<p>In this tutorial, we will cover:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Setting up the necessary libraries for SQL and LLM integration.<\/li>\n\n\n\n<li>Creating a basic Streamlit app that connects to a SQL database.<\/li>\n\n\n\n<li>Enhancing the app to allow users to filter data by specific brands.<\/li>\n\n\n\n<li>Implementing functionality to limit the data size to comply with LLM token limits.<\/li>\n\n\n\n<li>Deploying multiple versions of the app with improved features.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Getting Started: Libraries and Setup<\/strong><\/h2>\n\n\n\n<p>To kick things off, let&#8217;s identify the libraries we need for this project:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>pyodbc:<\/strong> This library allows us to connect Python with SQL Server.<\/li>\n\n\n\n<li><strong>groq:<\/strong> Used to call our LLM models.<\/li>\n\n\n\n<li><strong>Streamlit:<\/strong> The framework we\u2019ll use to build our app.<\/li>\n<\/ul>\n\n\n\n<p>First, we need to load our data by establishing a connection to our SQL server. Make sure to have the correct server details ready.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/firebasestorage.googleapis.com\/v0\/b\/videotoblog-35c6e.appspot.com\/o\/%2Fusers%2FfiW0cYALLucN46OgNqQCq7JpfOt2%2Fblogs%2FeAvNJSxEGTyHPVQ4iPEr%2Fscreenshots%2F3bc0092b-8705-4a6c-a54a-aa5daf561299.webp?alt=media&amp;token=59bb5205-683c-477f-867e-5a3bb0f3b641\" alt=\"Connecting to SQL Server\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Connecting to SQL Server<\/strong><\/h2>\n\n\n\n<p>Here\u2019s how you can create a connection to your SQL server:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">connection = pyodbc.connect('DRIVER={SQL Server};SERVER=your_server;DATABASE=your_database;Trusted_Connection=yes;')\n<\/pre>\n\n\n\n<p>After executing this, you can run a query to fetch data:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">query = \"SELECT * FROM car_information\"\ndata = pd.read_sql(query, connection)\n<\/pre>\n\n\n\n<p>By running this code, you should see your data displayed. If you\u2019re looking to use the same dataset, check out my previous video where I web scrape this data and store it in SQL Server.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/firebasestorage.googleapis.com\/v0\/b\/videotoblog-35c6e.appspot.com\/o\/%2Fusers%2FfiW0cYALLucN46OgNqQCq7JpfOt2%2Fblogs%2FeAvNJSxEGTyHPVQ4iPEr%2Fscreenshots%2F6402aa1f-50cf-46c0-9ca9-74c59025cf64.webp?alt=media&amp;token=68fd034d-bccb-4c38-a00a-0e252f7ee618\" alt=\"Fetching data from SQL\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Limiting Data for LLM Compatibility<\/strong><\/h2>\n\n\n\n<p>One important aspect of working with LLMs is that they have token limits. To avoid errors, we must limit the amount of data we send to the model. This can be done by either allowing users to input their SQL queries or by filtering specific brands.<\/p>\n\n\n\n<p>Next, we initialize the GROQ client:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import groq\n\n# Initialize the GROQ client\nclient = groq.Client(api_key='your_api_key')\n<\/pre>\n\n\n\n<p>Make sure you sign up on the GROQ website for a free API key if you haven&#8217;t already.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/firebasestorage.googleapis.com\/v0\/b\/videotoblog-35c6e.appspot.com\/o\/%2Fusers%2FfiW0cYALLucN46OgNqQCq7JpfOt2%2Fblogs%2FeAvNJSxEGTyHPVQ4iPEr%2Fscreenshots%2F8a210fc6-8cd9-4d77-baf3-146deaef5d0a.webp?alt=media&amp;token=b45a17db-06cc-4dc3-bba3-79ffec9cdca9\" alt=\"Initializing GROQ Client\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Transforming Data for LLM Understanding<\/strong><\/h2>\n\n\n\n<p>After limiting our data to a manageable size, we convert it into a JSON format that LLMs can understand:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">json_data = data.head(200).to_json(orient='records')\n<\/pre>\n\n\n\n<p>This transformation helps the LLM summarize and analyze the relational data effectively.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Summarizing Data with LLMs<\/strong><\/h2>\n\n\n\n<p>Now, let\u2019s define our prompt for the LLM. We\u2019ll ask the model to summarize the relational data:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">prompt = \"Summarize the following relational data: \" + json_data\nresponse = client.completions.create(prompt=prompt, model='instant')\nsummary = response['choices'][0]['text']\nprint(summary)\n<\/pre>\n\n\n\n<p>This code will provide a summary of the data, detailing the make and model of the cars, along with their specifications.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/firebasestorage.googleapis.com\/v0\/b\/videotoblog-35c6e.appspot.com\/o\/%2Fusers%2FfiW0cYALLucN46OgNqQCq7JpfOt2%2Fblogs%2FeAvNJSxEGTyHPVQ4iPEr%2Fscreenshots%2F052a7c49-ae2a-45a4-92f9-ba420e7903c3.webp?alt=media&amp;token=a35f57e1-bde6-4e5f-a5c0-eec3f3a510df\" alt=\"Summarizing data with LLM\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Creating the First Streamlit App<\/strong><\/h2>\n\n\n\n<p>Let\u2019s now encapsulate our code into functions and build our first Streamlit app. Start by organizing your code:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import streamlit as st\n\ndef connect_to_sql(server, database):\n    connection_str = f'DRIVER={{SQL Server}};SERVER={server};DATABASE={database};Trusted_Connection=yes;'\n    return pyodbc.connect(connection_str)\n\ndef fetch_data(connection, query):\n    return pd.read_sql(query, connection)\n<\/pre>\n\n\n\n<p>Next, create the main function for your Streamlit app:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">def main():\n    st.title(\"SQL Server Data Querying with LLMs\")\n    server = st.text_input(\"Server\")\n    database = st.text_input(\"Database\")\n    query = st.text_area(\"SQL Query\", \"SELECT * FROM car_information\")\n\n    if st.button(\"Fetch Data\"):\n        conn = connect_to_sql(server, database)\n        data = fetch_data(conn, query)\n        st.write(data)\n<\/pre>\n\n\n\n<p>Run this function in your Streamlit app to display the data fetched from SQL.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/firebasestorage.googleapis.com\/v0\/b\/videotoblog-35c6e.appspot.com\/o\/%2Fusers%2FfiW0cYALLucN46OgNqQCq7JpfOt2%2Fblogs%2FeAvNJSxEGTyHPVQ4iPEr%2Fscreenshots%2F191b8cad-4707-4903-8fb9-d001190e0bdc.webp?alt=media&amp;token=26d2fcd4-cf79-4e43-91bd-1674b34663ea\" alt=\"Creating the main function for Streamlit\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Deploying the First App<\/strong><\/h2>\n\n\n\n<p>To deploy your Streamlit app, save your script as a .py file and run the following command in your terminal:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">streamlit run your_script.py\n<\/pre>\n\n\n\n<p>This command will launch your app in a new browser tab, allowing you to interact with your SQL data directly.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/firebasestorage.googleapis.com\/v0\/b\/videotoblog-35c6e.appspot.com\/o\/%2Fusers%2FfiW0cYALLucN46OgNqQCq7JpfOt2%2Fblogs%2FeAvNJSxEGTyHPVQ4iPEr%2Fscreenshots%2F3f11f143-1596-481a-89b1-b9b4446cc2fe.webp?alt=media&amp;token=ed0f0b78-411d-4eeb-8050-a980a86146e9\" alt=\"Running Streamlit app\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Enhancing the Streamlit App<\/strong><\/h2>\n\n\n\n<p>Now, let\u2019s enhance our app by allowing users to filter data by specific brands and limit the number of records displayed. This is crucial for efficient data handling.<\/p>\n\n\n\n<p>We will add a multi-select box for brands and a slider to control the number of records:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">brands = st.multiselect(\"Select Brands\", options=[\"Mercedes\", \"Audi\", \"Nissan\"])\nnum_records = st.slider(\"Number of Records\", min_value=10, max_value=2000, value=200)\n<\/pre>\n\n\n\n<p>Integrate these features into your fetching logic to ensure users can customize their queries effectively.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/firebasestorage.googleapis.com\/v0\/b\/videotoblog-35c6e.appspot.com\/o\/%2Fusers%2FfiW0cYALLucN46OgNqQCq7JpfOt2%2Fblogs%2FeAvNJSxEGTyHPVQ4iPEr%2Fscreenshots%2F30dcc920-27af-42d7-9c59-6811fb6d1aae.webp?alt=media&amp;token=0d92cf74-e87d-42d5-8cfa-3d901de38060\" alt=\"Enhancing the Streamlit app\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Creating the Second and Third Apps<\/strong><\/h2>\n\n\n\n<p>For the second app, we\u2019ll maintain similar functionality but with additional features like model selection. Copy your first app code, make necessary changes, and add a selection box for different LLM models.<\/p>\n\n\n\n<p>For the third app, focus on aesthetic changes by moving settings to a sidebar for a cleaner interface:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">with st.sidebar:\n    st.title(\"Connection Settings\")\n    server = st.text_input(\"Server\")\n    database = st.text_input(\"Database\")\n    # Other settings...\n<\/pre>\n\n\n\n<p>This modification will improve user experience and make the app more intuitive.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/firebasestorage.googleapis.com\/v0\/b\/videotoblog-35c6e.appspot.com\/o\/%2Fusers%2FfiW0cYALLucN46OgNqQCq7JpfOt2%2Fblogs%2FeAvNJSxEGTyHPVQ4iPEr%2Fscreenshots%2Fb3e34686-a440-43cd-86a9-35b186b83e0b.webp?alt=media&amp;token=fcd93d61-6f8b-4b79-b47c-ff6bba699f78\" alt=\"Creating the third app with sidebar\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Testing the Final App<\/strong><\/h2>\n\n\n\n<p>After implementing all features, it\u2019s time to test your final app. Input different queries, select brands, and observe how the app responds. For example, try asking:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\"Which car is the fastest?\"\n<\/pre>\n\n\n\n<p>The LLM should provide a detailed response based on the filtered data.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/firebasestorage.googleapis.com\/v0\/b\/videotoblog-35c6e.appspot.com\/o\/%2Fusers%2FfiW0cYALLucN46OgNqQCq7JpfOt2%2Fblogs%2FeAvNJSxEGTyHPVQ4iPEr%2Fscreenshots%2F3d973707-9532-4785-9d9b-8850b00f69dd.webp?alt=media&amp;token=3cf7b285-db01-4070-927d-bfd430fe2fae\" alt=\"Testing the final Streamlit app\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p>You\u2019ve now built a fully functional Streamlit app that leverages LLMs to analyze SQL data using natural language queries. This powerful combination allows users to gain insights from relational data in an accessible manner. If you found this tutorial helpful, please like, subscribe, and enable notifications for future updates!<\/p>\n\n\n\n<p>If you have any questions or suggestions for future topics, feel free to leave a comment below. Happy coding!<\/p>\n\n\n\n<p>For the complete source code, check out my <a href=\"https:\/\/github.com\/Pitsillides91\/llms_2024\/tree\/main\/6.Groq_llms_to_sql\">GitHub repository<\/a>.<\/p>\n\n\n\n<p>Connect with me on <a href=\"https:\/\/x.com\/pitsillides91\">X<\/a> for more updates!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Welcome to an exciting journey into the world of data analysis using Large Language Models (LLMs) and SQL databases! This guide will walk you through the entire process of building a Streamlit app that utilizes the GROQ API to efficiently analyze relational data stored in SQL tables. With a focus on user-friendly interaction, we\u2019ll enable [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":2362,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[2950,1544],"tags":[2980,2981,2982,2954,2983],"class_list":{"0":"post-2360","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-data_analytics_101","8":"category-video","9":"tag-data-analysis","10":"tag-llms","11":"tag-sql","12":"tag-streamlit","13":"tag-tech-tutorial"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Using LLMs to Analyze SQL Data with Streamlit - Rodaportal<\/title>\n<meta name=\"description\" content=\"Discover how to harness the power of Large Language Models and Streamlit to analyze SQL data effortlessly. This guide covers setup, querying, and app deployment.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/18.220.63.61\/?p=2360\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using LLMs to Analyze SQL Data with Streamlit\" \/>\n<meta property=\"og:description\" content=\"Discover how to harness the power of Large Language Models and Streamlit to analyze SQL data effortlessly. This guide covers setup, querying, and app deployment.\" \/>\n<meta property=\"og:url\" content=\"http:\/\/18.220.63.61\/?p=2360\" \/>\n<meta property=\"og:site_name\" content=\"Rodaportal\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Rodaportal\" \/>\n<meta property=\"article:published_time\" content=\"2024-10-04T20:20:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-04T20:20:27+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/18.220.63.61\/wp-content\/uploads\/2024\/10\/UyDVbQkkb-0-HD.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Rodaportal\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"Using LLMs to Analyze SQL Data with Streamlit\" \/>\n<meta name=\"twitter:description\" content=\"Discover how to harness the power of Large Language Models and Streamlit to analyze SQL data effortlessly. This guide covers setup, querying, and app deployment.\" \/>\n<meta name=\"twitter:image\" content=\"http:\/\/18.220.63.61\/wp-content\/uploads\/2024\/10\/UyDVbQkkb-0-HD.jpg\" \/>\n<meta name=\"twitter:creator\" content=\"@RodaPP1\" \/>\n<meta name=\"twitter:site\" content=\"@RodaPP1\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rodaportal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\\\/\\\/18.220.63.61\\\/?p=2360#article\",\"isPartOf\":{\"@id\":\"http:\\\/\\\/18.220.63.61\\\/?p=2360\"},\"author\":{\"name\":\"Rodaportal\",\"@id\":\"https:\\\/\\\/www.rodaportal.net\\\/#\\\/schema\\\/person\\\/1ed067be473943abefead5f395f0bf70\"},\"headline\":\"Using LLMs to Analyze SQL Data with Streamlit\",\"datePublished\":\"2024-10-04T20:20:20+00:00\",\"dateModified\":\"2024-10-04T20:20:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\\\/\\\/18.220.63.61\\\/?p=2360\"},\"wordCount\":794,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.rodaportal.net\\\/#organization\"},\"image\":{\"@id\":\"http:\\\/\\\/18.220.63.61\\\/?p=2360#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/18.220.63.61\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/UyDVbQkkb-0-HD.jpg\",\"keywords\":[\"Data Analysis\",\"LLMs\",\"SQL\",\"Streamlit\",\"Tech Tutorial\"],\"articleSection\":[\"Data Analytics 101\",\"Video\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\\\/\\\/18.220.63.61\\\/?p=2360#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\\\/\\\/18.220.63.61\\\/?p=2360\",\"url\":\"http:\\\/\\\/18.220.63.61\\\/?p=2360\",\"name\":\"Using LLMs to Analyze SQL Data with Streamlit - Rodaportal\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rodaportal.net\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\\\/\\\/18.220.63.61\\\/?p=2360#primaryimage\"},\"image\":{\"@id\":\"http:\\\/\\\/18.220.63.61\\\/?p=2360#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/18.220.63.61\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/UyDVbQkkb-0-HD.jpg\",\"datePublished\":\"2024-10-04T20:20:20+00:00\",\"dateModified\":\"2024-10-04T20:20:27+00:00\",\"description\":\"Discover how to harness the power of Large Language Models and Streamlit to analyze SQL data effortlessly. This guide covers setup, querying, and app deployment.\",\"breadcrumb\":{\"@id\":\"http:\\\/\\\/18.220.63.61\\\/?p=2360#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\\\/\\\/18.220.63.61\\\/?p=2360\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\\\/\\\/18.220.63.61\\\/?p=2360#primaryimage\",\"url\":\"http:\\\/\\\/18.220.63.61\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/UyDVbQkkb-0-HD.jpg\",\"contentUrl\":\"http:\\\/\\\/18.220.63.61\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/UyDVbQkkb-0-HD.jpg\",\"width\":1280,\"height\":720,\"caption\":\"Using LLMs to Analyze SQL Data with Streamlit\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\\\/\\\/18.220.63.61\\\/?p=2360#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.rodaportal.net\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Using LLMs to Analyze SQL Data with Streamlit\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.rodaportal.net\\\/#website\",\"url\":\"https:\\\/\\\/www.rodaportal.net\\\/\",\"name\":\"Rodaportal\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.rodaportal.net\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.rodaportal.net\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.rodaportal.net\\\/#organization\",\"name\":\"Rodaportal\",\"url\":\"https:\\\/\\\/www.rodaportal.net\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rodaportal.net\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"http:\\\/\\\/www.rodaportal.net\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/imageedit_1_9835162131.png\",\"contentUrl\":\"http:\\\/\\\/www.rodaportal.net\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/imageedit_1_9835162131.png\",\"width\":112,\"height\":112,\"caption\":\"Rodaportal\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rodaportal.net\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/Rodaportal\",\"https:\\\/\\\/x.com\\\/RodaPP1\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.rodaportal.net\\\/#\\\/schema\\\/person\\\/1ed067be473943abefead5f395f0bf70\",\"name\":\"Rodaportal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/57e783bd41f1f91e03748e1e48327997442e1387475b4aa6b38c40ec5eeaadf7?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/57e783bd41f1f91e03748e1e48327997442e1387475b4aa6b38c40ec5eeaadf7?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/57e783bd41f1f91e03748e1e48327997442e1387475b4aa6b38c40ec5eeaadf7?s=96&d=mm&r=g\",\"caption\":\"Rodaportal\"},\"sameAs\":[\"http:\\\/\\\/www.rodaportal.net\"],\"url\":\"http:\\\/\\\/18.220.63.61\\\/?author=2\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Using LLMs to Analyze SQL Data with Streamlit - Rodaportal","description":"Discover how to harness the power of Large Language Models and Streamlit to analyze SQL data effortlessly. This guide covers setup, querying, and app deployment.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/18.220.63.61\/?p=2360","og_locale":"en_US","og_type":"article","og_title":"Using LLMs to Analyze SQL Data with Streamlit","og_description":"Discover how to harness the power of Large Language Models and Streamlit to analyze SQL data effortlessly. This guide covers setup, querying, and app deployment.","og_url":"http:\/\/18.220.63.61\/?p=2360","og_site_name":"Rodaportal","article_publisher":"https:\/\/www.facebook.com\/Rodaportal","article_published_time":"2024-10-04T20:20:20+00:00","article_modified_time":"2024-10-04T20:20:27+00:00","og_image":[{"width":1280,"height":720,"url":"http:\/\/18.220.63.61\/wp-content\/uploads\/2024\/10\/UyDVbQkkb-0-HD.jpg","type":"image\/jpeg"}],"author":"Rodaportal","twitter_card":"summary_large_image","twitter_title":"Using LLMs to Analyze SQL Data with Streamlit","twitter_description":"Discover how to harness the power of Large Language Models and Streamlit to analyze SQL data effortlessly. This guide covers setup, querying, and app deployment.","twitter_image":"http:\/\/18.220.63.61\/wp-content\/uploads\/2024\/10\/UyDVbQkkb-0-HD.jpg","twitter_creator":"@RodaPP1","twitter_site":"@RodaPP1","twitter_misc":{"Written by":"Rodaportal","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/18.220.63.61\/?p=2360#article","isPartOf":{"@id":"http:\/\/18.220.63.61\/?p=2360"},"author":{"name":"Rodaportal","@id":"https:\/\/www.rodaportal.net\/#\/schema\/person\/1ed067be473943abefead5f395f0bf70"},"headline":"Using LLMs to Analyze SQL Data with Streamlit","datePublished":"2024-10-04T20:20:20+00:00","dateModified":"2024-10-04T20:20:27+00:00","mainEntityOfPage":{"@id":"http:\/\/18.220.63.61\/?p=2360"},"wordCount":794,"commentCount":0,"publisher":{"@id":"https:\/\/www.rodaportal.net\/#organization"},"image":{"@id":"http:\/\/18.220.63.61\/?p=2360#primaryimage"},"thumbnailUrl":"http:\/\/18.220.63.61\/wp-content\/uploads\/2024\/10\/UyDVbQkkb-0-HD.jpg","keywords":["Data Analysis","LLMs","SQL","Streamlit","Tech Tutorial"],"articleSection":["Data Analytics 101","Video"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/18.220.63.61\/?p=2360#respond"]}]},{"@type":"WebPage","@id":"http:\/\/18.220.63.61\/?p=2360","url":"http:\/\/18.220.63.61\/?p=2360","name":"Using LLMs to Analyze SQL Data with Streamlit - Rodaportal","isPartOf":{"@id":"https:\/\/www.rodaportal.net\/#website"},"primaryImageOfPage":{"@id":"http:\/\/18.220.63.61\/?p=2360#primaryimage"},"image":{"@id":"http:\/\/18.220.63.61\/?p=2360#primaryimage"},"thumbnailUrl":"http:\/\/18.220.63.61\/wp-content\/uploads\/2024\/10\/UyDVbQkkb-0-HD.jpg","datePublished":"2024-10-04T20:20:20+00:00","dateModified":"2024-10-04T20:20:27+00:00","description":"Discover how to harness the power of Large Language Models and Streamlit to analyze SQL data effortlessly. This guide covers setup, querying, and app deployment.","breadcrumb":{"@id":"http:\/\/18.220.63.61\/?p=2360#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/18.220.63.61\/?p=2360"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/18.220.63.61\/?p=2360#primaryimage","url":"http:\/\/18.220.63.61\/wp-content\/uploads\/2024\/10\/UyDVbQkkb-0-HD.jpg","contentUrl":"http:\/\/18.220.63.61\/wp-content\/uploads\/2024\/10\/UyDVbQkkb-0-HD.jpg","width":1280,"height":720,"caption":"Using LLMs to Analyze SQL Data with Streamlit"},{"@type":"BreadcrumbList","@id":"http:\/\/18.220.63.61\/?p=2360#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.rodaportal.net\/"},{"@type":"ListItem","position":2,"name":"Using LLMs to Analyze SQL Data with Streamlit"}]},{"@type":"WebSite","@id":"https:\/\/www.rodaportal.net\/#website","url":"https:\/\/www.rodaportal.net\/","name":"Rodaportal","description":"","publisher":{"@id":"https:\/\/www.rodaportal.net\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.rodaportal.net\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.rodaportal.net\/#organization","name":"Rodaportal","url":"https:\/\/www.rodaportal.net\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rodaportal.net\/#\/schema\/logo\/image\/","url":"http:\/\/www.rodaportal.net\/wp-content\/uploads\/2023\/10\/imageedit_1_9835162131.png","contentUrl":"http:\/\/www.rodaportal.net\/wp-content\/uploads\/2023\/10\/imageedit_1_9835162131.png","width":112,"height":112,"caption":"Rodaportal"},"image":{"@id":"https:\/\/www.rodaportal.net\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Rodaportal","https:\/\/x.com\/RodaPP1"]},{"@type":"Person","@id":"https:\/\/www.rodaportal.net\/#\/schema\/person\/1ed067be473943abefead5f395f0bf70","name":"Rodaportal","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/57e783bd41f1f91e03748e1e48327997442e1387475b4aa6b38c40ec5eeaadf7?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/57e783bd41f1f91e03748e1e48327997442e1387475b4aa6b38c40ec5eeaadf7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/57e783bd41f1f91e03748e1e48327997442e1387475b4aa6b38c40ec5eeaadf7?s=96&d=mm&r=g","caption":"Rodaportal"},"sameAs":["http:\/\/www.rodaportal.net"],"url":"http:\/\/18.220.63.61\/?author=2"}]}},"_links":{"self":[{"href":"http:\/\/18.220.63.61\/index.php?rest_route=\/wp\/v2\/posts\/2360","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/18.220.63.61\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/18.220.63.61\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/18.220.63.61\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/18.220.63.61\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2360"}],"version-history":[{"count":1,"href":"http:\/\/18.220.63.61\/index.php?rest_route=\/wp\/v2\/posts\/2360\/revisions"}],"predecessor-version":[{"id":2364,"href":"http:\/\/18.220.63.61\/index.php?rest_route=\/wp\/v2\/posts\/2360\/revisions\/2364"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/18.220.63.61\/index.php?rest_route=\/wp\/v2\/media\/2362"}],"wp:attachment":[{"href":"http:\/\/18.220.63.61\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2360"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/18.220.63.61\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2360"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/18.220.63.61\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2360"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}