3 Stages in Database Design Requirements formulation and analysisConceptual Design -- Conceptual ModelImplementation Design -- Logical ModelPhysical Design --Physical Model
4 Database Design Process Requirements formulation and analysisPurpose: Identify and describe the data that are used by the organizationResults: Metadata identified, Data Dictionary, Conceptual Model-- ER diagram
5 Database Design Process Requirements Formulation and analysisSystems Analysis ProcessExamine all of the information sources used in existing applicationsIdentify the characteristics of each data elementnumerictextdate/timeetc.Examine the tasks carried out using the informationExamine results or reports created using the information
6 Conceptual Modeling Objective: to produce HIGH-LEVEL DATA MODEL GOALS a complete understanding of the database structure, meaning (semantics), interrelationships, and constraintsA stable description of the database contentsUsually more expressive and general than data models of individual DBMSsVehicle of communication among database users, designers, and analysts.
7 Database Design Process Conceptual ModelMerge the collective needs of all applicationsDetermine what Entities are being usedSome object about which information is to maintainedWhat are the Attributes of those entities?Properties or characteristics of the entityWhat attributes uniquely identify the entityWhat are the Relationships between entitiesHow the entities interact with each other?
8 Database Design Process Logical ModelHow is each entity and relationship represented in the Data Model of the DBMSHierarchic?Network?Relational?Object-Oriented?
9 Database Design Process Physical ( Internal) ModelChoices of index file structureChoices of data storage formatsChoices of disk layout
10 Database Design Process External ModelUser views of the integrated databaseMaking the old (or updated) applications work with the new database design
11 Data Models: History Relational Model (1980’s) Provides a conceptually simple model for data as relations (typically considered “tables”) with all data visible.
12 Data Models: History Object Oriented Data Model (1990’s) Encapsulates data and operations as “Objects”Books(id, title)PublisherSubjectsAuthors(first, last)
13 Intro. to ER ModelsEntity/Relationship approach - one of the most well known modeling methodsDeveloped by P.Chen in many variations since thenData modeling is generally considered the most important component of the systems development process
14 Entity Relationship Diagrams A Simple ERD: Consider the following situationA customer places an order. The order consists of parts.EntityRelationshipAnother RelationshipPlacesContainCustomerOrdersPartsAn Organization about which we wish to maintain informationAn Association between EntitiesAnother EntityAltogether, a Database
15 ER NOTATION Attribute Entity type Key attribute Weak entity type Multivalued attributeRelationship typeDerived attributeIdentifyingRelationship typeComposite attribute
16 A special entity that is also a relationship Relationship symbolsEntity symbolsAttribute symbolsA special entity that is also a relationshipRelationship degrees specify number of entity types involvedRelationship cardinalities specify how many of each entity type is allowed8
17 EntityAn Entity is an object in the real world (or even imaginary worlds) about which we want or need to maintain informationPersons (e.g.: customers in a business, employees, authors)Things (e.g.: purchase orders, meetings, parts, companies)Employee
19 Identifiers (Keys)Identifier (Key) - An attribute (or combination of attributes) that uniquely identifies individual instances of an entity typeSimple Key versus Composite KeyCandidate Key – an attribute that could be a key…satisfies the requirements for being a key6
20 Characteristics of Identifiers Will not change in valueWill not be nullNo intelligent identifiers (e.g. containing locations or people that might change)7
21 AttributesAttributes are the significant properties or characteristics of an entity that help identify it and provide the information needed to interact with it or use it. (This is the Metadata for the entities.)EmployeeLastMiddleFirstNameSSNAgeBirthdateProjects
22 Figure 3-7 – A composite attribute An attribute broken into component parts12
23 Weak Entities Owe existence entirely to another entity Order-line ContainsOrderInvoice #Part#Rep#QuantityInvoice#
24 Figure 3-9a – Simple key attribute The key is underlined14
25 Figure 3-9b – Composite key attribute The key is composedof two subparts15
26 Figure 3-8 – Entity with a multivalued attribute (Skill) and derived attribute (Years_Employed) What’s wrong with this?Derivedfrom date employed and current dateMultivalued:an employee can havemore than one skill13
27 RelationshipsRelationships are the associations between entities. They can involve one or more entities and belong to particular relationship types
28 Relationships Class Attends Student Part Supplier Project Supplies
29 Relationships Class Attends Student Part Supplier Project Supplies
30 Types of Relationships Concerned only with cardinality of relationshipTruckAssignedEmployeeProject1nmChen ER notation
32 Degree of Relationships Degree of a relationship is the number of entity types that participate in itUnary RelationshipBinary RelationshipTernary Relationship16
33 Degree of relationships – from Figure 3-2 Entities of two different types related to each otherOne entity related to another of the same entity typeEntities of three different types related to each other8
34 Cardinality of Relationships One-to-OneEach entity in the relationship will have exactly one related entityOne-to-ManyAn entity on one side of the relationship can have many related entities, but an entity on the other side will have a maximum of one related entityMany-to-ManyEntities on both sides of the relationship can have many related entities on the other side
35 Cardinality Constraints Cardinality Constraints - the number of instances of one entity that can or must be associated with each instance of another entityMinimum CardinalityIf zero, then optionalIf one or more, then mandatoryMaximum CardinalityThe maximum number29