Hands-on task
This task is step 14 of the course “SQL with SQLite”
SQLite: create a view (VIEW)
The database /root/shop.db has a table sales(id, category, amount). Create a view (VIEW) named category_totals with two columns: category and total — the total revenue for each category.
The view must stay in the database (not a file with the result, but a view object), so that it can be queried like a table: SELECT * FROM category_totals.
Reference:sqlite3
What you'll practise:
- sqlite3
- create view
- views
- named query
- sqlite_master