transit to design and create a solution
|
4 types of entity
|
|
|
Event
|
|
|
Person
|
|
|
Location
|
|
|
Thing
|
|
Three types of relationship
|
|
|
One to one
|
1:1
|
|
One to many
|
1:N
|
|
Many to one
|
M:1
|
|
Many to many can not be done in a database and will need to be solved
|
M:N
|
|
Cardinality
|
Number of elements of each side of the relationship
|
|
Solving M:N
|
|
|
Many to many means that a number of records in one table belongs to a number of records in another table
|
|
|
1. Remove these records and place them into their own table (associative entity)
|
|
|
2. The relationship between the existing entities and the new entity will be 'one to many'
|
|
|
Attributes
|
Entity fields are called attributes. Aka metadata
|
|
Tables are entities, rows are tuples, and columns are attributes
|
|
|
Each value in the tuple must be of some basic type, like a string or an integer
|
|
|
Attribute domain is the set of values allowed in an attribute.
|
|
|
Helps with data integrity, by insuring the value entered in each field of a table is consistent with its attribute domain
|
|
|
The standard domain types include data values for characters, numerals, currency, dates, times, and Boolean entries (a logical value of either true or false).
|
|
|
http://www.cheatography.com/davechild/cheat-sheets/mysql/ Refer to this cheatsheet with data types for more assistance
|
|
Candidate key
|
|
|
Each key which COULD serve as primary key. Eg: employee # or license #
|
|
|
Candidate keys can never be null
|
|
|
Primary Key
|
|
|
1. Next select a candidate as a Primary Key (X). X Should:
|
|
|
have the minimal set of attributes
|
|
|
be least likely to have its values changed
|
|
|
be least likely to lose uniqueness in the future
|
|
|
All columns in the relation must be dependant on X
|
|
|
Alternate key
|
A candidate key NOT chosen as primary key
|
|
Examine the ER model and if redundancy found, remove from model.
|
|
|
The three activities in this step are
|
|
|
1
|
re-examine one-to-one relationships
|
|
2
|
remove redundant relationships
|
|
3
|
consider the time dimension when assessing redundancy
|
|
ER model represents the data requirements of the organization
|
|
|
Objective is to check that ER model supports the required transactions
|
|
|
Two possible approaches
|
|
|
1
|
Describing the transaction
|
|
2
|
Using transaction pathways
|
I forgot about this cheat sheet. This is going to come back in handy :)
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.