8.3 Database Concepts


Before we proceed to database design, first we need to understand the concepts of database. In ER-Diagram, an entity is a person, thing, place or event for which data is collected and maintained. The relational model is based on a concept of a relation, which is physically represented as a table. In this section, we will explain the terminology and structural concepts of the relational model.

Figure 8-2: A Table STUDENT in a Database



8.3 Database Concepts


8.3.1 Tables or Files

Data is organized into tables or files. In database system, a file is called a table. A file is a set of all occurrences a given record structure. A table is the relational database equivalent of a file. A table or files, contains a set of related records that store data about specific entity. Tables and files are shown as two-dimensional structures that consist of rows and columns. Columns represent a fields, or characteristics of the entity, while row represent a record which it is refer to individual instances. Figure 8-2 shows an example of one table named STUDENT exist in STUDENT REGISTRATION SYSTEM.

8.3.2 Fields

Fields are common for files and databases. A field is a physical implementation of an attribute exists in ER-D. It's the smallest unit of meaningful data to be stored in a file or database. Attributes is represented as a field in a tables. A table consists of more than one attributes. Fields can have values. Figure 8-2 shows an example of fields exist in STUDENT table. These values can be of fixed or variable length; can be alphabetic, numeric, or others depending on setting during the design; refers to domain. A domain is a set of allowable values for one or more than one values. There are four types of fields can be stored :

Primary key - is a field whose value is used to identify one and only one record
Secondary key - is a field that can be used as an alternate key that can be used to identify a single record in a table


8.3 Database Concepts


Foreign key - is a field that can be used as a pointer to the records of a different files or tables in a database
Descriptive field - are a field that stores a business data except all they types of keys above


8.3.3 Records

Fields are organized into records. Records are common to both files and tables. A record is a collection of data that have something in common with the entity. A record, also refer to a tuple; is a set of related fields that describes one instances, or occurrence of an entity. A record may have one or more than one fields, depending on what type of information is needed. Figure 8-2 shows an example of records in STUDENT table.