In statistics, the mode is the function that returns the element that appear most often in a series. This is what people try to achieve when they run MAX(COUNT(*))… and they find out that it doesn’t work. Let’s see how to obtain the mode in SQL.
Simple examples of SQL stored procedures in Db2.
Let’s see how to check what a user can do with a certain PostgreSQL table, or which users have a certain permission on a table.
Transact-SQL provides facilities to raise errors and warnings, as well as handling them. Here’s an introduction to this subject.
Let’s see how to preserve, empty or drop temporary tables when a transaction succeeds (
COMMIT) or fails (
Running sums are useful in situations where you want to get a total, but you also want to see how much each entry of a list contributes to the total. So each entry is accompanied by a partial sum, up to that point of the list. While getting a total in SQL is trivial, getting a running sum requires the use of window functions.
PostgreSQL manual says that it is not possible to delete an element from an
ENUM type, nor change their order. However, there is a way to do it in a single transaction.
Let’s see how to create, modify and use an alias in Db2. An alias can refer to a table, a sequence or a module. Aliases exist in several databases, but we’re focusing on Db2 syntax here.
How to find out which combinations of items from different tables never appear in a third table.
Sometimes we want to send an email when something suspicious happens in a database. Oracle is able to natively send emails.