Week 3 – Homework
Homeworks are not mandatory, and not marked. You can use them to test your understanding of the lecture. Use the Pagila database.
1). Get info on the rental date by customer:
| first_name | last_name | rental_date |
|---|---|---|
| TOMMY | COLLAZO | 2005-05-24 22:54:33+02 |
| MANUEL | MURRELL | 2005-05-24 23:03:39+02 |
| ANDREW | PURDY | 2005-05-24 23:04:41+02 |
2). Join Actors and Film table:
| first_name | last_name | title |
|---|---|---|
| PENELOPE | GUINESS | ACADEMY DINOSAUR |
| CHRISTIAN | GABLE | ACADEMY DINOSAUR |
| LUCILLE | TRACY | ACADEMY DINOSAUR |
3). Count the number of films per each actor:
| first_name | last_name | count |
|---|---|---|
| HARRISON | BALE | 28 |
| JULIA | ZELLWEGER | 16 |
| AUDREY | OLIVER | 25 |
4). Get customer (first_name and last_name), rental_date, and film title:
| first_name | last_name | rental_date | title |
|---|---|---|---|
| “TOMMY” | “COLLAZO” | “2005-05-24 22:54:33+02” | “FREAKY POCUS” |
| “MANUEL” | “MURRELL” | “2005-05-24 23:03:39+02” | “GRADUATE LORD” |
| “ANDREW” | “PURDY” | “2005-05-24 23:04:41+02” | “LOVE SUICIDES” |
5). Get customer (first_name and last_name), rental_date, and category name:
| first_name | last_name | rental_date | name |
|---|---|---|---|
| “TOMMY” | “COLLAZO” | “2005-05-24 22:54:33+02” | “Music” |
| “MANUEL” | “MURRELL” | “2005-05-24 23:03:39+02” | “Children” |
| “ANDREW” | “PURDY” | “2005-05-24 23:04:41+02” | “Horror” |
6). Get customer (first_name and last_name), category name, and count of occurrences:
| first_name | last_name | name | count |
|---|---|---|---|
| “RAFAEL” | “ABNEY” | “Animation” | 4 |
| “RAFAEL” | “ABNEY” | “Children” | 1 |
| “RAFAEL” | “ABNEY” | “Comedy” | 1 |