数据库Question 1概念题合集

         数据库一般考四道题,Q1大概率是考概念需要(也有可能不考概念,同样,概念也有可能不出在Q1出在Q4).

        目前出现的Q1如下,有的题只有答案,有的题只有题干,既有题目又有答案的很少。

        文案使用了图片文字识别,不一定识别准确。蓝色是不知道靠不靠谱的翻译,绿色是补充答案,每题末尾有拓展。

(能统计的样本太少啦!!!)

Question 1

a) List and explain 4 advantages of using a database system for storing information compared with storing information in a number of files on the computer.

b) Explain, and give an example of each of the following terms:

 i) Primary key   ii )Referential integrity   iii) Functional dependency   iv) Transitive dependency

c) What are the different roles in database environment? List and explain three of the roles 

a) 列出并解释使用数据库系统存储信息与将信息存储在计算机上的多个文件中相比的4个优势。

Advantage of DBMSs数据库管理系统的优点
        • Control of data redundancy 数据冗余控制
        • Data consistency数据一致性
        • More information from the same amount of data等量数据更多信息
        • Sharing of data数据共享
        • Improved data integrity数据完整性优化
        • Improved security安全性优化
        • Enforcement of standards执行标准

b)解释并给出以下每个术语的示例:i) 主键 ii) 引用完整性 iii) 功能依赖性 iv) 传递依赖性

        i) 主键  Primary Key : Candidate key selected to identify tuples uniquely within relation.

        ii) 引用完整性 Referential integrity : foreign key matches a candidate key value in its home relation or is null

        iii) 功能依赖性 Functional dependency describes relationship between attributes.Functional dependency is a property of the meaning or semantics of the attributes in a relation

        iv) 传递依赖性Transitive dependency :A, B, and C are attributes of a relation such that ,if A → B and B → C, then C is transitively dependent on A via B (provided that A is not functionally dependent on B or C)

c)数据库环境中的不同角色是什么?列出并解释其中三个角色

        • Data Administrator (DA)数据管理员

        • Database Administrator (DBA)数据库管理员

        • Database Designers (Logical and Physical)数据库设计者(逻辑和物理)

        • Application Developers应用开发者

        • End Users (naive and sophisticated)终端用户(天真且复杂)

Candidate Key
– A set of attributes that uniquely identifies a tuple within a relation. 
– Uniqueness : In each tuple, candidate key uniquely identify that tuple.
– Irreducibility: No proper subset of the candidate key has the uniqueness property.
• Primary Key
– Candidate key selected to identify tuples uniquely within relation.
• Foreign Key
Attribute, or set of attributes, within one relation that matches candidate key of some other (possibly same) relation.

a) Define the following terms in Entity-Relationship model and give an example of each;

1) entity, 2) relationship and 3) primary key.

b) Discuss the relationship between Entity-Relationship model and Relational model.

a) 在实体关系模型中定义以下术语,并给出每个术语的示例;1) 实体、2)关系和3)主键。

1) 实体Entity: a distinct object in the organization that is to be represented in the database.

2)关系Relationship: an association between entities;

3)主键 Primary Key – Candidate key selected to identify tuples uniquely within relation.

b) 讨论实体关系模型和关系模型之间的关系。

        关系模型将信息表示为元组,直接映射到关系模式。该准则源于关系代数。同时,ER图使用实体在系统中为用户及其底层数据之间的关系建模。ER图可以映射到关系模型,最后映射到工作方案。

• Aspects of relational model
– Relation (table), Attribute (column), Tuple (row) 
– Degree (no. Rows), Cardinality (no. columns)
– Domain (set of allowable values for attribute)
• Relational keys
– Candidate, Primary, Foreign
• Integrity
– Entity (primary key not null)
– Referential (foreign key matches a candidate key value in its home relation or is null)
– General (requirements on values)

Logically related data comprises entities, attributes, and relationships of an organization’s information.
• Entity: a distinct object in the organization that is to be represented in the database.
• E.g. person, place, thing, etc
• Attribute: a property that describes some aspect of the object that we wish to record.
• Relationship: an association between entities.

(a) What is the difference between a relation and a view (external schema)?

(b) What is a data model? What is the relational data model?

(c) What is a transaction ? What are the properties ACID of transactions?

(d) What are candidate keys for a relational database schema? What is a foreign key for a relational database schema?

(e) What is the entity integrity and referential integrity in a relational database ?

