You are on page 1of 3

Lab 04.

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

4. WideWorldImporters: You can download the WideWorldImporters database from the


Microsoft website at this link:
https://github.com/Microsoft/sql-server-samples/releases/download/wide-world-
importers-v1.0/WideWorldImporters-Full.bak

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):

SELECT c.first_name, c.last_name, c.email


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_actor fa ON i.film_id = fa.film_id
JOIN actor a ON fa.actor_id = a.actor_id
WHERE a.first_name = 'Tom' AND a.last_name = 'Hanks';
Lab 05
Corrections
Lab manual 05 refers to a SQL Server Native Client. The SQL Server Native Client (often
abbreviated SNAC) has been removed from SQL Server 2022 (16.x) and SQL Server
Management Studio 19 (SSMS). The SQL Server Native Client (SQLNCLI or SQLNCLI11) and
the legacy Microsoft OLE DB Provider for SQL Server (SQLOLEDB) are not recommended for
new application development. Switch to the new Microsoft OLE DB Driver (MSOLEDBSQL)
for SQL Server or the latest Microsoft ODBC Driver for SQL Server going forward.

You might also like