Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Challenge: Mask Sensitive Information | String Functions
Functions in SQL
Секція 1. Розділ 5
single

single

bookChallenge: Mask Sensitive Information

Свайпніть щоб показати меню

Завдання

Проведіть, щоб почати кодувати

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

Рішення

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 1. Розділ 5
single

single

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

some-alt