Automatic Data Model Generation from SQL Statements
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current automated database modeling tools are limited in their ability to generate a comprehensive data model from a database, as they only explicitly map previously defined queries and fail to uncover implicit information that can be inferred from the data, providing an incomplete understanding of the database.
Innovation Solution
A method and system for automatically generating a data model from a structured query language (SQL) statement, which involves parsing the SQL statement to extract table references, selecting all fields, and generating a data model, optionally adding aliases, derived fields, and sorting parameters, while also detecting syntax errors and identifying common elements with other data models to enhance the model.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Loss of information
If automated database modeling tools only explicitly map previously defined queries, then the modeling process is simple and straightforward, but the data model remains incomplete and fails to uncover implicit information
Solution Approach 1:
The system performs preliminary actions by executing the SQL query against the database to retrieve actual data results before generating the data model. This preliminary data retrieval enables the system to analyze implicit information in the data itself, such as inferred relationships and patterns, rather than relying solely on explicit query definitions. The retrieved data serves as a foundation for discovering additional semantic information that would otherwise remain hidden.
Solution Approach 2:
The patent introduces an intermediary data analysis layer between the SQL query and the final data model. This intermediary processes the actual query results to extract implicit information, such as inferred relationships between entities, cardinality constraints, and semantic meanings that are not explicitly defined in the query structure. This intermediary analysis bridge connects the explicit query syntax with the implicit data semantics.
2Loss of information
If a comprehensive data model is generated by analyzing all query results, then the understanding of database structure is deeper and more complete, but the processing time and computational resources increase
Solution Approach 1:
The system extracts only the essential and relevant implicit information from the query results rather than processing all possible data attributes. It identifies and extracts key relationships, entity types, and cardinality constraints that are most important for building an accurate data model, while ignoring redundant or less significant information. This selective extraction reduces processing overhead while maintaining model quality.
Solution Approach 2:
The patent applies partial action by focusing the analysis on specific aspects of the query results that are most indicative of the database structure, such as primary key relationships, foreign key constraints, and entity-cardinality patterns. Rather than exhaustively analyzing every possible data attribute and relationship, the system concentrates computational effort on the most informative subsets of the data, achieving good model quality with reduced processing time.
3Quantity of substance
If all fields from referenced tables are selected and added to the data model, then the data model becomes more comprehensive, but the complexity of managing and displaying the model increases
Solution Approach 1:
The system segments the comprehensive set of fields into logical groups based on their functional relationships and semantic meanings. It organizes fields into entity types, relationship types, and attribute categories, making the large number of fields more manageable and easier to navigate. This segmentation transforms a flat, overwhelming list of fields into a structured, hierarchical organization that improves usability.
Solution Approach 2:
The patent adds another dimension to field organization by introducing semantic categorization and relationship-based grouping beyond simple table membership. Fields are organized not just by their source table but also by their role in relationships, their semantic category, and their connectivity to other fields. This multi-dimensional organization makes it easier to manage and understand large numbers of fields by providing multiple ways to navigate and filter them.
Data Source
AI summary
A method for the automatic generation of a data model from an SQL statement includes receiving a single SQL statement in a user interface to a data analytics application, parsing the single SQL statement and extracting from the SQL statement different table references. The method also includes, for each one of the table references, directing a selection of all fields available in a corresponding table and storing the available fields in a collection of fields implicated by each table referenced by the table references. Finally, the method includes generating a data model with the fields in the collection of fields and displaying a view of the data model in a user interface of the data analytics application.

