TGViewer
Data Engineers Data Engineers @sql_engineer · 11.2K subscribers
Post #196 2.61K
⏰ VIEWS in SQL

Definition

A view is a virtual table based on the result of a SELECT query.

Features

- Does not store data; it retrieves data from underlying tables.
- Simplifies complex queries.

Syntax
CREATE VIEW view_name AS
SELECT columns
FROM table_name
WHERE condition;

Example

Create a view to show high-salaried employees:

CREATE VIEW HighSalaryEmployees AS
SELECT name, salary
FROM employees
WHERE salary > 100000;


Use the view:

SELECT * FROM HighSalaryEmployees;


Interview Questions

1. What is the difference between a table and a view?
- A table stores data physically; a view does not.
2. Can you update data through a view?
- Yes, if the view is updatable (no joins, no aggregate functions, etc.).
3. What are the advantages of using views?
- Simplifies complex queries, enhances security, and provides abstraction.
  • 👍 4
  • 🔥 1
More from @sql_engineer
  1. Aug 29, 2026Example: Source Database → CDC → Only Changed Records → Data Platform CDC is especially us…
  2. Aug 29, 2026🚀 Data Engineering Fundamentals – Part 7 📥 Data Ingestion: How Data Enters a Data Platfo…
  3. Aug 18, 2026🚀 Data Engineering Fundamentals – Part 6 📌 ETL vs ELT: How Data Moves from Source to Des…
  4. Aug 11, 2026📊 The 90-Minutes Business Analytics Masterclass Learn how to transform raw data into powe…
  5. Aug 8, 2026Data Warehouse Stores: Cleaned sales data Customer KPIs Revenue reports Historical busines…
  6. Aug 8, 2026🚀 Data Engineering Fundamentals – Part 4 📌 Databases vs Data Warehouses vs Data Lakes vs…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →