关系型数据库由哪三部分组成_关系数据库| 第1部分

本文介绍了关系型数据库的基本概念,包括其作为电子数据管理系统的地位、使用SQL进行查询和操作、以及关系数据库的数学基础。文章强调了关系数据库的简单性和灵活性,并详细解释了关系、记录和键等基本元素。此外,还讨论了表间关系、链接、外键等概念,并与其他如面向对象数据库、半结构化数据库进行了对比。

关系型数据库由哪三部分组成

使用关系数据库 (Using The Relational Database)

A relational database is used for electronic data management in computer systems and is based on the relational database model. This was proposed in 1970 by Edgar F. Codd first time and is still, despite some criticism, as an established standard for databases.

关系数据库用于计算机系统中的电子数据管理,并且基于关系数据库模型。 这是由Edgar F. Codd于1970年首次提出的,尽管有一些批评,它仍然是数据库的既定标准。

The associated database management system is called a relational database management system, or RDBMS (Relational Database Management System). To query and manipulate the data predominantly the database language SQL (Structured Query Language) is used.

关联的数据库管理系统称为关系数据库管理系统或RDBMS(关系数据库管理系统)。 为了主要查询和操作数据,使用了数据库语言SQL(结构化查询语言)。

Basis of the concept of relational databases is the relation, in a sense of well-defined mathematical concept. It represents a mathematical description of a table, see database relation. Operations on these routes are determined by the relational algebra. The relational algebra is thus the theoretical basis of SQL.

从明确定义的数学概念的意义上来说,关系数据库的概念的基础是关系。 它代表表的数学描述,请参见数据库关系。 这些路线上的运算由关系代数决定。 因此,关系代数是SQL的理论基础。

Despite the math and abstract definition of the database model relational databases to handle relatively simple and flexible. This had great impact on the success of database technology.

尽管对数据库模型进行了数学和抽象定义,但关系数据库仍然可以相对简单灵活地进行处理。 这对数据库技术的成功产生了重大影响。

关系数据库–基本概念 (Relational Database – Basic concepts)

A relational database can be thought of as a collection of tables (the relations), which are stored in records. Each row (tuple) in one table is a record (record). Each tuple is a set of attribute values (attributes = attributes), the columns of the table. The relation schema specifying, in the number and type of attributes for a relation. The picture illustrates the relation R with attributes A1 to An in the columns.

关系数据库可以认为是表(关系)的集合,这些表存储在记录中。 一个表中的每一行(元组)都是一条记录(记录)。 每个元组是一组属性值(属性=属性),即表的列。 关系模式,用于指定关系的属性的数量和类型。 该图在列中说明了具有属性A1到An的关系R。

For example, one book at a library by the record (book-id, author, publisher, publishing year, title, date of recording will be described). A record must be clearly identifiable. This takes about one or more keys (English Key). In this case book contains the key ID. A key must never change. It relates to the record and not on the position in the table.

例如,将按记录记录图书馆的一本书(书号,作者,出版者,出版年份,书名,记录日期)。 记录必须清晰可辨。 这大约需要一个或多个键(英文键)。 在这种情况下,书包含密钥ID。 钥匙永远不能改变。 它与记录有关,而不与表中的位置有关。

表之间的关系 (Relations between tables)

Furthermore, links are used to express the relationships between tables. A library database could therefore be implemented as follows:

此外,链接用于表示表之间的关系。 因此,可以如下实现库数据库:

Table books, which contains one row for each book:

表格书籍,每本书包含一行:

  • Each line consists of the columns of the table (attribute): book ID, author, publisher, publishing year, title, date of recording.

    每行包括表格的列(属性):书籍ID,作者,出版者,出版年份,书名,记录日期。
  • The key is the book ID, because it marks any book unmistakably.

    密钥是书籍ID,因为它可以清楚地标记任何书籍。

The entry (10.3) would be called so that the user has with the ID 10 (“Hans bookworms’) the book with the ID3 (“My life with Asterix”). The same user also has the book “Borrowed Printing Made Easy”, which is evidenced by the table entry (10, 2). The key one here takes the attribute set (user-ID, book ID). At the same time connects the user ID each entry in the table Item out with an entry in the table users, and the book ID Item out of each entry with an entry of the table combines books. Therefore, these attributes mean in this context, foreign key (English foreign key).

条目(10.3)将会被调用,以便用户拥有ID 10(“汉书虫”)和ID3(“ Asterix我的生活”)的书。 同一用户还拥有一本书“轻松进行借阅印刷”,这可以通过表格条目(10,2)证明。 这里的关键是采用属性集(用户ID,书ID)。 同时,将表ID中的每个条目的用户ID与表用户中的一个条目连接在一起,并将表中每个条目的用户ID条目与该表中的条目连接在一起。 因此,这些属性在此上下文中表示外键(英文外键)。

