Views
6. Creating your own view
Revision

Instruction

Nice. See how simple it is? You just have to remember that most databases don't allow inserting new data or updating existing data in views. Some databases provide the so-called updateable views where such operations are possible, but we're not going to discuss them here.

Exercise

Alright, now it's your turn to create a simple view. Remember: before the query, write CREATE VIEW name AS

Create a view current_lecturer which selects all information about lecturers who still work (their ended_work column is a null).

Stuck? Here's a hint!

Type

CREATE VIEW current_lecturer AS 
SELECT * FROM lecturer WHERE ended_work IS NULL;

Console

Code editor

Result

TableConsole