Generative AI Code Generation for Natural Language Data Analysis

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Users without specialized knowledge of Structured Query Language (SQL) find it difficult and time-consuming to analyze data stored in databases, hindering their ability to utilize data effectively.

Innovation Solution

A method and electronic device that utilize a generative artificial intelligence model to generate an SQL statement from a user's natural language query, allowing selection of a target database, generating a prompt, and executing the SQL statement to perform data analysis, displaying the results on a user terminal.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Ease of operation

If a system is implemented to perform data analysis according to a user's natural language query, then user convenience is improved and more users can utilize data, but the system complexity increases due to the need for AI models and integration with databases

Engineering Contradiction:
Improveuser convenienceVSAvoidsystem complexity
Core Design Contradiction:
Ease of operationVSDevice complexity

Solution Approach 1:

The patent introduces a code generation model as an intermediary component that translates natural language queries into SQL statements. This mediator enables users without SQL knowledge to perform data analysis by simply formulating questions in natural language, while the system handles the complex SQL generation and execution underneath, thus resolving the contradiction between ease of operation and system complexity

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent replaces the mechanical approach of requiring users to manually write and execute SQL code with an AI-based natural language processing system. Instead of users directly manipulating SQL syntax, the system uses generative AI models to automatically generate and execute queries, substituting the complex mechanical process of SQL writing with a more user-friendly natural language interface

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

2Productivity

If users are required to write SQL statements directly, then data analysis can be performed with precise control, but it becomes difficult and time-consuming for users without specialized training

Engineering Contradiction:
Improvedata analysis efficiencyVSAvoidease of SQL writing
Core Design Contradiction:
ProductivityVSEase of operation

Solution Approach 1:

The system enables self-service data analysis by allowing users to formulate their own questions in natural language without needing to learn SQL syntax. The code generation model automatically translates these user-friendly queries into executable SQL statements, making the system serve itself by handling the technical translation work rather than requiring users to manually write complex queries

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The code generation model acts as an intermediary that bridges the gap between simple natural language queries and complex SQL statements. This mediator translates user-friendly questions into precise SQL code, enabling users to perform data analysis efficiently without needing specialized training in SQL syntax

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS20250209065A1Method of performing data analysis according to natural language query by using generative artificial intelligence, and electronic device for performing the same
Publication Date: 2025.06.26 SAMSUNG ELECTRONICS CO LTD
  • US20250209065A1 patent drawing
  • US20250209065A1 patent drawing
  • US20250209065A1 patent drawing

AI summary

A method of performing data analysis according to a natural language query from a user includes: receiving, from a user terminal, a user input including the natural language query requesting the data analysis; determining, based on the user input, at least one database among a plurality of databases as a target database; generating a prompt based on the user input and the target database; inputting the prompt into a code generation model to obtain a structured query (SQL) statement; executing the SQL statement to generate a result of the data analysis on the target database; and transmitting the result of the data analysis to the user terminal, where the result of the data analysis is displayed on a screen of the user terminal.