Chill
Chill
Our database project is designed to bring the joy of cinematic entertainment right to the
homes of our users. With this platform, users will have the convenience of watching movies and
series from the comfort of their homes. Our primary focus is on ensuring user satisfaction and
data security. Specially, we provide separate interface for different type such as movie and series.
For loyal and high -spending customers ,there is a system to pay cashback for the vip customers.
1
2. Objectives
To easily access and enjoy a wide range of movies and series from their homes.
To keep your data and payment details in safe.
To make sure that unauthorized access can’t be grant.
To reduce energy effort for traveling to cinema.
To rewatch every movie or series whenever users want.
2
4. Data Dictionary
3
5. Building tables with SQL language
Table 1 : all_item
4
userID user_name password gmail wallet
u1 Pyae Sone Toe passtoe [email protected] 3000
u2 Todoroki jujustsu [email protected] 5000
u3 Andrew Tate brotate [email protected] 7000
u4 Kyaw Gyi kyaw1554 [email protected] 6500
u5 Sophia sophie4u [email protected] 4000
u6 Nwe ni ni nwenitoe55 [email protected] 5500
Table 2 : user_login
(iii) CREATE TABLE download_list (userID VARCHAR(5), itemID VARCHAR(5), qty INT,
date DATE,PRIMARY KEY(userid,itemid), FOREIGN KEY(userID) REFERENCES
user_login(userID) ON DELETE CASCADE ON UPDATE CASCADE , FOREIGN
KEY(itemID) REFERENCES all_item(itemID) ON DELETE CASCADE ON UPDATE
CASCADE );
Table 3 : download_list
5
Table 4 : movie_collection
6
2 u3 Andrew Tate [email protected] 500
3 u4 Kyaw Gyi [email protected] 500
Table 6 : vip_customer
7
6. View and Privileges of the project
(i) User ‘Andrew’ RETRIEVE privileges over the all_item of itemID, item_name, category, type,
price, viewed, box_office attributes over tuple for category ‘action’.(only)
8
User ‘Andrew’ can see all data of action movies .
(ii) User ‘Andrew’ all privileges (RETRIEVE, INSERT, UPDATE, DELETE ) over tuple for
movie price 15 dollars.
9
User ‘Andrew’ can see movies that cost 15 dollars each.
10
User ‘Andrew’ has all privileges on virtual table ‘spider’. Andrew can see user information who
watched spider man movie.
7. Generating Triggers
11
(2) CREATE TABLE series_collection(No INT PRIMARY KEY AUTO_INCREMENT ,
seriesID VARCHAR(5)NOT NULL, series_name VARCHAR(40) NOT NULL, category
VARCHAR(30) NOT NULL, price INT );
Following triggers start activate after insert operation is performed on main table. Triggers detect
incoming item type for movie and series and the record of item will automatically add to their
corresponding table separately..
DELIMITER //
CREATE TRIGGER movie_trig AFTER INSERT ON all_item FOR EACH ROW BEGIN
IF (new.type=” movie “) THEN INSERT INTO movie_collection
(movieID, movie_name, category , price)
VALUES ( new.itemID,new.item_name,new.category,new.price ); END IF; END; //
12
DELIMITER //
CREATE TRIGGER series_trig AFTER INSERT ON all_item FOR EACH ROW
BEGIN IF (new.type=” series “) THEN INSERT INTO
series_collection (seriesID, series_name,category , price ) VALUES
(new.itemID,new.item_name,new.category, new.price ); END IF; END; //
(1) The ‘view_trig’ trigger will automatically update after insert on ‘download_list’ table. It will
increase count on ‘viewed’ tuple correspond to the downloaded item.
13
CREATE TRIGGER view_trig
AFTER INSERT on download_list FOR EACH ROW
UPDATE all_item JOIN download_list SET viewed=viewed+1 WHERE
all_item.itemID=new.itemID;
(2) The ‘box_trig’ trigger will calculate and update after insert on ‘download_list’ table. It will
increase amount on ‘box_office’ tuple correspond to the downloaded item.
14
The ‘vip_trig’ trigger start after insert on ‘user_login’ table. The data of users who filled 5000 or
more amount on ‘wallet’ tuple will be added on ‘vip_customer’ and gave them 500
simultaneously.
DELIMITER //
8. Conclusion
In conclusion, our movie database project offers a convenient and secure solution for
users to access a vast library of movies, series, and popular films. Our commitment to user
satisfaction is evident through the availability of the most-viewed and highest-earning videos on
our platform, all offered at reasonable prices. We believe that our interface provides an easy and
15
enjoyable experience for all movie enthusiasts, making home entertainment accessible to
everyone.
16