Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSIS 254 Oracle Database Design

Similar presentations


Presentation on theme: "CSIS 254 Oracle Database Design"— Presentation transcript:

1 CSIS 254 Oracle Database Design
CSIS Introduction to Oracle CSIS 254 Oracle Database Design Day 3 Day 1

2 CSIS 252 - Introduction to Oracle
Today’s Agenda Questions on homework Review key concepts from last week Continue with Analysis stage of SDLC Entity Life History Diagrams Data Flow Diagrams Relational Databases Day 1

3 Seven System Development Stages (Review)
CSIS Introduction to Oracle Seven System Development Stages (Review) The Software Development Life Cycle Strategy / Scope Analysis Design Programming Testing Go Live Production & Maintenance Day 1

4 The Entity Relationship Model (ERM) Entities
CSIS Introduction to Oracle The Entity Relationship Model (ERM) Entities Entities are people, places, things, or events of interest to our system that can be divided into distinct classes An entity may describe physical things, or it may be conceptual Entity types (or sets) are collections of entities having similar properties Each occurrence of an entity type can also be called an instance or an object Day 1

5 The Entity Relationship Model (ERM) Attributes
CSIS Introduction to Oracle The Entity Relationship Model (ERM) Attributes Attributes are relevant properties or characteristics that describe the entity instances in an entity set An attribute may be simple (atomic) or composite An attribute may also be single-valued or multi-valued The values of an attribute in an entity instance may be restricted: mandatory, uniqueness, formatting, restricted domain... Day 1

6 The Entity Relationship Model (ERM) Keys
CSIS Introduction to Oracle The Entity Relationship Model (ERM) Keys An attribute (or combination of attributes) that uniquely identify an entity is called a key attribute Key attributes are limited to the minimum set of attributes that can uniquely identify an entity When an entity has more than one set of key attributes, they are called candidate keys When a key does not contain any descriptive data about the entity,it is called a surrogate or natural key, or an identifier Day 1

7 The Entity Relationship Model (ERM) Derived Attributes
CSIS Introduction to Oracle The Entity Relationship Model (ERM) Derived Attributes A derived attribute is one that can be determined based upon the values of other attributes in the entity object or related entity objects These might it be beneficial for us to include derived attributes in our physical database design Performance Redundancy Security Consistency (??) Snapshots in time (as of) Day 1

8 Engineering Method Entity Diagrams
CSIS Introduction to Oracle Engineering Method Entity Diagrams Entity Name Attributes PALOMAR STUDENT Student ID Full Name First Name Middle Name Last Name Social Security Number Home Address Home Phone High Schools Day 1

9 Engineering Method Entity Diagrams
CSIS Introduction to Oracle Engineering Method Entity Diagrams PUBLISHER Publisher Id Publisher Name Street Address City State A familiar Key example Attribute Day 1

10 The Entity Relationship Model (ERM) Weak Entity Types
CSIS Introduction to Oracle The Entity Relationship Model (ERM) Weak Entity Types Entity types that do not have key attributes of their own are called weak entity types Weak entities are always related to specific entities from another entity type -- the owner A weak entity must have a partial key or an identifier, which is a set of attributes that can be used to uniquely identify each instance from other instances belonging to the same owner Day 1

11 The Entity Relationship Model (ERM) Subtypes and Supertypes
CSIS Introduction to Oracle The Entity Relationship Model (ERM) Subtypes and Supertypes When different entity types share the same attributes, we can break out the common attributes into Supertypes, leaving the attributes that distinguish entities into Subtypes There must be at least one attribute that distinguishes subtypes common to a supertype An entity instance must belong to one and only one subtype Day 1

12 The Entity Relationship Model (ERM) Relationships
CSIS Introduction to Oracle The Entity Relationship Model (ERM) Relationships A relationship is an association between two or more entities Each relationship has an inverse relationship Participation or optionality refers to whether each entity instance must occur in the relationship (i.e., is it a mandatory relationship) The degree of a relationship is the number of participating entity types Day 1

13 CSIS 252 - Introduction to Oracle
Cardinality Cardinality is the maximum number of occurrences of each entity type that can occur in a relationship In binary relationships: A 1-to-1 relationship occurs when an entity of one type can occur in (at most) one relationship with an entity of the other type A 1-to-many relationship occurs when an entity of one type can occur in (at most) one relationship with the other type, but entities or the second type can be related to any number of entities of the first type. A many-to-many relationship occurs when no restrictions exist on the number of entities that can participate in a relationship Day 1

14 Relationships ER Diagrams
CSIS Introduction to Oracle Relationships ER Diagrams In ERDs, entities that are related are connected by lines. (A 1-to-1 relationship is shown below.) SOCIAL SECURITY NUMBER PALOMAR STUDENT ID Day 1

15 Relationships ER Diagrams
CSIS Introduction to Oracle Relationships ER Diagrams Crow’s feet are used at the “many” end in 1-to-many relationships. has had as Head of State COUNTRY RULER Day 1

16 Relationships ER Diagrams
CSIS Introduction to Oracle Relationships ER Diagrams Both sides of the line will have crow’s feet in a many-to-many relationship. CAR MODEL is available using COLOR GROUP Day 1

17 Relationships ER Diagrams
CSIS Introduction to Oracle Relationships ER Diagrams A small circle is placed at the end of an optional participation, and a small perpendicular line placed at the end of a mandatory participation. is biological mother of WOMAN CHILDREN Day 1

18 Relationships ER Diagrams
CSIS Introduction to Oracle Relationships ER Diagrams Subtype entities reference their supertypes using arrows, rather than lines. LICENSED VEHICLE CAR TRUCK BIKE Day 1

