Assignment 1
Assignment 1
Lab Assignment 1
Wolfgang C. Strack
Student ID#: ****7355
Due date: 3 July 2015
Date handed in: 3 July 2015
An entity is something that can be classified as a single object and that object can
be a person, place, or anything that which data about it can be classified and
stored. An entity is usually defined in a database as a table. The entity’s classified
characteristics, which are more commonly referred to as attributes, represent
columns in a table. Finally, the rows in a table represent separate, unique records
that all fall under that specific entity.
2. What are primary and foreign keys? Explain in detail. What are the
implications of using these keys in different tables?
Primary keys are represented in tables as a field or group of fields that are not null
and uniquely identify all individual records within that table, by definition. For
example, a primary key can be classified in an entity such as a student such that
the primary key would be every student’s unique student ID. Since all students have
a different, unique student ID, it can be considered a primary key if we let “student”
be the entity in our database. A foreign key on the other hand can be considered a
secondary key. To be exact, what makes a foreign key “foreign” is that it comes from
a different table from the table it is stored in. These two tables, the table in which
the key is considered foreign and the table from which the key comes from, share
some sort of relationship that allows for them to share unique keys that correspond
to their records. The implications of using these keys in different tables is, just as
mentioned before, that there is a relationship between the records in the different
tables which share keys. By sharing the foreign key, that table can share
information to the other table that is using the foreign key.
The three rules of normalization, otherwise known as the three normal forms in
structuring a table, are:
1. there must be no repeating of the same attribute or group of attributes in a
row,
2. after qualifying for the first normal form, data in the table must be wholly
dependent on the primary key’s value such that the unnecessary duplication
of data in individual rows can be avoided,
3. and after qualifying for the first two normal forms, the third normal form
requires that data in each column, besides keys, must not be interdependent
such that the data could already be defined somewhere else or can just be
calculated from existing values.