Getting a syntax error when attempting to create a VIEW. Tried with and without including “chinook.” before the view name. Both times it failed.
My Code:
CREATE VIEW chinook.usa_customer AS
SELECT c.country, i.customer_id, i.invoice_id FROM customer c
WHERE c.country = "USA"
INNER JOIN invoice i ON c.customer_id = i.customer_id
SELECT * from chinook.usa_customer;
What actually happened:
File "<ipython-input-4-d014c93d066a>", line 1
CREATE VIEW chinook.usa_customer AS
^
SyntaxError: invalid syntax