MySQL is the most used open source relational database management system as of the year 2008. The opportunities associated with MySQL are amazing and some of the leading IT industries uses MySQL. For example, WordPress, NASA, US Navy, Bank of Finland, and many more. Well, there are two important terms we need to understand.
We will understand step by step Data Retrieval and Data Modification Techniques. and also learn Joins, Functions, Views, Transactions, Stored Procedures, Stored Functions, Triggers, and Events.
1] Relational database
A relational database is a collection of data items organized as a set of tables and keys. The model was proposed in June 1970 by Edgar Cord.
2] Open source
MySQL is licensed under GNU General Public License. The GNU General Public License is the most widely used free software license, which guarantees end users the freedom to use, study, share, and modify the software.
History of Relational Database Model
The Database Management System plays a very important role in any application. There are two kinds of database models
1] Relational Database Model
2] Non-Relational Database Model
MySQL is a Relational Database Model. In 1970, Dr. E. F. Code has developed the concepts of the relational database. There will be less redundancy between the data, retrieval of the data will be very efficient. and data modification should be intuitive. Though the relational database can get complex, the basic three properties of less redundancy, efficient data retrieval, and intuitive data modification usually stay the same because relational database concepts enforce them. Let’s see what are the relational database concepts in depth.
What is Relational Database Model?
For any relational database model, there are four very important concepts. A model for relational database states the data is storing one or more tables. It also states that each table is two-dimensional. Each dimension is columns and rows. The intersection of the columns and rows are cells.
Let’s see them a little bit more in detail.
Any relational database consists of one or more tables. Tables are usually modeled after real-world entities. For example, an address table would have Address 1, Address 2, City, State, Country, and Zip code or Postal Code. It’s quite possible on a single address, one or many different persons are staying. It’s quite possible that there is nobody staying at the address as well. An address can have different types, like Work, Home, Factory or Open Ground. Well, all of them can be tables.
2] Column & Rows:
A column represents some attribute of the entity of the table. For example, in the case of the address, as we discussed, it can be Street, Apartment, Address, City, Zip code or any other detail. Columns are also known as fields. A row usually contains a set of values for a single instance of the entity.
For example, an address table it will have a single address. A single address may contain multiple columns. An address can be Apartment, followed by Street, followed by City, State, and Zip code. If the table has multiple Countries data, then there may be an additional column for Country and the row will contain Name of the Country.
The cells are nothing but the intersection of row and column. One cell may contain Apartment and another cell may contain Street. They can belong to different columns and they can belong to different rows. It is an intersection and each of the cells will have a single value. Well, think about it this way. Apartment # may be a number, but the street name may not be a string. Now we are leading to another concept that cell can have different kinds of value. It can be a number or it can be a string or it’s quite possible it’s a mix of both of them. In a relational database, everything into the table has a relation to each other, as well as there is a relation among the tables.