IniziaInizia gratis

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.

Questo esercizio fa parte del corso

Functions for Manipulating Data in PostgreSQL

Visualizza il corso

Istruzioni dell'esercizio

  • Extract only the street address without the street number from the address column.
  • Use functions to determine the starting and ending position parameters.

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

SELECT 
  -- Select only the street name from the address table
  ___(address ___ ___(' ' ___ ___)+1 FOR ___(___))
FROM 
  address;
Modifica ed esegui il codice