FreeCodeCamp-Pandas-Real-Life-Example /Exercises_2.ipynb

Tell us what’s happening:

Describe your issue in detail here.

conn = sqlite3.connect(‘data/sakila.db’)

df = pd.read_sql(‘’’
SELECT
rental.rental_id, rental.rental_date, rental.return_date,
customer.last_name AS customer_lastname,
store.store_id,
city.city AS rental_store_city,
film.title AS film_title, film.rental_duration AS film_rental_duration,
film.rental_rate AS film_rental_rate, film.replacement_cost AS film_replacement_cost,
film.rating AS film_rating
FROM rental
INNER JOIN customer ON rental.customer_id == customer.customer_id
INNER JOIN inventory ON rental.inventory_id == inventory.inventory_id
INNER JOIN store ON inventory.store_id == store.store_id
INNER JOIN address ON store.address_id == address.address_id
INNER JOIN city ON address.city_id == city.city_id
INNER JOIN film ON inventory.film_id == film.film_id
;
‘’', conn, index_col=‘rental_id’, parse_dates=[‘rental_date’, ‘return_date’])

Error

OperationalError Traceback (most recent call last)
in <cell line: 1>()
----> 1 conn = sqlite3.connect(‘data/sakila.db’)
2
3 df = pd.read_sql(‘’’
4 SELECT
5 rental.rental_id, rental.rental_date, rental.return_date,

OperationalError: unable to open database file

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36

Challenge Information:

Data Analysis with Python - How to use Jupyter Notebooks Intro

OperationalError: unable to open database file

Can you confirm that the database file is present in the folder?

Can you share a link to your environment if you are doing this on Google Colab?

Or a screenshot showing the folders with the databae file?

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.