数据库基本概念(名词解释)中英版
说明:这个文档是老王准备数据库考试的基本概念部分(虽然只有10分吧哈哈哈)时整理的,没有好好排版就发出来啦,捡有用的看吧,嘻嘻~
Metadata:
元数据,和数据独立,描述数据的属性,不包含样本数据,也是数据库的一部分。
Database(DB)
A database is an organized collection of data, generally stored and accessed electronically from a computer system. Where databases are more complex they are often developed using formal design and modeling techniques.
Database-management system(DBMS)
The database management system (DBMS) is the software that interacts with end users, applications, and the database itself to capture and analyze the data.
由数据库和一组用来访问数据的程序组成,是位于用户和操作系统之间的一层数据管理软件,提供一种方便高效存取数据库信息的途径
RDBMS(关系型数据库管理系统)Oracle,Mysql,Microsoft(MS SQL Server),IBM(DB2),SAP(Sybase),PostgreSQL
Database System(DBS)
数据库系统指计算机系统中引入数据库后的系统构成,包含DB和DBMS
Major Disadvantages of File System
Database Schema(数据库模式) 也称database intension
The database schema of a database system is its structure described in a formal language supported by the database management system (DBMS). the logical design of the database
Designed in the design process, not often changed
Database Instance(数据库实例)也称 database extension/ database state
which is a snapshot of the data in the database at a given instant in time.
Often changed,(CRUD)
Relation Schema(关系模式)
In general, a relation schema consists of a list of attributes and their corresponding domains
通常,关系模式由属性列表及其相应的域组成。
Relation Instance (关系实例)
We use the term relation instance to refer to a specific instance of a relation, i.e.,containing a specific set of rows
我们使用“关系实例”一词来指关系的特定实例,即包含一组特定的行。
DBMS architectures
ACID
原子性——通常,数据库上的几个操作构成一个单一的逻辑工作单元。(事务)
事务的四个属性(ACID of A Transaction):
(此部分参考:https://blog.csdn.net/p312011150/article/details/71439499)
事务的原子性(Atomicity),就是事务涉及的两者要么不发生,要么同时发生。
事务包含的所有操作要么全部成功,要么全部失败回滚,因此事务的操作如果成功就必须要完全应用到数据库,如果操作失败则不能对数据库有任何影响。
事务的一致性(consistency),就是事务执行时,数据库涉及的总量保持不变,如存取款,必须保证取出的和存着的加一起总和不变一致性是指事务必须使数据库从一个一致性状态变换到另一个一致性状态,也就是说一个事务执行之前和执行之后都必须处于一致性状态。。
事务的持久性(durability)是指一个事务一旦被提交了,那么对数据库中的数据的改变就是永久性的,即便是在数据库系统遇到故障的情况下也不会丢失提交事务的操作。
事务的隔离性(Isolation)是当多个用户并发访问数据库时,比如操作同一张表时,数据库为每一个用户开启的事务,不能被其他事务的操作所干扰,多个并发事务之间要相互隔离。即要达到这么一种效果:对于任意两个并发的事务T1和T2,在事务T1看来,T2要么在T1开始之前就已经结束,要么在T1结束之后才开始,这样每个事务都感觉不到有其他事务在并发地执行。
The isolation property of a transaction ensures that the concurrent execution of transactions results in a system state that is equivalent to a state that could have been obtained had these transactions executed one at a time in some order. Ensuring the isolation property is the responsibility of a component of the database system called the concurrency-control system事务的隔离属性确保事务的并发执行产生一个系统状态,该状态相当于如果这些事务按某种顺序一次执行一个事务,则可能获得的状态。确保隔离属性是称为并发控制系统的数据库系统组件的责任
Data abstraction(Three-Layer Architecture)
(1)Physical level(Physical schema) internal schema 内模式
描述物理存储结构,使用physical data model,描述存取路径
(2)Logical level(Logical schema) conceptual schema概念模式,用E R model 描述,OO model 进行设计
(3)View level(External schema) 外模式,描述特定用户感兴趣的一部分数据库,隐藏其他部分,通常用ER model实现
Mapping:映射
有些DBMS允许在概念层和外层使用不同的数据模型(UDB)
In fact,Data only restore in physical level.
两级映射:
1.conceptual to Internal
Allow diffrences of enity name, attribute name, attribute order,data type between two levels exist.
2.external to conceptual
Main purpose of three-schema architecture is ensuring the data independence.The reversions of lower level won’t affect which in higher.
Physical data independence
Logical data independence
谁独立谁变化,上一层不变化。
Database languages:
(1)Procedural languages
(2)Declarative languages
SQL:
(1)Data-definition language(DDL)
数据库定义语言:
其实就是我们在创建表的时候用到的一些sql,比如说:CREATE、ALTER、DROP等。DDL主要是用在定义或改变表的结构,数据类型,表之间的链接和约束等初始化工作上
(2)Data-manipulation language(DML)数据操纵语言:
就是我们最经常用到的 SELECT、UPDATE、INSERT、DELETE。 主要用来对数据库的数据进行一些操作。
(3)Query language(Select)
Types of Database System Users
Functions of Database Administrators(DBA)
DBA模式定义的功能。DBA通过在DDL中执行一组数据定义语句来创建原始的数据库模式。存储结构和访问方法定义。
模式和物理组织修改。DBA对模式和物理组织进行更改,以反映组织不断变化的需求,或更改物理组织以提高性能。
授予数据访问授权。通过授予不同类型的授权,数据库管理员可以调整不同用户可以访问的数据库部分。授权信息保存在一个特殊的系统结构中,每当有人试图访问系统中的数据时,数据库系统都会参考该结构。
日常维护。定期将数据库备份到磁带或远程服务器上,以防止在发生洪水等灾难时丢失数据。确保正常操作有足够的可用磁盘空间,并根据需要升级磁盘空间。监视数据库上运行的作业,并确保某些用户提交的非常昂贵的任务不会降低性能。
Database Data dictionary
DDL获取一些指令(语句)作为输入,并生成一些输出,DDL的输出放在数据字典中,该字典包含元数据,即有关数据的数据。
数据字典被认为是一种特殊类型的表,只能由数据库系统本身(而不是普通用户)访问和更新。数据库系统在读取或修改实际数据之前查阅数据字典。