
{"id":8442,"date":"2025-10-14T09:18:07","date_gmt":"2025-10-14T08:18:07","guid":{"rendered":"https:\/\/dasini.net\/blog\/?p=8442"},"modified":"2025-10-14T09:18:09","modified_gmt":"2025-10-14T08:18:09","slug":"querying-the-unstructured-natural-language-to-sql-for-json-data","status":"publish","type":"post","link":"https:\/\/dasini.net\/blog\/2025\/10\/14\/querying-the-unstructured-natural-language-to-sql-for-json-data\/","title":{"rendered":"Querying the Unstructured: Natural Language to SQL for JSON Data"},"content":{"rendered":"\n<p>In <a href=\"https:\/\/dasini.net\/blog\/2025\/09\/30\/ask-your-database-anything-natural-language-to-sql-in-mysql-heatwave\/\" target=\"_blank\" rel=\"noopener\" title=\"Ask Your Database Anything: Natural Language to SQL in MySQL HeatWave\"><strong><code><em>Ask Your Database Anything: Natural Language to SQL (NL2SQL) in MySQL HeatWave<\/em><\/code><\/strong><\/a>, we have explored the innovative MySQL HeatWave GenAI technology that converts Natural Language into SQL, making it easier for you to interact with databases. This feature collects information on the schemas, tables, and columns that you have access to, and then uses a Large Language Model (LLM) to generate an SQL query for the question pertaining to your data. It also lets you run the generated query and view the result set.<\/p>\n\n\n\n<p>Following our last article, <a href=\"https:\/\/dasini.net\/blog\/2025\/10\/07\/let-your-ai-dba-assistant-write-your-mysql-queries\/\" target=\"_blank\" rel=\"noopener\" title=\"Let Your AI DBA Assistant Write Your MySQL Queries\"><em><strong><code>Let Your AI DBA Assistant Write Your MySQL Queries<\/code><\/strong><\/em><\/a>, showcased an interesting use case: leveraging an AI DBA Assistant to generate monitoring and tuning queries for the Performance, Information, and Sys Schemas using plain English.<\/p>\n\n\n\n<p>In this article, we will talk about how to <strong>handle JSON documents with MySQL HeatWave GenAI NL2SQL<\/strong> feature.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69e7334c090be&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69e7334c090be\" class=\"aligncenter size-full is-resized wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"770\" height=\"550\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2025\/09\/rc24-heatwave-logo.gif?fit=770%2C550&amp;ssl=1\" alt=\"\" class=\"wp-image-8340\" style=\"width:400px\"\/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Agrandir\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n<\/div>\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Context<\/h2>\n\n\n\n<p>I&rsquo;m using <a href=\"https:\/\/www.oracle.com\/heatwave\/\" target=\"_blank\" rel=\"noopener\" title=\"MySQL HeatWave\"><strong>MySQL HeatWave<\/strong><\/a> <strong>9.4.2<\/strong> on <a href=\"https:\/\/www.oracle.com\/cloud\/\" target=\"_blank\" rel=\"noopener\" title=\"Oracle Cloud Infrastructure\">Oracle Cloud Infrastructure<\/a> (OCI):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">SQL&gt; \n-- HeatWave MySQL server version\nSHOW VARIABLES WHERE Variable_name IN ('version_comment', 'version');\n+-----------------+--------------------------+\n| Variable_name   | Value                    |\n+-----------------+--------------------------+\n| version         | 9.4.2-cloud              |\n| version_comment | MySQL Enterprise - Cloud |\n+-----------------+--------------------------+<\/code><\/pre>\n\n\n\n<div style=\"height:15px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Furthermore, I&rsquo;m using a modified version (available on my <a href=\"https:\/\/github.com\/freshdaz\/MySQL_HeatWave_NL2SQL\" target=\"_blank\" rel=\"noopener\" title=\"\">GitHub account<\/a>, file: <em><a href=\"https:\/\/github.com\/freshdaz\/MySQL_HeatWave_NL2SQL\/blob\/main\/nl2sql_world_json_nested_-_tables_json_nested.sql\" target=\"_blank\" rel=\"noopener\" title=\"nl2sql_world_json_nested_-_tables_json_nested.sql\">nl2sql_world_json_nested_-_tables_json_nested.sql<\/a><\/em>) of the well-known <a href=\"https:\/\/dev.mysql.com\/doc\/world-setup\/en\/\" target=\"_blank\" rel=\"noopener\" title=\"Setting Up the world Database\"><em><strong>World database<\/strong><\/em><\/a>. Although the data hasn\u2019t been updated in some time, it still serves as a useful tool for visualizing the results of SQL queries.<\/p>\n\n\n\n<p>Here the schema:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">CREATE TABLE `country_json_nested` (\n  `ID` int NOT NULL AUTO_INCREMENT COMMENT 'Primary key: integer that uniquely identifies country_json JSON documents.',\n  `country_description` json NOT NULL COMMENT 'Country information. Including country names, continent, region, surface area, identifiers (country code), demographics, economy (GNP), and government structure',\n  PRIMARY KEY (`ID`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='Stores detailed information about countries, including identifiers, demographics, economy, and government structure.'\n;\n\nCREATE TABLE `country_language_json_nested` (\n  `ID` int NOT NULL AUTO_INCREMENT COMMENT 'Primary key: integer that uniquely identifies country_language_json JSON documents.',\n  `country_language_description` json NOT NULL COMMENT 'Country languages information. Including a three-letter country code referencing the country table, the name of the language spoken in the country, whether they are official and the share of the population using them.',\n  PRIMARY KEY (`ID`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='Stores information about the languages spoken in each country, including whether they are official and the share of the population using them.'\n;\n\nCREATE TABLE `city_json_nested` (\n  `ID` int NOT NULL AUTO_INCREMENT COMMENT 'Primary key: integer that uniquely identifies city_json JSON documents.',\n  `city_description` json NOT NULL COMMENT 'Cities information. including their name, country, district, and population.',\n  PRIMARY KEY (`ID`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='Stores information about cities, including their name, country, district, and population.'\n;<\/code><\/pre>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Let\u2019s run 3 queries on the data set:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">MySQL&gt;\n-- Find the name, country code and the district of the city with ID 2989\nSELECT \n    city_description-&gt;&gt;\"$.city_name\" AS \"City Name\", \n    city_description-&gt;&gt;\"$.location.country_code\" AS \"Country Code\", \n    city_description-&gt;&gt;\"$.location.district\" AS District \nFROM city_json_nested \nWHERE city_description-&gt;&gt;\"$.ID_city\" = 2989;\n+-----------+--------------+-------------+\n| city_name | country_code | district    |\n+-----------+--------------+-------------+\n| Grenoble  | FRA          | Rh\u00f4ne-Alpes |\n+-----------+--------------+-------------+\n\n-- Find the government form of Germany\nSELECT \n    country_description-&gt;&gt;\"$.government.government_form\" AS \"Government Form\" \nFROM country_json_nested \nWHERE country_description-&gt;&gt;\"$.identifiers.code\" = 'FRA';\n+-----------------+\n| government_form |\n+-----------------+\n| Republic        |\n+-----------------+\n\n-- List all official languages spoken in Canada\nSELECT \n    country_language_description-&gt;&gt;\"$.language_info.language\" AS Language \nFROM country_language_json_nested \nWHERE country_language_description-&gt;&gt;\"$.country.country_code\" = 'CAN' \n    AND country_language_description-&gt;&gt;\"$.language_info.is_official\" = 'T';\n+----------+\n| language |\n+----------+\n| English  |\n| French   |\n+----------+<\/code><\/pre>\n\n\n\n<p>I&rsquo;m employing the <strong>inline path operator (<code><a href=\"https:\/\/dev.mysql.com\/doc\/refman\/9.4\/en\/json-search-functions.html#operator_json-inline-path\" target=\"_blank\" rel=\"noopener\" title=\"Improved, unquoting extraction operator\">-&gt;&gt;<\/a><\/code>)<\/strong>, which serves as a convenient shorthand for extracting and unquoting values: <code><a href=\"https:\/\/dev.mysql.com\/doc\/refman\/9.4\/en\/json-search-functions.html#function_json-extract\" target=\"_blank\" rel=\"noopener\" title=\"Unquotes JSON value and returns the result as a utf8mb4 string\">JSON_UNQUOTE<\/a>(<a href=\"https:\/\/dev.mysql.com\/doc\/refman\/9.4\/en\/json-search-functions.html#function_json-extract\" target=\"_blank\" rel=\"noopener\" title=\"Returns data from a JSON document, selected from the parts of the document matched by the path arguments.\">JSON_EXTRACT<\/a>(...))<\/code>.<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>The execution of these queries, while simple, still relies on existing <strong>SQL and JSON expertise<\/strong>. MySQL HeatWave GenAI can eliminates this dependency by enabling users to interact with the database via <strong>Natural Language to SQL<\/strong>. As highlighted in \u00ab\u00a0<a href=\"https:\/\/dasini.net\/blog\/2025\/09\/30\/ask-your-database-anything-natural-language-to-sql-in-mysql-heatwave\/\" target=\"_blank\" rel=\"noopener\" title=\"Ask Your Database Anything: Natural Language to SQL in MySQL HeatWave\">Ask Your Database Anything: Natural Language to SQL in MySQL HeatWave<\/a>\u00a0\u00bb the new <strong><code>NL_SQL<\/code> routine<\/strong> allows non-technical users to write requests in plain English, and have the system automatically generate the necessary SQL.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"400\" height=\"377\" src=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2025\/10\/Querying-the-Unstructured-Natural-Language-to-SQL-for-JSON-Data-400.png?resize=400%2C377&#038;ssl=1\" alt=\"\" class=\"wp-image-8511\" srcset=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2025\/10\/Querying-the-Unstructured-Natural-Language-to-SQL-for-JSON-Data-400.png?w=400&amp;ssl=1 400w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2025\/10\/Querying-the-Unstructured-Natural-Language-to-SQL-for-JSON-Data-400.png?resize=300%2C283&amp;ssl=1 300w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/figure>\n<\/div>\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<h2 class=\"wp-block-heading\">Introducing JSON<\/h2>\n\n\n\n<p><a href=\"https:\/\/www.json.org\/json-en.html\" target=\"_blank\" rel=\"noopener\" title=\"JSON\">JSON<\/a> (JavaScript Object Notation) is a lightweight, human-readable format for structuring and exchanging data. Built around key\u2013value pairs and ordered arrays, JSON enables developers to model complex, hierarchical information without the rigidity of a fixed schema. <br>Its simplicity, flexibility, and near-universal support across programming languages have made it the standard for transmitting structured data between servers, web applications, and APIs in modern software systems.<\/p>\n<\/div><\/div>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">JSON in the MySQL Context<\/h2>\n\n\n\n<p>In MySQL, the native JSON data type \u2014 introduced in version 5.7 \u2014 brings NoSQL-style flexibility into the realm of relational databases. It allows developers to store, validate, and optimize JSON documents directly within columns, combining the ACID compliance and transactional integrity of MySQL with the dynamic nature of semi-structured data. <br>Specialized JSON functions such as <code><a href=\"https:\/\/dev.mysql.com\/doc\/refman\/8.4\/en\/json-search-functions.html#function_json-extract\" target=\"_blank\" rel=\"noopener\" title=\"JSON_EXTRACT(json_doc, path[, path] ...)\"><em>JSON_EXTRACT<\/em><\/a>()<\/code>, <code><a href=\"https:\/\/dev.mysql.com\/doc\/refman\/8.4\/en\/json-search-functions.html#function_json-contains\" target=\"_blank\" rel=\"noopener\" title=\"JSON_CONTAINS(target, candidate[, path])\"><em>JSON_CONTAINS<\/em><\/a>()<\/code>, <a href=\"https:\/\/dev.mysql.com\/doc\/refman\/8.4\/en\/json-creation-functions.html#function_json-object\" target=\"_blank\" rel=\"noopener\" title=\"JSON_OBJECT([key, val[, key, val] ...])\"><em>JSON_OBJECT<\/em><\/a>() or <code><a href=\"https:\/\/dev.mysql.com\/doc\/refman\/8.4\/en\/json-table-functions.html\" target=\"_blank\" rel=\"noopener\" title=\"Convert JSON data to tabular data\"><em>JSON_TABLE<\/em><\/a>()<\/code> enable precise querying and manipulation, while indexing options like <a href=\"https:\/\/dev.mysql.com\/doc\/refman\/8.4\/en\/create-table-generated-columns.html\" target=\"_blank\" rel=\"noopener\" title=\"CREATE TABLE and Generated Columns\">generated columns<\/a> ensure high performance. <br>This hybrid approach lets MySQL handle everything from traditional records to complex API payloads within a unified, scalable system.<\/p>\n\n\n\n<p>Some MySQL &amp; JSON content that you may find useful:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/dev.mysql.com\/doc\/refman\/9.4\/en\/json-function-reference.html\" target=\"_blank\" rel=\"noopener\" title=\"MySQL JSON Function Reference\">MySQL JSON Function Reference<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/dasini.net\/blog\/2018\/07\/23\/30-mins-with-mysql-json-functions\/\" target=\"_blank\" rel=\"noopener\" title=\"30 mins with MySQL JSON functions\">30 mins with MySQL JSON functions<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/dasini.net\/blog\/2015\/11\/17\/30-mins-with-json-in-mysql\/\" target=\"_blank\" rel=\"noopener\" title=\"30 mins with JSON in MySQL\">30 mins with JSON in MySQL<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/dev.mysql.com\/doc\/refman\/8.0\/en\/document-store.html\" target=\"_blank\" rel=\"noopener\" title=\"Using MySQL as a Document Store\">Using MySQL as a Document Store<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/dasini.net\/blog\/2019\/04\/02\/mysql-json-document-store\/\" target=\"_blank\" rel=\"noopener\" title=\"MySQL JSON Document Store\">MySQL JSON Document Store<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/blogs.oracle.com\/mysql\/post\/two-models-one-world-introducing-json-relational-duality-views-in-mysql-heatwave\" target=\"_blank\" rel=\"noopener\" title=\"Two Models, One World: Introducing JSON Relational Duality Views in MySQL HeatWave\">Two Models, One World: Introducing JSON Relational Duality Views in MySQL HeatWave<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/blogs.oracle.com\/mysql\/post\/defining-json-duality-views-in-mysql\" target=\"_blank\" rel=\"noopener\" title=\"Hands-on with JSON Duality Views in MySQL: From Creation to Day-to-Day Use\">Hands-on with JSON Duality Views in MySQL: From Creation to Day-to-Day Use<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/dev.mysql.com\/doc\/refman\/9.4\/en\/json-duality-views.html\" target=\"_blank\" rel=\"noopener\" title=\"JSON Duality Views\">JSON Duality Views<\/a><\/li>\n<\/ul>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Challenges of Using the JSON Data Type<\/h2>\n\n\n\n<p>NL2SQL in MySQL HeatWave GenAI is easy to use and highly effective when configured with the right context. To help the LLM generate accurate queries, it\u2019s important to narrow its focus by specifying the relevant schemas and tables through the&nbsp;<em>schemas<\/em>&nbsp;and&nbsp;<em>tables<\/em>&nbsp;parameters. Additionally, using clear, descriptive names for tables, columns, and views ensures the model can better interpret their purpose and produce more precise SQL statements.<\/p>\n\n\n\n<p>The core difficulty stems from JSON&rsquo;s structure: the document simultaneously holds both <strong>data and metadata (keys)<\/strong>, yet MySQL treats the entire document as undifferentiated raw data within a single column. From the database&rsquo;s perspective, the column contains a blob of JSON, meaning <strong>there&rsquo;s little or no external schema metadata<\/strong> \u2014 such as explicit column names, data types, or constraints \u2014 to help the LLM interpret the semantic meaning or internal structure of the fields. This inherent lack of external context makes intelligent processing more challenging.<\/p>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong><span style=\"text-decoration: underline;\">Examples<\/span><\/strong><\/p>\n\n\n\n<p>Using <a href=\"https:\/\/dev.mysql.com\/doc\/heatwave\/en\/mys-hwgenai-nl-sql.html\" target=\"_blank\" rel=\"noopener\" title=\"Generates SQL queries using natural-language statements\">nl_sql<\/a> is quite simple:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">CALL sys.NL_SQL(\n  \"NaturalLanguageStatement\",\n  @output,\n  JSON_OBJECT(\n    'schemas', JSON_ARRAY('DBName'),\n    'model_id', 'ModelID'\n  )\n);<\/code><\/pre>\n\n\n\n<p>Replace the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><em><code><strong>NaturalLanguageStatement<\/strong><\/code><\/em>: natural-language statement. It can be a question, statement, or query pertaining to your data available in MySQL HeatWave.<\/li>\n\n\n\n<li><em><code><strong>DBName<\/strong><\/code><\/em>: database to consider for generating and running the SQL query.<\/li>\n\n\n\n<li><em><code><strong>ModelID<\/strong><\/code><\/em>: LLM to use.<\/li>\n<\/ul>\n\n\n\n<p>You can find additional information&nbsp;<a href=\"https:\/\/dev.mysql.com\/doc\/heatwave\/en\/mys-hw-genai-nl-sql.html\" target=\"_blank\" rel=\"noopener\" title=\"Generate SQL Queries From Natural-Language Statements\">here<\/a>.<\/p>\n\n\n\n<p>Let&rsquo;s see an example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">MySQL&gt;\nSELECT model_id, provider \nFROM sys.ML_SUPPORTED_LLMS \nWHERE capabilities LIKE '[\"GENERATION\"]';\n\n+-------------------------------+---------------------------+\n| model_id                      | provider                  |\n+-------------------------------+---------------------------+\n| llama2-7b-v1                  | HeatWave                  |\n| llama3-8b-instruct-v1         | HeatWave                  |\n| llama3.1-8b-instruct-v1       | HeatWave                  |\n| llama3.2-1b-instruct-v1       | HeatWave                  |\n| llama3.2-3b-instruct-v1       | HeatWave                  |\n| mistral-7b-instruct-v1        | HeatWave                  |\n| mistral-7b-instruct-v3        | HeatWave                  |\n| cohere.command-latest         | OCI Generative AI Service |\n| cohere.command-plus-latest    | OCI Generative AI Service |\n| cohere.command-a-03-2025      | OCI Generative AI Service |\n| meta.llama-3.3-70b-instruct   | OCI Generative AI Service |\n| cohere.command-r-08-2024      | OCI Generative AI Service |\n| cohere.command-r-plus-08-2024 | OCI Generative AI Service |\n+-------------------------------+---------------------------+<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"SQL\" class=\"language-SQL\">MySQL&gt; \nSHOW TABLES;\n+------------------------------------+\n| Tables_in_nl2sql_world_json_nested |\n+------------------------------------+\n| city_json_nested                   |\n| country_json_nested                |\n| country_language_json_nested       |\n+------------------------------------+<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">MySQL nl2sql_world_json_nested SQL&gt; SET @nlq = \"Number of cities\";\nQuery OK, 0 rows affected (0.0003 sec)\n\nMySQL nl2sql_world_json_nested SQL&gt; CALL sys.NL_SQL(@nlq, @output, '{\"model_id\": \"meta.llama-3.3-70b-instruct\", \"schemas\":[\"nl2sql_world_json_nested\"]}');\n+-----------------------------------------------------------------------+\n| Executing generated SQL statement...                                  |\n+-----------------------------------------------------------------------+\n| SELECT COUNT(`ID`) FROM `nl2sql_world_json_nested`.`city_json_nested` |\n+-----------------------------------------------------------------------+\n1 row in set (1.6583 sec)\n\n+-------------+\n| COUNT(`ID`) |\n+-------------+\n|        4079 |\n+-------------+\n1 row in set (1.6583 sec)<\/code><\/pre>\n\n\n\n<p>That was straightforward! <\/p>\n\n\n\n<p>Now, let&rsquo;s raise the bar with a slightly more complex query:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">MySQL nl2sql_world_json_nested SQL&gt; SET @nlq = \"Population of Monaco\";\nQuery OK, 0 rows affected (0.0003 sec)\n\nMySQL nl2sql_world_json_nested SQL&gt; CALL sys.NL_SQL(@nlq, @output, '{\"model_id\": \"meta.llama-3.3-70b-instruct\", \"schemas\":[\"nl2sql_world_json_nested\"]}');\n+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n| Executing generated SQL statement...                                                                                                                                   |\n+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n| SELECT JSON_EXTRACT(`city_description`, '$.population') FROM `nl2sql_world_json_nested`.`city_json_nested` WHERE JSON_EXTRACT(`city_description`, '$.name') = 'Monaco' |\n+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n1 row in set (2.1982 sec)\n\nEmpty set (2.1982 sec)\n\nQuery OK, 0 rows affected (2.1982 sec)<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"SQL\" class=\"language-SQL\">MySQL nl2sql_world_json_nested SQL&gt; SET @nlq = \"List all official languages spoken in Canada\";\nQuery OK, 0 rows affected (0.0004 sec)\n\nMySQL nl2sql_world_json_nested SQL&gt; CALL sys.NL_SQL(@nlq, @output, '{\"model_id\": \"meta.llama-3.3-70b-instruct\", \"schemas\":[\"nl2sql_world_json_nested\"]}');\n+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n| Executing generated SQL statement...                                                                                                                                                                                                                                                                |\n+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n| SELECT JSON_EXTRACT(`country_language_description`, '$[*].language') FROM `nl2sql_world_json_nested`.`country_language_json_nested` WHERE JSON_EXTRACT(`country_language_description`, '$[*].country_code') = '\"CAN\"' AND JSON_EXTRACT(`country_language_description`, '$[*].is_official') = 'true' |\n+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n1 row in set (2.3889 sec)\n\nEmpty set (2.3889 sec)\n\nQuery OK, 0 rows affected (2.3889 sec)<\/code><\/pre>\n\n\n\n<p>In both of these recent cases, the generated queries were <strong>syntactically correct<\/strong>, but the system failed to produce a <strong>semantically relevant<\/strong> query.<\/p>\n\n\n\n<p>But all is not lost&#8230;<\/p>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Workaround: Defining Views for Better Context<\/h2>\n\n\n\n<p>A highly effective workaround is to introduce <strong>well-defined views<\/strong> over the existing table. The main idea is to expose the JSON&rsquo;s internal structure by effectively <strong>translating the semi-structured data into a fully relational schema<\/strong>. By using descriptive, explicit column names in these views, you furnish the NL2SQL model with the necessary <strong>semantic metadata<\/strong>. This strategy significantly improves accuracy for complex <strong>JOIN operations<\/strong> and accurate filtering by providing clear, accessible relational keys.<\/p>\n\n\n\n<p>Let&rsquo;s see what the views (<a href=\"https:\/\/github.com\/freshdaz\/MySQL_HeatWave_NL2SQL\/blob\/main\/nl2sql_world_json_nested_-_view_json_nested.sql\" target=\"_blank\" rel=\"noopener\" title=\"nl2sql_world_json_nested_-_view_json_nested.sql\"><em>nl2sql_world_json_nested_-_view_json_nested.sql<\/em><\/a>) might look like:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">CREATE OR REPLACE VIEW country_nested_flat AS\nSELECT\n    ID AS country_id,\n\n    -- Identifiers\n    JSON_UNQUOTE(JSON_EXTRACT(country_description, '$.identifiers.code')) AS country_code,\n    JSON_UNQUOTE(JSON_EXTRACT(country_description, '$.identifiers.code2')) AS country_code2,\n    JSON_UNQUOTE(JSON_EXTRACT(country_description, '$.identifiers.country_name')) AS country_name,\n    JSON_UNQUOTE(JSON_EXTRACT(country_description, '$.identifiers.local_name')) AS local_name,\n\n    -- Geography\n    JSON_UNQUOTE(JSON_EXTRACT(country_description, '$.geography.continent')) AS continent,\n    JSON_UNQUOTE(JSON_EXTRACT(country_description, '$.geography.region')) AS region,\n    CAST(JSON_EXTRACT(country_description, '$.geography.surface_area') AS DECIMAL(12,2)) AS surface_area,\n    CAST(JSON_EXTRACT(country_description, '$.geography.ID_capital') AS SIGNED) AS capital_id,\n\n    -- Demographics\n    CAST(JSON_EXTRACT(country_description, '$.demographics.country_population') AS SIGNED) AS population,\n    CAST(JSON_EXTRACT(country_description, '$.demographics.life_expectancy') AS DECIMAL(5,2)) AS life_expectancy,\n    CAST(JSON_EXTRACT(country_description, '$.demographics.independance_year') AS SIGNED) AS independance_year,\n\n    -- Economy\n    CAST(JSON_EXTRACT(country_description, '$.economy.GNP') AS DECIMAL(15,2)) AS gnp,\n    CAST(JSON_EXTRACT(country_description, '$.economy.GNPOld') AS DECIMAL(15,2)) AS gnp_old,\n\n    -- Government\n    JSON_UNQUOTE(JSON_EXTRACT(country_description, '$.government.head_of_state')) AS head_of_state,\n    JSON_UNQUOTE(JSON_EXTRACT(country_description, '$.government.government_form')) AS government_form\n\nFROM country_json_nested;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">CREATE OR REPLACE VIEW country_language_nested_flat AS\nSELECT\n    ID AS language_id,\n\n    -- Country reference\n    JSON_UNQUOTE(JSON_EXTRACT(country_language_description, '$.country.country_code')) AS country_code,\n\n    -- Language details\n    JSON_UNQUOTE(JSON_EXTRACT(country_language_description, '$.language_info.language')) AS language,\n    JSON_UNQUOTE(JSON_EXTRACT(country_language_description, '$.language_info.is_official')) AS is_official,\n    CAST(JSON_EXTRACT(country_language_description, '$.language_info.percentage') AS DECIMAL(5,2)) AS percentage\n\nFROM country_language_json_nested;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">CREATE OR REPLACE VIEW city_nested_flat AS\nSELECT\n    ID AS json_id,\n\n    -- City identifiers\n    CAST(JSON_EXTRACT(city_description, '$.ID_city') AS SIGNED) AS city_id,\n    JSON_UNQUOTE(JSON_EXTRACT(city_description, '$.city_name')) AS city_name,\n\n    -- Location details\n    JSON_UNQUOTE(JSON_EXTRACT(city_description, '$.location.district')) AS district,\n    JSON_UNQUOTE(JSON_EXTRACT(city_description, '$.location.country_code')) AS country_code,\n\n    -- Demographics\n    CAST(JSON_EXTRACT(city_description, '$.city_population') AS SIGNED) AS population\n\nFROM city_json_nested;<\/code><\/pre>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Let&rsquo;s now re-run our three previous queries, applying this new view-based approach:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">MySQL nl2sql_world_json_nested SQL&gt; SET @nlq = \"Number of cities\";\nQuery OK, 0 rows affected (0.0004 sec)\n\nMySQL nl2sql_world_json_nested SQL&gt; CALL sys.NL_SQL(@nlq, @output, '{\"model_id\": \"meta.llama-3.3-70b-instruct\", \"schemas\":[\"nl2sql_world_json_nested\"]}');\n+----------------------------------------------------------------------------+\n| Executing generated SQL statement...                                       |\n+----------------------------------------------------------------------------+\n| SELECT COUNT(`city_id`) FROM `nl2sql_world_json_nested`.`city_nested_flat` |\n+----------------------------------------------------------------------------+\n1 row in set (1.8282 sec)\n\n+------------------+\n| COUNT(`city_id`) |\n+------------------+\n|             4079 |\n+------------------+\n1 row in set (1.8282 sec)\n\nQuery OK, 0 rows affected (1.8282 sec)<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">MySQL nl2sql_world_json_nested SQL&gt; SET @nlq = \"Population of Monaco\";\nQuery OK, 0 rows affected (0.0004 sec)\n\nMySQL nl2sql_world_json_nested SQL&gt; CALL sys.NL_SQL(@nlq, @output, '{\"model_id\": \"meta.llama-3.3-70b-instruct\", \"schemas\":[\"nl2sql_world_json_nested\"]}');\n+-----------------------------------------------------------------------------------------------------------+\n| Executing generated SQL statement...                                                                      |\n+-----------------------------------------------------------------------------------------------------------+\n| SELECT `population` FROM `nl2sql_world_json_nested`.`country_nested_flat` WHERE `country_name` = 'Monaco' |\n+-----------------------------------------------------------------------------------------------------------+\n1 row in set (2.0889 sec)\n\n+------------+\n| population |\n+------------+\n|      34000 |\n+------------+\n1 row in set (2.0889 sec)\n\nQuery OK, 0 rows affected (2.0889 sec)<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">MySQL nl2sql_world_json_nested SQL&gt; SET @nlq = \"List all official languages spoken in Canada\";\nQuery OK, 0 rows affected (0.0004 sec)\n\nMySQL nl2sql_world_json_nested SQL&gt; CALL sys.NL_SQL(@nlq, @output, '{\"model_id\": \"meta.llama-3.3-70b-instruct\", \"schemas\":[\"nl2sql_world_json_nested\"]}');\n+---------------------------------------------------------------------------------------------------------------------------------------+\n| Executing generated SQL statement...                                                                                                  |\n+---------------------------------------------------------------------------------------------------------------------------------------+\n| SELECT `language` FROM `nl2sql_world_json_nested`.`country_language_nested_flat` WHERE `country_code` = 'CAN' AND `is_official` = 'T' |\n+---------------------------------------------------------------------------------------------------------------------------------------+\n1 row in set (2.0249 sec)\n\n+----------+\n| language |\n+----------+\n| English  |\n| French   |\n+----------+\n2 rows in set (2.0249 sec)\n\nQuery OK, 0 rows affected (2.0249 sec)<\/code><\/pre>\n\n\n\n<p>Q.E.D.<\/p>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Peroraison<\/h2>\n\n\n\n<p>Bridging natural language processing and semi-structured data presents both exciting opportunities and unique challenges. <strong>MySQL HeatWave GenAI\u2019s NL2SQL capability demonstrates how natural language can simplify interaction with complex data systems<\/strong>, even when working with intricate JSON documents. <br>However, because JSON stores both data and metadata together, the absence of explicit schema information can limit how effectively an LLM interprets and formulates queries. Creating well-structured views that expose JSON\u2019s internal organization offers a practical solution \u2014 transforming unstructured data into meaningful relational context. <br>Ultimately, this approach not only enhances NL2SQL\u2019s accuracy but also showcases how <strong>MySQL HeatWave continues to evolve as a powerful engine for intelligent, natural language\u2013driven analytics<\/strong>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69e7334c09cd3&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69e7334c09cd3\" class=\"aligncenter size-full is-resized wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"770\" height=\"550\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2025\/09\/rc24-heatwave-logo.gif?fit=770%2C550&amp;ssl=1\" alt=\"\" class=\"wp-image-8340\" style=\"width:400px\"\/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Agrandir\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n<\/div>\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Resources<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/dasini.net\/blog\/2025\/09\/30\/ask-your-database-anything-natural-language-to-sql-in-mysql-heatwave\/\" target=\"_blank\" rel=\"noopener\" title=\"Ask Your Database Anything: Natural Language to SQL in MySQL HeatWave\">Ask Your Database Anything: Natural Language to SQL in MySQL HeatWave<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/dasini.net\/blog\/2025\/10\/07\/let-your-ai-dba-assistant-write-your-mysql-queries\/\" target=\"_blank\" rel=\"noopener\" title=\"Let Your AI DBA Assistant Write Your MySQL Queries\">Let Your AI DBA Assistant Write Your MySQL Queries<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/blogs.oracle.com\/mysql\/post\/introducing-natural-language-to-sql-for-mysql-heatwave\" target=\"_blank\" rel=\"noopener\" title=\"Introducing Natural Language to SQL for MySQL HeatWave\">Introducing Natural Language to SQL for MySQL HeatWave<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/dev.mysql.com\/doc\/heatwave\/en\/mys-hw-genai-nl-sql.html\" target=\"_blank\" rel=\"noopener\" title=\"Generate SQL Queries From Natural-Language Statements\">Generate SQL Queries From Natural-Language Statements<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/dev.mysql.com\/doc\/heatwave\/en\/mys-hwgenai-nl-sql.html\" target=\"_blank\" rel=\"noopener\" title=\"MySQL HeatWave NL_SQL\">NL_SQL<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/dev.mysql.com\/doc\/heatwave\/en\/mys-hw-genai-supported-models.html\" target=\"_blank\" rel=\"noopener\" title=\"MySQL HeatWave GenAI Supported Models and Languages\">MySQL HeatWave GenAI Supported Models and Languages<\/a><\/li>\n<\/ul>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><a href=\"https:\/\/www.linkedin.com\/groups\/12524512\/\" target=\"_blank\" rel=\"noopener\" title=\"Olivier DASINI on Linkedin\">Follow me on Linkedin<\/a><\/p>\n\n\n\n<p>Watch my videos on my <a href=\"https:\/\/www.youtube.com\/channel\/UC12TulyJsJZHoCmby3Nm3WQ\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"Olivier's MySQL Channel\">YouTube channel<\/a> and <a href=\"https:\/\/www.youtube.com\/channel\/UC12TulyJsJZHoCmby3Nm3WQ\/?sub_confirmation=1\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"Subscribe\">subscribe<\/a>.<\/p>\n\n\n\n<p>My <a href=\"https:\/\/www.slideshare.net\/freshdaz\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"Olivier DASINI on Slideshare\">Slideshare account<\/a>.<\/p>\n\n\n\n<p>My <a href=\"https:\/\/speakerdeck.com\/freshdaz\/\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"Olivier DASINI on Speaker Deck\">Speaker Deck account<\/a>.<\/p>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"has-vivid-red-color has-text-color\"><strong>Thanks for using HeatWave &amp; MySQL!<\/strong><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Bridging natural language processing with semi-structured data brings both opportunity and complexity.<\/p>\n<p>MySQL HeatWave GenAI\u2019s NL2SQL feature shows how natural language can simplify data interaction \u2014 even for JSON documents. Yet, because JSON embeds both data and metadata within a single column, LLMs may struggle without explicit schema cues.<\/p>\n<p>By creating well-structured views that reveal JSON\u2019s internal organization, you can transform unstructured data into a relational format the model understands \u2014 improving both query accuracy and overall usability.<\/p>\n<p>This approach highlights how MySQL HeatWave continues to evolve as a powerful engine for intelligent, natural language\u2013driven analytics.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"footnotes":""},"categories":[1702,1740,1716,1719,203,339],"tags":[1700,1697,1756],"class_list":["post-8442","post","type-post","status-publish","format-standard","hentry","category-ai","category-artificial-intelligence","category-howto-en","category-mds-en","category-mysql-en","category-tuto-en","tag-genai","tag-heatwave-fr-en","tag-nl2sql"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9LfWW-2ca","jetpack-related-posts":[{"id":8285,"url":"https:\/\/dasini.net\/blog\/2025\/09\/30\/ask-your-database-anything-natural-language-to-sql-in-mysql-heatwave\/","url_meta":{"origin":8442,"position":0},"title":"Ask Your Database Anything: Natural Language to SQL in MySQL HeatWave","author":"Olivier DASINI","date":"30 septembre 2025","format":false,"excerpt":"Natural Language to SQL in MySQL HeatWave makes data accessible to everyone, not just SQL experts. By turning plain English into optimized queries, it removes barriers and speeds up insights. While best practices help ensure accuracy, the feature already shows how LLMs are transforming the way we work with data.\u2026","rel":"","context":"Dans &quot;AI&quot;","block_context":{"text":"AI","link":"https:\/\/dasini.net\/blog\/category\/ai\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2025\/09\/nl2sql-demo3.gif?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2025\/09\/nl2sql-demo3.gif?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2025\/09\/nl2sql-demo3.gif?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2025\/09\/nl2sql-demo3.gif?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2025\/09\/nl2sql-demo3.gif?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2025\/09\/nl2sql-demo3.gif?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":8393,"url":"https:\/\/dasini.net\/blog\/2025\/10\/07\/let-your-ai-dba-assistant-write-your-mysql-queries\/","url_meta":{"origin":8442,"position":1},"title":"Let Your AI DBA Assistant Write Your MySQL Queries","author":"Olivier DASINI","date":"7 octobre 2025","format":false,"excerpt":"Having explored the innovative MySQL HeatWave technology that converts Natural Language into SQL (Ask Your Database Anything: Natural Language to SQL in MySQL HeatWave), our next article in this series, dives into a practical use case demonstrating how an AI DBA Assistant can significantly simplify your query generation workflow. In\u2026","rel":"","context":"Dans &quot;AI&quot;","block_context":{"text":"AI","link":"https:\/\/dasini.net\/blog\/category\/ai\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2025\/10\/reltime_monitor.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2025\/10\/reltime_monitor.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2025\/10\/reltime_monitor.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2025\/10\/reltime_monitor.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":6752,"url":"https:\/\/dasini.net\/blog\/2024\/08\/07\/heatwave-genai-your-ai-powered-content-creation-partner\/","url_meta":{"origin":8442,"position":2},"title":"HeatWave GenAI: Your AI-Powered Content Creation Partner","author":"Olivier DASINI","date":"7 ao\u00fbt 2024","format":false,"excerpt":"Generative artificial intelligence (GenAI) is reshaping the content creation landscape. By training on vast datasets, these \"intelligent\" systems can produce new, human-quality content across a multitude of domains. Oracle's HeatWave GenAI (starting with version 9.0.1) is at the forefront of this revolution, offering an integrated platform that combines in-database large\u2026","rel":"","context":"Dans &quot;AI&quot;","block_context":{"text":"AI","link":"https:\/\/dasini.net\/blog\/category\/ai\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2024\/07\/hw_product_image.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2024\/07\/hw_product_image.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2024\/07\/hw_product_image.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2024\/07\/hw_product_image.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2024\/07\/hw_product_image.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2024\/07\/hw_product_image.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":7252,"url":"https:\/\/dasini.net\/blog\/2025\/02\/11\/building-an-interactive-llm-chatbot-with-heatwave-using-python\/","url_meta":{"origin":8442,"position":3},"title":"Building an Interactive LLM Chatbot with  HeatWave Using Python","author":"Olivier DASINI","date":"11 f\u00e9vrier 2025","format":false,"excerpt":"AI-powered applications require robust and scalable database solutions to manage and process large amounts of data efficiently. HeatWave is an excellent choice for such applications, providing high-performance OLTP, analytics, machine learning and generative artificial intelligence capabilities. In this article, we will explore a Python 3 script that connects to an\u2026","rel":"","context":"Dans &quot;HeatWave&quot;","block_context":{"text":"HeatWave","link":"https:\/\/dasini.net\/blog\/category\/heatwave-en\/"},"img":{"alt_text":"simple but robust chatbot system leveraging HeatWave GenAI and its in-database Mistral LLM","src":"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2025\/02\/HW-Chat-mistral-7b.gif?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2025\/02\/HW-Chat-mistral-7b.gif?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2025\/02\/HW-Chat-mistral-7b.gif?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2025\/02\/HW-Chat-mistral-7b.gif?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2025\/02\/HW-Chat-mistral-7b.gif?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":7058,"url":"https:\/\/dasini.net\/blog\/2024\/12\/10\/simplifying-ai-development-a-practical-guide-to-heatwave-genais-rag-vector-store-features\/","url_meta":{"origin":8442,"position":4},"title":"Simplifying AI Development: A Practical Guide to HeatWave GenAI\u2019s RAG &amp; Vector Store Features","author":"Olivier DASINI","date":"10 d\u00e9cembre 2024","format":false,"excerpt":"This tutorial explores HeatWave GenAI, a cloud service that simplifies interacting with unstructured data using natural language. It combines large language models, vector stores, and SQL queries to enable tasks like content generation, chatbot, and retrieval-augmented generation (RAG). The focus is on RAG and how HeatWave GenAI\u2019s architecture helps users\u2026","rel":"","context":"Dans &quot;AI&quot;","block_context":{"text":"AI","link":"https:\/\/dasini.net\/blog\/category\/ai\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2024\/12\/HeatWave_chatbot3.gif?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2024\/12\/HeatWave_chatbot3.gif?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2024\/12\/HeatWave_chatbot3.gif?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2024\/12\/HeatWave_chatbot3.gif?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2024\/12\/HeatWave_chatbot3.gif?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2024\/12\/HeatWave_chatbot3.gif?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":7363,"url":"https:\/\/dasini.net\/blog\/2025\/03\/13\/build-an-ai-powered-search-engine-with-heatwave-genai-part-1\/","url_meta":{"origin":8442,"position":5},"title":"Build an AI-Powered Search Engine with HeatWave GenAI (part 1)","author":"Olivier DASINI","date":"13 mars 2025","format":false,"excerpt":"Discover how to build an AI-powered search engine for your applications using HeatWave GenAI. This approach leverages large language models (LLMs) for semantic search, offering a smarter alternative to traditional SQL and full-text search methods. By using embeddings\u2014vector representations of words\u2014the search engine understands context and intent, delivering more relevant\u2026","rel":"","context":"Dans &quot;AI&quot;","block_context":{"text":"AI","link":"https:\/\/dasini.net\/blog\/category\/ai\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2025\/03\/HW_GenaI_search_engine.gif?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2025\/03\/HW_GenaI_search_engine.gif?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2025\/03\/HW_GenaI_search_engine.gif?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2025\/03\/HW_GenaI_search_engine.gif?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2025\/03\/HW_GenaI_search_engine.gif?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2025\/03\/HW_GenaI_search_engine.gif?resize=1400%2C800&ssl=1 4x"},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/dasini.net\/blog\/wp-json\/wp\/v2\/posts\/8442","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dasini.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dasini.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dasini.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/dasini.net\/blog\/wp-json\/wp\/v2\/comments?post=8442"}],"version-history":[{"count":83,"href":"https:\/\/dasini.net\/blog\/wp-json\/wp\/v2\/posts\/8442\/revisions"}],"predecessor-version":[{"id":8527,"href":"https:\/\/dasini.net\/blog\/wp-json\/wp\/v2\/posts\/8442\/revisions\/8527"}],"wp:attachment":[{"href":"https:\/\/dasini.net\/blog\/wp-json\/wp\/v2\/media?parent=8442"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dasini.net\/blog\/wp-json\/wp\/v2\/categories?post=8442"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dasini.net\/blog\/wp-json\/wp\/v2\/tags?post=8442"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}