What Are Views in Lake Databases | Azure Synapse Analytics Tutorial

What Are Views in Lake Databases | Azure Synapse Analytics Explained

What Are Views in Lake Databases | Azure Synapse Analytics Explained

📘 Overview

In Azure Synapse Analytics, views in Lake Databases allow users to define logical query layers on top of data without duplicating it. These views are stored in the metastore and can be queried using both Spark and Serverless SQL Pools, enabling seamless analytics across structured and semi-structured data.

🧠 What Is a View in Lake Database?

A view in a Lake Database is a virtual table created by saving a SQL query. It does not store data physically but references data from existing Delta or Parquet tables.

🛠️ How to Create a View in Lake Database

✅ Step 1: Use Spark SQL to Create a View

%%spark
CREATE OR REPLACE VIEW lake.vw_customer_summary AS
SELECT country, COUNT(*) AS customer_count
FROM lake.customer
GROUP BY country;

✅ Step 2: Query the View

%%sql
SELECT * FROM lake.vw_customer_summary;

📌 Benefits of Views

  • No data duplication — views reference base tables
  • Reusable logic — great for summarizing and reporting
  • Accessible from both Spark and Serverless SQL Pools
  • Can be used to hide complexity or standardize queries

🧩 Use Cases

  • Creating data marts from Lakehouse tables
  • Power BI models referencing summarized data
  • Abstracting joins, filters, and calculations

⚠️ Limitations

  • Views in Lake Databases are read-only
  • Cannot include procedural logic or parameters
  • Underlying tables must be Delta/Parquet and accessible to Spark and Serverless

📺 Watch the Video Tutorial

📚 Credit: Content created with the help of ChatGPT and Gemini.