MySQL Basics - Introduction to Databases

This article introduces the basics of MySQL, including what is a database, what is a relational database, the difference between a database and an instance, and database classification

Reference documents:

  1. English document
  2. Chinese document
  3. What is a database?
  4. Link
  5. Database classification

foreword

insert image description here

What is a database?

A database is an ordered collection of structured information or data, usually stored electronically on a computer system. Usually controlled by a database management system (DBMS) . In reality, data, DBMS, and associated applications are collectively referred to as a database system, often referred to simply as a database.

In order to improve data processing and query efficiency, today's most common databases usually store data in a series of tables in the form of rows and columns, allowing users to easily access, manage, modify, update, control and organize data. Also, most databases use Structured Query Language (SQL) to write and query data.

What is a Database Management System (DBMS)?

A database usually requires a complete database software program, also known as a database management system (DBMS). A DBMS acts as an interface between a database and its users or programs, allowing users to retrieve, update, and manage the way information is organized and optimized . Additionally, a DBMS helps in the supervision and control of databases, providing various management operations such as performance monitoring, tuning, backup and recovery.

Common database software or DBMSs are MySQL, Microsoft Access, Microsoft SQL Server, FileMaker Pro, Oracle Database, and dBASE.

What is a relational database management system (RDBMS)?

The so-called relational database is a database based on the relational model, and the data in the database is processed by means of mathematical concepts and methods such as set algebra.

RDBMS is the characteristics of relational database management system (Relational Database Management System):

  • The data comes in the form of a table
  • Each line contains various record names
  • Each column is the data field corresponding to the record name
  • Many rows and columns make up a form
  • A number of forms form a database

What is a MySQL database?

MySQL is an open source SQL-based relational database management system .

  • It is specifically designed and optimized for web applications and can run on any platform. The rise of the Internet brought many new and different needs, and MySQL began to become the platform of choice for web developers as well as web-based applications.

  • It can handle millions of queries and thousands of transactions, making it popular with e-commerce businesses that need to transfer large amounts of money. On-demand flexibility is a key feature of MySQL.

  • Developed by the Swedish MySQL AB company, it currently belongs to Oracle Corporation.

  • MySQL is open source and is currently a product of Oracle.

  • 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 supports multiple languages. These programming languages ​​include C, C++, Python, Java, Perl, PHP, Eiffel, Ruby, and Tcl, among others.

  • MySQL has good support for PHP, and PHP is very suitable for web program development.

  • 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, using the GPL agreement, you can modify the source code to develop your own MySQL system.

The difference between database and instance

definition

Database: A collection of physical operating system files or other formal file types.

Example: The MySQL database consists of background threads and a shared memory area.

the difference

A database is a collection of files , a collection of data organized according to a certain data model and stored in secondary storage.

The database instance is a program, which is a layer of data management software between the user and the operating system . Any operation of the user on the database data, including database definition, data query, data maintenance, and database operation control, is carried out under the database instance. , the application can only deal with the database through the database instance.

RDBMS Terminology

  • Database : A database is a collection of associated 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 data of the same type, such as zip 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 : A primary key is unique. A data table can contain only one primary key. You can use the primary key to query data.
  • Foreign Key : A foreign key is used to relate two tables.
  • Composite key : Composite key (composite key) uses multiple columns as an index key, which is generally used for composite indexes.
  • Indexes : Use indexes to quickly access specific information in database tables. An index is a structure that orders the values ​​of one or more columns in a database table. Similar to a catalog of books.
  • Referential Integrity : Referential integrity requires that references to non-existent entities are not allowed in a relationship. Entity integrity is the integrity constraint condition that the relational model must satisfy, the purpose is to ensure the consistency of data.
  • Header (header) : the name of each column;
  • Column (col) : a collection of data with the same data type;
  • Row : Each row is used to describe the specific information of a record;
  • Value (value) : the specific information of the row, 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.
    insert image description here
    insert image description here

Database classification

Database rank:https://db-engines.com/en/ranking
insert image description here

According to the storage medium and database structure, the database can be divided into two types: relational database and non-relational database

  • In general, relational databases store data on disk, while non-relational databases store data in memory;
  • In terms of data access performance, non-relational databases are more efficient;
  • In terms of data security and persistence, relational databases have obvious advantages;
  • Relational database is conducive to the persistent storage and management of data

relational database

MySQL , MariaDB (MySQL alternative),
Percona Server (MySQL alternative), PostgreSQL,
Microsoft Access, Google Fusion Tables, SQLite , DB2, FileMaker, Oracle, SQL Server , INFORMIX, Sybase, dBASE, Clipper, FoxPro, foshub.

non-relational database

Redis、MongoDB、Memcache、HBase、BigTable、Cassandra、CouchDB、Neo4J。

key-value store database

Key-value databases are like hash tables used in traditional languages. The database can be added, queried, or deleted through the key. Because the primary key of the key is used for access, high performance and scalability will be obtained.

Typical products: Memcached, Redis, MemcacheDB

column store database

Column-based storage is relative to the row-based storage of traditional relational databases. Simply put, the difference between the two is the difference in the storage form of the data in the table.

Typical products: HBase, Cassandra, etc.

document-oriented database

  • A document-oriented database stores data in the form of documents.
  • Each document is a self-contained unit of data, a collection of data items.
  • Each data item has a noun and a corresponding value, and the value can be a simple data type, such as a string, a number, and a date, etc.; it can also be a complex type, such as an ordered list and an associated object.
  • The smallest unit of data storage is a document, and the document attributes stored in the same table can be different, and the data can be stored in various forms such as XML, JSON, or JSONB.

Typical products: MongoDB, CouchDB

graph database

As the name implies, a graph database is a database that stores graph relationships. A graph database is a type of NoSQL database that applies graph theory to store relational information between entities.

Typical products: Neo4J, InforGrid

Guess you like

Origin blog.csdn.net/baidu_33256174/article/details/130610756