When or something in a table, for example

When tables are linked together, if a primary key is found in
another table, it is classed as a foreign key. Referential integrity keeps the
relationships between tables that are linked consistent. For instance, if you
have two tables (booking table, payment table) and assign passenger IDs
(primary keys) to both tables, referential integrity ensures all records
between those two tables correspond. If a user tries to add any records in the
foreign key, it won’t work as it already contains a corresponding record. If
you delete any records in the booking or payment tables, because they are
linked, referential integrity will make sure to update it in the linked tables.
If tables are linked, and there’s a foreign key, referential integrity does not
allow the deletion of records from the primary key, only if its records are already
being used in another table that it is linked to. For example, in a table that
has details of flights, you cannot delete a flight ID since its linked to other
tables such as a booking table and other passengers that have booked that flight.

Primary keys are unique sets of numbers that are used to
identify someone or something in a table, for example in a database, primary
keys will be given to everyone on the table so that they can all be identified
when used in other tables. For example, in retail, when you order an item at
Argos, you would have to list the item number (which would be the primary key)
to the staff at the till; they will then check the number to see if the item is
in stock so that you are able to purchase it. Without the primary key they
would have to search a long list of names through their database just to find
the item, which could take hours, therefore by having primary keys it speeds up
the process of being able to find items in a store. When building relationships
between tables, for example in a one-to-many relationship, in the primary key
table, it would contain one record that links to either many records in the
table, one or even no records in the tables it is linked to. For example, in a
one-to-many relationship, if a customer has booked a flight, the primary key
containing their record would link to a booking table, and a flight table and a
payment table.

We Will Write a Custom Essay Specifically
For You For Only $13.90/page!


order now
x

Hi!
I'm James!

Would you like to get a custom essay? How about receiving a customized one?

Check it out