Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende Challenge: Mask Sensitive Information | String Functions
Functions in SQL
Sección 1. Capítulo 5
single

single

bookChallenge: Mask Sensitive Information

Desliza para mostrar el menú

Tarea

Desliza para comenzar a programar

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()

Solución

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 1. Capítulo 5
single

single

Pregunte a AI

expand

Pregunte a AI

ChatGPT

Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla

some-alt