Abschnitt 1. Kapitel 5
single
Challenge: Mask Sensitive Information
Swipe um das Menü anzuzeigen
Aufgabe
Wischen, um mit dem Codieren zu beginnen
Write a SQL query that masks customer names, keeping only the first letter visible.
- Select all columns from the
customerstable in the following order:id,name,masked_name,email,city - Add a computed column
masked_namebuilt 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()
- Extract the first character of the name using
Use the following functions: CONCAT(), SUBSTRING(), REPEAT(), LENGTH()
Lösung
War alles klar?
Danke für Ihr Feedback!
Abschnitt 1. Kapitel 5
single
Fragen Sie AI
Fragen Sie AI
Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen