Database Lock Error - SQL Mission 190

Hello,

I am stuck on screen 4 of Building and Organizing Complex Queries mission. Could someone please help understand what is causing the database lock and how to get past this error?

My Code:

CREATE VIEW chinook.customer_gt_90_dollars AS
SELECT
c.*
FROM chinook.invoice i
INNER JOIN chinook.customer c ON i.customer_id = c.customer_id
GROUP BY 1
HAVING SUM(i.total) > 90;

The above query when executed gives the following error:

(sqlite3.OperationalError) database is locked
[SQL: CREATE VIEW chinook.customer_gt_90_dollars AS SELECT c.* FROM chinook.invoice i INNER JOIN chinook.customer c ON i.customer_id = c.customer_id GROUP BY 1 HAVING SUM(i.total) > 90;]
(Background on this error at: http://sqlalche.me/e/13/e3q8)

Thank you!

2 Likes

Same here :frowning:

2 Likes

Although restarting the session right away did not help in my case, the lock got released in about an hour - so I was able to complete the mission with the code similar to yours

2 Likes

Ah, finally found someone with the same issue, I thought I was going crazy… even the simplest queries return the same error. Fingers crossed it works when I reload it tomorrow!

(error I’m getting even though I never wanted to do anything with customer_usa view:
(sqlite3.OperationalError) table customer_usa already exists
[SQL: CREATE VIEW chinook.customer_usa AS SELECT * FROM chinook.customer WHERE country = “USA”;]
(Background on this error at: http://sqlalche.me/e/13/e3q8))