Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Data design terms

The following data design terminology are applied to information system

 Data structure it’s a framework for organizing, storing, and managing


data. Data structures consist of files or tables that interact in various
ways
 Entity is a person, place, thing, or event for which data is collected
and maintained
 Table it’s a data structure that contains a set of related records that
store data about a specific entity
 Field also called an attribute, is a single characteristic or fact about an
entity
 Record also called a tuple, is a set of related fields that describe one
instance or occurrence of an entity
 Key field. Data base uses tables to organize information. In order to
maintain data integrity, we use concepts of keys.

They are four types of keys:

 Primary key it’s a field or combination of fields that uniquely &


minimally identify a particular member/instance of an entity. A
primary key may be based on a single field or a combination of fields.
If it’s the latter case, the primary key may also be called a composite
key or a concatenated key, or a multivalued key
 Candidate key it’s any field that may be used as a primary key. A
field that is neither a primary key nor candidate key is called a non-key
field. NOTE that not any field can qualify to be a primary key.
 Foreign key it’s a field in one table that must match a primary key
value in another table. A foreign key links the two tables thus
establishing a relationship. Unlike a primary key, a foreign key need
not be unique. But may form part of unique combination key in a table
 Secondary key is a field or a combination of fields that can be used to
access or retrieve records. Secondary key values are not necessarily
unique. A secondary key is useful when you don’t know the primary
key and by using it you can obtain a scaled down list of records from
which you may identify the record(s) you are interested in.

As an example to illustrate the concept of keys, consider three tables


linked together in a relational database
STUDENT, GRADE and COURSE
The STUDENT table contain student personal details and the courses he
does
The GRADE table contain grade obtained by the student in the various
courses
The COURSE table contain the different courses
I will summarize each table by providing a few possible fields in each
table

STUDENT {Student ID, Student first name, Student surname, Course


ID}
COURSE {Course ID, Description}
GRADE {Student ID, Course ID, Grade}

In the STUDENT table we can summarise the various keys as follows:


Candidate key are; Student ID, or combination of
Student first name + Student surname
Primary key; Student ID this is unique for each student
Foreign key: Course ID because this is a primary key in COURSE
table
Secondary Key; Student first name + Student surname
a combination of these two fields can be used to retrieve information on a
student. However take note that it may be possible to have two students
with exactly the same first name and Surname so it may not be unique

In the COURSE table we can summarise the various key fields as follows
Similar explanation I have used for the STUDENT table does apply
Candidate key: Course ID
Primary key: Course ID
Foreign key: NONE
Secondary Key: None
In the GRADE table we can summarise the various keys as follows
Candidate key: combination of Student ID;Course ID
Primary key : combination of Student ID; Course ID
Foreign key: Student ID and Course ID. Note these are primary keys in
their respective tables.

 Referential integrity. It’s a type of validity check. Validity checks


help avoid data input errors.
Referential integrity is a set of rules built into the system that
avoids data inconsistency and quality problems.
In a relational database, referential integrity means that a foreign
key value cannot be entered in one table unless it matches an
existing primary key in another table

You might also like