Вы находитесь на странице: 1из 8

New Delhi Institute of Management

Database Management Systems


Group Project
Project-A: Video Rental Company
Max Marks: 20
Following is a case study describing the data requirements for a Video Rental Company.
 The video rental company has several branches throughout a country. The data held on each
branch is the branch address made up of street, city, state, and zip code, and the telephone
number. Each branch is given a branch number, which is unique throughout the company.
 Each branch is allocated a number of staff members, including a Manager. The Manager is
responsible for the day-to-day running of a given branch. The data held on a member of staff
is his or her name, position, and salary. Each member of staff is given a staff number, which
is unique throughout the company.
 Each branch has a stock of videos. The data held on a video is the catalogue number, video
number, title, category, daily rental, cost, status, the names of the main actors, and the
director. The catalogue number uniquely identifies each video. However, in most cases, there
are several copies of each video at a branch, and the individual copies are identified using the
video number. A video is given a category such as Action, Adult, Children, Drama, Horror,
or Sci-Fi. The status indicates whether a specific copy of a video is available for rent.
 Before hiring a video from the company, a customer must first register as a member of a
local branch. The data held on a member is the first and last name, address, and the date that
the member registered at a branch. Each member is given a member number, which is unique
throughout all branches of the company.
 Once registered, a member is free to rent videos, up to maximum of ten at any one time. The
data held on each video rented is the rental number, the full name and number of the
member, the video number, title, and daily rental, and the dates the video is rented out and
date returned. The rental number is unique throughout the company.
 Attempt the following Questions.

a) Identify the main entity types of the video rental company.


 Branches
 Members
 Rental
 Staff
 Video

b) Choose the primary keys for each (strong) entity type.


 Branches – Branch ID
 Members – Member ID
 Rental – Rental ID
 Staff – Staff ID
 Video – Catalogue No.
c) Draw an ER diagram for this description.

d) Create the tables as identified from the ERD and insert dummy data into it (at least 10
records in each table).
e) Execute the following SQL queries on the database created above in SQLite:

1. Display details of all the branches of the video rental company.

2. Display the managers at any chosen branch.


3. Display the number of videos available category wise.

4. Display all the customers whose names have ‘o’ as the second character.

5. Display the videos that have been rented.


6. Display the number of videos of each category that are available with the company.

7. Display the list of customers who have rented more than 4 videos.

8. Display details of all videos and the customers to whom they have been rented.
9. Display details of all customers registered with branches in Delhi.

10. Display details of all staff members whose salary is greater than the salary of the manager.

11. Display details of all videos including those that have been rented and for the rented videos
display the details of customers.
12. Display details of Branch managed by Manager “Prateek Kuhad”.

13. Display number of videos rented category wise.

14. Display the videos rented in the month of JANUARY.


15. Display the minimum and maximum salary paid by the company.

16. Display the minimum and maximum salary paid branch wise.

17. Display the details of videos which have been rented and those that have not been rented
through an additional field rental status.
18. Display the total earning of the company from video renting.
19. Display the most liked video.

20. Display the most profitable customer.

Вам также может понравиться