Extracting substrings from text data
In this exercise, you are going to practice how to extract substrings from text columns. The Sakila database contains the address table which stores the street address for all the rental store locations. You need a list of all the street names where the stores are located but the address column also contains the street number. You'll use several functions that you've learned about in the video to manipulate the address column and return only the street address.
Este exercício faz parte do curso
Functions for Manipulating Data in PostgreSQL
Instruções do exercício
- Extract only the street address without the street number from the
addresscolumn. - Use functions to determine the starting and ending position parameters.
Exercício interativo prático
Experimente este exercício completando este código de exemplo.
SELECT
-- Select only the street name from the address table
___(address ___ ___(' ' ___ ___)+1 FOR ___(___))
FROM
address;