ComenzarEmpieza gratis

Using the beginning or end of a string

Sometimes you may need to take only certain parts of a string. If you know that those parts can be found at the beginning or the end of the string, remember that there are built-in functions that can help you with this task.

You will use these functions in this exercise. The purpose is to create an alias for each voter from the voters table, as a combination of the first 3 letters from the first name, the last 3 letters from the last name, and the last 2 digits from the birthday.

Este ejercicio forma parte del curso

Functions for Manipulating Data in SQL Server

Ver curso

Ejercicio interactivo práctico

Prueba este ejercicio completando el código de muestra.

SELECT 
	first_name,
	last_name,
	country,
    -- Select only the first 3 characters from the first name
	___ AS part1
FROM voters;
Editar y ejecutar código