Sei sulla pagina 1di 10

TRISTAR VIDEO RENTAL DATABASE SYSTEM

System Analysis: Description A database system for Tristar video rental store will be developed in this project. This system should be able to Perform the following tasks efficiently and conviniently after the database gets completed. Management of daily transaction Analysis of customer Analysis of every Movie Management of Inventory Control

Current business activities and Operations TRISTAR is a video rental store which has been providing video rental service to customer including both member aswell as non-member . Following are some of the current business activites of Tristar vision. We buys CDS and mostly DVDs of all type including local movies and international movies too of several nationality. We store them.. We have been giving membership facilities to the one who are interested. We have also been renting movies in a cheap rate to both member and non-member. We dont sell movies at all. Business Policies of Tristar Video Rental The business policy of Tristar video rental is categorized on the basis of being member or nonmember. For members of Tristar Video rental Rs 250 should be paid for being a member of Tristar Vision. Members can renew their membership in every 6 months. They can rent every Cds and DVDs for Rs 10 and Rs 15 respectively. They should return movies within 1st week of issued date in the case the movies are not new. While they should return movies within 3 days of issued date if the movies have been released lately. Or else they would be charged with Rs 1 and Rs 3 per day for new and lately released movies respectively. All movies should be returned and dues should be cleared before taking other new movies. If movies had been found unreturned within a month of issued date, then their membership will be collapsed and they have to pay Rs 250 to be a member again if they want to. Credit is not accepted.

For Non-member Non-members should pay Rs 15 and Rs 20 for renting CD and DVD respectively. They should pay additional Rs 40 for each movie as a deposit. They should return movies within 1st week of issued date in the case the movies are not new. While they should return movies within 3 days of issued date if the movies have been released lately. If the movies had been found unreturned within estimated returned date, then that Rs 40 wouldn't be paid back to them and they can take that movies with them. Credit is not accepted.

Identification of Objects- Entities,Relationships and Attributes

TABLE:Movie For creating Table Movie Create table Movie ( Movie_ID Movie_title Release_Date Genre Nationality Director Cast ) Primary Key : Movie_ID Foreign Key: NUMBER(10) varchar2(100) Date varchar2(60) varchar2(60) varchar2(60) varchar2(150) primary key, NOT NULL, NOT NULL, NOT NULL, NOT NULL, NOT NULL, NOT NULL

For inserting data into Movie Table

Insert Into Movie VALUES (0001,'12 Angry Men','29 july 1957','Crime,drama,mystery','America','Sidney Lumet','Henry Fonda,Jack Klugman,Edward Binns') Insert Into Movie VALUES (0002,'Shiri' ,'13 February 1999','Drama,Romance,Mystery','South Korea','Je gyu Kang','Suk kyu hang,Min shik choi') Insert Into Movie VALUES (0003,'The Big Lebowski','6 March 1998','Comedy,Crime','America','Joel Coen','Jeff Bridges,Julliane moore,John Goodman') Insert Into Movie VALUES (0004,'The lives of Others','23 March 2006','Drama,thriller','Germany','Florian Henckel Von Donnersmarck','Martina Gedeck,Ulrich Muhe,Sebastian Koch')

Insert Into Movie VALUES (0005,'My name is Khan','10 February 2010','Drama,romance','India','Karan Johar','Sharukh Khan,Kajol') Explanation: The details of every available movies including MovieID, Movie title, Director,Release Date etc are stored in this table. And the same table gets updated upon the addition of new movies. When new movie is added, one row is inserted in this table and this row includes its id, movie title, Director, cast, release date etc. TABLE:Member For creating Member Table Create table Member ( Member_ID Member_Last_name Member_first_name Date_of_birth Address Home_phone Work_phone NUMBER(10) varchar2(20) varchar2(20) DATE varchar2(60) NUMBER(15) NUMBER(15) , NOT NULL, NOT NULL, NOT NULL, NOT NULL, NOT NULL, NOT NULL,

CONSTRAINT PK_Member Primary Key(Member_ID) ) Primary Key: Member_ID Foreign Key: For inserting data into Member Table Insert Into Member VALUES (0001,'Khadka','Ubraj','16 july 1991','Thasikhel,Lalitpur',015001703,014262520) Insert Into Member VALUES(0002,'Gurung','Sabina','21April 1994','Thalchikhel,Lalitpur',015553965,4483612) Insert Into Member VALUES(0003,'Rai','Kousal','4 january1991','Newroad,Ktm' ,014432128,014862321) Insert Into Member VALUES (0004,'Thapa','Aswin','10 june 1985','Kausaltar,Bkt',016638254,016656981) Explanation: This table will hold every personal details of the Member of Tristar Video Rental store including their ID, name, address,contact no etc. The table get updated when any member dont want their membership of this store. For a new membership, one row is inserted in this table which includes all the personal details of new member.

