数据库原理(一) 介绍

Database Systems 数据库系统——基本原理

一、Introduction 介绍

目录

1、Data is ubiquitous 无所不在的数据库

2、Basic Definitions 基本定义

3、Types of Database and Database Applications 典型的数据库及其应用

4、Typical DBMS Functionalities 数据库管理的典型功能

5、Example of a Database(University) 一个数据库例子

6、Main Characteristics of the Database Approach 数据库方法的主要特征

7、Database Users 数据库的使用者

8、Advantage of Using the Database Approach 使用数据库方法的优势


1、Data is ubiquitous 无所不在的数据库

有四种科技的进步改变了我们和数据的关系

  • More storage space 更多的存储空间

  • Faster processor (and memory)speeds 更快速的处理器

  • Better networking 更好的网络工作

  • Different “sensors”有多种不同的处理器

Need Effective Data Management 需要有效的数据管理

  • Effective management can make an organization’s data a valuable asset 有效的管理可以将组织的数据转化为有价值的资产

  • Ineffective policies can make an organization’s data a liability 无效政策会让组织数据成为负债

  • Big data analytics is becoming the gold mine of the 21st century大数据分析成为二十一世纪黄金产业

  • The paradigm has been extended from database systems to data science 从数据库系统到数据科学中扩展为模型

2、Basic Definitions 基本定义

Data

Known facts that can be recorded and have an implicit meaning.可以记录并具有隐含意义的已知事实。

Database

Collection of interrelated data 相关数据的收集

Mini-World / Universe of Discoures(UoD)微型世界

Some part of the real world about which data is stored in a database.数据存储在数据库中的真实世界的一部分

Database Management System(DBMS)

A collection of programs to facilitate the creation and maintenance of a database.为创建和维护数据库和编写的程序集合。

  • DBMS is :

    • A Collection of software programs 软件程序集合

    • General purpose 通用

  • DBMS enables users to 

    • Define DB 定义数据库

    • Construct DB 构建数据库

    • Change(or update)DB 更新

    • Query the data in a DB 查询数据

    • Share DB 共享数据块

  • DBMS maintains the integrity of DB 维护数据库的完整性

Database System=DBMS+Database

A database system contains information about a particular enterprise.数据库系统包含某个特定企业的信息

A database system provides an environment that is both convenient and efficient to use.数据库系统提供了既方便又高效的使用环境。

Main Goals of DB Course DB课程的主要目标

  • To understand how to use a DBMS 了解如何使用DBMS

    How to design and creat DB, data models,SQL,…..如何设计和创建DB,数据模型,SQL

  • To understand how a DBMS works 理解DBMS是如何工作的

    Physical properties of disks and files, software ot manage reading and writing to disk, implementation of algorithms to answer user queries…..磁盘和文件的物理属性,软件管理读写磁盘,实现回答用户查询的算法 

3、Types of Database and Database Applications 典型的数据库及其应用

  • Traditional Applications传统的应用程序:

    Numeric and Textual Databases 数字和文本数据库

  • More Recent Applications:最近的应用程序

    • Multimedia Databases(images, audio, video,…)多媒体数据库(图像,音频,视频)

    • Geographic Information Systems(GIS) 地理信息系统

    • Data Warehouses 数据仓库

    • Real-time and Active Databases 实时和主动数据库

    • Many other applications 许多其他应用程序

  • New Trends:big data analytics, IoT 新趋势:大数据分析、物联网

  • First part:focuses on traditional applications 第一部分:传统应用的重点

  • A number of recent applications are described later in the class and book. 以后的一些应用程序将在课堂和书中描述

4、Typical DBMS Functionalities 数据库管理的典型功能

  • Define a particular database in terms of its data types, structures, and constraints.根据数据类型、结构和约束定义一个特定的数据库。

