How to Use SERIAL Functionality on Integer Types Like INT in MySQL

Perhaps you’re familiar with MySQL’s SERIAL type, which is not actually a data type, but a shortcut for BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE.

One restriction of SERIAL is that it forces us to use the BIGINT data type, which is fine if you think you’ll need the extra space. But what if you want the same attributes for a smaller integer type, like INT or MEDIUMINT for example?

Enter SERIAL DEFAULT VALUE.

Continue reading

Understanding SQLite’s PI() Function

The PI() function in SQLite returns the mathematical constant π (pi), which is approximately 3.14159265358979. It is used to represent the ratio of the circumference of a circle to its diameter.

The PI() function is commonly employed in mathematical computations, particularly in geometry, trigonometry, and other scientific calculations involving circles and angles.

Continue reading

Understanding Serverless Databases: Classic Serverless vs Neo-Serverless

The term “serverless database” has gained popularity with the rise of cloud computing and on-demand services, but it has a dual meaning depending on context.

In particular, databases can be “serverless” in either the traditional, client-side manner (e.g., SQLite’s model) or the cloud-native way often associated with managed databases.

This article explores these two approaches to serverless databases—classic serverless and neo-serverless—along with contrasting examples from other database models like client/server architectures.

Continue reading