Tuesday, 25 September 2012
Tuesday, 11 September 2012
M1- Explain referential integrity in a relational database,
describing the purpose of primary
keys and foreign keys.
Referential integrity is a database concept that guarantees relationships between tables remain consistent. To do this you need to have a primary key and a foreign key.
A foreign key is a field in a relational table that matches a primary key column of another table. The foreign key can be used to cross-reference tables. On the other hand the primary key is unique for instance some businesses such as Matalan have card numbers unique to every customer. This is to identify them on their own. As many other ways they can identify them for instance ‘surnames’and‘street name’ several other customers would have the same.
There are different types of relationships including one to one, one to many and many to many.
An example of a one to one could be wife to husband and husband to wife.
An example of one to many could be a mother to her children.
An example of many to many could be many people can comment on a photo on social networking.
Referential integrity is a database concept that guarantees relationships between tables remain consistent. To do this you need to have a primary key and a foreign key.
A foreign key is a field in a relational table that matches a primary key column of another table. The foreign key can be used to cross-reference tables. On the other hand the primary key is unique for instance some businesses such as Matalan have card numbers unique to every customer. This is to identify them on their own. As many other ways they can identify them for instance ‘surnames’and‘street name’ several other customers would have the same.
There are different types of relationships including one to one, one to many and many to many.
An example of a one to one could be wife to husband and husband to wife.
An example of one to many could be a mother to her children.
An example of many to many could be many people can comment on a photo on social networking.
Subscribe to:
Comments (Atom)