Construct or Load the initial database contents on a secondary storage medium 在第二存储介质上构建或加载初始数据库内容

  • Mainpulating the database: 控制数据库

    • Retrieval检索: Querying, generating reports 查询、生成报告

    • Modification修改: Insertions, deletions and updates to its content.内容的插入、删除和更新

  • Processing and Sharing by a set of concurrent users and application programs-yet, keeping all data valid and consistent.通过一组并发用户和应用程序进行处理和共享,保持所有数据的有效性和一致性。

  • Other features 其他特点

    • Protection or Security measures to prevent unauthorized access 保护或安全措施,以防止未经授权的访问

    • “Actively” take internal actions on data 积极地对数据采取内部行动

    • Presentation and Visualization of data 数据的表示和可视化

    • Maintaining the database and associated programs over the lifetime of the database application在数据库应用程序的生命周期中维护数据和相关程序

      • Called database, software, and system maintenance. 称为数据库,软件和系统维护

Application Activities Against a DB 针对DB的应用程序活动

  • Applications interact with a database by generating应用程序通过生成与数据库交互

    • Queries查询: that access different parts of data and formulate the result of request 访问数据的不同部分并生成请求结果

    • Transactions交易: that may read some data and “updata” certair values of generate new data and store that in the database.可以读取一些数据和“升级”到一定值,生成新的数据和存储在数据库中

  • Applications must not allow unauthorized users to access data应用程序不能允许未经授权的用户访问数据

  • Applications must keep up with changing user requirements against the database.应用程序必须跟上用户需求对数据库的变化

Database Applications数据库应用

  • Banking银行业务: all transactions所有交易

  • Airlines航空公司: reservations, schedules预定、时间表

  • Universities大学: registration, grades注册、成绩

  • Sales销售: customers, products, purchases客户,产品,采购

  • Online retailers在线零售商: order tracking, customized recommendations订单跟踪,定制建议

  • Manufacturing制造业: production, inventory, orders, supply chain生产、库存、订单、供应链

  • Human resources人力资源: employee records, salaries, tax deductions 员工档案、工资、减税

  • Databases touch all aspects of our lives数据库触及我们生活的方方面面

Purpose of Database Systems数据库系统的目的——解决文件系统带来的问题

  • In the early days, database applications were built directly on top of file systems在早期,数据库应用程序直接建立在文件系统之上

  • Drawbacks of using file systems:使用文件系统的缺点

    • Data redundancy and inconsistency 数据冗余,不一致

      Multiple file formats, duplication in different files

      多种文件格式,不同文件的重复

    • Difficulty in accessing data 数据访问困难

      Need to write a new program for each new task

      需要为每个新任务编写一个新程序

    • Data isolation—— multiple files and formats

      数据隔离——多个文件和格式

    • Integrity problems 诚信问题

      • Integrity constraints(e.g. account balance > o)become “buried” in program code rather than being stated explicitly

        完整性约束,例如,账户余额>0, 在程序代码中被“埋没”,而不是显示地声明

      • Hard to add new constraints or change existing ones

        难以添加新的约束或更改现有的约束

    • Atomicity of updates

      更新的微型性

      • Failures may leave database in an inconsistent state

        失败可能使数据库处于不一致状态

      Example:Transfer of funds from one account to another

      例子: 把资金从一个账户转到另一个账户

    • Concurrent access by multiple users

      多用户并发访问

      • Concurrent accessed needed for performance

        并发访问所需要的性能

      • Uncontrolled concurrent accesses can lead to inconsistencies

        不受控制的并发访问可能导致不一致

      Example: Two people reading and updating at the same time

      两个人同时阅读和更新

    • Security problems 安全问题

      • Hard to provide user access to some, but not all, data

      很难提供用户访问某些数据,但不是全部

  • Database systems offer solutions to ALL the above problems 数据库系统提供了上述所有问题的解决方案

