logicalDatabaseDesign

合集下载

数据库术语表

数据库术语表

Database术语表Access method :访问方法Alias:别名Alternate keys:备用键,ER/关系模型Anomalies:异常Application design:应用程序设计Application server:应用服务器Attribute:属性,关系模型Attribute:属性,ER模型Attribute inheritance:属性继承Base table:基本表Binary relationship:二元关系Bottom-up approach:自底向上方法Business rules:业务规则Candidate key:候选键,ER/关系模型Cardinality:基数Centralized approach:集中化方法,用于数据库设计Chasm trap:深坑陷阱Client:客户端Clustering field:群集字段Clustering index:群集索引Column:列,参见属性(attribute)Complex relationship:复杂关系Composite attribute:复合属性Composite key:复合键Concurrency control:并发控制Constraint:约束Data conversion and loading:数据转换和加载Data dictionary:数据字典Data independence:数据独立性Data model:数据模型Data redundancy:数据冗余Data security:数据安全Database:数据库Database design:数据库设计Database integrity:数据库完整性Database Management System:数据管理系统Database planning:数据库规划Database server数据库服务器DBMS engine:DBMS引擎DBMS selection:DBMS选择Degree of a relationship:关系的度Denormalization:反规范化Derived attribute:派生属性Design methodology:设计方法学Disjoint constraint:无连接约束Domain:域Entity:实体Entity integrity:实体完整性Entity occurrence:实体出现Entity-Relationship model:实体-关系模型Fact-finding:事实发现Fan trap:扇形陷阱Field:字段File:文件File-based system:基于文件的系统File organization:文件组织First Normal Form:1NF,第一范式Foreign key:外键4GL,Fourth-Generation Language:第四代语言Full functional dependency:完全函数依赖Functional dependency:函数依赖Generalization:泛化Generalization hierarchy:泛化层次结构Global data model:全局数据模型Implementation:实现Index:索引Information system:信息系统Inheritance:继承Integrity constraints:完整性约束IS-A hierarchy:层次结构local logical data model:局部逻辑数据模型Logical database design:逻辑数据库设计Meta-data:元数据Mission objective:使命目标Mission statement:使命语句Multiplicity:多样性Multi-valued attribute:多值属性Nonkey attribute/column:非键属性/列Normal forms:范式Normalization:规范化Null:空值Operational maintenance:操作维护Participation constraint:参与约束,EER模型Participation constraint:参与约束,ER模型Physical database design:物理数据库设计Primary index:主索引Primary key:主键,ER模型Primary key:主键,关系模型Privileges:权限Prototyping:原型Query-by-Example: QBE,一种用于关系型DBMS的非过程化的数据库语言RDBMS:关系型DBMSRecord:记录Recovery control:恢复控制recursive relationship:递归关系Redundant data:冗余数据Referential integrity:参照完整性Relation:关系Relational model:关系模型Relational database关系数据库Relation:关系Relationship occurrence:关系出现Requirements collection and analysis:需求收集与分析Row:行,同元组(topple)Second normal form:2NF,第二范式Secondary index:二级索引Security:安全Server:服务器Simple-valued attribute:单值属性Specialization:特化Specialization hierarchy:同类层次结构SQL Structured Query Language:结构化查询语言Strong entity:强实体Subclass:子类Superclass:超类Superkey:超键,ER模型Superkey:超键,关系模型system catalog:系统目录System definition:系统定义System security:系统安全Table:表Ternary relationship:三元关系Testing:测试Third normal form:3NF,第三范式3GL,Third-Generation Language:第三代语言,一种过程化语言,如COBOL,C,C++ Three-tier client-server architecture:三层客户端-服务器体系结构Top-down approach:自顶向下方法Transaction:事务Transaction Processing Monitor,TPM:事务处理监视器Transitive dependency:传递依赖Tuple:元组Tow-tier client-server architecture:两层客户端-服务器体系结构Type hierarchy:类型层次结构UML Unified Modeling Language:统一建模语言Update anomalies:更新异常User view:用户视图view:视图View integration approach:视图统合方法Weak entity:弱实体。

数据库设计分为几个阶段,各阶段的任务是什么?

数据库设计分为几个阶段,各阶段的任务是什么?

数据库设计分为⼏个阶段,各阶段的任务是什么?
按照规范的设计⽅法,⼀个完整的⼀般分为需求分析、概念结构设计、逻辑结构设计、数据库物理设计、数据库的实施、数据库运⾏与维护六个阶段:
各阶段的任务如下:
1、需求分析:分析⽤户的需求,包括数据、功能和性能需求;
2、概念结构设计:主要采⽤E-R模型进⾏设计,包括画E-R图;
3、逻辑结构设计:通过将E-R图转换成表,实现从E-R模型到关系模型的转换;
4、数据库物理设计:主要是为所设计的数据库选择合适的和存取路径;
5、数据库的实施:包括编程、测试和试运⾏;
6、数据库运⾏与维护:系统的运⾏与数据库的⽇常维护。

拓展资料:
(Database Design)是指对于⼀个给定的应⽤环境,构造最优的数据库模式,建⽴数据库及其应⽤系统,使之能够有效地存储数据,满⾜各种⽤户的应⽤需求(信息要求和处理要求)。

在数据库领域内,常常把使⽤数据库的各类系统统称为数据库应⽤系统。

是建⽴数据库及其应⽤系统的技术,是信息系统开发和建设中的核⼼技术。

由于数据库应⽤系统的复杂性,为了⽀持相关程序运⾏,数据库设计就变得异常复杂,因此最佳设计不可能⼀蹴⽽就,⽽只能是⼀种"反复探寻,逐步求精"的过程,也就是规划和结构化数据库中的数据对象以及这些数据对象之间关系的过程。

数据库设计(DatabaseDesign)

数据库设计(DatabaseDesign)

数据库设计(DatabaseDesign)数据库设计(Database Design)是指对于一个给定的应用环境,构造最优的数据库模式,建立数据库及其应用系统,使之能够有效地存储数据,满足各种用户的应用需求(信息要求和处理要求)。

在数据库领域内,常常把使用数据库的各类系统统称为数据库应用系统。

一、数据库和信息系统(1)数据库是信息系统的核心和基础,把信息系统中大量的数据按一定的模型组织起来,提供存储、维护、检索数据的功能,使信息系统可以方便、及时、准确地从数据库中获得所需的信息。

(2)数据库是信息系统的各个部分能否紧密地结合在一起以及如何结合的关键所在。

(3)数据库设计是信息系统开发和建设的重要组成部分。

(4)数据库设计人员应该具备的技术和知识:数据库的基本知识和数据库设计技术计算机科学的基础知识和程序设计的方法和技巧软件工程的原理和方法应用领域的知识二、数据库设计的特点数据库建设是硬件、软件和干件的结合三分技术,七分管理,十二分基础数据技术与管理的界面称之为“干件”数据库设计应该与应用系统设计相结合结构(数据)设计:设计数据库框架或数据库结构行为(处理)设计:设计应用程序、事务处理等结构和行为分离的设计传统的软件工程忽视对应用中数据语义的分析和抽象,只要有可能就尽量推迟数据结构设计的决策早期的数据库设计致力于数据模型和建模方法研究,忽视了对行为的设计如图:三、数据库设计方法简述手工试凑法设计质量与设计人员的经验和水平有直接关系缺乏科学理论和工程方法的支持,工程的质量难以保证数据库运行一段时间后常常又不同程度地发现各种问题,增加了维护代价规范设计法手工设计方基本思想过程迭代和逐步求精规范设计法(续)典型方法:(1)新奥尔良(New Orleans)方法:将数据库设计分为四个阶段S.B.Yao方法:将数据库设计分为五个步骤I.R.Palmer方法:把数据库设计当成一步接一步的过程(2)计算机辅助设计ORACLE Designer 2000SYBASE PowerDesigner四、数据库设计的基本步骤数据库设计的过程(六个阶段)1.需求分析阶段准确了解与分析用户需求(包括数据与处理)是整个设计过程的基础,是最困难、最耗费时间的一步2.概念结构设计阶段是整个数据库设计的关键通过对用户需求进行综合、归纳与抽象,形成一个独立于具体DBMS的概念模型3.逻辑结构设计阶段将概念结构转换为某个DBMS所支持的数据模型对其进行优化4.数据库物理设计阶段为逻辑数据模型选取一个最适合应用环境的物理结构(包括存储结构和存取方法)5.数据库实施阶段运用DBMS提供的数据语言、工具及宿主语言,根据逻辑设计和物理设计的结果建立数据库,编制与调试应用程序,组织数据入库,并进行试运行6.数据库运行和维护阶段数据库应用系统经过试运行后即可投入正式运行。

