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.
Deze oefening maakt deel uit van de cursus
Functions for Manipulating Data in PostgreSQL
Praktische interactieve oefening
Probeer deze oefening eens door deze voorbeeldcode in te vullen.
-- Select the title and description columns
SELECT
title,
description
FROM
film
WHERE
-- Match "Astounding Drama" in the description
___(___) ___
to_tsquery('Astounding & Drama');