Databases
Collection of info that is organised so that data can be stored, managed, updated and retrieved. Engineers need a visual way to know how all elements are related to each other.
Entity – Rows (Object: person, place or thing)
- Customer
- Order
- Product
In an entity, there are attributes, columns, for example;
- Customer_ID
- Order_number
- Product_ID
Relationships exist between entities to identify how they react to each other if at all.
ERD Cardinality – The relationship within numerical context (minimums, maximums) Ordinality, on the other hand, is the minimum number of times an instance in one entity can be associated with an instance in the related entity.
The diagram can be database ready, import and export. Using the export feature, code is automatically generated for you and exported to the DBMS (Database Management System) that you are using.
Primary Keys
- An attribute or field that uniquely identifies each record in a single table
- 1 primary key per entity
Rules:
- Has to be unique
- Has to be never changing
- Never Null (Value can’t be left blank)
Foreign Key
- Located in a foreign place
- There can be multiple foreign keys in one table/entity
Rules:
- Use the fewest number of attributes possible
- Don’t use attributes that are not to change