0% found this document useful (0 votes)
70 views

Mohammad Ali Jinnah University: TERM Project Spring 2020

The document outlines two options for a term project - either creating a desktop or web application using a database, or answering questions using the Sakila sample database. It provides the schema for the Sakila database and 20 questions to answer using joins and other SQL queries. Students are warned that plagiarism will be penalized.

Uploaded by

Shay Watsons
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views

Mohammad Ali Jinnah University: TERM Project Spring 2020

The document outlines two options for a term project - either creating a desktop or web application using a database, or answering questions using the Sakila sample database. It provides the schema for the Sakila database and 20 questions to answer using joins and other SQL queries. Students are warned that plagiarism will be penalized.

Uploaded by

Shay Watsons
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Mohammad Ali Jinnah University

TERM Project Spring 2020

Option 1 : Create any desktop/Web Application using any built in Database or you can create
your own database . Your application must perfrom ( Insert / Update / Delete / Search ) ( Max
2 students allowed ).
Option 2 : Solve the following Question Using Sakila Database.( Individual Submission )

Plagiarism will be strictly panelized .

Consider the following schema of Sakila Database:

Actor ( actor_id, first_name ,last_name,last_update )


film (film_id ,title ,Description,release_year,language_id ,original_language_id,r
ental_duration,rental_rate,rental_duration ,length ,replacement_cost ,rating ,spec
ia,
features ,last_update)
inventory ( inventory_id ,film_id ,store_id ,last_update )
customer (customer_id, store_id , first_name , last_name, email, address_id ,
create_date)
payment ( payment_id, customer_id, staff_id , rental_id , amount , payment_date,)
rental ( rental_id , rental_date, inventory_id, customer_id, return_date,
staff_id)
staff ( staff_id , first_name , last_name, address_id, picture, email, store_id)
store (store_id , manager_staff_id , address_id , )
country ( country_id, country , last_update )
city ( city_id , city , country_id , last_update)
address ( address_id , address , city_id , postal_code , phone )
Question 1
Restore SAKILA database and fetch the following information (10)
1. Return the full names (first and last) of actors with “SON” in their last name, ordered by their
first name.
2. Display the total amount rung up by each staff member in August of 2005.
3. List each film and the number of actors who are listed for that film
4. How many copies of the film Hunchback Impossible exist in the inventory system
5. Display all actors who appear in the film Alone Trip
6. You want to run an email marketing campaign in Canada, for which you will need the names and
email addresses of all Canadian customers. (Hint: Use joins to retrieve this information).
7. Sales have been lagging among young families, and you wish to target all family movies for a
promotion. Identify all movies categorized as family films
8. Display the most frequently rented movies in descending order
9. Write a query to display for each store its store ID, city, and country
10. How many films involve a “Crocodile” and a “Shark”
11. Show the title,release year and language of the film.
12. Which movie was rented for the longest duration.
13. List the customer id and total amount paid by each customer in ascending order.
14. Create a list of films and their corresponding categories
15. Create a list of actors and the number of movies by each actor.
16. List the film_id and titles of those films that are not in inventory
17. Find a list of customers who have not rented a movie yet.
18. Find the number of English films in the category of ‘Documentary’
19. How many languages are there that ends at ‘n’
20. Find out the top 5 countries with most number of clients
Question 2
(a) Create view name vw_Film_details.that hold the information like filmID its title, description,
category, price, length, rating and the name of the actor. As shown below (2)

(b) Create view name vw_store_sales that contain the total sales of each store its manager, city and
country name where the store are situated as shown below(2)
Question 3
Create an insert trigger on Customer table for column create_date which restrict the admin not to enter the
customer information if the entered is greater than today and generate an alert message “Future Date is
not allowed” (2)
Question 4

Write a script that contains a WHILE loop nested inside another WHILE loop. The counter for the outer
loop should count up from 1 to 100. The counter for the inner loop should count up from 1 to 5.(2)

Question 5

Create a stored procedure name sp_cust_info that takes a country’s name as the input parameter and
outputs the details of customers in it (customer_id, first_name, last_name).(2)

Viva 10 Marks ( for both student of Option 1 and Option 2 )

************ GO OD LUCK ☺ ************

You might also like