logicalDatabaseDesign
- 格式:pdf
- 大小:27.34 KB
- 文档页数:8
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)数据库设计(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 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.。
Chapter 9—Database Management SystemsTRUE/FALSE1. The database approach to data management is sometimes called the flat file approach.ANS: F2. The Database Management System provides a controlled environment for accessing the database.ANS: T3. To the user, data processing procedures for routine transactions, such as entering sales orders, appearto be identical in the database environment and in the traditional environment.ANS: T4. An important feature associated with the traditional approach to data management is the ability toproduce ad hoc reports.ANS: F5. The Data Definition Language is used to insert special database commands into application programs.ANS: F6. There is more than one conceptual view of the database.ANS: F7. In the database method of data management, access authority is maintained by systems programming.ANS: F8. The physical database is an abstract representation of the database.ANS: F9. A customer name and an unpaid balance is an example of a one-to-many relationship.ANS: F10. In the relational model, a data element is called a relation.ANS: F11. Data normalization groups data attributes into tables in accordance with specific design objectives.ANS: T12. Under the database approach, data is viewed as proprietary or “owned” by users.ANS: F13. The data dictionary describes all of the data elements in the database.ANS: T14. A join builds a new table by creating links.ANS: F15. The deletion anomaly is the least important of the problems affecting unnormalized databases.ANS: F16. A deadlock is a phenomenon that prevents the processing of transactions.ANS: T17. Timestamping is a control that is used to ensure database partitioning.ANS: F18. A lockout is a software control that prevents multiple users from simultaneous access to data.ANS: T19. Logical database design is the foundation of the conceptual design.ANS: F20. An entity is any physical thing about which the organization wishes to capture data.ANS: F21. An ER diagram is a graphical representation of a data model.ANS: T22. The term occurrence is used to describe the number of attributes or fields pertaining to a specificentity.ANS: F23. Cardinality describes the number of possible occurrences in one table that are associated with a singleoccurrence in a related table.ANS: T24. A table in third normal form is free of partial dependencies, multiple dependencies, and transitivedependencies.ANS: F25. Improperly normalized databases are associated with three types of anomalies: the update anomaly, theinsertion anomaly, and the deletion anomaly.ANS: TMULTIPLE CHOICE1. All of the following are basic data management tasks excepta. data deletionb. data storagec. data attributiond. data retrievalANS: C2. The task of searching the database to locate a stored record for processing is calleda. data deletionb. data storagec. data attributiond. data retrievalANS: D3. Which of the following is not a problem usually associated with the flat-file approach to datamanagement?a. data redundancyb. restricting access to data to the primary userc. data storaged. currency of informationANS: B4. Which characteristic is associated with the database approach to data management?a. data sharingb. multiple storage proceduresc. data redundancyd. excessive storage costsANS: A5. Which characteristic is not associated with the database approach to data management?a. the ability to process data without the help of a programmerb. the ability to control access to the datac. constant production of backupsd. the inability to determine what data is availableANS: D6. The textbook refers to four interrelated components of the database concept. Which of the following isnot one of the components?a. the Database Management Systemb. the Database Administratorc. the physical databased. the conceptual databaseANS: D7. Which of the following is not a responsibility of the Database Management System?a. provide an interface between the users and the physical databaseb. provide security against a natural disasterc. ensure that the internal schema and external schema are consistentd. authorize access to portions of the databaseANS: C8. A description of the physical arrangement of records in the database isa. the internal viewb. the conceptual viewc. the subschemad. the external viewANS: A9. Which of the following may provide many distinct views of the database?a. the schemab. the internal viewc. the user viewd. the conceptual viewANS: C10. Users access the databasea. by direct queryb. by developing operating softwarec. by constantly interacting with systems programmersd. all of the aboveANS: A11. The Data Definition Languagea. identifies, for the Database Management System, the names and relationships of all dataelements, records, and files that comprise the databaseb. inserts database commands into application programs to enable standard programs tointeract with and manipulate the databasec. permits users to process data in the database without the need for conventional programsd. describes every data element in the databaseANS: A12. The Data Manipulation Languagea. defines the database to the Database Management Systemb. transfers data to the buffer area for manipulationc. enables application programs to interact with and manipulate the databased. describes every data element in the databaseANS: C13. Which statement is not correct? A query language like SQLa. is written in a fourth-generation languageb. requires user familiarity with COBOLc. allows users to retrieve and modify datad. reduces reliance on programmersANS: B14. Which duty is not the responsibility of the Database Administrator?a. to develop and maintain the Data Dictionaryb. to implement security controlsc. to design application programsd. to design the subschemaANS: C15. In a hierarchical modela. links between related records are implicitb. the way to access data is by following a predefined data pathc. an owner (parent) record may own just one member (child) recordd. a member (child) record may have more than one owner (parent)ANS: B16. Which term is not associated with the relational database model?a. tupleb. attributec. collisiond. relationANS: C17. In the relational database modela. relationships are explicitb. the user perceives that files are linked using pointersc. data is represented on two-dimensional tablesd. data is represented as a tree structureANS: C18. In the relational database model all of the following are true excepta. data is presented to users as tablesb. data can be extracted from specified rows from specified tablesc. a new table can be built by joining two tablesd. only one-to-many relationships can be supportedANS: D19. In a relational databasea. the user’s view of the physical database is the same as the physical databaseb. users perceive that they are manipulating a single tablec. a virtual table exists in the form of rows and columns of a table stored on the diskd. a programming language (COBOL) is used to create a user’s view of the databaseANS: B20. The update anomaly in unnormalized databasesa. occurs because of data redundancyb. complicates adding records to the databasec. may result in the loss of important datad. often results in excessive record insertionsANS: A21. The most serious problem with unnormalized databases is thea. update anomalyb. insertion anomalyc. deletion anomalyd. none of the aboveANS: C22. The deletion anomaly in unnormalized databasesa. is easily detected by usersb. may result in the loss of important datac. complicates adding records to the databased. requires the user to perform excessive updatesANS: B23. Which statement is correct?a. in a normalized database, data about vendors occur in several locationsb. the accountant is responsible for database normalizationc. in a normalized database, deletion of a key record could result in the destruction of theaudit traild. connections between M:M tables is provided by a link tableANS: D24. Which of the following is not a common form of conceptual database model?a. hierarchicalb. networkc. sequentiald. relationalANS: C25. Which of the following is a relational algebra function?a. restrictb. projectc. joind. all are relational algebra functionsANS: D26. Which statement is false?a. The DBMS is special software that is programmed to know which data elements each useris authorized to access.b. User programs send requests for data to the DBMS.c. During processing, the DBMS periodically makes backup copies of the physical database.d. The DBMS does not control access to the database.ANS: D27. All of the following are elements of the DBMS which facilitate user access to the database excepta. query languageb. data access languagec. data manipulation languaged. data definition languageANS: B28. Which of the following is a level of the database that is defined by the data definition language?a. user viewb. schemac. internal viewd. all are levels or views of the databaseANS: D29. An example of a distributed database isa. partitioned databaseb. centralized databasec. networked databased. all are examples of distributed databasesANS: A30. Data currency is preserved in a centralized database bya. partitioning the databaseb. using a lockout procedurec. replicating the databased. implementing concurrency controlsANS: B31. Which procedure will prevent two end users from accessing the same data element at the same time?a. data redundancyb. data replicationc. data lockoutd. none of the aboveANS: C32. The advantages of a partitioned database include all of the following excepta. user control is enhancedb. data transmission volume is increasedc. response time is improvedd. risk of destruction of entire database is reducedANS: B33. A replicated database is appropriate whena. there is minimal data sharing among information processing unitsb. there exists a high degree of data sharing and no primary userc. there is no risk of the deadlock phenomenond. most data sharing consists of read-write transactionsANS: B34. What control maintains complete, current, and consistent data at all information processing units?a. deadlock controlb. replication controlc. concurrency controld. gateway controlANS: C35. Data concurrencya. is a security issue in partitioned databasesb. is implemented using timestampingc. may result in data lockoutd. occurs when a deadlock is triggeredANS: B36. Entities area. nouns that are depicted by rectangles on an entity relationship diagramb. data that describe the characteristics of properties of resourcesc. associations among elementsd. sets of data needed to make a decisionANS: A37. A user viewa. presents the physical arrangement of records in a database for a particular userb. is the logical abstract structure of the databasec. specifies the relationship of data elements in the databased. defines how a particular user sees the databaseANS: D38. All of the following are advantages of a partitioned database excepta. increased user control by having the data stored locallyb. deadlocks are eliminatedc. transaction processing response time is improvedd. partitioning can reduce losses in case of disasterANS: B39. Each of the following is a relational algebra function excepta. joinb. projectc. linkd. restrictANS: CSHORT ANSWERUse the following words to complete the sentences.Database Administrator Data Dictionarydata redundancy Index Sequential Access Methodquery language schemasequential structure subschema1. _________________________ occurs when a specific file is reproduced for each user who needsaccess to the file.ANS:Data redundancy2. The conceptual view of the database is often called ____________________.ANS:schema3. The ____________________ allows users to retrieve and modify data easily.ANS:query language4. The __________________________ authorizes access to the database.ANS:Database Administrator5. The __________________________ describes every data element in the database.ANS:Data Dictionary6. Describe a specific data element, entity, and record type in the expenditure cycle.ANS:data element: vendor’s name or account balance; entity: vendor; record type: purchase requisition, purchase order7. What is the relationship between a database table and a user view?ANS:User views are derived database tables. A single table may contribute data to several different views On the other hand, simple views may be constructed from a single table.8. How does the database approach solve the problem of data redundancy?ANS:Data redundancy is not a problem with the database approach because individual data elements need to be stored only once yet be available to multiple users.9. Explain how linkages between relational tables are accomplished.ANS:Tables that are logically related in the data model need to be physically linked. The degree ofassociation between the tables (i.e., 1:1, 1:M, or M:M) determines how the linking occurs. Thekey-assignment rules for linking tables are discussed below. Where a true 1:1 association existsbetween tables, either (or both) primary keys may be embedded as foreign keys in the related table.Where a 1:M (or 1:0,M) association exists, the primary key of the 1 side is embedded in the table of the M side.To represent the M:M association between tables, a link table needs to be created that has a combined (composite) key consisting of the primary keys of two related tables.10. Explain the basic results that come from the restrict, project, and join functions.ANS:A restrict extracts selected rows from a table–records that satisfy prescribed conditions–to create a newtable.A project extracts selected attributes (columns) from a table to create a new table.A join builds a new table, from two existing tables, by matching rows on a value of a commonattribute.11. Explain the purpose of an ER diagram in database design.ANS:The Entity Relationship (ER) diagram is the graphical representation technique used to depict a data model. Each entity in a ER diagram is named in the singular noun form such as Customer rather than Customers. The labeled line connecting two entities describes the nature of the association between them. This association is represented with a verb such as shipped, requests, or receives. The ERdiagram also represents cardinality(the degree of association between two entities). Four basic forms of cardinality are possible: zero or one (0,1), one and only one (1,1), zero or many (0,M), and one or many (1,M). These are combined to represent logical associations between entities such as 1:1, 1:0,M, and M:M.12. What are two types of distributed databases?ANS:Partitioned and replicated databases.13. Describe an environment when a firm should use a partitioned database.ANS:A partitioned database approach works best in organizations that require minimal data sharing amongits information processing units and when a primary user of the data can be identified.14. Explain how to link tables in (1:1) association. Why may this be different in a (1:0,1) association?ANS:Where a true 1:1 association exists between tables, either (or both) primary keys may be embedded as foreign keys in the related table. On the other hand, when the lower cardinality value is zero (1:0,1) a more efficient table structure can be achieved by placing the one-side (1:) table’s primary key in the zero-or-one (:0,1) table as a foreign key. Assume that a company has 1000 employees but only 100 of them are sales staff. Assume also that each sales person is assigned a company car. Therefore, every occurrence in the Employee entity is associated with either zero or one occurrence in the Company Car entity. If we assigned the Company Car (:0,1) side primary to the Employee (:1) table as a foreign key then most of the foreign will have null (blank) values. While this approach would work, it could cause some technical problems during table searches. Correctly applying the key-assignment rule solves this problem because all Company Car records will have an employee assigned and no null values will occur.APPENDIX QUESTION15. Why are the hierarchical and network models called navigational databases?ANS:These are called navigational models because traversing or searching them requires following apredefined path which is established through explicit linkages between related records.ESSAY1. Give three examples that illustrate how cardinality reflects an organization’s underlying business rules.ANS:1) When an organization decides to purchases the same items of inventory from different suppliers,the cardinality between the Supplier and Inventory tables is M:M.2) When a the company purchases all items of a certain type from only one supplier, the cardinalitybetween Supplier and Inventory tables is 1:M respectively.3) A policy that a separate receiving report is prepared for the receipt of goods specified on a singlepurchase order will result in a 1:1 cardinality between the receiving report and purchase ordertables. If, however, multiple purchase orders are combined on a single receiving report then thecardinality between these tables will be 1: M respectively.2. Explain the three types of anomalies associated with database tables that have not been normalized.ANS:The update anomaly is the result of data redundancy. If a data element is stored in more than one place, it must be updated in all places. If this does not happen, the data are inconsistent.The insertion anomaly occurs when too much data is stored together–when vendor information is only stored with specific inventory items. Until items are purchased from a given vendor, the vendor cannot be added to the database.The deletion anomaly is the opposite of the insertion anomaly–if a vendor supplies only one item, and the firm discontinues that item, all information on the vendor is lost when vendor information is only stored with specific inventory items.3. What are the four elements of the database approach? Explain the role of each.ANS:Users are the individuals in the organization who access the data in the database. This may happen via user programs or by direct query.The database management system is a set of programs that control access to the database and thatmanage the data resource through program development, backup and recovery functions, usagereporting, and access authorization.The database administrator is a function (which may involve part of on e individual’s duties or anentire department) which manages the database resources through database planning, design,implementation, operation and maintenance, and growth and change.The physical database is the only physical form that the database has. It is comprised of magnetic spots on magnetic media.4. Explain the three views of a database.ANS:The unique internal view of the database is the physical arrangement of records which describes the structure of data records, the linkages between files, and the physical arrangement and sequence of records in the file.The unique conceptual view (or schema) represents the database logically and abstractly.The many user views (or subschema) define the portion of a database that an individual user isauthorized to access.5. Explain a database lockout and the deadlock phenomenon. Contrast that to concurrency control and thetimestamping technique. Describe the importance of these items in relation to database integrity.ANS:In a centralized database, a lockout is used to ensure data currency. A lockout prevents simultaneous access to individual data elements by different information processing units (IPU). When one IPU requests access to a data element, a lock is put on the file, record, or element. No other IPU can access the file, record, or element until the lock is released.In a partitioned database, lockouts are also used to ensure data currency. It is possible, however, for multiple sites to place locks on records that results in a deadlock condition which prevents transactions from processing. All transactions are in a “wait” state until the locks are removed. A deadlock cannot be resolved without outside intervention from the user’s application, the DBMS, or the operating system.In a replicated database, a large volume of data flows between sites, and temporary inconsistencies in the database may occur. Concurrency control ensures that transactions executed at each IPU areaccurately reflected in the databases of all other sites. A popular method for concurrency control is to timestamp transactions. Transactions that may be in conflict are assigned a system-wide timestamp.Then, the identified transactions are processed in timestamp order.Both database lockouts and concurrency controls are designed to ensure that the transactions arecompletely processed and that all transactions are accurately reflected in the firm’s databases. Failure to implement these controls can result in transactions being lost, being partially processed, or with inconsistent databases.6. What are the key control implications of the absence of database normalization?ANS:When considering the quality of the data in a database, accountants should be aware of the outcomes of typical anomalies. The update anomaly can yield conflicting data in the database. The insertion anomaly can result in unrecorded transactions. The deletion anomaly can cause loss of accounting information and destruction of the audit trail.7. In a distributed data processing system, a database can be centralized or distributed. What are theoptions? Explain.ANS:In a distributed data processing system, a database can be centralized or distributed. When the database is centralized, the entire database is stored at a central site which processes requests from users at remote locations. Certain concerns arise when data processing is distributed. Questions arise with regard to data currency when multiple users have access to the database. Database lockout prevents more than one user from making changes at the same time.Distributed databases can be partitioned with parts stored at different sites, or replicated, with theentire database stored in multiple locations. When the database is partitioned, users have more control over data stored at local sites, transaction processing time is improved, and the potential of data loss is reduced. When the database is replicated, the entire database is stored at multiple locations. This works well when the primary use of the database is for querying. When transactions are processed at many sites, problems of database concurrency arise.8. What are the characteristics of a properly designed relational database table?ANS:The characteristics of a properly designed relational database table are:a. All occurrences at the intersection of a row and column are a single value.b. The attribute values in any column must all be of the same class.c. Each column in a given table must be uniquely named.d. Each row in the table must be unique in at least one attribute which is considered the primary key.9. Ownership of data in traditional legacy systems often leads to data redundancy. This in turn leads toseveral data management problems. What are they? How does the database approach solve them?ANS:Data redundancy causes significant data management problems in three areas: data storage, dataupdating, and currency of information. Data storage is a problem because if multiple users need the data, it must be collected and stored multiple times at multiple costs. When multiple users hold the same information, changes must be updated in all locations or data inconsistency results. Failure to update all occurrence of a data item can affect the currency of the information.With a database system, these problems are solved. There is no data redundancy since a data item is stored only once. Hence changes require only a single update, thus leading to current value.10. What services are provided by a database management system?ANS:Database management systems typically provide the following services:a. program development which permits both programmers and end users to create applications toaccess the database;b. backup and recovery is built in therefore reducing likelihood of data loss;c. database usage reporting captures statistics on what data is being used, by whom, when; andespeciallyd. database access is provided to authorized users.11. Discuss the key factors to consider in determining how to partition a corporate database.ANS:The partitioned approach works best for organizations that require minimal data sharing among users at remote sites. To the extent that remote users share common data, the problems associated with the centralized approach will apply. The primary user must now manage requests for data from other sites.Selecting the optimum host location for the partitions to minimize data access problems requires an in-depth analysis of end-user data needs.12. Distinguish between a database lockout and a deadlock.ANS:To achieve data currency, simultaneous access to individual data elements or records by multiple users needs to be prevented. The solution to this problem is a database lockout, which is a software control that prevents multiple simultaneous accesses to data. A deadlock occurs when multiple users seeking access to the same set of records lockout each other. As a result, the transactions of all users assume a “wait” state until the locks are removed. A deadlock is a permanent condition that must be resolved by special software that analyzes each deadlock condition to determine the best solution.13. Replicated databases create considerable data redundancy, which is in conflict with the databaseconcept. Explain the justification of this approach.ANS:The primary justification for a replicated database is to support read-only queries in situationsinvolving a high degree of data sharing, but no primary user exists. With data replicated at every site, data access for query purposes is ensured, and lockouts and delays due to network traffic areminimized. A potential problem arises, however, when replicated databases need to be updated by transactions. Since each site processes only local transactions, the common data attributes that are replicated at each site will be updated by different transactions and thus, at any point in time, will have uniquely different values. System designers need to employ currency control techniques to ensure that transactions processed at different locations are accurately reflected in all the databases copies.APPENDIX QUESTION14. Contrast the navigational databases with relational databases. What is the primary advantage of therelational model?ANS:The most apparent difference between the relational model and navigational models is the way that data associations are represented to the user. In navigational models, data are represented in treestructures or network structures. The navigational database models have explicit links, called pointers, between records. Data are accessed using defined data paths.The relational model portrays data in the form of two-dimensional tables. Users do not perceive any pointers linking the tab les. At the conceptual level (logical view) and the external level (user’s view), data are represented only as tables. Relations between tables are formed by an attribute (data element) that is common to the tables. This attribute is a primary key in one table and a foreign key in the other.The relational model is more flexible than a navigational model. Users can obtain data from thedatabase by using the primary key and a database query language. Typically users do not requireassistance from programmers to obtain answers to ad hoc queries.。
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.。