introduction
DESCRIPTION
Module 2:1. Introduction. Describing a Family Tree. - PowerPoint PPT PresentationTRANSCRIPT
INTRODUCTION
Module 2:1
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
• Both my great grandparents had 2 children each. My Father had 4 siblings with 3 children each. My Mother had 3 siblings with 2 children each. My Father had 2 other Cousins with 2 children each. My Mother had 2 cousins with 3 children each. We are 5 in my family
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
• How many 1st degree cousins do I have? 2nd degree? How many cousins do we have in the whole clan? Great grand children?
• Given that all my titos and titas will give my 500 for christmas, how many will I receive by the 26th?
• How many are we all in all?
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
• Solve for all cousins:Father Side
Father siblings = 4 x 3 children each = 12Father cousin = 2 x 2 children each = 4Father side = Father sibling + Father cousinFather side = 16 children
Mother SideMother sibling = 3 x 2 children each = 6 Mother cousin = 2 x 3 children each = 6Mother side = Mother sibling + Mother cousinMother side = 12
Cousins = Motherside + Fatherside = 16+12 = 28
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
• Solve for all greatgrandchildren:Since Father Side = 16 and Mother Side =12And FatherMotherchildren = 5 childrenFS+MS+FMC= 16+12+5 = 33
• Solve for Titostitas:Fatherside:
Let FGGParents = (FGParentsA + FGParentsB) x 2FGParentsA= 2 ; FGParentsB = 4FGGParents = (2+4)2 = 12
MothersideMGGParents = (MGParentsA + MGParentsB) x 2MGParentsA= 2 ; FGParentsB = 3MGGParents = (2+3)2= 10
Christmas_Aguinaldo=(Motherside+Fatherside)xP500Christmas_aguinaldo=(10+12)x500=(22)xP500)=11,000
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
• How many are we all in allSince all siblings = 33Titos and Titas = 22Grandparents = 2 x 2 = 4 x 2 = 8Great grand parents = 2 x 2 = 4Parents = 2
• Allinall=33+22+8+4+2= 69
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
• Data models…Relatively simple representationsUsually graphicalOf a more complex real-world data structure
• …supported by powerful database design tools have made it possible to substantially diminish the errors of database design.
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
• help understand the complexities of a real-world object or event
• It represents data structures and their:
CharacteristicsRelationsConstrainsTransformations
BUILDING BLOCKS OF DATA MODELS
Module 2:1
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
• 1950s and early 1960s:Data processing using magnetic tapes for storage
Tapes provide only sequential accessPunched cards for input
• Late 1960s and 1970s:Hard disks allow direct access to dataNetwork and hierarchical data models in widespread useTed Codd defines the relational data model
Would win the ACM Turing Award for this workIBM Research begins System R prototypeUC Berkeley begins Ingres prototype
High-performance (for the era) transaction processing
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
• 1980s:Research relational prototypes evolve into commercial systems
SQL becomes industry standardParallel and distributed database systemsObject-oriented database systems
• 1990s:Large decision support and data-mining applicationsLarge multi-terabyte data warehousesEmergence of Web commerce
• 2000s:XML and XQuery standardsAutomated database administrationIncreasing use of highly parallel database systemsWeb-scale distributed data storage systems
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
• A collection of tools for describing
Data entitiesData attributesData relationshipsData constraints
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
• Anything! Person, Place or thing, or events which data are to be collected and stored
• An entity represents a particular type of object in a real world
Physical objectscustomersProducts
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
• Characteristics of an entity
• Example: the Attributes of a Customer are:
FirstnameLastnameCourseYear
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
• Association among entities• Example:
The relationship between customers and an agent
• Types of RelationshipOne to Many (1:M) relationshipMany to Many (M:N) relationshipOne to One (1:1) relationship
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
• 1:Many (1:M)Store Employees
• Many:Many (M:N)Employees Skills
• 1:1 (1:1)Employee Store
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
• Models an enterprise as a collection of entities and relationships
Entity: a “thing” or “object” in the enterprise that is distinguishable from other objects
Described by a set of attributesRelationship: an association among several entities
• Represented diagrammatically by an entity-relationship diagram:
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
Painter
paints
Painting
Employee
learns
skills
Employee
manages
store
1 1
1M
M
N
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
• Example of tabular data in the relational model
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
• Restrictions placed on the data
• This ensures data integrity• Usually in a form of rulews• Examples
QPI: Not less than 0.00 not more than 4.00A class should only have a maximum of 45 studentsA teacher should only have 21 units or 7 subjectsAn uyab should have one and only one uyab.
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
• Physical level: describes how a record (e.g., customer) is stored.
• Logical level: describes data stored in database, and the relationships among the data.
type customer = recordcustomer_id : string; customer_name : string;customer_street : string;customer_city : string;
end;
• View level: application programs hide details of data types. Views can also hide information (such as an employee’s salary) for security purposes.
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
• An architecture for a database system
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
BUSINESS RULES
Module 2:1
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
• Before database designers start designing databases (entities, attributes and relationships), they understand first the business rules.
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
• A business rule isBriefPreciseAnd unambiguous
• Description of PoliciesProceduresAnd principles
• Of a specific organization
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
• Business rules help to create and enforce action within that organization’s environment
• It is rendered in writing and updated to reflect any changes in the organization’s operational environment
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
• A customer may generate many invoices
• An invoice is generated by one customer
• A training session cannot be scheduled for fewer that 10 employees or for more than 30 employees.
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
• A customer may generate many invoices(1:M relationship)
• An invoice is generated by one customer(1:M relationship)
• A training session cannot be scheduled for fewer that 10 employees or for more than 30 employees.(1:M relationship with a constrain)
TRANSLATING BUSINESS RULES INTO DATA MODEL COMPONENTS
Module 2:1
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
• What are the Business Rules? Site all of it.
• In every business rule, look for its entities and attributes
• Are there relationships from it?
• From the business rules, identify possible constrains.
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
• Enrolling a Subject IM32Business Rules
A class should have a maximum of 45 studentsA student can’t enroll twice on a class on the same semester.There should be one teacher per class.Only 3rd and 4th year IM students are allowed to enroll in the class
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
• Enrolling a Subject IM32Entities
ClassStudentTeacher
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
• Enrolling a Subject IM32Attributes
Class Seats, Subject Code,Subject Description,Schedule
StudentName, year, course
TeacherName, Subject, Schedule
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
• Enrolling a Subject IM32Constrains
Class not exceed 45 studentsTeacher not exceed 45 students
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
• Enrolling a Subject IM32Relationships
Class1 Class 1 Teacher1 Class 45 students
Student1 Student 1 Class
Teacher1 Teacher Many students1 Teacher 1 Class1 Teacher 1 Class schedule
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
Class
enrols
student
Teacher
teaches
skills
Teacher
handles
Class
1 1
1M
M
N
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
SUMMARY
Module 2:1
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
• Data Model is a (relatively) simple abstraction of complex real-world data environment. Database designers ause data models to communicate with application programmers and end users.
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
• Basic data-modeling components are entities, attributes , relationships and constrains
Introduction
Data Model Building Blocks
Business Rules
Translating Business Rules to Data Models
Summary
• Business rules are used to identify and define the basic modeling components within a specific real-world environment
END
Module 2:1