Sitemap
6 min readSep 14, 2025

View vs Materialised Views in PostgreSQL

Press enter or click to view image in full size
Photo by Paul Skorupskas on Unsplash

This is the most commonly asked interview question. In this article, I will cover all the possible questions that may be asked in a SQL Developer Interview.

What is a View?

A view in a database is a virtual table that is based on the result set of an SQL query. Views are used to simplify complex queries, enhance security, and present data in a specific format.

We have two tables: Orders and Returns

orders
returns
create view vw_orders as
SELECT o.*, r.return_date FROM orders o left join
returns r on o.order_id = r.order_id
Press enter or click to view image in full size
Output From The View
--Insert one row:
INSERT INTO orders values(12,'2023–01–21','Laptop', 15000000)
Nidhi Gupta
Nidhi Gupta

Written by Nidhi Gupta

Azure Data Engineer 👨‍💻. Heading towards cloud technologies expertise✌️.

Responses (1)