Aan de slagGa gratis aan de slag

VIEWing your query

You've worked hard to create the below SQL query:

SELECT DISTINCT author AS unique_author
FROM books;

What if you'd like to be able to refer to it later, or allow others to access and use the results?

The best way to do this is by creating a view. Recall that a view is a virtual table: it's very similar to a real table, but rather than the data itself being stored, the query code is stored for later use.

Deze oefening maakt deel uit van de cursus

Introduction to SQL

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

-- Create a view called library_authors
___ AS
SELECT DISTINCT author AS unique_author
FROM books;
Code bewerken en uitvoeren