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 master the basic knowledge of MySQL and use MySQL database easily.
What is a database?
Database is a warehouse that organizes, stores and manages data according to 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 the speed of reading and writing data in files is relatively slow.
So, now we use relational database management systems (RDBMS) to store and manage large amounts of data. The so-called relational database is a database built on the basis of a relational model, which uses mathematical concepts and methods such as set algebra to process data in the database.
RDBMS is the characteristic of relational database management system (Relational Database Management System):
- 1. The data appears in the form of a table
- 2. Each line of various record names
- 3. Each column is the data field corresponding to the record name
- 4. Many rows and columns form a form
- 5. Several forms form a database
Before we start learning MySQL database, let us first understand some RDBMS terms:
- 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 postal code data.
- Row: A row (= tuple, or record) is a group of related data, such as a piece of data subscribed by a user.
- Redundancy : Store twice the data. Redundancy reduces performance but improves data security.
- Primary key : The primary key is unique. A data table can only contain one primary key. You can use the primary key to query data.
- Foreign key: A foreign key is used to associate two tables.
- Composite key : A composite key (composite key) uses multiple columns as an index key, and is generally used for a composite index.
- Index: Use the index to quickly access specific information in the database table. An index is a structure for sorting the values of one or more columns in a database table. Similar to a catalog of books.
- Referential integrity: Referential integrity requires that non-existent entities are not allowed in the relationship. Integrity with entity is the integrity constraint condition that the relational model must meet, the purpose is to ensure the consistency of data.
MySQL is a relational database (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:
MySQL is a relational database management system developed by the Swedish company MySQL AB 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 and is currently part of Oracle’s products.
- MySQL supports large databases. It can handle large databases with tens of millions of records.
- MySQL uses a standard SQL data language format.
- MySQL can run on multiple systems and supports multiple languages. These programming languages include C, C++, Python, Java, Perl, PHP, Eiffel, Ruby, Tcl, etc.
- MySQL has very good support for PHP, which is currently the most popular web development language.
- MySQL supports large databases, a data warehouse with 50 million records, a 32-bit system table file can support a maximum of 4GB, and a 64-bit system supports a maximum table file of 8TB.
- MySQL can be customized, using the GPL agreement, 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 use them easily.
Many examples in this tutorial are related to the PHP language, and our examples are basically the PHP language to demonstrate.
If you don’t know PHP yet, you can learn about the language through the PHP tutorial on this site .