SQL LOWER

The mirror of UPPER — converts every letter to lowercase, most commonly used to normalize emails before comparing them.

What & Why

LOWER(text) converts letters to lowercase. It is useful for normalizing values such as acquisition channels before comparison or grouping, so casing differences do not create separate categories.

See How It Works

BUSINESS QUESTION

Growth wants acquisition channels normalized to lowercase.

idcreated_atcountrychannelplanactivated_atchurned_at
1012024-01-15 09:10:00+00USorganicpro2024-01-16 14:25:00+00NULL
1022024-02-10 11:05:00+00CApaidfreeNULL2024-03-20 10:00:00+00
1032024-03-12 16:35:00+00GBreferralpro2024-03-13 08:15:00+00NULL
1042024-04-01 13:20:00+00USorganicfree2024-04-03 12:00:00+00NULL
EXAMPLE QUERY
SELECT
  LOWER(channel) AS normalized_channel,
  COUNT(*) AS users
FROM growth.users
GROUP BY normalized_channel
ORDER BY users DESC, normalized_channel;
RESULT — exact output from the displayed Queryflo rows
normalized_channelusers
organic2
paid1
referral1

LOWER keeps the actual normalized growth-user channel groups.

Now You Try

Practice this concept

Growth wants acquisition channels normalized to lowercase.

Available schema
growth

Prefix tables with growth.table_name.

normalized_channelusers
growth.users
ColumnType
idinteger
created_attimestamp with time zone
countrytext
channeltext
plantext
activated_attimestamp with time zone
churned_attimestamp with time zone
legacy_user_codetext
query.sql
Intermediate business practice

Sign up free to try it on a real business scenario