Command
CREATE VIEW viewname AS SELECT column1, column2, ... FROM tablename;
Explanation
Creates a new view in the current database.
Examples
Create view for active users
CREATE VIEW active_users AS SELECT * FROM users WHERE status = 'active';
CREATE VIEW viewname AS SELECT column1, column2, ... FROM tablename;
Creates a new view in the current database.
Create view for active users
CREATE VIEW active_users AS SELECT * FROM users WHERE status = 'active';