In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The use of database can store data efficiently and clearly, so that people can manage data more quickly and conveniently. The database has the following characteristics:
1. A large amount of data and information can be stored structurally, which is convenient for users to retrieve and access effectively.
2. It can effectively maintain the consistency and integrity of data information and reduce data redundancy.
3. It can meet the requirements of application sharing and security.
The basic concepts of a database:
1. Data: symbols that describe things are recorded into data (Data), including numbers, text, graphics, images, sound, archival records, and so on. Data is stored in a uniform format in the form of "records".
2. Database and database tables: tables are used to store specific data, and a database is a collection of tables. It is a collection of mutual data stored in a certain organizational way. For example, a table in a relational database consists of records, records consist of fields, and fields consist of characters or numbers. It can be shared by all kinds of users with minimum redundancy and high data independence. It is a collection of related data under unified management.
Database management system (Database Management System,DBMS) is a system software that realizes the effective organization, management and access of database resources. With the support of the operating system, it supports the operation of the database by the user. DBMS mainly includes:
1. Database establishment and maintenance function
2. Data definition function
3. Data operation function
4. the operation and management function of the database.
5. Communication function
Database system (Database System DBS) is a man-machine system, which is generally composed of hardware, operating system, database, DBMS, application software and database users (including database administrators). Users can operate the database through DBMS or through applications.
An application is an ordered collection of commands written to solve a specific management or data processing task using DBMS. If the application program is relatively perfect, can provide a friendly man-machine interface, and compiled into executable file distribution, so that ordinary users do not need to have computer professional knowledge, in a relatively short time to learn to use, then it is called database application software.
The database administrator (Database Administrator DBA) is responsible for the update and backup of the database and the maintenance and user management of the database system to ensure the normal operation of the database system. DBA is generally held by people with high professional level and senior qualifications.
History of database development
According to the development of the data model, it can be divided into three stages: the first generation of mesh and hierarchical database system, the second generation of relational database system, and the third generation of database system characterized by object-oriented model.
In the 1960s, the database system of hierarchical model and mesh model was represented by the hierarchical model database management system-IMS (Imformation Management System, Information Management system) developed by IBM in 1969 and the mesh model proposed by the Database Task Force (DBTG) of the American data system language Association (CODASYL) in the 1970s.
In the early 1970s, the second generation database-relational database began to appear. Gradually become the dominant database, become the mainstream of the industry. Relational data system uses structured query language (Structured Query Language,SQL) as data definition language (DataDefinition Language,DDL) and data manipulation language (Data Manipulation Language,DML). It has become the standard language of relational database since it was born.
Since the 1980s, a variety of new database systems have emerged to adapt to different fields, such as engineering database, multimedia database, graphic database, intelligent database, distributed database and object-oriented database.
Classical data model
Data is the abstraction of "quantity" in the real world, while data model (Data Model) is the abstraction of data features. In the database system, the data model is its core and foundation. The data model is represented by the structure of the data, the operations and constraints defined on it. It describes the static characteristics, dynamic characteristics and constraints of the system at the conceptual level, and provides an abstract framework for the information representation and operation of the database system.
In the process of the development of DBMS, there are three classical data models: mesh model, hierarchical model and relational model.
The content of the data model includes three aspects: data structure, data operation and data constraint.
Reticular model
Data records are organized into graphs, and "data structure diagrams" are used for abstract analysis and representation. The mesh model is suitable for expressing complex data relations, and can also reduce data redundancy to a minimum. Its data structure model can directly reflect the relationship between data in reality.
Data operation
The data operation of the mesh model is a navigational operation based on the relational chain. The mesh model is based on the graph,
Data constraint
The data constraints of the mesh model are scattered and isolated, either scattered in each node, or centralized into a relational chain, which can easily lead to inconsistency or reduce efficiency. Usually, the mesh model does not specifically implement data constraints, but by the application itself to achieve data constraints.
Hierarchical model
In the hierarchical model, data records are organized in the form of trees, using "tree structure diagrams".
Data operation
The data operation on the hierarchical model inevitably has the characteristics of the mesh model-navigation. This structure helps to improve the query efficiency of data, but there are still requirements that must be navigated in data access. Therefore, the database of hierarchical model is still complex in data operation.
Data constraint
The data constraint of the hierarchical model is similar to the mesh model, because of the simplification of the structure, the many-to-many and many-to-one relationship in the mesh model is removed, and the data constraint of the hierarchical model can be properly implemented by the system, or it depends on the application itself.
The implementation technology of the hierarchical model is superior to the relational model and simpler than the mesh model, so it always takes the lead. It is represented by IBM's IMS system. The system was once one of the earliest and most widely used databases, and it was one of the largest databases in history. Because its developers were the first to deal with concurrency, recovery, integrity and efficient query, some of the technologies and ideas were naturally applied to DB2, which is the root of the enduring prosperity of DB2.
Relation model
Data structure. The relational model is based on the theory of relational algebra. The data structure can be directly represented by the simple and understandable two-dimensional data table and the "entity-relation" diagram, which contains three elements: entities (data objects), relations and attributes.
Entity: also known as an instance, corresponding to an "event" or "thing" that can be distinguished from other objects in the real world.
Entity set: a collection of entities that have the same type and share the same properties.
Attribute: a property that an entity has. An entity can have multiple attributes.
Connection: the correspondence between sets of entities becomes a relationship, also known as a relationship.
Data manipulation. For the users of the database, the relational model operates using the database manipulation language (DML) abstracted from the relational algebra. Structured query language (SQL) is one of the most important. Its characteristic is that it directly faces the results, simplifies the operation steps, and makes the design of the database application very easy to understand.
For the physical structure of the database, the relational database system has the advantages of simple data structure, strong function, high data independence and solid theoretical foundation. The strict relational database takes the two-dimensional database table as the basic data structure, and uses simple or complex index technology to realize the query algorithm, which is relatively simple to implement, and it is convenient for the pre-compilation technology to directly transform the SQL language into an effective data retrieval algorithm.
Data constraints. The data constraints of relational models can be directed against entities, attributes of entities, relationships, and can be fully implemented when defining entities, entity attributes, and relationships. The data definition language (DDL) used by the relational model and the relational model theoretically require the core implementation of the relational database, so that the data constraint can be easily implemented, but its efficiency is not high.
Generally speaking, the relational model has a more solid and complete theoretical foundation than the mesh model and the hierarchical model. Compared with the hierarchical model and the mesh model, the relational model is closer to the user, while the mesh model and hierarchical model are more closely integrated with the underlying implementation. This feature also makes it easier for relational models to become the choice of commercial databases.
Introduction to today's mainstream databases
SQL Server is a database product of Microsoft. In the design, Microsoft SQL Server makes a lot of use of the underlying structure of the Microsoft Windows operating system, directly facing Microsoft Windows, especially the users of Windows series server operating system.
Oracle was founded in 1977 and was officially released by Oracle 12C in June 2013, enabling enterprises to quickly achieve a private cloud. Oracle database has become one of the most widely used database systems in the world. Oracle has been in a leading position in the database field, not only the core of the database is excellent, but also its related supporting products are quite perfect and comprehensive. Oracle can adapt to more than 70 kinds of control systems.
DB2, in 1970, Degacot of IBM Company put forward the concept of relational model. He is called the "father of relational databases". DB2 supports a variety of operating system platforms from PC to UNIX, from small and medium-sized to mainframes, and from IBM to non-IBM (HP and Sun UNIX systems, etc.). The best running environment for DB2 server is OS/400, IBM's own operating system platform.
DB2 database core, also known as DB2 general-purpose server, can run on a variety of operating systems. It has been adjusted and optimized according to the corresponding platform environment in order to achieve better performance.
MySQL is also a relational database management system, which has been acquired by Oracle. MySQL runs on top of the Linux operating system, with Apache and Nginx as Web servers, MySQL as the background database, and PHP/Perl/Python as the script interpreter. All four apps are free or open source. The industry is known as the "LAMP" combination.
The basic concept of Relational Database
Relational database system is a database system based on relational model. It is the instantiation of the application of relational model to the field of database. Its basic concept comes from the relational model.
The storage structure used in relational database is multiple two-dimensional tables, and the data description that reflects things and their relations is reflected in the form of flat tables.
A relational database consists of associations between data tables, where:
A data table is usually a two-dimensional table composed of rows and columns, each of which describes the objects and their properties of a particular aspect or part of the database.
A row in a data table is often called a record or tuple, which represents one of many objects with the same properties.
Columns in a data table are often called fields or properties, which represent common properties stored in the corresponding database.
Primary key and foreign key
Each row of records in the data table must be unique, and identical records are not allowed. The uniqueness of records (entities) can be guaranteed by defining primary keys (primary keys, Primary Key).
Key, or keyword, is a very important element in the relational model.
The primary key uniquely identifies the row data in the table, with a primary key value corresponding to a row of data. The primary key consists of one or more fields whose values are unique and do not allow null values (NULL). A table can have only one primary key.
If a property set uniquely represents a row of a table without more than one attribute, the property set is called a candidate key. There can be multiple candidate keys in a table, but only one candidate key can be selected as the primary key of the table, and the other candidate keys are called alternate keys.
Foreign key
A relational database usually contains multiple tables, which can be associated with foreign keys (ForeignKey).
A foreign key is one or more columns used to establish and strengthen a link between two table data. You can create a link between two tables by adding one or more columns of primary key values in a table to another table. This column is called the foreign key of the second table.
The "master table" and "slave table" always appear in pairs and are related to each other by "foreign keys".
Data integrity rules
Data and update operations in relational databases must follow four complete rules:
1. Entity integrity rules
Entity integrity rules require that tuples in a relationship cannot have null values on the attributes of the primary key. If a null value occurs, the primary key value does not uniquely identify the tuple.
2. Domain integrity rules
Domain integrity, also known as column integrity, specifies whether a dataset is valid for a column or determines whether null values are allowed.
3. Referential integrity rules
If two tables are related to each other, the referential integrity rule requires that references to tuples that do not exist are not allowed.
4. User-defined integrity rules
User-defined complete rules are constraints for a specific data, which are determined by the application environment. It reflects the semantic requirements that the data involved in a specific application must meet. The system provides a mechanism for defining and verifying such integrity so that it can be handled in a unified system approach and is no longer undertaken by the application.
Entity integrity rules and domain integrity rules are implemented in the core layer of the database system by relational database standards.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.