Understanding MySQL: DBMS, SQL and MySQL Workbench

Databases

What is MySQL? And what is a database? 🤔

We will answer both answers in this post.

What is MySQL?

Ok we already know what MySQL is not, it is not a database.

MySQL is a relational database management system. 🤯

Okay, now we need to define what a database management system is.

What is a Database Management System (DBMS)?

A Database Management System (DBMS) is software designed to store, retrieve, define, and manage data or data structure in a database.

Data in DBMS is stored in database objects called tables. A table is a collection of related data entries and consists of columns and rows.

Users of this system are given tools to perform various types of operations on the table structures or on the data.

A DBMS acts mainly as an interface between the end user and the database, managing both the data and the database structure in order to facilitate data organisation and manipulation.

Some examples of DBMS include MySQL, PostgreSQL, Microsoft Access, SQL Server and Oracle.

What is a database?

A database is an organised collection of data, typically stored electronically in a digital system in table forms.

In this post we are considering only relational databases, but there is another category of database, called non-relational databases, like MongoDB, you can better understand the difference between relational and non-relational databases here.

A database is usually controlled by a database management system (DBMS). Together, the data the DBMS and associated applications are referred to as a database system, often shortened to just database.

Data, within the most common types of databases currently in operation, is typically modeled in rows and columns in a series of tables to make data processing and querying efficient.

The data can then be easily retrieved, managed, modified, updated, controlled, and organised. Most databases use SQL to write and query data.

What is the difference between a database and an Excel spreadsheet?

Databases and Excel spreadsheets are both convenient ways to store information. The main differences between the two are:

  • How data is stored and manipulated
  • Who can access the data
  • How much data can be stored

The spreadsheets were originally created for one user, or for a small number of users who do not need to do a lot of manipulation on the data.

Databases, on the other hand, are designed to hold much larger collections of information. Databases allow multiple users at the same time to manage and query the data quickly and securely, using logic and a more complex language.

What is SQL?

SQL (Structured Query Language) is the standard language for querying and manipulating relational databases.

Yes, SQL is a programming language. It offers loops, logic directives, variables, and so on.

But rather than being a programming language for building websites, applications, or software, SQL is a language focused on storing, retrieving, and manipulating data in databases.

Here are some examples of SQL commands:

SELECT * FROM table_name WHERE column_name='...';
CREATE TABLE table_name (COLUMN_NAME DATATYPES[,....]);  
ALTER TABLE table_name ADD column_name COLUMN-definition; 
DROP TABLE table_name;  
TRUNCATE TABLE table_name;  

What can you do with SQL?

  • SQL can execute queries on a database
  • SQL can retrieve data from a database
  • SQL can insert records into a database
  • SQL can update records in a database
  • SQL can delete records from a database
  • SQL can create new databases
  • SQL can create new tables in a database
  • SQL can set permissions on tables, procedures, and views

How do SQL and DBMS relate to each other?

DBMS is a database management system. And SQL is the language used to communicate with the data in a DBMS.

Or, in simple terms:

DBMS is a book and SQL is the language being used in the book. Want to read or write in the book? Use SQL.

MySQL Workbench

MySQL Workbench is a visual database design tool that integrates the development, administration, design, creation and maintenance of SQL databases into a single integrated development environment (IDE) for the MySQL database system.

MySQL Workbench provides a set of tools to improve the performance of MySQL applications, provides a visual platform to manage MySQL environments and gain better visibility into databases, also provides visual tools to create, execute, and optimize SQL queries.

There many other tools like that, at some level, it turns out to be your preference to choose one to go with. Some good options are TablePlus and Sequel Pro if you use Mac, otherwise MySql workbench will do the job.

Connecting the parts

To understand how all these pieces are connected, take a look at the image below.

Leave a Reply

Your email address will not be published. Required fields are marked *

1 Comments

graliontorile

Hi there! This post couldn’t be written any better! Reading through this post reminds me of my previous room mate! He always kept talking about this. I will forward this article to him. Pretty sure he will have a good read. Thank you for sharing!