Create a view in_stock of books with stock > 0 (title, genre, stock), then count its rows. Column: n.
Create a view in_stock of books with stock > 0 (title, genre, stock), then count its rows. Column: n.
Answer
CREATE VIEW in_stock AS SELECT title, genre, stock FROM books WHERE stock > 0; SELECT count(*) AS n FROM in_stock;