4-Advantages of Using DBMS Approach-22-07-2024
4-Advantages of Using DBMS Approach-22-07-2024
In the database approach, the views of different user groups are integrated during
database design. Ideally, we should have a database design that stores each logical
data item—such as a student’s name or birth date—in only one place in the database.
This is known as data normalization, and it ensures consistency and saves storage
space (data normalization is described in Part 6 of the book). However, in practice, it
is sometimes necessary to use controlled redundancy to improve the performance
of queries. For example, we may store Student_name and Course_number redundantly
in a GRADE_REPORT file (Figure 1.6(a)) because whenever we retrieve a
GRADE_REPORT record, we want to retrieve the student name and course number
along with the grade, student number, and section identifier. By placing all the data
together, we do not have to search multiple files to collect this data. This is known as
denormalization. In such cases, the DBMS should have the capability to control this
redundancy in order to prohibit inconsistencies among the files. This may be done by
automatically checking that the Student_name–Student_number values in any
GRADE_REPORT record in Figure 1.6(a) match one of the Name–Student_number val-
ues of a STUDENT record (Figure 1.2). Similarly, the Section_identifier–Course_number
values in GRADE_REPORT can be checked against SECTION records. Such checks can
be specified to the DBMS during database design and automatically enforced by the
DBMS whenever the GRADE_REPORT file is updated. Figure 1.6(b) shows a
GRADE_REPORT record that is inconsistent with the STUDENT file in Figure 1.2; this
kind of error may be entered if the redundancy is not controlled. Can you tell which
part is inconsistent?
GRADE_REPORT
Student_number Student_name Section_identifier Course_number Grade
17 Brown 112 MATH2410 B
(b)
1.6 Advantages of Using the DBMS Approach 19
others are allowed to retrieve and update. Hence, the type of access operation—
retrieval or update—must also be controlled. Typically, users or user groups are
given account numbers protected by passwords, which they can use to gain access to
the database. A DBMS should provide a security and authorization subsystem,
which the DBA uses to create accounts and to specify account restrictions. Then, the
DBMS should enforce these restrictions automatically. Notice that we can apply
similar controls to the DBMS software. For example, only the dba’s staff may be
allowed to use certain privileged software, such as the software for creating new
accounts. Similarly, parametric users may be allowed to access the database only
through the predefined canned transactions developed for their use.
straints. The simplest type of integrity constraint involves specifying a data type for
each data item. For example, in Figure 1.3, we specified that the value of the Class
data item within each STUDENT record must be a one digit integer and that the
value of Name must be a string of no more than 30 alphabetic characters. To restrict
the value of Class between 1 and 5 would be an additional constraint that is not
shown in the current catalog. A more complex type of constraint that frequently
occurs involves specifying that a record in one file must be related to records in
other files. For example, in Figure 1.2, we can specify that every section record must
be related to a course record. This is known as a referential integrity constraint.
Another type of constraint specifies uniqueness on data item values, such as every
course record must have a unique value for Course_number. This is known as a key or
uniqueness constraint. These constraints are derived from the meaning or
semantics of the data and of the miniworld it represents. It is the responsibility of
the database designers to identify integrity constraints during database design.
Some constraints can be specified to the DBMS and automatically enforced. Other
constraints may have to be checked by update programs or at the time of data entry.
For typical large applications, it is customary to call such constraints business rules.
A data item may be entered erroneously and still satisfy the specified integrity con-
straints. For example, if a student receives a grade of ‘A’ but a grade of ‘C’ is entered
in the database, the DBMS cannot discover this error automatically because ‘C’ is a
valid value for the Grade data type. Such data entry errors can only be discovered
manually (when the student receives the grade and complains) and corrected later
by updating the database. However, a grade of ‘Z’ would be rejected automatically
by the DBMS because ‘Z’ is not a valid value for the Grade data type. When we dis-
cuss each data model in subsequent chapters, we will introduce rules that pertain to
that model implicitly. For example, in the Entity-Relationship model in Chapter 7, a
relationship must involve at least two entities. Such rules are inherent rules of the
data model and are automatically assumed to guarantee the validity of the model.