VIEW

SQL VIEW Keyword

In SQL, a view is a virtual table based on the result set of an SQL statement. A view does not store data itself — it dynamically pulls data from the underlying table(s).

Tutorials dojo strip

SQL CREATE VIEW Syntax

SQL

SQL CREATE VIEW Example

This query creates a view named FemalePatients that returns a list of female patients from the Patients table.

SQL

SQL Query The View Example

This query selects all records from the FemalePatients view.

SQL

SQL CREATE OR REPLACE VIEW Syntax

SQL

SQL CREATE OR REPLACE VIEW Example

This query updates the FemalePatients view to include the gender column.

SQL

Note: This code does not work in TechKubo playground. SQLite does not support CREATE OR REPLACE VIEW. You must use DROP VIEW first and then CREATE VIEW again to simulate replacing a view.

SQL DROP VIEW Syntax

SQL

SQL DROP VIEW Example

This query deletes the FemalePatients view from the database.

SQL

SQL VIEW Labs

Tutorials dojo strip