# data[].attributes.body
Defines the structure of the database - ie the tables, the attributes, the type of attributes, the constraints that must be followed.

# data[].attributes.body
A table is in 1NF if it contains no repeating attributes or groups of attributes and all attributes are atomic

Second Normal Form (2NF)
A table is in 2NF if it is in 1NF and contains no partial dependencies

Third Normal Form (3NF)
A table is in 3NF if it is in 2NF and contains no non-key dependencies

# data[].attributes.headline
Many to many relationship in normalised form

# data[].attributes.subject
Many to many relationship in normalised form

# data[].attributes.headline
This is a many to many relationship in an entity relationship model

# data[].attributes.subject
This is a many to many relationship in an entity relationship model

# data[].attributes.headline
This is a one to many relationship in an entity relationship model

# data[].attributes.subject
This is a one to many relationship in an entity relationship model

# data[].attributes.headline
This is a one to one relationship in an entity relationship model

# data[].attributes.subject
This is a one to one relationship in an entity relationship model

# data[].attributes.body
This is when many items are linked to many other items.

For example many students can take many courses.

Many to many relationships should be avoided, this can be done by normalising the relationship into 1NF.

# data[].attributes.body
Referential integrity is a relational database concept, which states that table relationships must always be consistent. In other words, any foreign key field must agree with the primary key that is referenced by the foreign key.

If you have a relationship between Table A and Table B, and Table B has a foreign key that points to a field in Table A; referential integrity would prevent you from adding a record to Table B that cannot be linked to table A.

Referential integrity also uses 'cascade update' and 'cascade delete'. These ensure changes made to the linked table are reflected in the primary table.This diagram shows why Referential Integrity is used. In this example there is an artist in in one table that does not appear in a linked table, thus referential integrity is lost. Referential integrity would ensure that nothing like this happens.

# data[].attributes.body
This is when there is one entity on both sides of the relationship

For example a single teacher teaches a single subject.

# data[].attributes.body
Holds the location of a record or portion of a record in a database. They are used when a primary key is not enough to distinguish an object as unique in a database.

For example, employee information stored in a database could have the employee's national insurance number or email address as a secondary key.

# data[].attributes.body
This is when there is one entity on one side of the relationship linked to many on the other side.

For example one product can have many suppliers.

# data[].attributes.body
They are used to show data relationships. The model uses foreign keys to implement the relationships.

# data[].attributes.body
In a database an entity is category of something like a place or a person. It is an object that information about it can be stored in the database. an entity is normally a real world object.

For example an entity could be a type of car, with information about the car stored in the database E.G. brand, engine type, insurance, cost, fuel capacity.

Examples of potential entities:
customers, videos, appointments, patients, books, etc.

Not everything can be an entity and any information about an entity is called an attribute (see "Attribute By DAN")

# data[].attributes.body
A flat file database is a database which is stored on as an ordinary unstructured file (E.G, ".txt" file),  It is a standalone table with no relations to other tables and can only be one table of data. To access the data and manipulate it, the file must be read in its entirety into the computer's memory. When finished editing the file/database, the file is again written out in it's entirety to the file system. Basically it loads and saves the whole database all at once. it is called a "flat" database because it has no relationships with records. A file can be a plain text file or a binary one. An example of this would be ".CSV" files.

# data[].attributes.body
An attribute is an aspect of a database which tells you something about the field or database component.

Attributes are used by Database Management software in order to search for the component.

An attribute has a name and a type: text fields such as Surname have a character limit, numeric fields might have the attribute that defines whether numbers are positive, negative or both.

Attributes are usually characteristics of an entity such as the FirstName is a characteristic of a Customer.

# data[].attributes.body
There are 3 degrees of relationship modelling.

One to Many

One to One

Many to Many

# data[].attributes.body
A primary key is a field in a table which is unique to itself so that it allows you to ensure its the only copy in the database.

It ensures that there are not any data redundancies

Data redudancies is when the same piece of information is held in two places at once.

An ID is often used to represent the primary key in a record.

# data[].attributes.body
"A Foreign key is field or a group of fields that provides a "link" between 2 tables in a relationship database, it normally references the primary key that was defined in the parent table. "

A table can have multiple foreign keys.

Each Foreign key can have a different parent table.

In the database above there are three tables:

Artists

Recordings

Genre

The primary key in the Artists table is: ArtistID
The primary key in the Genre table is: GenreID
This is because both of these fields are the unique identifier in their respective tables.

These primary keys link to identically named fields in the Recordings table. Each of those identically named fields are known as a 'foreign key'.