5、Example of a Database(University) 一个数据库例子

  • Mini-world for the example:以微型世界为例

    • Part of a University environment.大学环境的一部分
  • Some mini-world entities微型世界的实体:

    • Students 学生

    • Courses 课程

    • Sections(of Courses) (课程)章节

    • Departments 院系

    • Instructors 指导员

  • Some mini-world relationships微型世界的关系:

    • Sections are of specific courses 章节是特定的课程

    • Students take sections 学生上课

    • Courses have prerequisite courses 课程有必修课

    • Instructors teach sections 指导员教课

    • Courses are offered by departments 课程由每个院提供

    • Students major in Departments 学生主修某个院系

6、Main Characteristics of the Database Approach 数据库方法的主要特征

  • Self-describing: A DBMS catalog(meta-data) stores the description of the database.

    **自描述:**DBMS目录存储数据库的描述

  • Program-data Independence: Allows changing storage structures w/o changing DBMS access programs.

    程序数据的独立性: 允许改变存储结构 w/o改变DBMS访问程序。

  • Data abstraction: Data models hide storage details and present the users with a conceptual view of the DB.

    数据抽象: 数据模型隐藏存储细节,并向用户呈现DB的概念视图

  • Multiple views: Each user may see a different view of database.

    多视图 每个用户可以看到数据库的不同视图

  • Data sharing: among multiple users

    数据共享: 在多个用户之间

  • Transactions, concurrent access, recovery, OLTP

    交易,事物并发访问,回首

7、Database Users 数据库的使用者

  • Users may be divided into用户可分为:

    • Those who actually use and control the database content, and those who design, develop and maintain database applications(called “Actors on the Scene“)

    那些实际使用和控制数据库内容的人,以及那些设计、开发和维护数据应用程序的人

    Database administrators数据库管理员:

    - Responsible for authorizing access to the database, for coordinating and monitoring its use, acquiring software and hardware resources, controlling its use and monitoring efficiency of operations.负责授权访问数据库,协调和监控数据库的使用,获取软件和硬件资源,控制其使用和监控操作效率。
    
    1/ Coordinates all the activities of the database system; must have a good understanding of the enterprise's information resources and needs.
    
    协调数据库系统的所有活动,必修对企业信息资源和需求有很好的了解
    
    2/ Database administrator's dutie 数据管理员的职责s:
    
        - Schema definition 架构定义
    
        - Storage structure and access method definition 存储机构和访问方法定义
    
        - Schema and physical organization modification 模式和物理组织修改
    
        - Granting user authority to access the database.授予用户权限访问数据库 
    
        - Specifying integrity constraints 指定完整性约束
    
        - Acting as liaison with users 与用户联络
    
        - Monitoring performance and responding to changes in requirements 监控性能并响应需求的变化
    

    Database Designers数据库设计人员:

    - Responsible to define the content, the structure, the constraints, and functions or transactions against the database. They must communicate with the end-users and understand their needs.
    
      负责定义数据库的内容、结构、约束、函数和事物。他们必须与最终用户沟通并了解他们的需求
    
    • Those who design and develop the DBMS software and related tools, and the computer systems operators (called “Workers Behind the Scene“)

    那些设计和开发DBMS软件和相关工具,以及计算机系统操作员

    - DB Designers 数据库设计者——design the database systems for end users 为最终使用者设计数据库系统
    
    - DBMS designers 数据库管理系统设计者 —— design database management systems and tools for building database. 设计数据库管理系统和建立数据库的工具
    
    - Tool designers 工具设计者—— Design and implement tools that facilitate building of applications and allow using database effectively(eg. modeling and designing database, performance monitoring, prototyping, test data generation, user interface creation, simulation etc.)设计与实现工具,建立应用程序和允许有效地使用数据库(如建模、数据库设计、性能监测、原型、测试数据生成,用户界面生成、仿真等)
    
    • Operators and maintenance personnel.操作人员和维修人员
  • End-users 最终用户

    • Casual: access DB occasionally when needed 在需要时偶尔访问DB

    • Naive or Parametric: they make up a large section of the end-user population 他们构成了最终用户的一大部分

      • They use previously well-defined functions in the form of “canned transactions” against the database. 他们使用以前定义号的函数,以“canned transcation”的形式对付数据库

      • Examples are bank-tellers or reservation clerks who do this activity for an entire shift of operations. 例如,银行出纳员或预定员,他们为整个业务转移做这项活动。

    • Sophisticated复杂的:

      • Business analysts, scientists, engineers, others thoroughly familiar with the system capabilities.业务分析师,科学家,工程师和其他完全熟悉系统功能的人员。

      • Many use tools in the form of software packages that work closely with the stored database. 许多人使用软件包的形式,与存储的数据库密切合作

    • Stand-alone:

      • Mostly maintain personal database using ready-to-use packaged appliactions. 主要是保持个人数据库,使用现成的包装应用

        ex:1. a tax program user that creates its own internal database.创建内部数据库的税务程序用户

        1. a user that maintains an address book.维护地址簿的用户
  • System Analysts and Application Programmers系统分析和应用程序员

    • System analysts系统分析: Analyze problem, determine the requirements of the users, develop specifications. 分析问题,决定使用者需求,开发规格

    • Application programmers应用程序员: Design and implement specification, testing, debugging, maintaining softwares. Also known as software deveopers of software engineers. 设计和实现规范,测试,调试,维护软件。也被称为软件工程师,或是软件开发者。

    • Business analysts业务分析: There is an increasing need for people who can analyze vast amounts of business data and real-time data(Big Data)for better decision making, planning, advertising, marketing etc.有人可以分析大量

