Database manager practical examples

Last update: 18 September 2025
Author Dr369
database manager examples

A database management system (DBMS) is a tool that helps you manage the data stored in databases. You can use it to create, delete, or update tables and rows. In this article, I'll show you five practical examples of how to use a database management system.

Database manager practical examples

Database Manager Example 1: Creating a Database

Creating a database is the first thing you need to do when using the Database Manager. This can be done in three ways:

  • Create a database with a name and a user. The following example shows how create a database called «myDatabase» with user «user1», password «passw0rd».
  • Create a database with the host, port and user data. The following example shows how to create a database called “myDatabase” on the host localhost (127.0.0), listening on port 3306 with the user “user1” and the password “passw0rd”.
  • Create an empty database without specifying any parameters for future use.
Database examples
Related articles:
Best Database Examples for Developers and Administrators

Database Manager Examples 2: Create a table in the database

Let's create a table in our database. We'll use the create table command to create our new table and then add some columns.

  • CREATE TABLE . (column1 data_type, column2 data_type)

This creates a new table called "table_name" with two columns: "column1" and "column2". Both columns are of type integer (INT).

  Types of databases: Relational, NoSQL and more

Database Manager Example 3: Inserting Rows into Table

In this example, we'll insert rows into a table. The INSERT statement is used to add data to an existing table. The VALUES clause specifies the values ​​to be inserted into the specified columns and their data types. You can also use the DEFAULT keyword to set default values ​​for columns or the NULL keyword to define the column as nullable (allowing it to contain a NULL value).

The AUTO_INCREMENT keyword auto-increments the primary key value of each new row inserted into the table with a random number, starting at 1 and going up to 2147483647 (or just beyond).

Database Manager Example 4: Retrieving Data from the Table

The following example shows how to retrieve data from a table in a database.

  • Use the query() method to get data from the database.
  • Use the execute() method to get the data from the database.
  • Get all records using the fetchall() method:

Database Manager Example 5: Deleting Rows from Table

Database manager example 5 – Deleting rows from a table

In this example, you will learn how to delete rows from a database table using SQL, PHP, Python, and Java.

  • In PHP:

// Create the connection with mysql_connect()

$link = mysql_connect("localhost", "root", "") or die("Cannot connect");

// We select the database we want to use

mysql_select_db("testdb") or die("Cannot select db");

// Run our query here using prepared statements if we need to: $sql = 'DELETE FROM `table` WHERE `id` = ?'.$id;

  Career path to becoming a Data Engineer

// Execute the statement: $result = mysqli_query($link, $sql);

if (!$result) { echo "An error occurred while executing the query."; } else { echo "The query was executed successfully."; }

Top Database Managers

A database management system (DBMS) is software that helps manage and manipulate databases. It allows you to create, modify, and query data stored in a database efficiently and securely.

There are different types of database managers, some practical examples are:

MySQL

It is a widely used open-source relational database management system . It is very popular on the web and is used to store data for web applications, such as blogs, e-commerce sites, and content management platforms.

Oracle database

It is a relational database management system that is primarily used by large companies and organizations. It is known for its scalability, security, and ability to handle large volumes of data.

MongoDB

MongoDB, a NoSQL database management system , is document-oriented. It is suitable for applications that need a flexible and scalable data structure, such as those related to social networks and content management systems.

Microsoft SQL Server

Microsoft developed SQL Server, which is a relational database management system. It is used in a variety of industries, from small businesses to multinational corporations, and is supported by a wide range of operating systems.

PostgreSQL

It is an open source relational database manager and one of the oldest available. It is known for its stability, reliability and ability to handle large volumes of data.

  phpMyAdmin: what it is, what it's for, and how to get the most out of it

These are just a few examples, but there are many other database managers available, each with specific features and functionality to suit different needs and use cases.

Conclusion: Database Manager Practical Examples

In this article we have covered five practical examples of how to use a database manager. These examples will help you learn how to use a database and gain confidence in using it. The first example showed how to create a new database and tables within it; the second example showed us how to insert data into those tables; the third example shared information about retrieving information from those same tables; finally, the last two examples demonstrated how to delete data from those same tables, as well as recover all the rows within them.