Large models are changing how enterprises access and use data. In the past, business users who wanted to query business data often had to submit requirements to technical staff, who then wrote SQL or built reports. Today, with technologies such as Text2SQL, users can ask questions in natural language, and the model generates query statements and returns results. The threshold for data querying is indeed lowering.

But this raises a question: when large models can connect to databases and generate SQL, do enterprises still need to build a data middle platform and carry out data governance?

This cannot be judged only by SQL generation capability. For enterprises, a query statement being executable is only one part of data use. Whether the data is accurate, whether statistical definitions are consistent, whether sources are clear, and whether results can support business judgment are also issues that must be considered in AI application implementation.

Queryable does not mean correct

A database table structure can tell the model what tables and fields exist, but it cannot necessarily fully express the enterprise’s internal business rules. For example, a database may contain order amount, payment amount, and refund amount fields, but what the enterprise means by “sales” — which field to use, what time basis to apply, and whether refunds are deducted — must be determined according to specific business definitions. If the model does not understand these rules, even if the generated SQL is syntactically correct and executes without error, the result may still be inconsistent with business expectations.

Why can the business result still be wrong when the SQL is not wrong?

Consider a retail enterprise with order, payment, and refund tables. A manager asks AI: “What was last month’s sales?” AI aggregates order amount by order creation time and gets RMB 12 million; the sales department counts paid order amount and gets RMB 10.5 million; the finance department, under the enterprise’s agreed net amount basis, deducts RMB 700,000 in refunds meeting the rules and gets RMB 9.8 million. The amounts are illustrative, not real enterprise operating data, and are not equivalent to the financial revenue recognition basis.

The difference mainly comes from different statistical objects and calculation rules. At least the following need to be clarified: statistical object — all orders or only paid orders; statistical time — order placement time or payment time; refund handling — at what point and under what rules refunds are deducted; data association — how order, payment, and refund records are associated and whether duplicate calculation exists. SQL itself may have no syntax errors and execute normally, but the final result may still deviate from business reality.

The problem is not SQL, but that AI does not know how the enterprise defines business

Field names cannot replace business definitions. Effective order determination, the month in which refunds are deducted, and whether metrics include taxes and discounts often need to be determined in combination with actual enterprise business rules. When an enterprise has not yet formed clear and unified metric definitions, it is difficult for AI to accurately understand the business relying only on field names or field comments.

More data does not necessarily fill this understanding gap. Different enterprise systems may have differences in data definitions and management. For example, the same customer may correspond to multiple IDs in different systems; “completed” in an order system may mean payment succeeded, while “completed” in a logistics system may mean the goods have been signed for. Historical data may also contain duplicate records, missing fields, or untimely updates. Without unified data standards and quality management mechanisms, the more data the model is exposed to, the more differences it may need to handle. This type of problem cannot simply be attributed to large model hallucination.

Establish unified data definitions first

To let AI query data according to business requirements, enterprises first need to clarify the definitions of commonly used metrics. For sales-related metrics, “order amount,” “paid amount,” and “net sales” can be defined separately, clarifying the calculation formula, order status, statistical time, refund handling rules, and statistical granularity for each metric. Unified definitions do not mean that sales, finance, and other departments must use the same number. Different departments may have different management and accounting needs; the key is that every statistical result has a clear name, definition, and scope of application.

Enterprises also need to clarify which data should be queried. The same type of business data may exist in original business tables, cleaned detail tables, and daily summary tables. Different tables have different purposes, update frequencies, and quality states. Enterprises need to systematically organize data assets: data asset catalog, metadata and data lineage, and data quality management. Through these foundational efforts, developers and AI applications can more clearly understand where data comes from, what processing it has undergone, and whether it is suitable for the current analysis scenario.

AI queries should also be constrained by rules and permissions. Compared with directly exposing all physical data tables to the model, a more prudent approach is to prioritize letting AI use confirmed metrics, data models, or data services. For ambiguous questions, necessary confirmation should be made first; for questions without corresponding data, the model should not fabricate numbers; for data beyond the permission scope, access control should not be bypassed to complete the query. These measures cannot guarantee that AI queries will never make mistakes, but they can reduce the space for the model to guess business rules.

How qData Data Middle Platform supports AI applications

qData Data Middle Platform builds a standardized data foundation for enterprises through data integration, data development, data modeling, metric management, metadata management, data lineage, and asset catalog. On this basis, qData Intelligent Data Querying supports business users in natural-language data queries.

For order, payment, and refund data, enterprises first need to integrate data scattered across different business systems, then complete cleansing, transformation, and association according to actual analysis needs to form data models that support business analysis. qData can ingest data from different systems through data integration, complete data cleansing, transformation, and association through data development, and organize processed data into business models with clear granularity through data modeling.

After data modeling, enterprises also need to clarify the business meaning and usage rules of data. On the basis of models, qData’s related definition capabilities in data modeling and supporting metric management capabilities can organize statistical rules, analysis dimensions, and scope of application for metrics such as sales, so that metric definitions no longer exist only in individually written SQL or scattered business reports. At the same time, metadata management, data lineage, and data asset catalog can record data sources, processing, and related usage information.

It should be noted that data modeling, metadata management, data lineage, and asset catalog are mainly used to standardize data organization and management; metric management involves coordination with supporting metric management capabilities. Together they help enterprises establish relatively clear data definitions and usage basis, but different product capabilities should not be conflated.

When business users again ask “What was last month’s sales?”, the query process should not stop at letting AI generate a piece of SQL based on original table structures. More importantly, the query should be carried out around organized data models and clear business definitions as much as possible, reducing situations where the model selects data sources and infers metric meanings on its own. qData Intelligent Data Querying supports users in performing natural-language queries within a selected data scope and viewing query results, charts, and Text2SQL content. Business users can further check the query logic with the returned data and SQL.

Of course, existing data models do not mean AI will automatically follow all enterprise metric rules. Enterprises still need to configure data scope and query constraints based on actual product capabilities and perform necessary validation on key query results. The data middle platform provides a more standardized data foundation to help AI query within relatively clear data scopes and business definitions, rather than guaranteeing that all statistical results will necessarily be correct after AI is connected.

Large models have indeed lowered the threshold for enterprise data querying. For query needs with simple data structures and clear business rules, directly using AI to generate SQL can already provide convenience. But when enterprises need to integrate data across systems, unify departmental metric definitions, and use query results for business analysis and decision-making, SQL generation capability alone is still not enough.

AI solves how to ask questions and obtain data more conveniently; data governance focuses on whether data is standardized, definitions are clear, and sources are traceable. They are not substitutes. The deeper large models enter enterprise business, the more attention should be paid to data quality, business semantics, and data management foundations. For enterprises hoping to further develop intelligent data querying and AI data applications, data governance remains a link that needs serious construction.

DataGovernance #Text2SQL #DataMiddlePlatform #AI #DataQuality #Metadata #DataLineage #qData