Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Challenge: Mask Sensitive Information | String Functions
Functions in SQL
Section 1. Chapitre 5
single

single

bookChallenge: Mask Sensitive Information

Glissez pour afficher le menu

Tâche

Glissez pour commencer à coder

Write a SQL query that masks customer names, keeping only the first letter visible.

  • Select all columns from the customers table in the following order: id, name, masked_name, email, city
  • Add a computed column masked_name built as follows:
    • Extract the first character of the name using SUBSTRING(name, 1, 1)
    • Replace the remaining characters with asterisks using REPEAT('*', LENGTH(name) - 1)
    • Concatenate both parts using CONCAT()

Use the following functions: CONCAT(), SUBSTRING(), REPEAT(), LENGTH()

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 1. Chapitre 5
single

single

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

some-alt