DEV Community

Syed Umer Tariq
Syed Umer Tariq

Posted on

1

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

AWS Q Developer image

Your AI Code Assistant

Automate your code reviews. Catch bugs before your coworkers. Fix security issues in your code. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay