TOPIC 29/3015 MINNOT STARTED

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.

  1. Core
  2. Local
  3. Test
Accents

HOW THE PICTURE MAPS

How each part of the picture matches the work
In the pictureIn the work
The languageSQL
An accentA dialect
Common wordsThe portable core
Local slangLocal 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
  1. 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.

    SELECT: WHERE/HAVING/output aliases, functional dependence, NULL ordering and LIMIT. PostgreSQL18 implementation, not a universal SQL mandate. · Checked 2026-11-06

    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.

  2. 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.

    §9.9 typed date arithmetic and truncation/timezones. · Checked 2026-11-06

    Publisher documentation opened on6November2026. Engine/version scope is explicit; other database implementations may differ. Teaching queries are synthetic, not a required publisher template.

  3. 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.

    CASE/BETWEEN/IN/EXISTS, scalar cardinality, NULL-safe equality and parameter values. · Checked 2026-11-06

    Publisher documentation opened on6November2026. Engine/version scope is explicit; other database implementations may differ. Teaching queries are synthetic, not a required publisher template.

  4. Market practice

    SQLite: date/time functions ↗ — SQLite project · SQLite: date/time functions; ISO text/julianday/date modifiers, numeric subtraction contrast. Publisher page opened6November 2026.

    ISO text/julianday/date modifiers, numeric subtraction contrast. · Checked 2026-11-06

    Publisher documentation opened on6November2026. Engine/version scope is explicit; other database implementations may differ. Teaching queries are synthetic, not a required publisher template.

  5. 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.

    Says EXCEPT returns the rows from the left query that the right query does not produce, and that both sides need the same number of columns. · Checked 2026-11-06

    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.

  6. Market practice

    Oracle Database19: CURRENT_DATE ↗ — Oracle · Oracle Database19: CURRENT_DATE; Session timezone and Oracle DATE time component. Publisher page opened6November 2026.

    Session timezone and Oracle DATE time component. · Checked 2026-11-06

    Publisher documentation opened on6November2026. Engine/version scope is explicit; other database implementations may differ. Teaching queries are synthetic, not a required publisher template.

  7. Market practice

    Oracle Database19: SYSDATE ↗ — Oracle · Oracle Database19: SYSDATE; Server OS date and time, distinct from session CURRENT_DATE. Publisher page opened6November 2026.

    Server OS date and time, distinct from session CURRENT_DATE. · Checked 2026-11-06

    Publisher documentation opened on6November2026. Engine/version scope is explicit; other database implementations may differ. Teaching queries are synthetic, not a required publisher template.

  8. 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.

    LIKE wildcards % and _; MySQL case rules; trailing spaces are significant for LIKE. · Checked 2026-11-06

    MySQL8.4 publisher manual opened6November2026. String comparison/LIKE collation and trailing-space behavior; target collation must be checked.

  9. Simplified educational illustration

    Payments Signal editorial teaching models — Payments Signal

    This site's own simplified teaching models. · Checked 2026-07-12

    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.