Menu

Learn SQL and Databases with Practical Examples

SQLiz is a practical learning library for SQL and databases. Browse query examples for MySQL, PostgreSQL, SQLite, MariaDB, and SQL Server, alongside references and setup guides for Oracle, MongoDB, Redis, and more. Use the SQL and database tools or run SQLite queries in a temporary browser database, search for a function or diagnose a common MySQL or PostgreSQL error, choose a database tutorial below, or browse all articles for installation and programming guides.

Recent articles and guides

SQL Server ATN2() Function (ATAN2)

Use SQL Server ATN2(y, x), the T-SQL atan2 function, to calculate an angle from two coordinates while preserving the quadrant.

SQL Server COT() Function

Use SQL Server COT() to return the cotangent of an angle in radians as a float value.

SQL Server COUNT_BIG() Function

Use SQL Server COUNT_BIG() to count rows or non-NULL values with a bigint result when COUNT()’s int range may be too small.

SQL Server Data Type Precedence

See SQL Server’s data type precedence order and learn when implicit conversions can change an expression or raise an error.

SQL Server JSON Data Type

Learn where SQL Server’s native json type is available, how it differs from JSON text in nvarchar, and its validation and indexing limits.

SQL Server ROWVERSION (TIMESTAMP) Data Type

Learn why SQL Server TIMESTAMP is a deprecated ROWVERSION synonym, how its 8-byte value tracks row changes, and use it for optimistic concurrency.

SQL Server Error 245: Conversion Failed from varchar to int

Diagnose SQL Server Msg 245 by finding invalid varchar values and implicit conversions, then choose a safe fix with TRY_CONVERT or matching types.

SQL Server Error 515: Cannot Insert NULL into a NOT NULL Column

Diagnose SQL Server Msg 515 by checking the named NOT NULL column, supplied values, omitted columns, and default constraints.

SQL Server Error 8115: Arithmetic Overflow

Diagnose SQL Server Msg 8115 from integer expressions, SUM, AVG, COUNT, and conversions; widen values before the operation.

SQL Server Error 8120: Column Is Not in GROUP BY

Fix SQL Server Msg 8120 by grouping every nonaggregate select expression, choosing a meaningful aggregate, or using a window function.

SQL Server TRY_CONVERT() Function

Learn how SQL Server TRY_CONVERT() returns NULL for failed conversions, supports date styles, and still rejects explicitly disallowed conversions.

SQL Server XML Data Type

Learn when to use SQL Server’s xml data type, how typed and untyped XML differ, and how to query XML with XQuery methods.

MySQL DECIMAL and NUMERIC Data Types

Learn how MySQL DECIMAL and NUMERIC store exact decimal values, how precision and scale control range, and when to use them for monetary data.

SQL Server DATETIMEOFFSET Data Type

SQL Server DATETIMEOFFSET stores a date and time with a UTC offset, preserves that offset, and compares values by their UTC instant.

MySQL VALUES Statement: Create a Table of Rows

Use MySQL’s standalone VALUES statement as a table value constructor. Learn ROW syntax, default columns, aliases, ORDER BY, LIMIT, and how it differs from INSERT VALUES.

MySQL VALUES() Function in ON DUPLICATE KEY UPDATE

Learn what MySQL VALUES(column) returns in an upsert, why it is deprecated in 8.0.20+, and how to replace it with row and column aliases.

SQL Server CURRENT_DATE

Use CURRENT_DATE on SQL Server 2025+ and supported Azure SQL/Fabric services; use CONVERT(date, GETDATE()) on SQL Server 2022 and earlier.

SQL Server EOMONTH() Function

Use SQL Server EOMONTH() to return the last date of a month, optionally offset by a number of months.

SQL Server GETUTCDATE() Function

Return the current UTC date and time as datetime without a time-zone offset; use SYSUTCDATETIME() for higher precision.

SQL Server AT TIME ZONE

Convert SQL Server date/time values using named time zones, UTC offsets, and daylight-saving rules with AT TIME ZONE.

SQL Server DATE_BUCKET() Function

Use SQL Server 2022 DATE_BUCKET() to group date/time values into fixed-width intervals and align buckets with an origin.

SQL Server DATETRUNC() Function

Use SQL Server 2022 DATETRUNC() to truncate dates to a year, month, week, day, or supported time part.

How to Size a MySQL Connection Pool

Calculate a safe MySQL pool ceiling across app replicas, then tune it with database and application metrics instead of guessing.

MySQL Error 2015: Named Pipe Connection on Windows

Troubleshoot MySQL Error 2015 on Windows by checking named-pipe support, the pipe name, and client access permissions.

How to Upgrade PostgreSQL 14 to PostgreSQL 18

PostgreSQL 14 support ends Nov 12, 2026. Plan an upgrade to 18 with pg_upgrade checks, checksum compatibility, a tested backup, and application validation.

How to Upgrade PostgreSQL 17 to PostgreSQL 18

Plan a PostgreSQL 17 to 18 major-version upgrade with pg_upgrade: check extensions and checksums, test backups, use check mode, and verify the new cluster.

MySQL Error 1114: The Table Is Full

Diagnose MySQL Error 1114 by checking disk space, the affected storage engine, InnoDB tablespaces, MEMORY limits, and query temporary tables.

PostgreSQL Error 22007: Invalid Datetime Format

Fix PostgreSQL SQLSTATE 22007 by checking DateStyle, using ISO date values, and parsing fixed input formats explicitly.

MySQL Error 1040: Too Many Connections

Recover from MySQL Error 1040 with an administrator connection, inspect sessions, and size application pools against max_connections.

MySQL Error 1206: Lock Table Full

Fix MySQL Error 1206 by shrinking oversized transactions, batching row changes, checking query indexes, and sizing the InnoDB buffer pool.