Book Image

MariaDb Essentials

By : Kenler
Book Image

MariaDb Essentials

By: Kenler

Overview of this book

This book will take you through all the nitty-gritty parts of MariaDB, right from the creation of your database all the way to using MariaDB’s advanced features. At the very beginning, we show you the basics, that is, how to install MariaDB. Then, we walk you through the databases and tables of MariaDB, and introduce SQL in MariaDB. You will learn about all the features that have been added in MariaDB but are absent in MySQL. Moving on, you’ll learn to import and export data, views, virtual columns, and dynamic columns in MariaDB. Then, you’ll get to grips with full-text searches and queries in MariaDb. You’ll also be familiarized with the CONNECT storage engine. At the end of the book, you’ll be introduced to the community of MariaDB.
Table of Contents (10 chapters)
9
Index

Views


A view can be thought of as a virtual table. It is a query that has been saved in a database with a name. The rows returned by the saved query can be seen as table contents, and the set of columns that form the result set can be seen as the table structure. Most SQL statements can refer to a view as if it were a table, and the user who writes those queries may not even know that he/she is using a view.

In MariaDB, sometimes the tables are called base tables to highlight the fact that they are not views.

There can be several reasons for using a view. For example, views can:

  • Avoid duplication of the same SQL code in several queries

  • Minimize the impact of changes in the underlying tables on the SQL code

  • Hide the complexity of the underlying tables

  • Hide information from the underlying tables

We will explore these concepts later. First, let's see how views can be managed using SQL statements.

Views can be managed using the following statements:

  • CREATE VIEW

  • ALTER VIEW

  • RENAME VIEW

  • DROP VIEW

Tip...