Foreign keys are a controversial topic. MySQL and MariaDB implementation has several bugs and limitations, that are discussed here.
Maybe you’re wondering why in MySQL/MariaDB ‘string’ seems to be the same as ‘STRING’. Or maybe that’s not the case for you, but you would like to make a case insensitive search. This article explains how to write a case …
MySQL transactions can be read only. Here’s how to use them, and why they are useful.
In MySQL and MariaDB, all tables should have a primary key – especially InnoDB tables – this is almost common wisdom. But why? Let’s discuss the reasons.
Reducing the number of queries is important. The article describes how to use the SQL language more expressively (in MySQL) to achieve the purpose.
Returning random rows in a random order from a relational database is a very hard problem. In this article we will see an antipattern, we will discuss why this problem is so hard, and we’ll examine some imperfect solutions.
One of the trickiest problems in SQL is to query rows in tranches. This is typically needed in a website search, or in a dynamic catalogue where products appear as you scroll down. You want the DBMS to only return …
There are many non-obvious ways to return values from MySQL stored procedures, and each of them solves particular problems.
How to find useless indexes and get rid of them to improve your database performance.
When creating indexes, some common mistakes should be avoided.