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

single

bookChallenge: Mask Sensitive Information

Scorri per mostrare il menu

Compito

Scorri per iniziare a programmare

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

Soluzione

Switch to desktopCambia al desktop per esercitarti nel mondo realeContinua da dove ti trovi utilizzando una delle opzioni seguenti
Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 1. Capitolo 5
single

single

Chieda ad AI

expand

Chieda ad AI

ChatGPT

Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione

some-alt