Views
Plain View
Syntax
CREATE OR REPLACE VIEW view_name AS queryExample 1
CREATE OR REPLACE VIEW v_movie_quick AS
SELECT movie_name,
movie_length,
release_date
from movies mv;
-- use just like a normal table
select * from v_movie_quick limit 5;
movie_name | movie_length | release_date
--------------------+--------------+--------------
A Clockwork Orange | 112 | 1972-02-02
Apocalypse Now | 168 | 1979-08-15
Battle Royale | 111 | 2001-01-04
Blade Runner | 121 | 1982-06-25
Chungking Express | 113 | 1996-08-03
Example with JOIN
Managing VIEW
View containing condition
Deleting from view also deletes from the main table
Materialized View
Allows you to
Last updated