TABLE:Member_Rent For creating Member_Rent Table Create table Member_Rent ( Rent_ID Member_ID Movie_ID Rent_DATE Estmtd_Returned_Date Actual_returned_Date Rent_Price NUMBER(10) NUMBER(10) NUMBER(10) DATE DATE DATE NUMBER(5,2) NOT NULL, NOT NULL, NOT NULL, NOT NULL, NOT NULL, NOT NULL, NOT NULL,

Fine ) For creating Index member_rent_tvr

NUMBER(5,2)

create Index member_rent_tvr on Member_Rent(Member_ID asc) For creating a primary Key ALTER TABLE Member_Rent ADD PRIMARY KEY (Rent_ID) For creating a Foreign Key ALTER TABLE Member_Rent ADD CONSTRAINT fk_movie FOREIGN KEY (Movie_ID) REFERENCES Movie(Movie_ID) ALTER TABLE Member_Rent ADD CONSTRAINT fk_member FOREIGN KEY (Member_ID) REFERENCES Member(Member_ID) Primary Key: Rent_ID Foreign Keys: Movie_ID, Member_ID For inserting Data into Member_Rent Table Insert Into Member_Rent VALUES (0001,0002,0005,'9 March 2009','12 March 2010','12 March 2010','Rs 15','') Insert Into Member_Rent VALUES (0002,0004,0003,'20 January 2010','27 January 2010','27 January 2010','Rs 15','')

Insert Into Member_Rent VALUES ('0001,0002,0005,'21 December 2009','28 December 2009','30 December 2009','Rs 15','Rs 2') Explanation: This table will hold the information of the movies which are on rent and are taken by

the member of Tristar Video Rental. When any member rent movies, then a new row will be inserted in this table which will includes the date of rent, estimated returned date, actual returned date and the same table gets updated when he/she return movies.

TABLE:NONMEMBER_RENT For Creating Table Nonmember_Rent Create table Nonmember_Rent ( NM_Rent_ID Movie_ID Nonmember_name Address Home_phone Work_phone Rent_Date Estmtd_returned_date Actual_returned_Date Rent_price ) Primary Key: NM_Rent_ID Foreign Key: Movie_ID For Inserting Data into Nonmember_Rent Table Insert Into Nonmember_Rent VALUES (0001,0032,'Suman Rai','Lagankhel,Lalitpur','015545679','0155256 98','7 october 2009','14 October 2009','14 October 2009','Rs 20') Insert Into Nonmember_Rent VALUES (0002,0532,'Deepa oli ','Kupondole,Lalitpur','015555679','0155246 98','7 october 2009','14 October 2009','14 October 2009','Rs 20' NUMBER(10) NUMBER(10) VARCHAR2(60) VARCHAR2(20) NUMBER(15) NUMBER(15) DATE DATE DATE NUMBER(5,2) NOT NULL, NOT NULL, NOT NULL, NOT NULL, PRIMARY KEY, NOT NULL, NOT NULL, NOT NULL, NOT NULL,

Movie_ID NUMBER FOREIGN KEY REFERENCES Movie(Movie_ID)

Insert Into Nonmember_Rent VALUES (0003,'0012,'Sahil Rai','Thapathali,Ktm','014345179','0155256 98','15 December 2009','22 December 2009','22 December 2009'Rs 20') Insert Into Nonmember_Rent VALUES (0004,0132,'Sabin Lam','Gatthaghar,Bkt','016545379','0155236 98','14 January 2010','21 January 2010','Rs 20') Explanation: The information of renting movies by nonmember will be stored in Nonmember_Rent Table. When any nonmember rent movies, then a new row will be inserted in tthis table and the same table gets updated when he/she return movies. TABLE: Movies_Status For Creating Table Movies_Status Create table Movies_Status ( Movie_ID Status ) Primary Key: Movie_ID Foreign Key: For Inserting data into Movies_Status Insert Into Movies_Status VALUES (0056,'In') Insert Into Movies_Status VALUES (0546,'Out') Insert Into Movies_Status VALUES (1047,'Coming Soon') Insert Into Movies_Status VALUES (0352,'In') Insert Into Movies_Status VALUES (00264,'Out') Insert Into Movies_Status NUMBER(10) VARCHAR2(20) PRIMARY KEY, NOT NULL

VALUES (0015,'In') Explanation: From Movies_Status Table, you can see the status of the movie, if they are currently available or not or coming soon.

ER Model Following entities for ER model are identified on the basis of above business activities and polices: Movies_ Status * Movie_ID Status 1 Movie Movie_ID Movie_title Genre Nationality Director Cast 1 Movie_ID=Movie_ID 1 * Member_ID=Member_ID Nonmember_rent * Member_Rent M_Rent_ID Member_ID Movie_ID Actual_returned_date Rent_Date Estmtd_returned_date Actual_returned_date Fine * NM_Rent_ID Movie_ID Nonmember_name Address Home_phone Work_phone Estmtd_returned_date Actual_returned_date Rent_price Movie_ID=Movie_ID Movie_ID=Movie_ID

Member Member_ID Member_last_name Member_first_name Date_of_Birth Address Home_phone Work_phone

Rent_price

Potrebbero piacerti anche