×
☰ See All Chapters

MySQL Tutorial

MySQL is the most widely used open source relational database management system for the development of enterprise applications.  MySQL is based on the Structured Query Language (SQL), which is the popular language for accessing and managing the records in relational database. This MySql tutorial is comprehensive guide designed for beginners and professionals.

Data

  • Data is a value. 

  • Data includes names, numbers, dollar amounts, text, graphics, decimals, figures, calculations, summarization, videos, audios and just about anything else you can possibly imagine. 

Database

Database is a repository and is used to store data (especially related to an organization or enterprise). It is an example for secondary memory.

Popular Database Vendors

Closed-source:  Oracle, Microsoft, Informix, Sybase, and IBM.

Open-source: MySQL, PostgresSQL, and SAP.

Data Base Management System (DBMS)

  • DBMS is a software management system to maintain database. 

  • The software required to perform the task of database management is called as DBMS (Data Base Management System). 

  • Management of data means, providing mechanisms for data manipulation such as adding, updating, deleting or reading of data. And providing data security against unauthorized access. 

  • There are many types of DBMS implementation but among which RDBMS and ORDBMS are popular. 

Relational Data Base Management System (RDBMS)

  • A relational database management system (RDBMS) is an implementation of database management system (DBMS) or software that is used to maintain database. 

  • In RDBMS data will be stored in many tables and all the tables will be related with each other with the help of Primary Key and Foreign Key. 

  • RDBMS database use SQL (Structured Query Language) to communicate with the system. 

Object Relational Database Management System (ORDBMS)

  • An object relational database management system (RDBMS) is also a database management system (DBMS). 

  • ORDBMS also has the same features of RDBMS. 

  • ORDBMS database is used to bridge the gap between Relational World and 

  • Object Oriented Programming language like Java, C++, and VB etc. We can map directly any language object with the tables of relational database. 

  • In java applications, we very rarely use ORDBMS support. 

  • In JAVA, application developers generally use RDBMS and the support of ORM (Object Relational Mapping) technologies like Hibernate, Ibatis, Toplink, etc. 

  • Today almost all databases like Oracle, MySQL, DB2, etc. are ORDBMS but we rarely use the object oriented support. We use only the RDBMS support. 

Normalization

  • Normalization is process where large tables are divided into smaller tables and these smaller tables are related with each other. This is mainly done to avoid redundant values (duplicates). 

  • Data manipulation (CUD operation) becomes complicated and It occupies more storage space by having redundant values. 

  • If normalization is done future changes to the data in the database will be easy and hence maintenance reduces. It also occupies less storage space. 

  • Normalization is mainly done while storing values into database. 

  • RDBMS databases support normalization. 

Maintaining details in a single table will create some problems like:

  • Data redundancy or duplicity of data. 

  • When there are too many columns search operations becomes slow. 

  • There will be limitation of columns. 

Denormalization

  • Denormalization means allowing redundancy in a table. 

  • It is achieved by storing all the data into a single table. 

  • The main benefit of denormalization is to improve the read performance of the database or when lot of read queries will be written. 

  • This is mainly done in data warehousing when creating reports or statistics. 

Features MySQL Database

MySQL is a fast, easy-to-use RDBMS being used for many small and big businesses. MySQL is developed, marketed and supported by MySQL AB, which is a Swedish company. MySQL is becoming so popular because of many good features.

  • MySQL is released under an open-source license. So you have nothing to pay to use it. 

  • MySQL uses a standard form of the well-known SQL data language. 

  • MySQL works on many operating systems and with many languages including PHP, PERL, C, C++, JAVA, etc. 

  • MySQL works very quickly and works well even with large data sets. 

  • MySQL is very friendly to PHP, the most appreciated language for web development. 

  • MySQL supports large databases, up to 50 million rows or more in a table. The default file size limit for a table is 4GB, but you can increase this (if your operating system can handle it) to a theoretical limit of 8 million terabytes (TB). 

  • MySQL is customizable. The open-source GPL license allows programmers to modify the MySQL software to fit their own specific environments. 

 


All Chapters
Author