(a)关系和视图(外部模式)之间的区别是什么?

        视图:可以把它看作虚拟表,但不一定是基于两个表,可以基于一个表,多个表,或者表+其他视图.。

        关系:一般是一个表主键的和另一个表的外键指代同一事物,这个时候需要在两个表建立关系,有一对一和一对多两种.如果是多对多关系,需要在两个表中间夹一个过渡表.建立关系的目的是保持数据完整性。

(b) 什么是数据模型?什么是关系数据模式?

     Data model – A model is a representation of ‘real world’ objects and events, and their associations.

        关系数据模型是定义在E-R模型和关系的数学定义基础上的一种数据模型,它将描述实体和联系的有关属性看成是集合,而将实体和联系认为是建立在这些集合之上的关系。

(c) 什么是事务?事务的属性是什么?

        Transaction: Action, or series of actions, carried out by user or application, which reads or updates contents of database.
        事务:由用户或应用程序执行的操作或一系列操作,用于读取或更新数据库的内容。
 
Four basic (ACID) properties of a transaction are:
        • Atomicity : ‘All or nothing’ property
        • Consistency : Must transform database from one valid state to another.
        • Isolation : Partial effects of incomplete transactions should not be visible to other transactions.
        • Durability : Effects of a committed transaction are permanent and must not be lost because of later failure.
事务的四个基本(ACID)属性是:
        •原子性:“全部或全部”属性
        •一致性:必须将数据库从一个有效状态转换为另一个有效状态。
        •隔离:不完整交易的部分影响对其他交易不可见。
        •持久性:提交的事务的效果是永久的,不能因为以后的失败而丢失。
 

(d) 关系数据库模式的候选键是什么?关系数据库模式的外键是什么?

        Candidate Key:A set of attributes that uniquely identifies a tuple within a relation. 

         Foreign Key:Attribute, or set of attributes, within one relation that matches candidate key of some other (possibly same) relation.

(e) 关系数据库中的实体完整性和引用完整性是什么?

        Entity Integrity : In a base relation, no attribute of a primary key can be null.

        Referential Integrity:If foreign key exists in a relation, either foreign key value must match a candidate key value of some tuple in its home relation or foreign key value must be null.

Transaction: 
• Logical unit of work on the database.
• An application program can be thought as a series of transactions with non database processing in between.
• Transforms database from one consistent state to another,although consistency may be violated during transaction.

Entity Integrity
In a base relation, no attribute of a primary key can be null.
• Referential Integrity
If foreign key exists in a relation, either foreign key value must match a candidate key value of some tuple in its home relation or foreign key value must be null.
• General Constraints: specific constraints on values (e.g. Height (centimetres) must be > 0 and < 250 )

Data model
– A model is a representation of ‘real world’ objects and events, and their associations.
• Schema vs Data
– The description of the database is the database schema. 
– Data is the actual information stored in the database.

(a) What is the difference between a relation and a view (external schema)?

(b) What is the difference between a relation and a relationship in the relational database model?

(c) What does DDL stand for? What does DML stand for?

(d) What is an internal database schema?

(e) What is the data independence in the DBMS?

(a)关系和视图(外部模式)之间的区别是什么?

        视图:可以把它看作虚拟表,但不一定是基于两个表,可以基于一个表,多个表,或者表+其他视图.。

        关系:一般是一个表主键的和另一个表的外键指代同一事物,这个时候需要在两个表建立关系,有一对一和一对多两种.如果是多对多关系,需要在两个表中间夹一个过渡表.建立关系的目的是保持数据完整性。

(b) 关系和关系数据库模型中的关系之间有什么区别?

        Relation is a table with rows and columns in a relational model.

        Relationship: an association between entities.

(c) DDL代表什么?DML代表什么?

        DDL:Data definition language数据定义语言

        DML:Data manipulation language数据操纵语言

(d) 什么是内部数据库架构?

        我真找不到这个名词,要不看看这(点击此处)

(e) DBMS中的数据独立性是什么?

         数据独立性是在不影响要重写的程序和应用程序的情况下修改方案的能力。数据与程序分离,对数据所做的更改不会影响程序的执行和应用。

三层体系结构的主要目的是实现数据独立。数据库随着时间的推移发生变化和扩展,一个级别的更改不应影响数据库其他级别的数据。基于三个抽象级别,有“物理、数据”两个级别的数据独立性。
物理水平的变化包括:使用新的存储设备,如磁带、硬盘等;更改数据库的位置。

数据的逻辑视图是数据的用户视图。它以最终用户可以访问的形式呈现数据。用户应该能够在没有任何物理存储信息的情况下操作数据的逻辑视图。

