Professional Documents
Culture Documents
DBMS Lab 08 by Ali Ahmad - 373181
DBMS Lab 08 by Ali Ahmad - 373181
DBMS Lab 08 by Ali Ahmad - 373181
Ali Ahmad
373181
DBMS
Lab 08
Join Operations
Introduction:
In today's lab session, we continued relational databases and SQL queries, specifically
focusing on the practical application of JOIN operations. This lab included 8 tasks for joining
tables to extract information in meaningful ways. The primary purpose of this lab was to
combine information from multiple tables. By addressing real-world scenarios through SQL
queries, we learned to navigate complex database relationships and extract meaningful data
through JOINs.
Objectives:
Retreiving the category name ("Category") for the movie "Chocolate Duck" from the Sakila
database. It uses JOIN operations to link the category, film_category, and film tables based
on their respective identifiers, filtering the result based on the specified movie title.
Task 02:
To find the location (city and country) of staff member Jon, the query navigates through the
Sakila database, performing JOIN operations on the country, city, address, and staff tables,
filtering results based on the staff member's first name.
Task 03:
This query retrieves the first and last names of actors who played in the movie "Alone Trip"
by linking the actor, film_actor, and film tables through JOIN operations, filtering based on
the specified movie title.
Task 04:
To list movies in the "Games" category with a rental rate over $4, the query performs JOINs
on the film, film_category, and category tables, applying conditions on category name and
rental rate, and sorting the result alphabetically by movie title.
Task 05:
This query extracts the email addresses and corresponding movie titles of customers who
rented but did not pay. It involves JOIN operations on the customer, rental, inventory, film,
and payment tables, filtering results where the payment amount is zero.
Task 06:
To obtain a list of unpaid rentals with film title, rental ID, rental date, and duration, the query
navigates through the film, inventory, rental, and payment tables via JOIN operations,
filtering results where the payment amount is zero. List is ordered by film title and date.
Task 07:
By querying the film table, this command retrieves movie titles and descriptions containing
both "Crocodile" and "Shark" keywords, offering insights into films featuring these aquatic
elements.
Task 08:
This query retrieves language IDs for languages specified as "English" or "French" from the
language table, providing essential information for multilingual content identification.