SQL standards and conformance
Overview
SQL is a standardized language with optional features and vendor extensions. Portability means a particular query and its result contract work in the chosen engines, not that every engine implements all of SQL. Start with joins, CASE, COALESCE and explicit ordering.
First example
SELECT id,COALESCE(label,'missing') FROM dc_item ORDER BY id;Observed SQLite result (rows in JSON):
[ [ 1, "" ], [ 2, "missing" ], [ 3, "Guide" ], [ 4, "Guide" ]]How it works
SQL-92 classified conformance by levels; later standards use core and optional features. SQL:2023 continues the evolution. Vendor conformance tables identify features, not formal independent certification. The normative ISO text was not inspected. SQL standard classification, documented support, and observed execution are three distinct kinds of evidence. SQLite executing COALESCE does not certify another engine. Analytical engines also have their own syntax and capabilities; pin versions separately.
Practical example
SELECT category,COUNT(*) FROM dc_item GROUP BY category ORDER BY category;Observed SQLite result (rows in JSON):
[ [ "a", 2 ], [ "b", 2 ]]Practice and mistakes
Practice: group the four items by category and predict the counts. Hint: use COUNT(*) rather than COUNT(label). Then map each feature to documented, observed, or unknown. Mistake: treating a familiar syntax as universal.
PostgreSQL 17 example — NOT RUN
SELECT feature_id,feature_name,is_supported FROM information_schema.sql_features WHERE feature_id='T174' ORDER BY feature_id,sub_feature_id;Expected result, not executed: "Vendor conformance metadata; inspect returned feature rows, not formal certification."