Presentation is loading. Please wait.

Presentation is loading. Please wait.

Relational DB Components

Similar presentations


Presentation on theme: "Relational DB Components"— Presentation transcript:

1 Relational DB Components
MMG 508

2 Conceptual DB Design Components
To get started, look at the Conceptual Database Diagram on page 26 of the text, and on the next slide. Components Entities Attributes Relationships

3 Movie Rental Conceptual Design

4 Relationship Types One-to-One Relationships
The generic definition of 1:1 relationships is: This is an association where an instance of one entity can be associated with at most one instance of the other entity and vice versa These are rare and anomalies These are normally corrected by combining the entities Figure 2-2 on page 29 applies

5 One-to-One Conditional
Figure on next slide shows a different “flavor” of one-to-one relationship that is optional (some say conditional) in both directions The dealership issues automobiles to some employees, typically sales staff, for them to drive for a finite period. We can read the relationship between the Employee and Automobile entities as follows: “At any point in time, each employee can have zero or one automobiles issued to him or her, and each automobile can be assigned to zero or one employee.” Note the clause “At any point in time.” If an automobile is taken back from one employee and then reassigned to another, this would still be a one-to-one relationship, albeit a transferable one. This is because when we consider relationships, we always think in terms of a snapshot taken at an arbitrary point in time.

6 One-to-One Conditional (Cont’d)

7 Relationship Types (Cont’d)
One-to-Many relationships (1:m) Basic definition states that the 1:m relationship is an association between two entities where any instance of the first entity may be associated with one or more instances of the second and any instance of the second entity may be associated with at most one instance of the first See next slide

8 One-to-Many (1:M) Diagram

9 Relationship Types (Cont’d)
Many-to-Many Relationships (n:m) Defined as an association between two entities where any instance of the first entity may be associated with zero, one, or more instances of the second and vice versa. Look at Figure 2-1, p. 26 (and next slide) Most common relationship

10 Many-to-Many (M:N) Relationship

11 Relationship Types (Cont’d)
Recursive Relationships Can be 1:1; 1:n, n:m relationships Are relationships within one entity See Figure 2-4 p. 32

12 Business Rules These are policies mandated by the organization
Look at Figure 2-1 on page 26 This Business Rule states that “Customers with overdue amounts may not book new orders” Can be manually enforced Can be enforced via program coding

13 Tables This is the primary unit of storage for any RDBMS and is two dimensional Relational tables are logical storage structures and usually do not exist in tabular form in the physical layer Tables have unique names assigned by the DBA See Figure 2-5 on page 34

14 Table Attributes Table attributes are: Columns Data types Constraints
Primary Key constraints Referential constraints e.g. foreign keys Intersection Tables (p. 42)

15 Integrity Constraints
NOT NULL constraints Essentially, not null is used where a specific column cannot be blank CHECK constraints Used for value validation in columns See p. 44 for example – also Figure 2-11

16 Views A View is a virtual table
This is a logical table which give a user access to specific columns in a table or tables MS Access view illustrated on p. 46, Figure 2-12


Download ppt "Relational DB Components"

Similar presentations


Ads by Google