You are on page 1of 2

Tutorial 4

Stored Procedures

Film Club database schema contains the following tables:

Films ( FilmId , FilmName, YearReleased, PlotSummary , Rating, CategoryId )

Category ( CategoryId, Category)

FavCategory ( CategoryId, MemberId)

Members ( MemberId, FName, LName, DateOfBirth, Address, Email)

Write stored procedures for the following queries:

1) Create stored procedure SPmembers to List full details of all members.

2) Alter the SPmembers to view first name and last names only.

3) Delete the SPmembers from the database.

4) Create stored procedure SPcategory to list full details of all favourite category and
category tables.

5) Create stored procedure to list all films names and categories using one input
parameter (film rating).

6) Create stored procedure SPfilm_rating to get the rating number as an output parameter
and FilmName as input parameter from FILMS table.

7) Execute the SPfilm_rating stored procedure by checking the rating number. If the
rating number is less than 3 print a message "Poor film" else print a message "Good
film".

Advanced Database Systems Page 1 of 2


Advanced Database Systems Page 2 of 2

You might also like