1Views are created in order to store your queries as virtual
2table. If there are a lot of columns and we don’t want to
3use all columns and make the table simpler, we can create a
4view and reuse it repeatedly. Actually, view does not store
5any data however, it contains the retrieve statements to
6provide reusability. We can create view if we use some
7queries mostly.
8create view EmployeeInfo as
9select first_name || last_name as "Full Name"
10from employees;
11
1CREATE VIEW view_name AS SELECT id,category,MAX(created_at),content,title FROM table WHERE condition GROUP BY category
1CREATE VIEW view_name AS
2SELECT column1, column2.....
3FROM table_name
4WHERE condition;
5
6view_name: Name for the View
7table_name: Name of the table
8condition: Condition to select rows
9