Monday, 24 September 2012

d1


D1

Common Mistakes when Creating a Database

Deletion of Fields: this can happen when someone has direct access to the database and deletes or edits fields by accident. To prevent this from happening the database should be updated and backed up on a regular basis. If the database is updated regularly there should not be a problem with deletion of files. Another way that you can prevent this from happening is to only allow members of staff use a (read only) copy of the data base, this way nothing can be moved around Validation rules:

Validation rules that are put into the database in the creation. They stop bad data being saved in your table.  You can create a rule for a field , or for the table. Use the table's rule to compare fields.

Null Values:   NULL values indicates that the field is unknown. A value of NULL is different from an empty or zero value. No two null values are equal. Comparisons between two null values, or between a NULL and any other value, return unknown because the value of each NULL is unknown.

Incorrect data types: when completing a data entry form there are certain fields in which you can write. These are called input masks the masks can be made to only accept data such as integers, floating point numbers, characters, strings and arrays.

Friday, 21 September 2012

M1

M1


Relational Integrity
Referential integrity is a database concept that ensures that relationships between tables remain consistent. When one table has a foreign key to another table, the concept of referential integrity states that you may not add a record to the table that contains the foreign key unless there is a corresponding record in the linked table. It also includes the techniques known as cascading update and cascading delete, which ensure that changes made to the linked table are reflected in the primary table. 

Primary Keys
The primary key of a relational table uniquely identifies each record in the table. It can either be a normal attribute that is guaranteed to be unique (such as Social Security Number in a table with no more than one record per person) or it can be generated by the DBMS (such as a globally unique identifier, or GUID, in Microsoft SQL Server).

Foreign Keys
 A foreign key is a field in a relational table that matches the primary key column of another table. The foreign key can be used to cross-reference tables. 

Database relationships are similar to relationships in the real world, for instance your parents, siblings and other family are all relations. 

Relationships

One to one relationships; each primary key will relate specifically to one or none record in the table
One to many; This primary key will relate to one, none or more than one records in that table
Many to many; Each key in both tables can relate to more than one or any number of records.