Database Design

Database Design

Normal Forms A candidate key of a table is a combination of one or more attributes (minimal) of the table such that each value of these attributes uniquely identifies a row in the table. If the tables has more than one candidate keys, keys one of them is designated as primary key key. A table is in first normal form when each attribute value does not contain a repeating group. Attribute B depends on attribute A if for each A-value, there is only one B-value. Attribute B fully depends on attribute A if B depends on A and B does not depend on part of A. A t bl i i second normal f table is in d l form when it satisfies fi t h ti fi first normal form and has a primary key. Each non-key attribute must fully depend on the primary key. A table is in third normal form when it satisfies second normal form and each non-key attribute directly depends on the primary key. That is, there is no transitive dependency.

数据库系统概念(英文精编版.第六版)

数据库系统概念(英文精编版.第六版)


Atomicity of updates
Failures
may lead to inconsistencies (1) account_A = account_A – 100 (2) account_B = account_B + 100
Example:

Concurrent access by multiple users
Exercises
Computer users interacts with data in the _______ level A. physical B. logical C. view D. all of the above Application users interact with data in the _______ level. A. physical B. logical C. view D. all of the above How the data are actually stored is called _______ A. Physical level B. Logical level C. View level D. Conceptual level
property is called ( )
A. Data inconsistency C. Data isolation B. Data redundancy D. Data integrity
1.3 View of Data
Hierarchy of Abstraction Levels
Three Abstraction Levels of Data
机械工业出版社
本课程学习内容
关系数据模型 关系数据库语言

Database Design

Database Design

Database Design1. You are first required to create a conceptual data model of the data requirements for a company that specializes in IT trainingand then map the conceptual data model into a relational schema. The Company has 30 instructors and can handle up to 100 traineesper training session. The Company offers five advanced technology courses, each of which is taught by a teaching team of two or moreinstructors. Each instructor is assigned to a maximum of two teaching teams or may be assigned to do research.Each trainee undertakes one advanced technology course per training session.1) Identify the main entity types for the company.2) Identify the main relationship types and specify the multiplicity for each relationship. State any assumptions you make about the data.3) Using your answers for the previous two to draw a single ER model to represent the data requirements for the company.4) Convert the E-R model into a relational schema using the mapping algorithm specified in this course.Specify key and referential integrity constraints, using directed arcs. Make sure you also identify alternate keys.Label each step of the mapping algorithm.2. In this problem, we shall design a database system for a health center. The database must manage following information.- A physician has a name, and a ID number.- A patient has a name, a ID number, and an address.- A hospital has a unique name and an address. The name is unique.- An insurance company has a unique name and an address.- A patient is treated by physicians. Each treatment has a start date, an end date, and a cost. The cost is charged to an insurance company.- A physician works in just a hospital.- An address consists of a street, city, and zip information.Give an E-R model description for the health center database system and convert the E-R model into a relational schema usingthe mapping algorithm specified in this course. Specify keys and referential integrity constraints, using directed arcs.Make sure you also identify alternate keys. Label each step of the mapping algorithm.。

数据库实践9—逻辑数据库设计-步骤1

数据库实践9—逻辑数据库设计-步骤1
数据库设计方法学步骤1的任务(构建ER模 型)以及产生的文档(ER图和数据字典)
步骤1 – 创建和检查ER模型

目标是构建由数据库支持的公司(或者公 司的一部分)的数据需求的ER模型。
步骤1 – 任务

