Here are five ways to check whether or not a table exists in a MySQL database.
Relational
How to Generate a Random Integer Within a Range in MariaDB
MariaDB includes a RAND() function that returns a random number. More precisely, it returns a DOUBLE precision floating point value v in the range 0 <= v < 1.0.
This is great, but what if you want to generate an integer within a larger range – and a range that you specify?
Fortunately, there’s an easy technique for doing this.
2 Ways to List all Stored Procedures in MySQL
Below are two options for returning a full list of stored procedures in MySQL.
Fix: “BACKUP LOG cannot be performed because there is no current database backup.” in SQL Server/SQL Edge
If you’re trying to back up the transaction logs in a SQL Server or SQL Edge database, but you get an error that states BACKUP LOG cannot be performed because there is no current database backup, you’ll need to perform at least one full backup of the database before you attempt to back up the transaction logs.
Subtract Microseconds from a Datetime Value in MariaDB
Here are some options for subtracting one or more microseconds from a datetime expression in MariaDB.
JSON_VALUE() in MySQL
In MySQL, the JSON_VALUE() function extracts a value from a JSON document at the specified path.
The function was introduced in MySQL 8.0.21.
Add a Percent Sign to a Number in MariaDB
Below is a quick example of formatting a number as a percentage in MariaDB.
2 Ways to Add a Percent Sign to a Number in SQLite
Here are two ways to format a number as a percentage in SQLite.