I created a query in PSQL and run and would like to save it. Query example:
CREATE VIEW total_revenue_per_customer AS SELECT
customers.id, customers.first_name, customers.last_name,
SUM(items.price) FROM customers
INNER JOIN purchases ON customers.id = purchases.customer_id
INNER JOIN items ON purchases.item_id = items.id
GROUP BY customers.id;
What is the commando to save my query by terminal?