步骤1.1 – 标识实体 步骤1.2 – 标识关系 步骤1.3 – 标识实体或关系的属性 步骤1.4 – 确定属性域 步骤1.5 – 确定候选键、主键和备选键属性 步骤1.6 – 特化和泛化实体(可选) 步骤1.7 – 检查模型的冗余性 步骤1.8 – 检查模型是否支持用户事务 步骤1.9 – 和用户一起检查模型
本节主题



设计方法学 数据库设计的两个主要阶段 数据库设计的关键因素 逻辑和物理数据库设计的方法学 数据库设计方法学步骤1的任务(构建ER模 型)以及产生的文档(ER图和数据字典)
数据库设计的阶段

两个主要的阶段:

逻辑数据库设计 物理数据库设计 构建基于用户使用需求的,但独立于具体DBMS和其他 物理因素的数据模型的过程。 产生描述二级存储中的数据库如何实现的过程,它描 述了基本表、文件组织方式、为了获得对数据的高效 访问的索引以及相关的完整性约束和安全控制。
步骤1.1 – 标识实体

一个方法是检查用户需求说明书中的名词 或名词短语。 也要查找主要的对象,如people、 places 或者 concepts of interest,排除那些只表 示其他对象特征的名词。
将实体存档


StayHome 的实体
Branch Video Member Actor Staff VideoForRent RentalAgreement Director

Database design--Part 1_ Schema Design

Database design--Part 1_ Schema Design
第3章 数据库设计 Part 1:模式设计
Advanced Database Technologies
金培权(jpq@)
问题的提出
如何把现实世界表达成数据库模式? 针对一个具体应用,应该如何构造一个适
合于它的数据库模式?
这是数据库的逻辑设计问题 数据库的模式设计理论是数据库逻辑设计
R的每个关系r是它在Ri上的投影的自然连接 无损连接保证R分解后还可以通过Ri恢复
Advanced Database Technologies
13
金培权(jpq@)
4、无损连接概念
我们记 m r Ri r 则对于关系模式R关于F的无损连接条件
的理论基础
Advanced Database Technologies
2
金培权(jpq@)
将现实数据特征 转换为合理的数 据库模式结构
Advanced Database Technologies
3
金培权(jpq@)
本章主要内容
关系模式的设计问题 关系模式的分解 关系模式的范式 模式分解的算法
模式分解的含义
Advanced Database Technologies
10
金培权(jpq@)
2、模式分解的标准
具有无损连接 要保持函数依赖 既具有无损连接,又要保持函数依赖
Advanced Database Technologies
11
金培权(jpq@)
19
金培权(jpq@)
(2)不保持函数依赖带来的问题
R(city, street, zip), F={(city,street)→zip, zip→city} 分解为p={R1(street,zip),R2(city,zip)} 在R1中插入(’a’,’100081’)和(’a’,’100082’) R2中插入(’Beijing’,’100081’)和(’Beijing’,’100082’) R1 R2:得到
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