8、Advantage of Using the Database Approach 使用数据库方法的优势

  • Controlling redundancy in data storage and in development and maintenance efforts.控制数据存储中的冗余和开发维护工作。

    • Sharing of data among multiple users.在多个用户之间共享数据
  • Restricting unauthorized access to data.限制对数据的未授权访问

  • Providing persistent storage for program objects 为程序对象提供持久存储

    • In object-oriented DBMS 面向对象的数据库管理系统
  • Providing storage structures(e.g. indexes)efficient data access.提供存储结构高校的数据访问

  • Providing optimization of queries for efficient processing.为优化处理提供查询优化

  • Providing backup and recovery services.提供备份和恢复服务

  • Providing multiple interfaces to different classes of users.为不同的用户类提供多个接口

  • Representing complex relationships among data.表示数据之间的复杂关系

  • Enforcing integrity constraints on the database.对数据库执行完整性约束

  • Drawing inferences and actions from the stored data using deductive and active rules.使用演绎和主动规则从存储的数据中提取推断和动作

Additional Implications其他的影响

  • Potential for enforcing standards执行标准的潜力:

    • This is very crucial for the success of database applications in large organizations.Standards refer to data item names, display formats, screens, report structures, meta-data(description of data), Web page layouts, etc.对于这种大型组织中数据库应用的成功是至关重要的。标准是指数据项名称、显示格式、屏幕、报表结构、元数据(描述数据)等等

    • Reduced application development time减少应用程序的开发时间:

      • Incremental time to add each new application is reduced

        增加每个新应用程序的增量时间减少

  • Flexibility to change data structures灵活的改变数据结构:

    • Database structure may evolve as new requirements are defined. 数据库结构可能随着新需求的定义而发展
  • Availability of current information现有信息的可用性:

    • Extremely important for on-line transaction systems such as airline, hotel, car reservations.非常重要的在线交易系统,如航空公司、酒店、汽车预定。
  • Economies of scale规模经济:

    • Wasteful overlap of resources and personnel can be avoided by consolidating data and applications across departments.通过整合各部门的数据和应用程序,可以避免资源和人员的浪费重叠。

猜你喜欢

转载自blog.csdn.net/baidu_34418619/article/details/78511755