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.
This exercise is part of the course
Functions for Manipulating Data in PostgreSQL
Exercise instructions
- Select the film title and description.
- Calculate the similarity between the title and description.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
-- Select the title and description columns
SELECT
___,
___,
-- Calculate the similarity
___(___, ___)
FROM
film