Lab 04 and 05
Lab 04 and 05
Lab 04 and 05
Sakila Sample Database is made against MySQL. Script given contains many errors. Below is
the link to download the script SQL Server.
https://github.com/ozzymcduff/sakila-sample-database-ports
Other Databases which can be used for the same purpose are also presented below with
downloadable link. For example
1. Student Database.
Download Link: https://www.kaggle.com/datasets/emrahaydemr/sample-databases-for-the-sql-
server-course
2. Stack Overflow: You can download the Stack Overflow database from the Stack
Exchange Data Explorer website at this link:
https://data.stackexchange.com/stackoverflow/query/new
3. Northwind: You can download the Northwind database from the Microsoft website at this
link: https://github.com/microsoft/sql-server-samples/tree/master/samples/databases/
northwind-pubs
5. Bike Stores.
https://www.sqlservertutorial.net/load-sample-database/
Sample Queries for Sakila
1. Retrieve the names of all customers along with the rental dates and titles of the movies they
rented:
SELECT c.first_name, c.last_name, r.rental_date, f.title
FROM customer c
JOIN rental r ON c.customer_id = r.customer_id
JOIN inventory i ON r.inventory_id = i.inventory_id
JOIN film f ON i.film_id = f.film_id;
2. Retrieve the names and emails of all customers who have rented a movie starring a
particular actor (in this example, Tom Hanks):