Interview Question

What is VIEW in SQL?

A view gives a reusable name and interface to a query.

💡 Concept ✅ Quick Revision 🗃️ SQL

Answer

A view is a named query whose result can be referenced like a table. • A regular view stores its query definition rather than storing a separate result set. • Access permissions can be granted on the view. • Updatability depends on the view definition and database rules.

💡 SQL Example

CREATE VIEW active_employees AS SELECT employee_id, name FROM employees WHERE active = true;

Result

CREATE VIEW

⚡ Quick Revision

A view gives a reusable name and interface to a query.