Professional Documents
Culture Documents
IRM 200 - Lecture 2
IRM 200 - Lecture 2
IRM 200 - Lecture 2
MANAGEMENT SYSTEMS
Gilbert Mushi
Department of Information and Records Studies
Database Models
There are three common database model
namely;
• Hierarchical
• Network Database and
• Relational
Database Models…
Hierarchical;
• Organizes data in a tree structure
• Typically a one-to-many relationship between
data entities
Network Databases
• Allow both one-to-many and many-to-many
• relationships between data elements
Most databases today are neither hierarchical or
network models
Database Models…
The Relational Database Model (RDBMS)
• Data is organized in tables related by common
fields
• Most widely used database model today
Database Models…
Steps involved in designing RDBMS;
• Identify the purpose of the database
• Determine the tables and fields
• Assign the fields to a table and reorganize as
needed to
• minimize redundancy (normalization – most
databases stop at 3NF)
• Finalize the structure (primary keys, field
properties,
Database Models…
Creating a Relational Database;
– Creating the Tables
• Each table is created using the table structure
developed during the database design process
• In Access, can use Design view or Datasheet
view
Database Models…
Creating a Relational Database;
– Entering and Editing Data
• New data can be added via a form or
Datasheet view (MS Access)
• In either case, the same data is being
manipulated
• Existing data can be migrated to the new
database
Database Models…
Creating a Relational Database;
– Relating Tables
• Once all tables have been created, they can be
related to one another using their primary
keys
Database Models…
Retrieving Information from a Relational Database
– Querying the DB
• A request to see information from a database that
matches specific criteria
• Every DBMS provides tools users can use to query the
• database for information
• Can also write in structured query language (SQL)
• Must be designed to extract information as efficiently
as possible
• Poorly written queries can impact the overall
performance of the system
Database Models…
In maintaining RDBMS table structures can be
modified when needed, such as;
• Adding new indexes to speed up queries
• Deleting obsolete data
• Upgrading database software, installing patches
• Repairing/restoring data that has become corrupt
• Continuing to evaluate and improve security
MS-Access practical
• Develop a simple database which keeps
details of different library materials. The items
details should include item identity, author
name, date of publication, publisher, place of
publication, item type, subject, and item price
Normalization in Database
• Normalization is a process of organizing the
data in database in accordance with a series of
normal forms to avoid data redundancy and
improve data integrity.
• DB should be normalized to avoid three
common anomalies named insertion anomaly,
update anomaly and deletion anomaly
Normalization in Database
• There are four types of normal forms
i) First normal form (1NF)
ii) Second normal form (2NF)
iii) Third normal form (3NF)
iv) Boyce & Codd normal form (BCNF)
1NF
• A relation is in 1NF if it contains an atomic
value.
• An attribute (column) of a table cannot hold
multiple values
Stud_ID Stud_Name Address Stud_mobile
S201 John Mtwara 0713132456
0623153525
S203 Asha Tanga 0784125312
S204 Mrisho Pwani 0753125340
0715735649
1NF…
• The above table is NOT in 1NF rule
A 1NF database should be like this below
Stud_ID Stud_Name Address Stud_mobile
S201 John Mtwara 0713132456
S201 John Mtwara 0623153525
S203 Asha Tanga 0784125312
S204 Mrisho Pwani 0753125340
S204 Mrisho Pwani 0715735649
2NF
• A relation is in second normal form (2NF) if it
is in 1NF and no non-key attribute is partially
dependent on a candidate key
Lecturer_ID Module Lecturer_Age
P101 Appraisal 34
P101 Database 34
P209 Cataloguing 45
P108 Classification 44
P108 Digitization 44
2NF
• The above table is NOT in 2NF rule but the one
below which splits the table into two
Lecturer_Details Lecturer_Module table
Lecturer_ID Lecturer_Age Lecturer_ID Module
P101 Database
P101 34
P101 Appraisal
P209 45
P209 Cataloguing
P108 44
P108 Classification
3NF
• A relation is in third normal form (3NF) if it is
in 2NF and no non-key attribute is transitively
dependent on a candidate key
Cust_ID Cust_Na Cust_Addr Cust_Region Cust_Distr Cust_Stree
me ess ict t
123 Ally Box 3000 Morogoro Ifakara Mbuyuni