Introduction to MySQL
MySQL is one of the popular relational database management systems; before proceeding to the explanation of the introduction to MySql, we will see the basic concepts related to the database.
The database is used to store the data; that is, the database is an application that stores the collection of related data. The other source of storing the data can be flat files as well, but the problem is to store, manage and access the data not fast and it is difficult; therefore the good option is to use the database management system. There are different types of Database Management Systems, each used different APIs to store and manage the data in them.
Types of Database Management Systems
Different types of Database Management Systems based on the data models they follow are:
- Relational Database Management Systems
- Hierarchical Database Management Systems
- Network Database Management Systems
- Object-oriented Database Management Systems
A. Relational Database Management Systems
The Relational Database Management Systems, in short, is called RDBMS. In the RDBMS, the data is stored in the different tables, and relations between the tables are established using primary keys and other keys, which are known as Foreign Keys. We will learn in detail about relational database management systems to understand MySql more clearly because MySql is a type of relational database management system.
Let us revise the terminology related to the RDBMS:
1. Database: A database is used to store a collection of tables with related data.
2. Table: A table is a collection of related data organized in the form of rows and columns. A table in a database looks like a simple spreadsheet. The table is used to represents or to stores the data related to the objects or entities or even to represent the relations.
3. Column: Column also called the field. The column store the data value for the specific field; for example, the column name is to store the employee name, which stores only the employee name.
4. Row: Row also called a record. The row is the set of field values that are relevant to a specific entity in the table. For example, in employee table contain fields as eid, ename, salary, address and so on.
5. Constraint: Constraints are rules which restrict the type of data that can be stored in a table. The constraint is helpful to maintain the data integrity in a table as well as in the database.
Some of the constraints are as follow.
- Primary Key: A primary key is a unique key which means it should not have duplicate value and also should have a null value. As the primary key is having unique values so they can be used to identify each row or entity.
- Foreign Key: A foreign key is a key that is referred to another table’s primary key. The primary and foreign Key used to establish the connection between the tables.
- Composite key: A composite key is also called a compound key. The composite key is a key that having multiple columns as a primary key because identifying each row as one column is not sufficient.
- Not null: Not null constraint restricts a column from entering a NULL value.
- Unique: Unique constraint restricts a column to enter unique values.
- Check: Check constraint restricts a column to enter values from the domain specified.
- Default: Default constraints enter the default specified value if a null value is entered.
B. Hierarchical Database Management Systems
Now, in this topic of Introduction to MySQL, we are going to discuss Hierarchical Database Management Systems which organized or represent the data into a tree-like structure that is stored in the parent node and child node relationships. The data is represented in the collection of fields or records with only one value for each field and the records are linked to other records in the form of parent and children relationships. In a hierarchical database model, a parent record can have multiple children but a child record has only one parent. To travel a hierarchical database model, it needs to access each node of the tree until the record is found.
For example, Supplier can pay either cash or credit which can be represented in a hierarchical database model as:
C. Network Database Management Systems
In this topic of Introduction to MySQL, we are going to discuss network Database Management Systems which represent the data into a network structure, and to create a relationship between entities use the link between them. It is an interconnected records network. The network database model is similar to a hierarchical database model except where one node can have only one parent, a network child node can have multiple parents node which represents many-to-many relationships.
D. Object-oriented Database Management Systems
Object-oriented Database Management Systems also called OODBMS. It represents the data as objects and also supports the classes of objects and their properties like inheritance and all, it works with an object in programming languages similarly works in database objects. To represent composite or larger objects and objects linked to each other as by an “is-part-of” relationship.
Introduction to MySQL Database is popular in relational database management systems can be used from small business applications to big business applications.
Some of the key features of MySQL are:
- Open-source – MySQL is an open-source license. So we get it free nothing to pay to use it.
- Implemented language – MySQL Written in C, C++.
- Powerful – MySql handles a large subset of the data with the functionality of the most powerful database packages. So it makes MySQL is a very powerful program.
- SQL data language – MySQL uses a standard database language that is SQL data language, which is commonly used in most of the database. So it compatible with other databases also.
- Operating systems – On many operating systems the MySQL works with many languages like C, C++, PHP, PERL, JAVA, and so on.
- Large data sets – With large data sets MySQL works well and even very fast.
- Web development – MySQL can also be used in web applications as it is working with PHP and most web development languages.
- Supports large databases – MySQL works with large databases. The default file size limit for a table is 4GB, which can be increased depending on the operating system, up to 50 million rows or more in a table.
- Multi-layered design – MySQL is a multi-layered server design with independent modules. As it is fully multithreaded by using kernel threads, it uses multiple CPUs if they are available.
- Client/server environment – MySQL Server works in embedded or client/server systems.
Uses of MySQL
As we discussed the introduction to MySQL now we are going to learn about the uses of MySQL are as follow:
- Mysql is used by Wikipedia, Facebook, Google, Flickr, YouTube, and all famous companies.
- WordPress, Joomla, Drupal, and all Content Management Systems (CMS) uses MySQL.
- In developing a website as well uses MySQL.
How to get MySQL?
As MySql is an open-source can be freely downloaded from the website https://www.mysql.com and then install.
This has been a guide on Introduction to MySQL. Here we have discussed different types of database management systems and uses of MySQL. You may also look at the following article to learn more –