MariaDB Select Datatabase
Last Updated :
22 Jan, 2024
MariaDB is one of the most powerful relational database management systems(RDBMS) which offers a robust set of SQL commands for effective data manipulation. It is free and open-source software. It is used for various purposes like data warehousing, e-commerce, and logging applications.
We typically switch between databases using the USE command. We are using HeidiSQL software which is free and has the aim to be easy to learn. "Heidi" lets you see and edit data and structures from computers running one of the database systems MariaDB, MySQL, Microsoft SQL, PostgreSQL, and SQLite.
In this article, we will see, how to select a particular database for further processes like creating tables or writing queries.
Creating a Database
To initiate the process, let's start by Creating a database. Using the CREATE DATABASE statement, a new database named "Students" is established.
Query:
CREATE DATABASE Students;
Explanation: In the above query, We have created a database called student in the MariaDB.
Checking Database List
After creating the Students database, we can examine the available databases in the application using the SHOW DATABASES statement. This feature provides an overview of the existing databases.
Query:
SHOW DATABASES;
Output:
Databases listExplanation: As we can saw in the image that it provides a list of available databases, including the Students database which we had created recently.
Selecting a Database
Now for selecting a database for your project in MariaDB, we will use the USE command.
Query:
USE students;
Explanation: The students database has been selected. Now we can create tables, insert data and perform queries in this database.
Checking the Current Database
This command allows users to verify the current database.
Query:
SELECT DATABASE();
Output:
Selected databaseExplanation: This command’s output verifies the current database, offering users certainty concerning their functioning environment in MariaDB.
Conclusion
This article had shown us how to select the database in MariaDB and the use of USE command which helps in switching between the databases. The USE command is an important tool for selecting a specific database for subsequent operations such as table creation, data insertion, and query execution.
The creation of databases via CREATE DATABASE and exploration using SHOW DATABASES contributes to a user-friendly experience. SELECT DATABASE() allow users to know theÂir present situation, creating a cleÂar workflow. This in essence means that by mastering these commands, MariaDB users achieve the full potential of this powerful relational database management system.
The combination of the commands CREATE DATABASE, SHOW DATABASES, USE, and SELECT DATABASE() creates the solid foundation for an easy and effective data management process, recognizing both the simple and the complicated database related activities.
Similar Reads
MariaDB Alter Database MariaDB is an open-source relational database management system. In comparison to MySQL, MariaDB possesses several similar features, including ACID compliance, support for a wide range of storage engines, and availability of different data types. As our data needs develop, the demand to modify our d
5 min read
MariaDB Create Database MariaDB is a strong and adaptable relational database management system that retains a wide range of features, including efficient data manipulation. An essential element of database management is the creation of databases, which form the foundation for data organization and storage. In this article
3 min read
MariaDB Drop Database MariaDB, an open-source relational database management system widely used by users, enables them to manage their databases efficiently. MariaDB Offers fast data processing and scalability. MariaDB Stores data in tables with structured relationships between them. In this article, We will learn about
4 min read
SQL Select Database The USE DATABASE statement is a command in certain SQL-based database management systems that allows users to select and set a specific database as the default for the current session. By selecting a database, subsequent queries are executed within the context of that database, making it easier to i
4 min read
MariaDB Data Types MariaDB is an open-source software It has implemented various performance improvements over MySQL. It includes various enhancements such as the Aria storage engine, the Thread Pool feature, and the MaxScale proxy, all of which provide better performance and scalability. MariaDB has a large number of
5 min read