Menu

Cross-Database SQL Comparisons

SQL syntax and behavior vary by database. These guides compare common tasks across multiple engines, explain the differences that affect results, and link to detailed database-specific examples.

Task Comparison What it covers
Insert or update a row SQL UPSERT Syntax by Database Conflict syntax, unique keys, and concurrency cautions for MySQL, MariaDB, PostgreSQL, SQLite, Oracle, and SQL Server.
Return top rows per group Top N Rows per Group by Database Compare window-function patterns, tie handling, and support notes across six database engines.
Concatenate strings SQL String Concatenation: MySQL, PostgreSQL, SQLite, SQL Server & Oracle Operators vs functions, NULL propagation rules, CONCAT_WS delimiters, and type conversion.
Replace NULL values SQL NULL Handling: COALESCE, IFNULL, ISNULL & NVL by Database ANSI COALESCE, short-circuit evaluation, SQL Server truncation caveats, and proprietary fallbacks.
List databases or schemas List Databases in SQL: MySQL, MariaDB, PostgreSQL & More Compare database, schema, and attached-file scope, plus account visibility and platform-specific commands.
List tables in a database List Tables in SQL: MySQL, MariaDB, PostgreSQL & More Commands and metadata views, database/schema scope, and tool-specific shortcuts.
List views in a database List Views in SQL: MySQL, MariaDB, PostgreSQL & More Regular views, materialized views, schema scope, and account visibility across six engines.
Inspect columns in a table List Table Columns in SQL: MySQL, MariaDB, PostgreSQL & More Column names, types, nullability, schema scope, and metadata commands.
Inspect a table’s indexes List Indexes in SQL: MySQL, MariaDB, PostgreSQL & More Index names, types, key columns, and engine-specific metadata.
Format dates and times Date and Time Formatting by Database Equivalent output patterns and important differences between formatting tokens.
Validate JSON documents against a schema JSON Schema Validation in MySQL and MariaDB Compare supported schema dialects, function versions, validation reports, and cross-engine limits.

Use these comparisons to choose the right starting point, then follow the database’s official documentation and the linked SQLiz guide for version-specific syntax.