Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Relational Database Model & The Database Development Process

Similar presentations


Presentation on theme: "The Relational Database Model & The Database Development Process"— Presentation transcript:

1 The Relational Database Model & The Database Development Process
The little reed, bending to the force of the wind, soon stood upright again when the storm had passed over. ~ Aesop ~

2 Learning Objectives Describe the Relational Model
Define relational terms and understand the terminology in practice. Understand these relational terms through practice Explain the System Development Life Cycle (SDLC) Explain the Database Life Cycle (DBLC)

3 Fundamental Axioms of DBMSs
Users communicate with computer applications (websites, etc) Computer applications communicate with DBMSs. Users do not communicate with DBMSs directly. As a result DBMSs although they can be used interactively, are not used interactively. A DBMS is not a replacement for sound database design principles.

4 The Relational Database Model
Many DBMS applications implement the Relational Model, but none of them enforce it. This permits rookie database designers to shoot themselves in the foot. And many have (including yours truly). The Relational Model has: (Codd’s 3 rules) 1)Data Independence Clear separation between data and metadata 2) Data Consistency Minimal redundancy; the data adopts the “DRY” principle 3) Easy to use You don’t have to understand the implementation to use it.

5 You can build a poorly-designed DB in a DBMS
Do you see problems with this database design? Think Codd: Independence? Consistency? Ease-of-Use? Change Sally Jones’s phone #? How many ‘Software’ in the database? Add New Employee Bob Smith? Delete Dave Smith (no longer works here)

6 Activity: Relational Terminology
Identify Each of These : Table Relation Row Column Tuple Attribute Physical Domain Logical Domain

7 DBMS : Physical Domain Different “flavors” of DBMSs use different data types.

8 DBMS: Logical Domain Default Value – a value entered into an attribute for a row when one isn’t specified. Check Constraint – an expression which must be evaluated prior to the insertion of a row. Eg. Employee_hourly_wage >= 0 Unique Constraint – ensures duplicate values are not inserted into a column. (Secondary Keys should have unique constraints) Lookup table – a separate table containing all of the acceptable values for a given column, typically varchar (Think drop down list) The column you’re trying to constrain is a FK to the lookup table.

9 Example: Lookup Table CategoryID Book Hardware Software Foreign Key

10 Activity: The Relational Table
Relation name? Attributes? Does any column uniquely identify a row? Physical Domain? Logical Domain? Relation Name? Attributes? Physical Domain of Columns? Logical Domain of Columns? Candidate Keys?

11 Activity: Find the keys
Candidate? Primary? Secondary? Foreign? Surrogate? What would be the candidates for super, candidate, primary, secondary, and foreign keys in the above example?

12 Rule for joining tables
One more time. Tables Rule for joining tables Columns: Phys. Domain. Log Domain? Null? Keys: Candidate? Primary? Foreign, Surrogate, Secondary?

13 Activity: Which of these is a good PK?
Candidate keys? Best primary key? Why? Should a Surrogate key be used?

14 The Natural Join at Work

15 Activity: Where’s the Integrity?
Which of the 4 tables exhibit Entity Integrity? Which of the 3 relationships exhibit Referential Integrity? Answers: Entity Integrity = Tables B, C Referential Integrity = Relationships A=>B, B=>D

16 Example: Implementation of a 1-M Relationship

17 Example: Implementation of a M-N Relationship
This M-M Relationship has been resolved into two 1-M relationships

18 Example:Null and Flags
Nulls typically cause problems in Varchar and Numeric, and bit fields 103 and 105 are null for different reasons! Null makes sense for this column Flags used to represent different status

19 Data Models: Abstraction Levels
Conceptual Highly Abstract Hardware and Software Independent Logical Somewhat Abstract Hardware Independent Software Dependent Internal External Not Abstract (Concrete) Hardware and Software Dependent Physical

20 Systems Development Lifecycle
I Planning II Analysis III Design IV Implementation V Maintenance & Support Time Resources Conceptual Model Logical Model Internal / External Model SDLC / DBLC Physical Model

21 The Relational Database Model & The Database Development Process
Questions?


Download ppt "The Relational Database Model & The Database Development Process"

Similar presentations


Ads by Google