MulaiMulai sekarang secara gratis

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.

Latihan ini adalah bagian dari kursus

Introduction to SQL

Lihat Kursus

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

-- Create a view called library_authors
___ AS
SELECT DISTINCT author AS unique_author
FROM books;
Edit dan Jalankan Kode