groceries/Groceries.Data/Migrations/20210627012216_create_item_purchases.sql

5 lines
176 B
SQL

CREATE OR REPLACE VIEW item_purchases AS
SELECT item_id, transaction_id, created_at, store_id, price, quantity
FROM transaction_items
JOIN transactions USING (transaction_id);