Aan de slagGa gratis aan de slag

Creating vertical partitions

In the video, you learned about vertical partitioning and saw an example.

For vertical partitioning, there is no specific syntax in PostgreSQL. You have to create a new table with particular columns and copy the data there. Afterward, you can drop the columns you want in the separate partition. If you need to access the full table, you can do so by using a JOIN clause.

In this exercise and the next one, you'll be working with the example database called pagila. It's a database that is often used to showcase PostgreSQL features. The database contains several tables. We'll be working with the film table. In this exercise, we'll use the following columns:

  • film_id: the unique identifier of the film
  • long_description: a lengthy description of the film

Deze oefening maakt deel uit van de cursus

Database Design

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

-- Create a new table called film_descriptions
___ ___ ___ (
    ___ INT,
    ___ ___
);

-- Copy the descriptions from the film table
___ ___ ___
SELECT ___, ___ FROM ___;
Code bewerken en uitvoeren