views_flashcards
What is a view in SQL?
A virtual table based on the result-set of an SQL statement.
How do you create a view in SQL?
Using CREATE VIEW view_name AS SELECT …
Can a view be used in queries like a regular table?
Yes, it can be queried as if it were a table.
Are views stored physically in the database?
No, views are definitions saved; their result is generated on the fly.
What are the benefits of using views?
Security, abstraction, and simplified query expression.
What is an un-updatable view?
A view that includes joins or aggregates and cannot be directly updated.
How can you update a view?
Only simple views on a single table without aggregates are usually updatable.
What does the WITH CHECK OPTION do in views?
Ensures that all updates and inserts satisfy the view’s WHERE clause.