Logical Database Design Modeling
Logical Database Design Modeling
Logical Database Design Modeling
for a class of database management system Types of logical database models 1. 2. 3. Hierarchical model: Records are arranged in top-down structure that resembles a tree. Network model: Each record type may be associated with an arbitrary number of different record types. Relational model: represents data using tables.
STEPS IN LOGICAL DATABASE DESIGN 1. 2. 3. 4. Represent entities Represent relationships Normalize relations merge the relations
Relational Model Introduced by E. F. Codd of the IBM. Uses the concept of mathematical relation in the design of a database BASIC DEFINITIONS Data Structure. Data are organized into tables Data Manipulation Powerful operations using SQL are used to manipulate data stored in the relation Data Integrity. Facilities are included to specify business rules that maintain data when they are manipulated. RELATIONAL DATA STRUCTURE. Relation is a named, two-dimensional table of data. Expressing the structure of a relation: EMPLOYEE(EmpID. Name, DeptName, Salary) Relational Keys. Primary Key: An attribute or combination of attributes that uniquely identify each row in a relation.
Composite key. A primary key that consists of more than one attribute.
Foreign Key. An attribute in a relation of a database that serves as a primary key of another relation in the same database. PROPERTIES OF A RELATION 1. 2. 3. 4. 5. 6. Each relation (table) in a database has a unique name An entry at the intersection of each row and column is atomic (or single valued) there can be no multivalued attributes in a relation. Each row is unique; not two rows in a relation are identical. Each attribute (or column) within a table has a unique name. The sequence of columns (left to right) is insignificant The sequence of rows (top to bottom) is insignificant. As with columns, the rows may be interchanged.
INTEGRITY CONSTRAINTS
All the values that appear in the field of a relation must be taken from the same domain (set of values). Components of a domain: domain name, meaning, data type, size and allowable values or range.
Entity integrity.
key should no t be null.
Every relation has a primary key and the data values for a primary key are all valid, every primary
Referential Integrity. A rule that states that either each foreign key must match a primary key value in another relation
or the foreign key must be null WELL-STRUCTURED RELATIONS A relation that contains minimal redundancy and allows users to insert, modify, and delete the rows in a table without errors or inconsistencies Three Types of Anomalies when a user attempts to update the data in the table: 1. 2. 3. Insertion anomaly Deletion Anomaly Modification Anomaly
NORMALIZATION. The process of successively reducing relations with anomalies to produce smaller, well-structured relations. Some goals of Normalization: 1. 2. 3. 4. Minimize data redundancy to avoid anomalies and conserving storage space Simplify enforcement of referential integrity constraints Make it easier to maintain data (insert, update, and delete) Provide a better design that is an improved representation of the real world and a stronger basis for future growth.
NORMAL FORM. A state of a relation that results from applying simple rules regarding functional dependencies.