Database Exercises
Movie Rental Store database

Task: Database Design for a Movie Rental Store

Imagine you are helping a small movie rental store modernize its record-keeping. The store owner wants a database that can handle rentals, customers, and inventory, but does not know exactly how it should be structured. Your task is to design a relational database based on the following story.

  • The store has a large collection of movies, each with a title, director, release year, genre, and a unique code. Some movies are part of a series, and some have multiple copies available for rent.

  • Customers can sign up for a membership. Each customer provides their name, contact information, and membership start date. Customers can rent multiple movies at the same time.

  • The store staff wants to keep track of which customer has rented which movie, when it was rented, and when it is due back. They also want to know whether a copy is currently available or already rented out.

  • Occasionally, the store runs special promotions, like discounts on certain genres or “rent two, get one free” offers. The system should record which customers used these promotions and when.

  • Customers can leave ratings and reviews for movies they have rented. The store wants to store these reviews along with the date they were submitted.

  • The staff also needs to track late fees if a customer returns a movie past the due date, including how much is owed and whether it has been paid.

Your task is to design a database structure that fulfills all these requirements. Decide how to organize the information, how many tables are needed, and what relationships should exist between them.


  • Kaupalla on laaja kokoelma elokuvia, joista jokaisella on nimi, ohjaaja, julkaisuvuosi, genre ja yksilöllinen tunnus. Osa elokuvista kuuluu sarjoihin, ja joistakin elokuvista on useita kappaleita vuokrattavissa.

  • Asiakkaat voivat liittyä jäseniksi. Jokainen asiakas antaa nimensä, yhteystietonsa ja jäsenyyden alkamispäivän. Asiakkaat voivat vuokrata useita elokuvia samanaikaisesti.

  • Myymälän henkilökunta haluaa seurata, mikä asiakas on vuokrannut minkäkin elokuvan, milloin vuokraus on alkanut ja milloin elokuva on palautettava. Lisäksi halutaan tietää, onko tietty kappale tällä hetkellä saatavilla vai jo vuokrattuna.

  • Ajoittain myymälä järjestää erikoistarjouksia, kuten alennuksia tietyistä genreistä tai ”vuokraa kaksi, saat yhden ilmaiseksi” -kampanjoita. Järjestelmän tulee tallentaa, mitkä asiakkaat ovat hyödyntäneet näitä tarjouksia ja milloin.

  • Asiakkaat voivat jättää vuokraamistaan elokuvista arvioita ja arvosteluja. Myymälä haluaa tallentaa nämä arvostelut sekä niiden jättämispäivämäärän.

  • Henkilökunnan tulee myös seurata myöhästymismaksuja, jos asiakas palauttaa elokuvan eräpäivän jälkeen, mukaan lukien maksettava summa ja tieto siitä, onko maksu suoritettu.

Tehtäväsi on suunnitella tietokantarakenne, joka täyttää kaikki nämä vaatimukset. Päätä, miten tiedot järjestetään, kuinka monta taulua tarvitaan ja millaisia suhteita taulujen välillä tulee olla.



Toggle Menu