Slide 85
Slide 85 text
©2024 Percona
test=# create table base (a int, b int, c int);
CREATE TABLE
test=# insert into base values (1,2,3),(4,5,6),(7,8,9);
INSERT 0 3
test=# create view v1 as SELECT a, b, c*4 from base;
CREATE VIEW
test=# select * from v1;
a | b | ?column?
---+---+----------
1 | 2 | 12
4 | 5 | 24
7 | 8 | 36
(3 rows)
test=# select * from v1 where a > 6;
a | b | ?column?
---+---+----------
7 | 8 | 36
A View Is An Abstraction of a Table, Used Like a Table
85
Traditionally views are
used to simplify complex
table or obfuscate the
underlying table.