Você está na página 1de 5

System Design and Analysis Chapter 9 _ Designing Databases Key Terms 1.Calculated field 2.Data type 3.

Default value 4.Denormalization 5.Field 6.File organization 7.Foreign key 8.Functional dependency 9.Hashed file organization 10.Homonym 11.Index 12.Indexed file organization 13.Normalization 14.Null value 15.Physical file 16.Physical table 17.Pointer 18.Primary key 19.Recursive foreign key 20.Referential integrity 21.Relation 22.Relational database model 23.Secondary key 24.Second normal form (2NF) 25.Sequential file organization 26.Synonym 27.Third normal form (3NF) 28.Well-structured relation

Match each of the key terms above to the definition that best fits it. Calculated field A field that can be derived from other database fields. Data type A coding scheme recognized by system software for representing organizational data. Default value A value a field will assume unless an explicit value is entered for that field. Denormalization The process of splitting or combining normalized relations into physical tables based on affinity of use of rows and fields. Field The smallest unit of named application data recognized by system software. File organization A technique for physically arranging the records of a file. Foreign key An attribute that appears as a non primary key attribute in one relation and as a primary key attribute (or part of a primary key) in another relation. Functional dependency A particular relationship between two attributes. Hashed file organization The address for each row is determined using an algorithm. Homonym A single attribute name that is used for two or more different attributes. Index A table used to determine the location of rows in a file that satisfy some condition. Indexed file organization The rows are stored either sequentially or nonsequentially, and an index is created that allows software to locate individual rows.

Normalization The process of converting complex data structures into simple, stable data structures. Null value A special field value, distinct from a zero, blank, or any other value, that indicates that the value for the field is missing or otherwise unknown. Physical file A named set of table rows stored in a contiguous section of secondary memory. Physical table A named set of rows and columns that specifies the fields in each row of the table. Pointer A field of data that can be used to locate a related field or row of data. Primary key An attribute whose value is unique across all occurrences of a relation. Recursive foreign key A foreign key in a relation that references the primary key values of that same relation. Referential integrity An integrity constraint specifying that the value (or existence) of an attribute in one relation depends on the value (or existence) of the same attribute in another relation. Relation A named, two-dimensional table of data. Each relation consists of a set of named columns and an arbitrary number of unnamed rows. Relational database model Data represented as a set of related tables or relations. Secondary key One or a combination of fields for which more than one row may have the same combination of values. Second normal form (2NF) A relation for which every nonprimary key attribute functionally dependent on the whole primary key. Sequential file organization The rows in the file are stored in sequence according to a primary key value. Synonym Two different names that are used for the same attribute. Third normal form (3NF) A relation that is in second normal form and that has functional (transitive) dependencies between two more) nonprimary key attributes. Well-structured relation A relation that contains a minimum amount of redundancy and allows users to insert, modify, and delete the rows without errors or inconsistencies.

Review Questions 1.What is the purpose of normalization? Database normalization is the process of organizing the fields and tables of a relational database to minimize redundancy and dependency. Normalization usually involves dividing large tables into smaller (and less redundant) tables and defining relationships between them. The objective is to isolate data so that additions, deletions, and modifications of a field can be made in just one table and then propagated through the rest of the database using the defined relationships. 2. List five properties of relations. - Entries in cell are simple. An entry at the intersation of each row and column has a single value. - Entries in a given column are from the same set of values - Each row is unique. Uniqueness is guaranteed because the relation has a non-empty primary key value. - The sequence of columns can be interchanged without changing the meaning or use of the relation - The rows may be interchanged or stored in any sequences 3. What problems can arise when merging relations (view integration) ? Integration Problems Synonyms Two different names used for the same attribute When merging, get agreement from users on a single, standard nam A single attribute names that is used for two or more different attributes Resolved by creating a new name Dependencies may be created as a result of view integration In order to resolve, the new relation must be normalized


Dependencies between nonkeys

4. How are relationships between entities represented in the relational data model? Relationships between entities are represented in the several ways: A binary 1:M relationship is represented by placing a foreign key (the primary key of the entity on the one side of the relationship) in the relation for the entity on the many side of the relationship.

-In a binary 1:1 relationship, a foreign key is placed in the relation on either side of the relationship or on both sides. *Add the primary key of A as a foreign key of B. *Add the primary key of B as a foreign key of A. *Both of the above. -For a binary and higher degree M:N relationship, a relation is created with a primary key, which is the concatenation of the primary keys from the related entities. -In a unary relationship, a recursive foreign key is added to the relation.

5. What is the relationship between the primary key of a relation and the functional dependencies among all attributes within that relation? Normalization is based on the analysis of functional dependence. A functional dependency is a particular relationship between two attributes. In a given relation, attribute B is functionally dependent on attribute A if, for every valid value of A, that value of A uniquely determines the value of B. The functional dependence of B on A is represented by an arrow, as follows: A->B (e.g., Emp_ID-> Name in the relation of Figure 9-5). Functional dependence does not imply mathematical dependence-that the value of one attribute may be computed from the value of another attribute; rather, functional dependence of B on A means that there can be only one value of B for each value of A. Thus, a given Emp_ID value can have only one Name value associated with it; the value of Name, however, cannot be derived from the value of Emp_ID. Other examples of functional dependencies from Figure 9-3b are in ORDER, Order_NumberrOrder_Date, and in INVOICE, Invoice_NumberrInvoice_Date and Order_Number. 6. How is a foreign key represented in relational notation? An attribute that appears as a nonprimary key attribute in one relation and as a primary key attribute (or par of primary key) in another relation. 7. Can instances of a relation (sample data) prove the existence of a functional dependency? Why or why not? Instances in a relation cannot prove that a functional dependency exists; however, you can use sample data to demonstrate that a functional dependency does not exist. The sample data does not show every possible instance, only a sampling. Knowledge for the problem domain is a reliable methods for identifying functional dependencies. 8. In what way does the choice of a data type for a field help to control the integrity of that field? The choice of data type often limits the possible values that may be stored for field. Some data types have an assumed length that places an implicit range control on values. Data type may also limit the kinds of data manipulations possible, thus further controlling the integrity of the data or results from manipulating the data.

9. What is the difference how a range control statement and a referential integrity control statement are handled by a file management systems? A referential integrity control requires the data management software to access other data records to determine if the value is permitted, whereas a range control is checked by looking up values outside the files and database, in a repository or other source of metadata. 10. What is the purpose of denormalization? Why might you not want to create one physical table or file for each relation in a logical data model? The purpose of denormalization is physically locate data close to one another if they are often needed together for processing, thus minimizing secondary memory I/O operations. Because normalization forces all attributes dependent on the same primary key to be logically placed in one relation, a relation can become quite diverse with many attributes. 11. What factors influence the decision to create an index on a field? The factors that influence the decision to create an index are the data retrieval, insertion, deletion, and updating costs with and without the index. Indexes allow for rapid random retrieval and sorting of data, but indexes create additional storage and maintenance costs. 12. Explain the purpose of data compression techniques. Data compression techniques is pattern matching and other methods that replace repeating of characters with codes of shorter lights, thus reducing data storage requirements. 13. What are the goals of designing physical tables? - The efficient use of secondary - Data processing speed 14. What are the seven factors that should be considered in selecting a file organization? The seven factors to consider when selecting a file organization are: 1. 2. 3. 4. 5. 6. 7. Fast date retrieval High throughput for processing transactions Efficient use of storage space Protection from failures or data loss Minimizing need for reorganization Accommodating growth, and Security from unauthorized use