# data[].attributes.body
The other class is bad

# data[].attributes.body
ER Diagram Example

# data[].attributes.body
ENTITY RELATIONSHIP MODELLING

ER models contain entity aspects set on specific topics defined by the target of the ER model.
Dedicated links between the entity aspects can be used to sort those items. Aspects and subtle differences
can be better distinguished by a ER diagrams. These were originally defined by  notation. It visualizes links
And relationships between aspects in the diagram. It is also generally used in computing in regard to the
Organization of data within databases or information systems.

# data[].attributes.headline
Many attributes make up an entity. Attributes describe the facts, details and characteristics of an entity

# data[].attributes.subject
Many attributes make up an entity. Attributes describe the facts, details and characteristics of an entity

# data[].attributes.body
For example, if an entity is a car then an attribute for it would be the colour of the car.

By Sam

# data[].attributes.body
An entity is a single category about which data can be captured or stored. All things aren't entities—only those about which information should be captured.

Information about an entity is captured in the form of attributes and/or relationships. In databases, entities are the subjects whose attributes are stored as records.

Database entities appear in a data model as a box with a title. The title is the name of the entity.

An entity in a data model

If something is a candidate for being an entity and it has no attributes or relationships, it isn't an entity.

An example of a database table includes:
- A customer table
- An appointments table
- An exam sessions table
- A teachers' names table
- A concert venue table

# data[].attributes.body
Entities in a database can be related in more than one way. A one to one relationship means that one record in table 1 will correspond to one record in table 2. A one to many relationship means that one record in table 1 can be referenced by more than one record in table 2. Many to many relationships should be avoided as they make inefficient use of the database capabilities and are hard to work with.

These relationships can be represented in diagrams. [A]---[B] represents A and B in a one to one relationship.
[A]--<[B] represents a one to many relationship.
[A]>-<[B] represents a many to many relationship which is bad.

Many to many relationships can be resolved by introducing a link table - a third table that contains links to records in both the original tables.

# data[].attributes.body
A spreadsheet application such as Excel can be used as a flat file database also.
Because of its simple structure, it takes up less space than structured file but the information in the file can only be read, stored and sent.

# data[].attributes.body
A key in a table that refers to a key in another table. This key being referred to is often the primary key.

Name could be the primary key in one table, and in another table Name could exist as a foreign key which refers to the first table.

# data[].attributes.body
An entity is a uniquely identifiable characteristic about which data is stored in a database.

Database entities appear in a data model as a box with a title. The title is the name of the entity.

An entity in a data model

To be  considered an Entity it must have attributes and/or relationships.

# data[].attributes.body
Every entity has a number of attributes. An attribute is a single field of information, which data can be collected about. For instance, attributes of a car tuple could include things like make, model, engine size. Every item in a database can be defined by its entities, for instance the primary key; the unique identifier of an entity in a database, is simply just a unique attribute which is used to make sure there are no conflicting database entries, or outdated versions as well. For example, the unique attribute of a student would be their Student ID number.

Another way to describe attributes is with tables. The column of a table would be the attribute, and the value in the cell of an entity row would be the value for the attribute

A tuple is an organised list of data and its attributes, that cannot be edited once initialised. It is used frequently for databases because it prevents the database being changed without authorisation.

# data[].attributes.body
A primary key is a special relational database table column (or combination of columns) designated to uniquely identify all table records.

A primary key must contain a unique value for each row of data and cannot contain null values.

For example, the people in a town might be uniquely identified according to their driver license numbers in one application, but in another situation it might be more convenient to identify them according to their telephone numbers.

Example: a database must hold all of the data stored by a commercial bank. Two of the database tables include the CUSTOMER_MASTER, which stores basic and static customer data (e.g., name, date of birth, address and Social Security number, etc.) and the ACCOUNTS_MASTER, which stores various bank account data (e.g., account creation date, account type, withdrawal limits or corresponding account information, etc.).

To uniquely identify customers, a column or combination of columns is selected to guarantee that two customers never have the same unique value. Thus, certain columns are immediately eliminated, e.g., surname and date of birth. A good primary key candidate is the column that is designated to hold unique and government-assigned Social Security numbers. However, some account holders (e.g., children) may not have Social Security numbers, and this column’s candidacy is eliminated. The next logical option is to use a combination of columns such as the surname to the date of birth to the email address, resulting in a long and cumbersome primary key.

The account number associated with each CUSTOMER_ID allows for the secure handling of customer complaints or queries and also demonstrates why primary keys offer the fastest method of data searching within tables. For example, a customer may be asked to provide his surname when conducting a bank query. A common surname (e.g., Smith) query is likely to return multiple results. When querying data, utilizing the primary key uniqueness feature guarantees one result.

# data[].attributes.body
How does Entity Relationship Modeling work?
All databases are used to store information but there are many ways that this information can be
represented. It can either be represented in a flat file or a as a linked database.
A linked database is one that references data in other tables in its table.
Most of the time this is used to to reduce data redundancy, data that is repeated this is an issue
because if the data is updated in one place it is not updated in all tables that data is used in.
Entity Relationship Modeling is the way that we link these tables by referencing other tables and how we make this efficient and robust.

# data[].attributes.body
A flat file database is the most simple form of a database, a file containing records with no structure. The databse will contain only files, no subdirectories. The information has no links to other tables and will usually be a plain text file, the fields only seperated by spacing or punctuation for example as a .csv file. A flat file database uses only one file at a time

Due to its simplicity it does not require much memory to read, however it cannot be searched and as such becomes more inefficent the more information is added.

# data[].attributes.body
A table can have more than one choice of a field for a primary key, these are called candidate keys and they must fit the following conditions…

They must have unique data

Must not contain null values

Contain the minimum number of fields to maintain uniqueness

Uniquely identify records in a table

The candidate keys that weren’t chosen to be a primary key can work as a secondary key in the table. Secondary keys are used for making quick searches in the table.

# data[].attributes.body
Referential integrity means that you cannot have conflicting data in two linked tables if you have a foreign key in a table deleting one entry will delete it in the linked table

Changes made to the primary key must be done to the foreign key

# data[].attributes.body
The structure of a database. It defines the tables, the fields in each table and the relationships between them.