Different databases support different ways to get the first and last day of the month. Let’s see how to do it in MariaDB and MySQL.
Let’s see a slightly elaborated “Hello world”, to demonstrate the most common SQL operations with MariaDB: creating a database and a table, inserting a row, reading it, modifying it, deleting it.
In MariaDB most errors cause the current transaction to rollback, but warnings don’t. This article shows how to rollback when a warning happens.
There are many reasons why we may want to duplicate a table. We may want to copy the table structure alone, or include the rows, we may only want to copy some sample rows. Let’s see how to copy a table in MariaDB and MySQL.
How to run prepared statements in a MariaDB stored procedure. The article covers one-off prepared statements, reusable prepared statements, and parameters.
MariaDB and MySQL support a non-standard syntax to read and write comments for database objects.
MariaDB and MySQL are mostly compatible, while Percona Server is basically MySQL with some optimisations. For this reason, it’s quite common for developers not being sure which of them they are using.
How to get the length of the longest text in a column. Including Db2 specific syntax.
Most tables are created with a unique, progressive ID. But how to create an ID whose values are unique across multiple tables? For example, if value 1 is in table A, it must not be in table B.
How to select the first N numbers from the Fibonacci series, or the Nth number from the series. This is done by using the
SEQUENCE storage engine and user variables.