# AI models, data models and the 20% of SQL you will use every day

Source: https://sarang.pro/ai-models-data-models-and-sql/
Author: Sarang | Published: 24 October 2026

Analysts are expected to know a little about AI, a fair amount about data and a lot about turning both into decisions. Here is a plain map of the three, without the hype.

## Six kinds of AI model

TypeGood atExamples
Machine learningClassifying, predicting, spotting patterns in tables of dataDecision trees, gradient boosting
Deep learningUnstructured data: images, audio, textNeural networks, transformers
Language modelsUnderstanding and producing textChat assistants, summarisers
Generative modelsCreating new text, images or audioText and image generators
Hybrid systemsCombining rules or search with AI for accuracy and contextRetrieval-augmented generation
Computer visionDetecting and recognising things in images and videoObject detection, medical scans

For most business problems the first question is not which model, but whether a rule, a query or a spreadsheet would do. When it would not, the table above narrows the choice.

## How data is shaped

Many reporting problems start with how data is modelled, long before anyone writes a query. The main shapes are worth recognising:

- **Relational** tables linked by keys: the backbone of most business systems.

- **Dimensional** (star schema): a fact table of events, such as sales, surrounded by dimensions such as date, product and customer. This is the usual shape behind Power BI and other dashboards.

- **Entity-relationship** models: the design step that sets out entities and how they relate before building tables.

- **Graph** models: nodes and connections, suited to networks, recommendations and fraud detection.

- **Data vault**: hubs, links and satellites, built to keep full history and audit trails at scale.

- **Hierarchical** and **object-oriented** models: trees and objects, common in configuration files and application code.

## The SQL you will actually use

You do not need to master every function. A small set covers most daily work: SELECT and FROM to choose data, WHERE to filter, JOIN to combine tables, GROUP BY with SUM, COUNT and AVG to summarise, and ORDER BY to sort. Add CASE for simple categories and window functions when you need running totals or rankings.

One habit prevents most mistakes: check the number of rows after every join. If a join multiplies rows unexpectedly, every total after it is wrong.

## Where AI already helps analysts

AI assistants are already useful for first drafts: emails, meeting notes and executive summaries; procedures such as a month-end close checklist or an expense policy; and first-pass analysis of cost, pricing, cash flow or sensitivity. They are also good at explaining unfamiliar SQL or formulas. Treat every number they produce as a draft to verify against the source.

In KPI reporting, the slow part is rarely the calculation. It is agreeing definitions and cleaning the data, and that still needs a person who understands the business.