划界 (Demarcation)

In addition to the relational database model, there are several alternative approaches, which allow data to manage in other structures. These concepts often have only a minor importance or not yet enforced. Nevertheless, they provide an easier access for certain applications of the data to be managed.

除了关系数据库模型外,还有几种替代方法,这些方法允许在其他结构中管理数据。 这些概念通常只具有次要的重要性,或者尚未被实施。 但是,它们为要管理的数据的某些应用程序提供了更容易的访问。

较旧的方法 (Older approaches)

In the 60s and 70s for operational data processing hierarchical database systems and network database systems were used. These are the data or table structure defined in the draft stage and may not vary with the query. They come in special cases, also still in use today.

在60年代和70年代,用于操作数据处理的是分层数据库系统和网络数据库系统。 这些是在草稿阶段定义的数据或表结构,可能不会随查询而变化。 它们以特殊情况出现,今天仍在使用。

面向对象的数据库 (Object oriented databases)

With the advent of object-oriented programming languages object databases have been increasingly offered. This allows objects from OO languages like Java are held directly in the database – a mapping of objects to the relational table structure, the object-relational mapping is then no longer necessary. This approach has advantages over the relational design if you want to store complex data objects that can be mapped only heavy on the flat relational table structures.

随着面向对象编程语言的出现,越来越多地提供了对象数据库。 这样就可以将诸如Java之类的OO语言的对象直接保存在数据库中-将对象映射到关系表结构,这样就不再需要对象-关系映射。 如果要存储只能在平面关系表结构上重映射的复杂数据对象,则此方法相对于关系设计具有优势。

Object databases have, however, still disadvantages to relational databases with the processing of large amounts of data. This is caused for example by access paths to objects on multiple levels (example, inheritance and association). This results in write operations to the lock management at an exponential complexity and thus leads to poor performance. The performance issues were addressed in the object-relational databases in which only the constructs of object-oriented databases with lower complexity (eg n * log (n)) were taken.

但是,对象数据库在处理大量数据时仍比关系数据库不利。 例如,这是由对多个级别的对象的访问路径(例如,继承和关联)引起的。 这导致对锁管理的写操作呈指数复杂性,从而导致性能下降。 在对象关系数据库中解决了性能问题,其中仅采用具有较低复杂性(例如n * log(n))的面向对象数据库的结构。

对象关系数据库 (Object-relational databases)

Some providers add their relational databases, object-oriented properties and then call these object-databases. However, these are not provided for the direct imaging of objects in the programming language – they are just using the concept of inheritance to simplify the definition and query of tables with similar field structures and thus their use. The SQL-99 standard was extended to object-language elements.

一些提供程序添加他们的关系数据库,面向对象的属性,然后调用这些对象数据库。 但是,并没有为使用编程语言对对象进行直接成像提供这些功能-它们只是使用继承的概念来简化具有相似字段结构的表的定义和查询,从而简化了它们的使用。 SQL-99标准已扩展到对象语言元素。

半结构化数据库 (Semi-structured databases)

New concepts are the semi-structured databases. They differ from the traditional database model is that they do not have a fixed predetermined scheme. The database is hierarchically structured as a tree, and each database unit (English Entity) of the same type can have different sets of attributes.

新概念是半结构化数据库。 它们与传统数据库模型的不同之处在于它们没有固定的预定方案。 数据库按层次结构构建为树,并且同一类型的每个数据库单元(英语实体)可以具有不同的属性集。

Typical representative of this type are XML databases that manage the data as XML fragments. The XML data is hierarchically organized here and can contain any structure as long as they are well formed according to XML definition. The data can be queried using XQuery or XPath. Manipulation are now used proprietary language extensions. Disadvantage of current XML databases is in comparison to relational systems lower performance.

这种类型的典型代表是将数据作为XML片段管理的XML数据库。 XML数据在这里是按层次结构组织的,并且可以包含任何结构,只要它们根据XML定义格式正确即可。 可以使用XQuery或XPath查询数据。 现在,操纵已使用专有语言扩展。 当前XML数据库的缺点是与关系系统相比性能较低。

Semi-structured database can be implemented via extensions or server programming with relational DB where the relational model is used but no more.

半结构化数据库可以通过关系数据库的扩展或服务器编程来实现,而关系数据库仅使用关系模型。

Continued…

继续…

翻译自: https://www.eukhost.com/blog/webhosting/relational-database-part-1/

关系型数据库由哪三部分组成

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值