MODULE 8LOGICAL DATABASE DESIGNWORKED EXAMPLES8.1 What is an entity? Give examples of entities.Entities specify distinct real world items, in an application, e.g., employees, books, cars, fan, chair etc .8.2 In what ways is an attribute different from an entity?Attributes are specific properties of entities. For example, the attributes of the entity car is (Registration no., chassis no., engine no., h.p., no. of seats, model, manufacturer).8.3 What do you understand by a 1 to 1, 1 to many, many to many relationships?Give an example for each.If for every value of an attribute A in a relation there is a unique value of an attribute B in another relation then A and B are dependent 1 to 1.If for each A there are N values of B, then A and B are 1:N.Finally if for each value of A there are M values of B and for each B there are N values of A, then A and B are M:N related.Example of 1 to 1 relationshipA student can enroll in only one dept.Student id dept. idExample of 1 to manyA teacher teaching 3 coursesTeacher id 1:3 Course idExample of many to manyStudents take 4 coursesEach course can have 40 studentsStudent id N:M Course id8.4 What is the difference between a relation and a relationship?Relationship depicts the dependency or connection between two entities. A relation is a flat table.8.5 What is normalization of a relation?Normalization is a procedure used to transform a set of relations into another setwhich has the following desirable properties:1. Duplication of data in database is minimized.2. Operations of adding, deleting, modifying data in a database do not lead toinconsistent data in database.3. Retrieval of data is simplified8.6 Why should relations be normalized?Normalization ensures that data in the database are not unnecessarily duplicated. It also ensures that addition and deletion of entity rows(or tuples) or change ofindividual attribute values do not lead to accidental loss of data or errors in database. Normalization also simplifies retrieval of data from a database.8.7 What is functional dependency?Let X and Y be two attributes of a relation. Given a value of X, if there is only onevalue of Y corresponding to it then Y is functionally dependent on X.8.8 What is the key attribute in a relation?If an attribute X in a relation is such that the value of all the other attributes areuniquely determined by the value of X, then X is the key attribute of the relation.8.9 What is the difference between a 2 NF and a 3 NF relation?In 2 NF all non-key attributes are dependent on the key attribute. No non-keyattribute should be dependent in a part of a composite key. There may be adependency between non-key attributes. Such a dependency is not allowed in 3 NF relation.8.10 When is BCNF required?If there is a dependency between attributes of two overlapping multi-attribute keys the relation needs to be normalized to BCNF. It implies that a relation needingBCNF has more than one candidate key.8.11 When are 4 NF and 5 NF required?When there is more than 1 independent multi-valued dependency between attributes in a relation then 4 NF and 5 NF are required.8.12 What is the difference between 4 NF and 5 NF?5 NF adds one more relation with attributes which have multi-valued dependency in the 4 NF relation.8.13 Develop E-R diagram for the following:(i)Customer withdraws money from his account.writeexaminations.(ii)Students(iii)Students attend classes.(iv)Professors write books.(v)Driver drives a car.(i) (ii) (iii)8.14 For Question 8.13, obtain relations for each entity. Normalize the relations(i) CUSTOMER (A/c no., name, address, type of account)(A/c no., amount withdrawn, date)WITHDRAW(A/c no., A/c type, balance amount)ACCOUNT(Roll no., name, address, dept., year)STUDENT(ii)WRITES EXAM (Roll no., subject no., exam date, attempt no.)(Subject no., name, taught in sem., pre-requisites)SUBJECTSTUDENT(Roll no., name, address, dept., year)(iii)(Roll no.,course no., semester, calendar year)ATTENDS(course no., teacher id., time of class, location of class)CLASSES(iv)(Professor id., name, address, affiliation)PROFESSOR(Affiliation gives the University he is working in and the department in thatUniversity)WRITES (Professor id., book id., book name, year written)BOOKS (Book id., book name, authors, publisher, no. of pages, price, yearof publication)(book id. Is standardized as ISBN no. in India)DRIVER(License no., name, address, type, validity, date of license)(v)DRIVES (License no., registration no.)CAR(Registration no., manufacturer, model, year, horse power, chassisno., body no., no. of seats)Relations (i), (ii), (iv) are already in normal form.Relation (iii) has multi-valued dependency if we assume thata course may be taught by many teachersa teacher can teach many coursesa student may attend many coursesWe should add relationsTEACHER-COURSE (Teacher id., course no., roll no.)In relation (v), non-key attributes are dependent in the relation CAR as given manufacturer and model of car, the horse power is known. We thus split CARinto two relations as shown:(i)REGISTRATION(Registration no., manufacturer, model, year, CARchassis no., body no. )(ii) CAR PARTICULARS(Manufacturer, model, year, horse power, no. of seats)8.15 For the following word statement, obtain E-R diagram and relations. Use any reasonable assumptions. “A machine shop produces many parts which it takes on contract. It employs many machinists who operate any of the machines. A part needs working on only one machine. A record is kept on the quantity of material needed for producing each part. The production of each part is tracked by giving a job number, start time and end time and machinist identification.”PART(Part no., part name, material type, qty. needed)PART-MACHINE(Part no., machine no., time needed on machine)MACHINE(Machine no., machine name, details of machine)MACHINISTS(Machinist id., name, wage)MACHINE ASSIGNMENT(Machine no., machinist no., part no., start time, end time)8.16 Admission procedure in a university is as follows:An advertisement is issued giving essential qualifications for the course, thelast date for receipt of application, and the fee to be enclosed with theapplication. A clerk in the registrar’s office checks the received applications to see if marksheet and fee are enclosed and sends valid applications to theconcerned academic department. The department checks the application indetail and decides the applicants to be admitted, those to be put in the waiting list, and those rejected. Appropriate letters are sent to the Registrar’s officewhich intimates the applicant. Obtain an E-R diagram and a set of relationsfor the above problem statement.Assumptions:1. An applicant sends separate applications for each course.2. A clerk (or case worker) in Registrar’s office verifies several applications3. Several case workers are there in Registrar’s office4. The department has only one person who decides the result on scrutiny ofapplicationAPPLICANT(Applicant no., Applicant name, address)SENDS(Applicant no., Application no.)APPLICATION(Application no., dept no., fee paid, marks)APPLICATION-SCRUTINY(Application no., dept no.)DEPARTMENT(Dept no., Dept name, no. of student)APPLICATION-REPLY(Application no., dept no., admit)8.17 A magazine is published monthly and is sent by post to its subscribers. Twomonths before the expiry of subscription, a reminder is sent to the subscribers. If subscription is not received within a month, another reminder is sent. If renewal subscription is not received up to two weeks before the expiry of the subscription, the subscriber’s name is removed fromthe mailing list and the subscriber informed. Obtain an E-R diagram and relations for the above problem statement.SENT TO(Rem. Id., subscriber id., date due, amount due)REMINDER(Rem. Id., reminder no, date due) Can be merged as 1:1 relationship given below:REMINDER(Rem. Id., subscriber id.,reminder no, date due, amount due)SUBSCRIBER(Subscriber id., name, address, subscription expiry date)SUBSCRIBER-PAYMENT(Subscriber no., cheque no., date, amountreceived)8.18 What are the advantages and disadvantages of systems using separateData files?Main advantage is efficiency. Individual applications can be efficiently implemented using minimal storage and processing time. Disadvantages of usingindividual files for applications are listed in summary points 16,17,18 and 19.8.19 What do you understand by the term data integrity?If a data field is stored in different files with different values there is no dataintegrity. For example, if a student’s address in the department’s file is different from that in the hostel file then there is no data integrity.8.20 Students’ records in a University are kept by various sections: Hostel, Health Centre, Academic Office, major departments, Accounts Section and Library. If each of these sections maintains its own file-based system for processing, what problems do you foresee? Give examples.Student’s identity number may be different in different files and it will be difficult to link them. If a student’s home address changes he should notify eachsection independently to change his address. If a management decision is taken that if a student’s hostel dues are not paid he will not be given grade card, it is difficult to implement this decision unless the information from hostel is sent to academicsection. If the identification in hostel is different from that in academic office, thencorrelating the records would be very difficult. Stored data is redundant as it isrepeated at many places.8.21 What are the basic objectives in evolving a database for an organization?Share data between applications. Minimize redundancy in data. Maintainconsistency of data values. Protects data. Prevent unauthorized insertion,deletion and alteration of data. Ensure ready access to needed data.8.22 What do you understand by the term data independence?By data independence we mean that an application programmer need not know the physical format and storage of data to use the data in an application.8.23 Distinguish between issues of privacy and security in a database?Data security is concerned with protecting access to data. Authorization levels forupdating, retrieving different data elements are specified. Protection againstaccidental loss of data is planned. Data privacy is concerned with preventing use of individual’s data without his/her permission.8.24What is the difference between a conceptual model and a logical model of adatabase?A conceptual model of a database specifies the data needs for current and futureapplications. It also specifies the entities and relationships among entities. A logical data model formats the data as a relational model, hierarchical model or networkmodel.8.25 What is RDBMS?In relational DBMS relations are used to represent the logical data model.8.25What are the responsibilities of a Database Administrator (DBA) in anorganization?A database administrator is responsible for ensuring integrity, security and privacy of data.。

相关文档
最新文档