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.
This exercise is part of the course
Introduction to SQL
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
-- Create a view called library_authors
___ AS
SELECT DISTINCT author AS unique_author
FROM books;