Skip to content

SQL Bits

You're here to find quick SQL recipes.

  • Home
  • Topics
    • Generic SQL
    • PostgreSQL
    • MariaDB
    • MySQL
    • Oracle
    • SQL Server
    • Db2
    • Informix
    • SQLite
  • Advertising
  • Write
  • About

Tag: level-beginner

Simple articles that can be understood by beginners, but can be useful to experts as well.

Db2: Loop over an array

We saw in another article how to build an array from an SQL query (from each row, or from a column). This article shows how to loop over an array items.

Continue reading Db2: Loop over an array
Published January 29, 2022
Categorized as Db2 Tagged level-beginner

MariaDB/MySQL: How to get the first and last day of the month

Different databases support different ways to get the first and last day of the month. Let’s see how to do it in MariaDB and MySQL.

Continue reading MariaDB/MySQL: How to get the first and last day of the month
Published January 8, 2022
Categorized as MariaDB, MySQL Tagged level-beginner

How to get the highest and lowest value in a row in SQL

It is well-known how to get the highest and lowest values in a table column, but it is a bit less known how to get the highest and lowest values in a row. Let’s see how to do it.

Continue reading How to get the highest and lowest value in a row in SQL
Published November 21, 2021
Categorized as Generic SQL Tagged level-beginner

MariaDB CRUD operations Hello World

Let’s see a slightly elaborated “Hello world”, to demonstrate the most common SQL operations with MariaDB: creating a database and a table, inserting a row, reading it, modifying it, deleting it.

Continue reading MariaDB CRUD operations Hello World
Published October 30, 2021
Categorized as MariaDB Tagged level-beginner

SQL Server: Concatenate strings (NULL-safe)

There are several ways to concatenate strings in SQL, and they mainly differ in how they handle NULL values.

Continue reading SQL Server: Concatenate strings (NULL-safe)
Published October 24, 2021
Categorized as SQL Server Tagged level-beginner

PostgreSQL: Tables without columns

PostgreSQL allows to create, read and write tables without columns. Let’s see how to work with them, and whether they can have practical uses.

Continue reading PostgreSQL: Tables without columns
Published October 20, 2021
Categorized as PostgreSQL Tagged level-beginner

Are RIGHT JOINs ever necessary?

RIGHT JOINs can always be rewritten as LEFT JOINs, and some people consider RIGHT JOINs a bad practice. This article explains why.

Continue reading Are RIGHT JOINs ever necessary?
Published September 30, 2021
Categorized as Generic SQL Tagged level-beginner

PostgreSQL: Making a comparison case-insensitive

In PostgreSQL, string comparisons are case-sensitive by default. Making them case-insensitive requires the ILIKE operator and may require an additional index for performance reasons.

Continue reading PostgreSQL: Making a comparison case-insensitive
Published September 26, 2021
Categorized as PostgreSQL Tagged level-beginner

Find values above the average

How to find values in a table column that are above (or below) the average of that column.

Continue reading Find values above the average
Published September 23, 2021
Categorized as Generic SQL Tagged level-beginner

The difference between WHERE and HAVING

SQL clauses WHERE and HAVING have different functions. But they both filter out rows, so many people don’t know the important difference between them. Let’s shred some light.

Continue reading The difference between WHERE and HAVING
Published September 4, 2021
Categorized as Generic SQL Tagged level-beginner

Posts navigation

Page 1 … Page 3 Older posts
  • Twitter
  • Email
SQL Bits
Proudly sponsored by Vettabase.