19 Relationships ER Diagrams
CSIS Introduction to Oracle Relationships ER Diagrams All entity occurrences must fall into one of the subtypes We add an “other” category to include RV’s, planes, motorcycles, etc. LICENSED VEHICLE OTHER CAR TRUCK BIKE Day 1

20 CSIS 252 - Introduction to Oracle
ER Diagrams Relationships are (optionally) shown in diamonds connected to the associated entities meet in Super Bowl NATIONAL LEAGUE CHAMP AMERICAN LEAGUE CHAMP Day 1

21 Reflexive (Recursive) Relationships
CSIS Introduction to Oracle Reflexive (Recursive) Relationships Occur when an entity has a relationship with another entity in the same entity set We might need to add business rules prohibiting certain recursive conditions If participation is mandatory, then the relationship is circular If the relationship is hierarchical, then participation is optional Day 1

22 CSIS 252 - Introduction to Oracle
ER Diagrams Reflexive relationships are drawn with a single entity box is married to PERSON Day 1

23 Entity Life History Diagrams
CSIS Introduction to Oracle Entity Life History Diagrams Entity-Relationship Diagrams describe the data in our system, but have no sense of order or sequence Functional hierarchies or specifications describe processes Entity Life History Diagrams (ELH) pull the two together for each entity They are also commonly known as State Transition Diagrams, as entities pass from creation to their final states (archived, deleted, distributed, etc.) Day 1

24 Generic Entity Life History Diagram
CSIS Introduction to Oracle Generic Entity Life History Diagram Entity Creation Transactions Deletion or Archive Event 1 Event 2 Event 3 * Event A Event B o o Day 1

25 Entity Life History Notes
CSIS Introduction to Oracle Entity Life History Notes The single entity being examined appears at the top of the diagram The rest of the diagram is comprised of events, which create, modify, or delete instances of the entity A little ‘o’ in the upper-right corner of an event means “option” or selection An asterisk ‘*’ in the upper-right corner means “iteration” or repetition Basic flow of diagram is left-to-right Day 1

26 Entity Life History Example
CSIS Introduction to Oracle Entity Life History Example Payroll Check 2 years pass Job Cards Transferred Processing Archive Reviews Made Hours Summarized Calculations Performed * Check Printed Approved Rejected o o Day 1

27 CSIS 252 - Introduction to Oracle
Data Flow Diagrams Are used to uncover as many data elements as possible in our data dictionary Document the system from the data’s viewpoint (i.e., are data-centric) Contain several entities on each diagram (unlike Entity Life History Diagrams) Differentiate manual from automated processes Show both external and internal processes Day 1

28 Data Flow Diagram Example Purchase Requisition Fulfillment
CSIS Introduction to Oracle Data Flow Diagram Example Purchase Requisition Fulfillment EMPLOYEE D1 Inventory confirm place req. D2 Accts Payable update stock issue req. P1 match to invoice receive item P3 review & approve ship item BUYER issue P.O. SUPPLIER P2 create order send to Day 1

29 Data Flow Diagram Notes
CSIS Introduction to Oracle Data Flow Diagram Notes Rectangles represent entities Open-ended rectangles represent databases or data stores, and are labeled by a small box on their left Rounded rectangles represent processes, with the top part of the rectangle having a process number Arrows represent data flows (either electronic or physical) Flow is generally from left-to-right Entities may appear more than once in the diagram to preserve the flow and directional nature Day 1

30 Data Flow Diagram Rules
CSIS Introduction to Oracle Data Flow Diagram Rules All processes must have at least one flow of data coming in and one going out All processes on the diagram should modify the incoming data and create new forms of outgoing data Each data store and each external entity must be involved with at least one data flow Day 1

31 Relational Databases (Review)
CSIS Introduction to Oracle Relational Databases (Review) In relational databases, all data is stored in tables, which correspond roughly to entities Each table is two-dimensional, consisting of rows and columns Each row in a table, called a t-uple, corresponds to an occurrence of the entity Columns in each table contain similar data across all rows in the table Day 1

32 Relational Database Example
CSIS Introduction to Oracle Relational Database Example The following table is an example of a relational table describing classes that students have taken at a mythical college used in the rest of this lesson Student Student Course Id Name Id Course Name Grade Term Teacher Joe Adams CSIS-840 VB Concepts C Spr-02 Wilkins Joe Adams CSIS-824 Intro to C++ B Fal-02 Smythe Joe Adams CSIS-740 Oracle Admin A Spr-03 Wallace Jane Smith CSIS-941 Systems Des. B Fal-02 Evans Jane Smith CSIS-840 VB Concepts B Spr-02 Wolkins Ida Know CSIS-184 Networks A Sum-03 Farmer Eunice Eye CSIS-824 PowerPoint W Spr-02 Simpson Day 1

33 Relational Database Example
CSIS Introduction to Oracle Relational Database Example Each row (or t-uple) in the table describes a Class taken by a Student in a term at our college The data in each column is consistent throughout the table However, there are three inconsistencies in the table itself. Can you find them? Day 1

34 CSIS 252 - Introduction to Oracle
Primary Keys (Review) Each row in a table has a primary key, which is the column or set of columns identified to our DBMS that uniquely identifies it from every other row in the table No attribute value in a primary key can be NULL A table can have only one primary key If a primary key is not specified, Oracle supplies one What would be the primary key for our sample database? Day 1

35 CSIS 252 - Introduction to Oracle
Foreign Keys (Review) An attribute (or group of attributes) in a table can also be a foreign key, meaning that it references the primary key (or at least unique attribute) to another table An example would be a Customer Id attribute on an invoice header, which would reference the customer account information for that invoice Day 1


Download ppt "CSIS 254 Oracle Database Design"

Similar presentations


Ads by Google