Sorry, this page is no longer available
We may earn an affiliate commission when you visit our partners.

Derived Tables

Save
May 1, 2024 3 minute read

Derived tables, also known as materialized views, are a powerful tool in data analysis and reporting. They allow you to create virtual tables that are derived from one or more existing tables, and then use those virtual tables in queries and reports as if they were real tables.

Benefits of Using Derived Tables

There are many benefits to using derived tables, including:

  • Improved performance: Derived tables can improve the performance of queries and reports by avoiding the need to join multiple tables. This is especially beneficial for complex queries that involve large amounts of data.
  • Data reusability: Derived tables can be reused in multiple queries and reports, which saves time and effort. You can also create derived tables that are specific to a particular project or task, which makes it easier to manage and maintain your data.
  • Data security: Derived tables can be used to restrict access to sensitive data. By creating a derived table that only includes the data that users need to see, you can help protect your data from unauthorized access.

How to Create Derived Tables

There are many different ways to create derived tables. The most common way is to use a SQL query. The following example shows how to create a derived table called sales_by_product that shows the total sales for each product:

CREATE TABLE sales_by_product AS
SELECT
  product_id,
  product_name,
  SUM(sales) AS total_sales
FROM
  sales
GROUP BY
  product_id,
  product_name;

Share

Help others find this page about Derived Tables: by sharing it with your friends and followers:

Reading list

We've selected nine books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in Derived Tables.
This classic book covers all the advanced features of SQL:1999, including derived tables. It has been widely praised for its clarity and depth.
This practical guide teaches you how to write SQL queries, including queries that use derived tables. It great resource for beginners who want to learn more about this topic.
This cookbook provides a collection of recipes for solving common SQL problems, including problems related to derived tables. It great resource for professionals who want to learn more about this topic.
This pocket reference provides a quick overview of SQL, including a section on derived tables. It great resource for professionals who want to learn more about this topic.
Provides a comprehensive overview of Oracle PL/SQL, including a chapter on using derived tables. It great resource for developers who want to learn more about this topic.
Provides a comprehensive overview of the internals of SQL Server 2012, including a chapter on derived tables. It great resource for developers who want to learn more about this topic.
Provides a comprehensive overview of SQL performance tuning, including a chapter on using derived tables. It great resource for developers who want to learn more about this topic.
Provides a collection of antipatterns for SQL, including antipatterns related to derived tables. It great resource for developers who want to learn more about this topic.
Table of Contents
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2025 OpenCourser