Vous êtes sur la page 1sur 22

Kathmandu University

Department of Computer Science and Engineering


Dhulikhel, Kavre

A Project Report

on

“Movie Database System”


[Code No: COMP 232]

Submitted by:
Aashirwad Bhattarai (8)
aashirwad.bhattarai1@gmail.com
Pratik Khadka (24)
Bishal Shah (39)
Joshan Shrestha (42)
joshans92@gmail.com

Submitted to:
Mr. Santosh Khanal
Department of Computer Science and Engineering
Submission Date: July 20, 2019
PROJECT REPORT
ON
“Movie Database System”

Approved By:
Mr. Santosh Khanal
Assistant Professor

_______________
(Signature)
Abstract

This project is related to a Movie Database System. It is a web archive of that


keeps records of various information about a movie. It consists of Movie section,
About Us section and Contact section. The system enables to view information
about a movie, actors, directors and writers involved in that movie. Users can even
send us feedback regarding any changes or suggestions about the page. This
system saves times by enabling users to view all the information about a movie in
single page. This program is basically written using Python and HTML/CSS.
Usually most of these activities are done manually which is not reliable. The
Classroom Management System provides a user friendly environment which
makes it easier to fulfill the communication gap between teacher and student.
Synopsis of the project

July 22, 2019

We would like to submit our proposal on “Movie Database System” as our mini
project on Database Management System to meet the requirement of course COMP
232.
Movie is something we all watch and enjoy as it is one of our favorite time pass.
We often like to see information about the movie we like. Gathering such
information can be tedious and time consuming so we have to develop a web
application named as “Movie Database”. It is an online system where the user can
view information about various movies stored in the system.
We intended to use Python and MySQL to build this project and the database
required to do so. This project will be made with the main idea of making it
practical in the real-world scenario.
We hope by doing this project, we will have a better understanding of how
database work and how they can be used in a practical and time-saving manner.
We also hope to improve our programming skills and gain necessary experience to
benefit us in our future project.

Project Members:
Aashirwad Bhattarai
Bishal Shah
Pratik Khadka
List of Entities and Attributes
An entity is any object represented in the database system that we want to model
and store information about. Entities are usually recognizable concepts, either
concrete or abstract, such as person, places, things, or events which have relevance
to the database .The entities used in Movie Database System are listed below:

1. Movie: - This entity keeps track of all the information about the movies that is
stored in the database. The attributes of assignments are:-
a. movie_id:- It is a primary key which is a unique value given to a movie.
b. movie_name: - This attribute defines the name of the movie which is
stored in the database.
c. country:- This attribute defines the name of the place where movie was
made.
d. rating:- This attribute defines the rating of a movie.
e. length:- This attribute defines the length of a movie.
f. plot:- This attribute defines the plot of the movie.
g. releasedate:-This attribute defines the release date for a movie.
h. movie_image:- This attribute keeps link of the image of a movie.

2. Director: - This entity helps to store all the information related to the director
for each movie. The attributes of director are:-
a. movie_id:- It is a foreign key.
b. director_id:- It is a primary key which is a unique value given to a director.
c. director_fname:- This attribute keeps record of first name of the directors.
d. director_lname:- This attribute keeps record of last name of the directors.
e. director_address:- This attribute keeps record of addresses of the directors.
f. director_dob:- This attribute keeps record of date of birth of the directors.
g. director_accolades:- This attribute keeps record of achievement and
awards, the director has achieved.
h. director_image:- This attribute keeps the link of image of the director.

3. Actor: - This entity helps to store all the information about the actors/actress
involved in the movie. The attributes of users are:-
a. actor_id:- It is a primary key which is a unique value given to an
actor.
b. actor_fname:- This attribute keeps record of first name of the actors.
c. actor_lname:- This attribute keeps record of last name of the actors.
d. actor_address:- This attribute keeps record of addresses of the actors.
e. actor_accolades:- This attribute keeps record of awards, the actor has
received.
f. actor_dob:- This attribute keeps record of date of birth of the actors.
g. actor_image: This attribute keeps the link of image of the actor.

4. Genre:- This entity helps to define the category i.e. Drama, Sci-Fi, Action, etc.
the movie is related to. There is a single attribute for genre given below.
a. genre_id:- :- It is a primary key which is a unique value given to a
genre.
b. genre_name:- This attribute keeps record about the category of the
movie.

5. Writer: - This entity includes all of the information and details about the writer
involved in the movie. The attributes of the writers are listed below:
a. writer_id:- It is a primary key which is a unique value to a writer.
b. writer_fname:- This attribute keeps record of first name of the writers.
c. writer_lname:- This attribute keeps record of last name of the writers.
d. writer_address:- This attribute keeps record of addresses of the
writers.
e. writer_accolades:- This attribute keeps record of awards the writer has
received.
f. writer_dob:- This attribute keeps record of date of birth of the writers.
g. Writer_image:- This attribute keeps the link of image of the writer.

7. Composer: - This entity includes all of the details about the composition of
the movies. The attributes of composer are:
a. composer_id:- It is a primary key which is a unique value given to a
composer.
b. composer_fname:- This attribute keeps record of first name of the
composers.
c. composer_lname:- This attribute keeps record of last name of the
composers.
d. composer_address:- This attribute keeps record of addresses of the
composers.
e. composer_accolades:- This attribute keeps record of the awards the
composer has received.
f. composer_dob:- This attribute keeps record of date of birth of the
composers.
g. composer_image:- This attribute keeps the link of the image of the
composer.
8. ActorMovie: This entity includes information about id of actor and movie:
a. actormovie_id: It is a primary key that gives a unique value.
b. actor_id: It is a foreign key.
c. movie_id: It is a foreign key.

