Please enable JavaScript.
Coggle requires JavaScript to display documents.
Entities and Relationships (Entities and their Attributes (Identifying…
Entities and Relationships
Most DBMS support only one data model, which results in when you choose a DBMS you choose your data model
Entities and their Attributes
Identifying entities is where most database designs start
An entity is what we store data about
Entities have data that describes them. these are attributes
When entities are represented in a database, the attributes are only stored
Entity Identifiers
The purpose of putting the data that describes an entity into a database is to retrieve the data later
To make sure that there is a way to distinguish one entity from another, each entity will have some attribute values that will distinguish it from other instances of the entity in the database
When an instance of an entity is stored in a database, the DBMS must ensure that the new instance has a unique identifier
Single Valued verses multi valued attributes
Attributes in the data model must be single valued to allow for a relational database to be created
An existing piece of data such as a phone number if there is more than one phone number it will turn that attribute into a multi valued attribute
An entity in a relational database cannot have multi valued attributes
The problem with multi valued attributes is that it causes problems with the meaning of the data in the database and will significantly slow down searching and place restrictions on the amount of data that can be stored
Avoiding collections of entities
Some data cannot stand as an entity and therefore must be represented as a collection of instances of a entity
When documenting data relationships such as drawing an ERD, the types of relationships are shown among the entity
Unless it is specified that a relationship is mandatory there is no requirement that every instance of every entity to be involved with every documented relationship
Documenting entities and their attributes
Entity relationship diagrams (ERD) provides a way to document the entities in the database, as well as the attributes that describe them
There are three major methods such as Chen model, Information Engineering (IE), Unified Modelling Language (UML)
UML is specifically intended for the object oriented environment
Domains
Every attribute has a domain which is an expression of the permissible values for that attribute
DBMS enforces a domain through a domain constraint
Domains allow us to be assured that we are getting data of the right type
Documenting Domains
Domains are usually stored in a data dictionary
There is no specific syntax for indicating domains
Practical domain choices
Most relational DBMS that use SQL as the query language provides a data type of which can be assigned as a domain to an attribute
Basic data relationships
There are 3 types of relationships, One to one, One to many, Many to many
Types of relationships
One to One relationship
One to Many relationship
Many to Many relationship