WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

MySQL Tutorial


MySQL is the most popular relational database management system. In terms of web applications, MySQL is one of the best RDBMS (Relational Database Management System) application software.

In this tutorial, you will quickly learn the basics of MySQL and use MySQL databases easily.


What is a database?

A database is a warehouse that organizes, stores, and manages data according to the data structure.

Each database has one or more different APIs for creating, accessing, managing, searching and copying the saved data.

We can also store data in files, but reading and writing data in files is relatively slow.

So, now we use a relational database management system (RDBMS) to store and manage large amounts of data. The so-called relational database is a database based on a relational model. It uses mathematical concepts and methods such as set algebra to process data in the database.

RDBMS is a relational database management system (Relational Database Management System):

  • 1. Data appears in the form of a table
  • 2. Various record names for each line
  • 3. Each column is the data field corresponding to the record name
  • 4. Many rows and columns form a form
  • 5. Several forms form the database

RDBMS terminology

Before we start learning MySQL databases, let's understand some terms of RDBMS:

  • Database: A database is a collection of related tables.
  • Data table: A table is a matrix of data. A table in a database looks like a simple spreadsheet.
  • Column: A column (data element) contains the same type of data, such as data for a postal code.
  • Line: A line (= tuple, or record) is a related set of data, such as a piece of data that a user subscribes to.
  • Redundancy : Stores twice the data. Redundancy reduces performance but improves data security.
  • Primary key : The primary key is unique. A data table can contain only one primary key. You can use primary keys to query data.
  • Foreign keys: Foreign keys are used to associate two tables.
  • Composite key : A composite key (combined key) uses multiple columns as an index key, and is generally used for composite indexes.
  • Index: Use indexes to quickly access specific information in database tables. An index is a structure that sorts the values ​​of one or more columns in a database table. Similar to a catalog of books.
  • Referential integrity: The integrity of a reference requires that non-existent entities be referenced in the relationship. Integrity with entities is an integrity constraint that the relationship model must meet to ensure data consistency.

MySQL is a relational database management system. This so-called "relational" can be understood as the concept of "table". A relational database consists of one or several tables, as shown in the figure below. Form:

  • Header: the name of each column;
  • col (col): a collection of data of the same data type;
  • row: Each row is used to describe the specific information of a record;
  • value: The specific information of the row, each value must be the same as the data type of the column;
  • key : The value of the key is unique in the current column.

MySQL database

MySQL is a relational database management system developed by the Swedish MySQL AB company and currently belongs to the Oracle company. MySQL is a relational database management system. The relational database stores data in different tables instead of putting all the data in a large warehouse, which increases speed and flexibility.

  • MySQL is open source, so you don't need to pay extra fees.
  • MySQL supports large databases. Can handle large databases with tens of millions of records.
  • MySQL uses the standard SQL data language form.
  • MySQL can run on multiple systems and support multiple languages. These programming languages ​​include C, C ++, Python, Java, Perl, PHP, Eiffel, Ruby, Tcl, and more.
  • MySQL has good support for PHP, which is currently the most popular web development language.
  • MySQL supports large databases, a data warehouse with 50 million records, 32-bit system table files can support up to 4GB, and 64-bit systems can support up to 8TB.
  • MySQL is customizable and uses the GPL protocol. You can modify the source code to develop your own MySQL system.

What should you know before starting this tutorial?

Before starting this tutorial, you should understand the basics of PHP and HTML and be able to apply them easily.

Many of the examples in this tutorial are related to the PHP language, and our examples are basically demonstrated in the PHP language.