SQL (Structured Query Language) for BAs: when the same query behaves differently
SQL is a standard, but each database adds its own words and rules. Learn what usually differs so a query that works in one place does not surprise you in another.
L1–L4 are part of the Pro pass
L0 Explain simply
Analogy: one language, several accents. People share most of the words. A few words, and the way letters are ordered, change from place to place. A visitor understands the sentence and still gets caught by one local word.
Daily List is a made-up to-do app (SYNTHETIC / TRAINING ONLY). Sam, the , writes a report on SQLite and later runs it on the team's PostgreSQL database. Nina, the , sees a different answer and asks why.
What it is: (Structured Query Language) is a language for asking a database questions. A table is a grid, a row is one record, and a column is one fact. An is the version of that language one product speaks. The portable core is the shared part: SELECT, WHERE, JOIN, GROUP BY and ORDER BY. A collation is the rule for comparing and sorting text, including whether case matters. You meet a dialect inside one product, such as PostgreSQL, MySQL, SQLite or SQL Server. The neighbour of the portable core is a local extra, such as a date function that exists in only one product.
Why it matters: A query can run and still mean a different thing. In the run below, subtracting 7 from the current date did not mean seven days. Sam would have filtered the wrong tasks and not seen an error.
The accent picture stops at the grammar. A wrong date function does not sound odd. It returns a number.
PLAIN WORDS · 2 in this section
- sqlite
- a small free database tool
- subtracting
- taking one amount away from another
PICTURE IT
The picture is the one the lesson above opens with. The table below shows how each part of it matches the work.
THE REAL JOB Understanding regional accents of one language.
- Core
- Local
- Test
HOW THE PICTURE MAPS
| In the picture | In the work |
|---|---|
| The language | SQL |
| An accent | A dialect |
| Common words | The portable core |
| Local slang | Local functions |
WHERE THIS PICTURE STOPS
- Accents are spoken, but dialects are enforced by software.
- A listener adapts, but a database does not.
- Accents drift slowly, but versions change.
HOOK
Core first, test local.
TELL A FRIEND
Accents: common words first, local words checked.
OFTEN MIXED UP WITH SQL for BAs: SELECT and WHERE. That topic teaches the shared basics. This one explains where databases differ.
PRACTISE AND KEEP
Sources for this topic — 9 sources
- Market practice
SELECT command reference (PostgreSQL documentation) ↗ — PostgreSQL · PostgreSQL 18, SELECT: WHERE/HAVING/output aliases, functional dependence, NULL ordering and LIMIT; publisher page opened6November 2026. Dialect scope explicit.
PostgreSQL18 publisher documentation opened on6November2026: SELECT: WHERE/HAVING/output aliases, functional dependence, NULL ordering and LIMIT. No execution on PostgreSQL is claimed; engine-specific examples remain scoped to18.
- Market practice
PostgreSQL18: date/time functions ↗ — PostgreSQL Global Development Group · PostgreSQL 18: date/time functions; §9.9 typed date arithmetic and truncation/timezones. Publisher page opened6November 2026.
Publisher documentation opened on6November2026. Engine/version scope is explicit; other database implementations may differ. Teaching queries are synthetic, not a required publisher template.
- Market practice
SQLite: SQL expressions ↗ — SQLite project · SQLite: SQL expressions; CASE/BETWEEN/IN/EXISTS, scalar cardinality, NULL-safe equality and parameter values. Publisher page opened6November 2026.
Publisher documentation opened on6November2026. Engine/version scope is explicit; other database implementations may differ. Teaching queries are synthetic, not a required publisher template.
- Market practice
SQLite: date/time functions ↗ — SQLite project · SQLite: date/time functions; ISO text/julianday/date modifiers, numeric subtraction contrast. Publisher page opened6November 2026.
Publisher documentation opened on6November2026. Engine/version scope is explicit; other database implementations may differ. Teaching queries are synthetic, not a required publisher template.
- Market practice
SELECT: compound select statements (SQLite documentation) ↗ — SQLite project · SQLite rolling SELECT documentation opened6November 2026; §§2–5 joins/grouping/bare columns/compound queries/order/limit. UNION ALL supported; INTERSECT ALL/EXCEPT ALL are not. Synthetic fixtures rechecked on3.53.1; historical3.40.1 observations retain their date/version.
SQLite rolling SELECT documentation opened6November2026; §§2–5 joins/grouping/bare columns/compound queries/order/limit. UNION ALL supported; INTERSECT ALL/EXCEPT ALL are not. Synthetic fixtures rechecked on3.53.1; historical3.40.1 observations retain their date/version.
- Market practice
Oracle Database19: CURRENT_DATE ↗ — Oracle · Oracle Database19: CURRENT_DATE; Session timezone and Oracle DATE time component. Publisher page opened6November 2026.
Publisher documentation opened on6November2026. Engine/version scope is explicit; other database implementations may differ. Teaching queries are synthetic, not a required publisher template.
- Market practice
Oracle Database19: SYSDATE ↗ — Oracle · Oracle Database19: SYSDATE; Server OS date and time, distinct from session CURRENT_DATE. Publisher page opened6November 2026.
Publisher documentation opened on6November2026. Engine/version scope is explicit; other database implementations may differ. Teaching queries are synthetic, not a required publisher template.
- Market practice
String comparison functions and operators (MySQL reference manual) ↗ — Oracle / MySQL · MySQL 8.4 publisher manual opened6November 2026. String comparison/LIKE collation and trailing-space behavior; target collation must be checked.
MySQL8.4 publisher manual opened6November2026. String comparison/LIKE collation and trailing-space behavior; target collation must be checked.
- Simplified educational illustration
Payments Signal editorial teaching models — Payments Signal
What this simplifies: Daily List people, data and exercises are invented for teaching. Query results belong to the declared fixture and database version. Authorization, business identity, time bounds and unknown-value policy must be agreed in context; no universal mandatory query template is implied.
Used wherever diagrams, scenarios, figures, or example values are didactic constructions rather than sourced facts; every such use carries a simplifications disclosure. All people, companies, banks, and list entries in examples are fictional.
Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.