MySQL latest ma...LOGIN
MySQL latest manual tutorial
author:php.cn  update time:2022-04-15 14:04:12

MySQL tutorial


mysql

Mysql is the most popular relational database management system. MySQL is the best RDBMS (Relational Database Management System: relational database) in terms of WEB applications. Management system) one of the application software.

In this tutorial, you will quickly master the basic knowledge of Mysql and easily use the Mysql database.

Related tutorial recommendations:


What is a database?

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 and managing. Search and copy saved data.

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

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

Characteristics of RDBMS (Relational Database Management System):

  • 1. Data appears in the form of tables

  • 2. Each row has various record names

  • 3. Each column has the data field corresponding to the record name

  • 4.Many Rows and columns form a form

  • 5. Several forms form a database


RDBMS terminology

Before we start learning the MySQL database, let us first understand some terminology 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 data, such as zip code data.

  • Row: A row (= tuple, or record) is a set of related data, such as a user subscription data.

  • Redundancy: Store twice the data, redundancy can make the system faster.

  • Primary Key: The primary key is unique. A data table can only contain one primary key. You can use primary keys to query data.

  • Foreign key: Foreign key is used to associate two tables.

  • Compound key: Composite key (composite key) uses multiple columns as an index key and is generally used for composite indexes.

  • Index: Use indexes to quickly access specific information in a database table. An index is a structure that sorts the values ​​of one or more columns in a database table. Similar to the table of contents of a book.

  • Referential integrity: Referential integrity requires that references to non-existing entities are not allowed in the relationship. Entity integrity is an integrity constraint that the relational model must meet to ensure data consistency.

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 The table is composed of a table as shown in the figure:

未标题-1.jpg

  • ##Header: the name of each column;

  • Column (col): a collection of data with the same data type;

  • Row (row): Each row is used to describe the specific details of a record Information;

  • Value (value): row specific information, each value must be the same as the data type of the column;

  • key( 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 Oracle. MySQL is a relational database management system. A relational database stores data in different tables instead of putting all data in one large warehouse, which increases speed and flexibility.

  • Mysql is open source, so you don’t need to pay extra.

  • Mysql supports large databases. Can handle large databases with tens of millions of records.

  • MySQL uses the standard SQL data language form.

  • Mysql can be used on multiple systems and supports multiple languages. These programming languages ​​include C, C++, Python, Java, Perl, PHP, Eiffel, Ruby and Tcl, etc.

  • Mysql has good support for PHP, which is currently the most popular web development language.

  • MySQL supports large databases and data warehouses with 50 million records. The 32-bit system table file can support a maximum of 4GB, and the 64-bit system supports a maximum table file of 8TB.

  • Mysql can be customized and adopts 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 know the basic knowledge of PHP and HTML and be able to apply them simply.

Many examples in this tutorial are related to PHP language. Our examples basically use PHP language for demonstration.

If you don’t know PHP yet, you can learn the language through the PHP video tutorial on this site.

php.cn