Logical database design
Maps the conceptual data model on to a logical model (e.g. relational), but independent of a particular DBMS and other physical considerations.
Physical database design
The process of producing a description of the implementation of the database (tailored to specific DBMS); it describes the base relations, file organizations, and indexes design, and any associated integrity constraints and security measures.

a) Explain what is a database and a database management systems (DBMS).

b) In relational model, there are two integrity constraints: entity integrity and referential integrity.Explain both constraints with an example.

c) Describe the ANSI/SPARC three-level architecture for a Database Management System by drawing a diagram, explain the function of each level, and discuss the reasons for the three-level architecture.

 a)解释什么是数据库和数据库管理系统(DBMS)。

       Database: a shared collection of logically related data (and a description of this data)designed to meet the information needs of an organization.

    Database Management Systems (DBMS): a software system that enables users to define, create, maintain, and control access to the database.

b) 在关系模型中,有两个完整性约束:实体完整性和引用完整性。用一个例子解释这两个约束。

        实体完整性:是指保证表中所有的行唯一。实体完整性要求表中的所有行都有一个唯一标识符。这个唯一标识符可能是一列,也可能是几列的组合,称为主键。也就是说,表中的主键在所有行上必须取唯一值。强制实体完整性的方法有:索引、UNIQUE约束、PRIMARY KEY约束或IDENTITY属性。如:student表中sno(学号)的取值必须唯一,它唯一标识了相应记录所代表的学生,学号重复是非法的。学生的姓名不能作为主键,因为完全可能存在两个学生同名同姓的情况。

        参照完整性:是指保证主关键字(被引用表)和外部关键字(引用表)之间的参照关系。它涉及两个或两个以上表数据的一致性维护。外键值将引用表中包含此外键的记录和被引用表中主键与外键相匹配的记录关联起来。在输入、更改或删除记录时,参照完整性保持表之间已定义的关系,确保键值在所有表中一致。这样的一致性要求确保不会引用不存在的值,如果键值更改了,那么在整个数据库中,对该键值的所有引用要进行一致的更改。参照完整性是基于外键与主键之间的关系。例如学生学习课程的课程号必须是有效的课程号,score表(成绩表)的外键cno(课程号)将参考course表(课程表)中主键cno(课程号)以实现数据完整性。

c) 通过绘制图表描述数据库管理系统的ANSI/SPARC三层体系结构,解释每一层的功能,并讨论三层体系结构的原因。

        2)Objective of three level ANSI-SPARC architecture: Separate each user’s view of the database from the way the database is physically represented.

        三级ANSI-SPARC体系结构的目标:将每个用户的数据库视图与数据库的物理表示方式分开。

        3) 外模式;用户模式;子模式

        模式;概念模式;逻辑模式

        内模式;存储模式

​​

 i) Database: a shared collection of logically related data (and a description of this data)designed to meet the information needs of an organization.

For example, we establish a student management database, which stores logically related data including entities -- students, teachers, courses and so on, attributes --student names, teacher names, course name and so on, and the relationship to organizational information.

Database Management Systems (DBMS): a software system that enables users to define, create, maintain, and control access to the database.

For example, the popular database management system products are Oracle, IBM,Microsoft, Sybase, Mysql, and so on.

ii)Data: facts and statistics collected together for reference or analysis

For example, data can be continuous values, such as sounds and images, called analog data. It can also be discrete, such as symbols, text, called digital data. In a student management system, data is the actual information stored in the database.

Schema: The description of the database is the database schema.

For example, these are relational schema in a database:

Branch (branchNo, street, city, postcode)

Staff (staffNo, fName, IName, position, sex, DOB, salary, branchNo)

1)数据库:逻辑相关数据的共享集合(以及该数据的描述),旨在满足组织的信息需求。

例如,我们建立了一个学生管理数据库,该数据库存储逻辑上相关的数据,包括实体(学生、教师、课程等)、属性(学生姓名、教师姓名、课程名称等)以及与组织信息的关系。

数据库管理系统(DBMS):一种软件系统,允许用户定义、创建、维护和控制对数据库的访问。

例如,流行的数据库管理系统产品有Oracle、IBM、Microsoft、Sybase、Mysql等。

ii)数据:为参考或分析而收集的事实和统计数据。例如,数据可以是连续值,如声音和图像,称为模拟数据。它也可以是离散的,如符号、文本,称为数字数据。在学生管理系统中,数据是存储在数据库中的实际信息。

模式:数据库的描述是数据库模式。

例如,这些是数据库中的关系模式:Branch(branchNo、street、city、postcode)Staff(staffNo、fName、IName、position、sex、DOB、salary、branchNo)

  • 3
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值