Mysql Learning First Contact Mysql_mysql first day

Source: Internet
Author: User
Tags connection pooling data structures

One, what is a database?

A database is a warehouse that organizes, stores, and manages data according to data structures, and each database has one or more different APIs for creating, accessing, managing, searching, and replicating the data that is saved.
We can also store data in a file, but it is relatively slow to read and write data in a file. 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 the relational model, which can be used to deal with the data in the database with the help of mathematical concepts and methods such as set algebra.
The RDBMS is the characteristic of the relational database management system (relational DB Management system):
1 The data appears in tabular form
2 each kind of record name of each behavior
3 The data field corresponding to the record name of each column
4 Many rows and columns form a form
5 A number of forms constitute the database

Second, relational database (RDBMS) terminology

A relational database is explained as follows:
1 relational database can be simply understood as a two-dimensional database, tabular format similar to Excel tables, we usually contact the data, generally are relational database.
2 relational database is not the only advanced database model, nor is it the best one, but the relational database is the most widely used and easy to understand and use database model nowadays.
3 before we start to learn the MySQL database, let's take a look at some of the terms of the RDBMS:
1 Database: A database is a collection of related tables.
2 data table: A table is a matrix of data. A table in a database looks like a simple spreadsheet.
3 Relationship: Can be understood as a two-dimensional table, each relationship has a relationship name, that is, the table name.
4 Relational Pattern: A description of a relationship, usually called a table structure in a database.
5-tuple: Can be understood as a row in a two-dimensional table, which is often called a record in a database. A row (= tuple, or record) is a set of related data, such as a user-subscribed data.
6 attribute: It can be understood as a column in a two-dimensional table and is often used as a field in a database. A column (data element) contains the same data, such as the data for a postal code.
7 field: The value range of a property, which is also the value limit of a column in a database.
8 keywords: A set of properties that uniquely identify tuples. The database is often called a primary key with one or more columns.
9 Redundancy: Store twice times the data, redundancy can make the system faster.
10 PRIMARY key: Primary key is unique. Only one primary key can be included in a datasheet. You can use the primary key to query the data.
11 FOREIGN Key: Foreign key is used to correlate two tables.
12 composite key: Composite key (key combination) to use multiple columns as an index key, commonly used for composite indexes.
13 Index: Use an index 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. A catalog similar to a book.
14 Referential integrity: Referential integrity requires that references to entities that do not exist are not allowed in the relationship. and entity integrity are the integrity constraints that the relational model must meet to ensure the consistency of data.
4) Characteristics of relational database:
1 Easy to understand: Two-dimensional table structure is very close to the logical world of a concept, relative to the network, hierarchy and other models easier to understand.
2 easy to use: SQL language programmers and data administrators can easily manipulate the database at the logical level without having to understand its underlying implementation.
3 Easy to maintain: rich integrity (Entity integrity, referential integrity, user-defined integrity) reduces the probability of data redundancy and data inconsistency.
5) Relationship Operation:
1 data query: Selection, projection, connection, and, intersection, difference, except
2 Data manipulation: Add, delete, modify, inquire
6 SQL (Structured query Language): Structured Query Language, a special purpose programming language, database query and programming language, for storing data and querying, updating, and managing relational databases.

SQL query Language components:
       1DDL ( Data definition Languages statement: An object definition statement that defines a database of different data segments, databases, tables, columns, indexes, and so on. Commonly used keywords mainly include create, drop, alter and so on.
       2DML (data manipulation Language) statement: Manipulation statements, Used to add, delete, update, and query database records, and to check the number of
according to integrity. Commonly used keywords include insert, delete, update, and select.
       3DCL (Data Control Language) statement: Statements that control the permission and access levels of a different data segment to
Define database, table, field, user's access rights, and security levels. The commonly used keywords are grant, revoke and so on.  &NBSP

third, MySQL database
MySQL is a relational database management system, developed by the MySQL AB Company in Sweden and currently belongs to Oracle Company. MySQL's most popular relational database management system, MySQL is one of the best RDBMS (relational database Management system, relational DBMS) application software in Web applications.
MySQL is a relational database management system in which the associated database keeps data in different tables rather than putting all the data in a large warehouse, which increases speed and improves flexibility.
The SQL language used by MySQL is the most common standardized language used to access databases. MySQL software uses a dual licensing policy, it is divided into community and commercial version, because of its small size, speed, the overall cost of ownership, especially the characteristics of open source, the general development of small and medium-sized Web sites have chosen MySQL as a website database. Thanks to the performance of its community edition, the combination of PHP and Apache can make a good development environment.

Four, the characteristics of MySQL
1 MySQL is open source, so you do not have to pay an extra fee.
2 MySQL supports a large database. You can work with large databases that have thousands records on them.
3 MySQL uses the standard SQL data language form.
4 MySQL can be allowed on multiple systems and support multiple languages. These programming languages include C, C + +, Python, Java, Perl, PHP, Eiffel, Ruby, and Tcl.
5 MySQL has a good support for PHP, PHP is currently the most popular web development language.
6 MySQL support large database, support 50 million records of the Data Warehouse, 32-bit system table file can support the largest 4gb,64 bit system support the largest table file is 8TB.
7 MySQL can be customized, using the GPL protocol, you can modify the source code to develop their own MySQL system.

Five, MySQL system characteristics
1 The use of C and C + + writing, and the use of a variety of compilers for testing, to ensure that the source code portability.
2 support AIX, FreeBSD, HP-UX, Linux, Mac OS, Novellnetware, OpenBSD, Os/2 Wrap, Solaris, Windows and many other operating systems.
3 provides APIs for a variety of programming languages. These programming languages include C, C + +, Python, Java, Perl, PHP, Eiffel, Ruby, and so on. NET and Tcl and so on.
4 support multiple threads, make full use of CPU resources.
5 optimize the SQL query algorithm, effectively improve the query speed.
6 can be used as a separate application in the Client server network environment, but also as a library to embed in other software.
7 provide multi-language support, common coding such as Chinese GB 2312, BIG5, Japanese shift_jis can be used as data table name and data column name.
8 provide TCP/IP, ODBC and JDBC and other database connection channels.
9 provides management tools for managing, inspecting, and optimizing database operations.
10 support for large databases. You can work with large databases that have thousands records on them.
11) supports a variety of storage engines.
12 Online ddl/change functionality, data architecture supports dynamic applications and developer flexibility (5.6 new).
13 Copy global transaction identity, support self-healing cluster (5.6 new).
14 replication without crash from the machine, can improve availability (5.6 new).
15 replication multithreading from the machine, can improve performance (5.6 new).

Six, MySQL database implementation model


MySQL's core components (refer to the above figure)
1 connection pooling: used to complete user authentication, thread reuse, concurrent connection limit, memory detection and connection caching.
2) SQL interface: interfaces that use SQL structure query language to manipulate the database (DDL DML, etc.)
3) Parser: Analyzer, which is used for query conversion, access to permissions analysis of the operation.
4) Optimizer: optimizer, generate and select the best access path.
5) Cache & buffers: The I/O performance enhancement tool associated with the storage engine.
6 Storage Engine (tools for truly performing data query operations MyISAM, InnoDB, NDB, Archive, Federated, Memory, Merge, Partner, Community, custom, and so on).

With this article to do the basis, I believe that we are no longer familiar with MySQL, the next small series and everyone in-depth learning MySQL, enjoy the fun of MySQL.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.