9. WriterMovie: This entity includes information about id of writer and


movie:
a. writermovie_id: It is a primary key that gives a unique value.
b. writer_id: It is a foreign key.
c. movie_id: It is a foreign key.

10. ComposerMovie: This entity includes information about id of composer


and movie:
a. composermovie_id: It is a primary key that gives a unique value.
b. composer_id: It is a foreign key.
c. movie_id: It is a foreign key.

11. GenreMovie: This entity includes information about id of genre and movie:
a. genremovie_id: It is a primary key that gives a unique value.
b. genre_id: It is a foreign key.
c. movie_id: It is a foreign key.
Candidate keys
A candidate key is a column, or set of columns, in a table that can uniquely
identify any database record without referring to any other data. Each table may
have one or more candidate keys, but one candidate key is unique, and it is called
the primary key. The candidate keys used in Movie Database System are listed
below:

Entity Candidate Key


Movie movie_id, movie_name
Director director_id
Actor actor_id

Genre genre_id
Composer composer_id
Writer writer_id

Table 1 : Candidate keys

Primary key
A primary key is a special relational database table column (or combination of
columns) designated to uniquely identify all table records. A primary key's main
features are:
It must contain a unique value for each row of data. It cannot contain null values.
The primary key used in classroom management system is:
Entity Primary Key

Movie movie_id

Director director_id

Actor actor_id

Genre genre_id

Composer composer_id
Writer writer_id

Table 2 : Primary keys

Foreign Key
A Foreign Key is a field (or collection of fields) in one table that refers to the
Primary Key in another table.

Foreign Key Child Table Parent Table


movie_id Director, Movie
actor_id ActorMovie Actor
writer_id WriterMovie Writer
composer_id ComposerMovie Composer
genre_id GenreMovie Genre

Table 3 : Foreign Keys


Normalization
Since our database contains information about a large number of actors and other
crew members of the movie, we did performed normalization on tables to avoid
data redundancy.

Before Normalization: Before normalization, our movie database had following


tables with attributes:
Movie (movie_id, movie_name, country, length plot, releasedate, rating,
actor_name, actor_dob, actor_address, actor_accolades, writer_name, writer_dob,
writer_address, writer_accolades, composer_name, composer_dob,
composer_address, composer_accolades, director_name, director_dob,
director_address, director_accolades, genre)
Image (actor_image, director_image, writer_image, composer_image)

After Normalization: After normalization, our movie database includes following


tables with attributes:
Movie (movie_id, movie_name, country, plot, releasedate, length, rating,
movie_image)
Director (director_id, movie_id, director_fname, director_lname, director_dob,
director_address, director_accolades, director_image)
Actor (actor_id, actor_fname, actor_lname, actor_dob, actor_director,
actor_accolades, actor_image)
Writer (writer_id, writer_fname, writer_lname, writer_dob, writer_address,
writer_accolades, writer_image)
Composer (composer_id, composer_fname, composer_lname, composer_dob,
compsoer_address, composer_accolades, composer_image)
Genre (genre_id, genre_name)
Final ER diagram
Entity Relationship Diagram is an illustration of the logical structure of the
database which is used in modern database system. It is a relational schema
database modeling method used to model a system and approach. This approach is
commonly used in database design. The diagram created using this method is
called ER-Diagram.

Fig : ER Diagram

Indexing
Indexing is a way to optimize performance of a database by minimizing the
number of disk accesses required when a query is processed. An index or database
index is a data structure which is used to quickly locate and access the data in a
database table. Indexes are created using some database columns.
1. The first column is the Search key that contains a copy of the primary key or
candidate key of the table. These values are stored in sorted order so that the
corresponding data can be accessed quickly (Note that the data may or may
not be stored in sorted order).
2. The second column is the Data Reference which contains a set of pointers
holding the address of the disk block where that particular key value can be
found.

Fig : Indexing on Actors Table


Dependencies
Functional dependency is a relationship that exists when one attribute uniquely
determines another attribute.
1. Movie
movie_id - name
movie_id - country
movie_id - rating
movie_id - length
movie_id - plot
movie_id - releasedate
movie_id - image
2. Director
director_id - director_fname
director_id - director_lname
director_id - director_address
director_id - director_dob
director_id - director_accolades
director_id - director_image
3. Actor
actor_id - actor_fname
actor_id - actor_lname
actor_id - actor_address
actor_id - actor_dob
actor_id - actor_accolades
actor_id - actor_image

4. Writer
writer_id - writer_fname
writer_id - writer_lname
writer_id - writer_address
writer_id - writer_dob
writer_id - writer_accolades
writer_id - writer_image

5. Composer
composer_id - composer_fname
composer _id - composer _lname
composer _id - composer _address
composer _id - composer _dob
composer _id - composer _accolades
composer _id - composer _image

6. Genre
genre_id - genre_name
Front-End design

Fig : Movie Page


Fig: Home Page

Fig : Contact Page


Database Tables

Fig: Movie Table


Fig: Actor Table

Fig: Directors Table


Fig: Writers Table

Database Script

Vous aimerez peut-être aussi