ComeçarComece de graça

Putting it all together

In this exercise, we are going to use many of the techniques and concepts we learned throughout the course to generate a data set that we could use to predict whether the words and phrases used to describe a film have an impact on the number of rentals.

First, you need to create a tsvector from the description column in the film table. You will match against a tsquery to determine if the phrase "Astounding Drama" leads to more rentals per month. Next, create a new column using the similarity function to rank the film descriptions based on this phrase.

Este exercício faz parte do curso

Functions for Manipulating Data in PostgreSQL

Ver curso

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

-- Select the title and description columns
SELECT  
  title, 
  description 
FROM 
  film
WHERE 
  -- Match "Astounding Drama" in the description
  ___(___) ___ 
  to_tsquery('Astounding & Drama');
Editar e executar o código