Here’s an example of formatting a number as currency in MariaDB.
Continue readingTag: how to
How to Format Numbers as Currency in MySQL
Some DBMSs provide us with the ability to format a number as a currency by providing a format specifier for the currency symbol. Providing such a format specifier allows the DBMS to return the appropriate currency symbol for the locale.
MySQL doesn’t have a currency format specifier, and so we need to do a bit of extra work if we want the currency symbol to be returned.
Continue readingInstall MySQL on a Mac
Below are the steps that I used to install MySQL on my M1 Mac via the Homebrew package manager.
As mentioned, this is an M1 Mac (which uses the ARM64 architecture) but that didn’t cause any issues. The current version (MySQL 8.0.26) supports the ARM architechure.
Continue readingHow to Get the Short Month Name from a Date in MySQL
In MySQL, you can use the DATE_FORMAT()
function with the %b
format specifier to return the short month name. For example, you can return Jan
or Feb
instead of January
or February
.
How to Back Up an Azure SQL Edge Database to Local Disk using T-SQL
Microsoft Azure SQL Edge’s backup capabilities are similar to those in SQL Server on Linux, and SQL Server running in containers.
Azure SQL Edge supports T-SQL, and so you can back up your SQL Edge databases by running a T-SQL statement.
In this article, I back up a SQL Edge database to the local disk in my Docker container.
Continue readingGet the Month Name from a Date in SQL
Most major RDBMSs provide at least one function that enables us to return the month name from a date.
Continue reading2 Functions that Return the Month Name from a Date in MySQL
The following two functions enable us to get the month name from a date in MySQL.
Continue readingHow to Backup the Transaction Logs in Azure SQL Edge (T-SQL)
By default, databases created in Azure SQL Edge use the simple recovery model. This means that you can’t perform log backups on these databases.
Fortunately, you can change a database’s recovery model to full recovery mode, which will enable you to back up the logs.
Continue reading2 Ways to Concatenate a String and a Number in Oracle
In Oracle Database, we can concatenate strings and numbers with the CONCAT()
function or the pipe concatenation operator (||
).
How to Change the Recovery Model of a Database in Azure SQL Edge using T-SQL
By default, databases created with Azure SQL Edge use the simple recovery model. This means that you can’t perform log backups on these databases.
If you need to perform log backups on a database created with SQL Edge, you’ll need to change the recovery model of the database to either full or bulk logged.
This can be done with T-SQL with the ALTER DATABASE
statement.