DEV Community

Syed Umer Tariq
Syed Umer Tariq

Posted on

Views In Mariadb (part 1)

Views in mariadb are used for simplicity, access management and consistency. Views are basically virtual tables that do not store the data themselves instead take the data from base tables and show them as a single virtual table. We will see below the importance of views and how to create and use them.

Views are simply the saved select statements which help us obtain data from one or more tables. These do not speed up the execution as these are only the saved select queries and do not save the retrieved data so they have to be run again and again each time the view is executed.

Advantages Of Views in Mariadb

Views have following advantages in databases

Simplicity

Views allow you to encapsulate complex queries with joins to simplify the table access. Instead of typing a long and complex query in multiple applications, you can create a view based on the query and use the view name in the applications.

Security

In terms of security, you can grant a user account to access partial data of the base tables through a view. By doing this, you can hide the sensitive data from the users who do not have the privilege to view it.

Consistency

Views can be used to encapsulate business logic and formulas and make them consistent across applications.

In the next part we will see how to create and use the views link for part2

Top comments (0)