Aan de slagGa gratis aan de slag

Measuring similarity between two strings

Now that you have enabled the fuzzystrmatch and pg_trgm extensions you can begin to explore their capabilities. First, we will measure the similarity between the title and description from the film table of the Sakila database.

Deze oefening maakt deel uit van de cursus

Functions for Manipulating Data in PostgreSQL

Cursus bekijken

Oefeninstructies

  • Select the film title and description.
  • Calculate the similarity between the title and description.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

-- Select the title and description columns
SELECT 
  ___, 
  ___, 
  -- Calculate the similarity
  ___(___, ___)
FROM 
  film
Code bewerken en uitvoeren