ComeçarComece de graça

Manipulating strings

The company has launched a platform for customers. You've been asked to generate a username that's easy for customers to remember and for employees to interpret. You decide a username should be composed of these characters in lowercase and in the following order:

  • First four letters of LastName
  • All characters of the CustomerId

Este exercício faz parte do curso

Introduction to Oracle SQL

Ver curso

Instruções do exercício

  • Output a new column called Username using the concatenation function.
  • Get the necessary letters from LastName using the substring function.
  • Add the CustomerId to LastName.

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

-- Output a new column called Username
SELECT LastName, CustomerId, ___(
    -- First four letters of LastName
    ___, 
  	-- CustomerId
    ___
    ) AS ___
FROM ___
Editar e executar o código