Data, Analytics and AI
SQL for analysis
SQL is the point where an analyst stops waiting for somebody else's export. This page treats the language as analysts use it: selecting, joining, grouping and windowing inside a warehouse, reading tables other people designed, and writing queries a colleague can check line by line. Designing those tables for an application is developer work and lives under programming; here the concern is getting an answer out of them that holds up.
Why this topic exists: Querying, joining, aggregating and windowing data is the analyst's first real tool and the language of every warehouse (DP-900 relational concepts; DMBOK Data Storage and Operations; the programming field owns database design).
SQL for analysis is a narrower set of habits than SQL for building applications. The analyst reads far more than writes, works in tables somebody else designed and is judged on whether a number is right, not on whether a transaction commits quickly. Microsoft's DP-900 places the language inside its relational concepts area, beside normalisation and common database objects, and DMBOK files the stores themselves under Data Storage and Operations. Neither framework is about analysis as such, which is why the analyst's craft is learned mostly in practice. The questions arrive from colleagues in plain language, and translating them into the right tables is half the work.
Five moves that cover most questions
- Filter and select. Choosing columns and rows, with care over how NULL behaves in comparisons.
- Join. Combining tables on keys, and knowing before running the query how many rows each side should contribute.
- Aggregate. GROUP BY with counts, sums and averages, and HAVING to filter the groups themselves.
- Window. Rankings, running totals and comparisons with the previous row, computed without collapsing rows the way grouping does.
- Structure. Common table expressions that break a long query into named steps a colleague can read from top to bottom.
Behind the moves sits the idea that decides most errors: grain. Every table has one, a row per order, per order line or per customer per day. Join an orders table to its lines and then sum the order totals, and each order is counted once for every line it contains. The query runs, the figure looks plausible and it is wrong. Distinct counts carry the same trap in reverse: counting customers after joining them to their orders works only with a distinct count of the key, and an average of averages misleads whenever the groups differ in size. Comparing row counts before and after each join is the cheapest habit in analytics.
The beginner's mistake
Learning syntax on a tutorial database of five tidy tables and then freezing in front of a warehouse with eight hundred. The real skill is reading a schema: finding the documentation and the keys, noticing which tables are views over others, and asking the owner what a column actually holds before trusting it.
Where the queries run
Analytical SQL now mostly runs in cloud warehouses such as Snowflake, which charge for compute, so a careless scan of a large table costs money as well as time. Pipelines built through data engineering fill those warehouses, and dbt lets analysts turn their queries into versioned, tested models inside the same pipeline. For practice away from work, freeCodeCamp's Relational Databases certification has learners build and query real databases at no cost, and the SQL tool page covers dialects and engines. Designing the tables belongs to databases and SQL under programming. Turning results into charts continues in data visualisation and BI, and the framing of a question before any query is written sits under data analysis fundamentals.
Next to this topic
- Data analysis fundamentalsAsk, prepare, process, analyse, share: the analyst's workflow as Google's programme and DP-900's core data concepts teach it, before any tool (SFIA Data analytics).
- Data visualisation and business intelligenceDashboards, reports and the semantic models behind them: PL-300's four skill areas and DMBOK's Data Warehousing and BI area (Tableau, Power BI, Looker).
- Statistics and experimentationProbability, inference, regression and A/B tests separate a chart from a claim (Google's Advanced Data Analytics; SFIA Data science).
- Python for data workpandas, NumPy, notebooks and plotting: the working environment of analysis and machine learning (SFIA Data science; the AI pillar's argument for Python).
- Data engineering and pipelinesIngestion, transformation, warehouses, lakehouses and orchestration (DMBOK Data Integration and Interoperability; DEA-C01; DP-700; Databricks; Spark, Airflow, dbt).
- Data governance, quality and privacyOwnership, definitions, metadata, master data, quality rules and lawful use are DMBOK's centre and half its wheel; nobody hires for them until the numbers disagree.
- Machine learningSupervised and unsupervised learning, model evaluation, deep learning and the discipline of not fooling yourself (SFIA Machine learning; AIF-C01; Azure AI Fundamentals).
- Generative AI, LLMs and agentsFoundation models, prompting, retrieval, fine-tuning and agents: the newest layer of the field and the one AIF-C01 and Azure AI Fundamentals now test (the AI portal reads the concepts in order).
- Natural language processing and computer visionText and images are the two applied fields where classic machine learning met deep learning first, and where most production AI still lives (SFIA Machine learning; Azure AI Fundamentals AI-901 workloads).
- Responsible AI and AI governanceBias, transparency, privacy, safety and the frameworks that make them work (NIST AI RMF; AIF-C01's responsible-AI domain; SFIA 9's AI and data ethics skill; the EU AI Act).
- MLOps and AI engineeringGetting a model or an LLM application into production and keeping it there: deployment, monitoring, evaluation, cost (SFIA Machine learning and Data engineering; Applied Skills in Foundry; MLOps in the AI portal).
Concepts to know
Glossary entries with the reason each one matters here.
- SQL
The topic's language.
- Data Engineering
Warehouses are where analytical SQL runs.
Certifications that test it
Vendor exams and free certificates; facts, cost and the preparation path are on each page, and the certifications hub has them all.
Tools of the trade
Frequently asked
- How much SQL does a data analyst need?
- Enough to answer a new question against an unfamiliar schema without help: joins across several tables, grouping, window functions and common table expressions. Interview tasks usually test exactly those, often with a trap involving NULLs or duplicated rows.
- Which SQL dialect should I learn first?
- Any major one. PostgreSQL, SQL Server, BigQuery and Snowflake differ in date functions and a handful of keywords, not in the core. Learn one well, keep notes on the differences you meet, and expect a short period of adjustment after switching.
- Should an analyst learn SQL or Python first?
- SQL, in most jobs, because the data lives in a database and the first task is getting it out correctly. Python for data earns its place once the work outgrows what a single query can do.
Courses in the directory
71 courses are filed here; the top 6 by our ranking, details and the provider link on each course page.
Last reviewed 26 September 2026 · Getting Digital
