Module in CC104 Information Management PDF
Module in CC104 Information Management PDF
The Authors
2
UNIT I
INTRODUCTION TO INFORMATION MANAGEMENT AND DATABASES 5
Data versus Information 5
Information Management 6
DIKAR Model 7
Evolution of File System and Data Processing 7
File System Problems 8
The Role of a Database 9
File Systems vs Database Systems 10
The Database System Environment 10
Types of Databases 11
Database Management System 12
DBMS Advantages 12
DBMS Functions 13
3
UNIT III RELATIONAL MODEL CHARACTERISTICS 26
Relational Database Model 26
Characteristics of a Relational Table 26
Integrity Rules and Keys 27
Relational Schema 28
Data Dictionary and System Catalogs 29
Relational Set Operators 29
Codd’s Relational Database Rules 30
References 51
4
UNIT I
LEARNING OBJECTIVES
LESSON PROPER
Sound decisions require valid information. And such information is derived from
the observable facts around us.
Source: https://computersciencewiki.org/images/b/b1/Databases_2.pdf
5
Data- refers to raw facts that we can collect about entities- people, objects, and events.
Information- refers to processed data – which gives meaning to the raw facts.
Knowledge - relevant and objective information that helps in drawing conclusions.
Source: https://computersciencewiki.org/images/b/b1/Databases_2.pdf
Information Management
Choo (1995) defined information management (IM) as the management of
processes and systems responsible for acquiring, creating, organizing, distributing, and
using information.
In his discussion about Information Management, there are six related activities
involved in IM:
6
DIKAR Model
Data
Information
Knowledge
Action
Result
Before going straight to databases, it is essential to learn first the concept of the
file system. Knowing file systems can be helpful to understand the complexities of
databases and the conversion to database systems.
File systems can either manual or computerized. The manual file system is the
traditional pen-paper-folder file management. It is composed of a collection of file
folders, categorized and stored in cabinets.
The computerized file system uses computers and storage devices to acquire,
organize, and store data. It also facilitates faster data tracking and report generation as
compared to the manual method.
7
File System Problems
Structural dependence happens when changes in the file structure will entail
modifications in related programs and files to roll-out or apply the new structure.
Structural independence is when changes in file structures do not affect data
access.
Data dependence happens when data structure changes affect data access. Data
independence is when these changes do not affect the data nor the related
programs.
2. Data Redundancy
File systems are prone to data redundancy due to having data from multiple
resources and do not have automatic measures to avoid multiple data copies. If
redundancy exists, it can result in having:
• Data inconsistency
This happens when multiple copies of the data have conflicting versions.
This is usually a result of a particular update done in one document but
failed to update other existing copies.
8
• Lack of data integrity
File systems usually lack design and data models as compared to database
systems. Data models contribute to the overall structure and logic flow that
enable databases to be more organized in managing data.
As the data collected evolves and the transactions being done in businesses,
innovation and improvement in storage have been a continuous necessity for a
business. Hence, apart from file systems, database systems are often the more viable
option for organizations.
9
transactions. Metadata is often described as data about data or information about the
database and tables' structure and components.
Source: Carlos Coronel, Steve Morris, Peter Rob, Database Systems: Design,
Implementation, and Management, Ninth Edition 2015
10
• Software – the applications necessary to run a database. This includes the
operating system, database management system, among others.
• People – includes all the system stakeholders: end-users, designers,
administrators, programmers, and analysts.
Types of Databases
2. Based on location:
11
4. Based on the how it will be used and the time sensitivity of information:
• Analytical database contains historical data that can be used for business
intelligence.
DBMS Advantages
DBMS is capable of providing a platform for the users to access more organized
data.
DBMS is capable of improving data security and privacy by providing facilities for
managing access levels and implementing security policies.
12
3. Better data integration
Since data sharing and access are enhanced, DBMS can help the management
have a clearer view of how their business segments are doing.
DBMS can facilitate quick responses for data retrieval requests making it easier to
search and find what you need.
It is easier to study the data and make strategic reports through a more
organized and faster retrieval of data.
By providing ease of access and data availability, DBMS can help users do their
work faster and more efficiently.
DBMS Functions
A data dictionary holds the metadata about the database structures. DBMS offers
features that help manage and generate data dictionaries for reference and
documentation purposes.
13
2. Data storage management
3. Data presentation
DBMS can aid in the acquisition, storage, and transformation of data presented in
a structured way to satisfy logical expectations.
Access roles and levels can be configured through an Access Control List (ACL),
which allows the limited rights and privileges per user type.
Back-up and recovery options are available to avoid database outages and data
loss.
DBMS can handle the Structured Query Language (SQL) and its connection with
other programming languages and applications. Also, it supports communication
with other databases.
14
UNIT II
DATA MODELS
LEARNING OBJECTIVES
LESSON PROPER
data using the database structure. In developing a database, the first phase is data
modeling, which refers to creating a data model for a given problem domain.
Data Model
15
The various features, changes, and constructs on a particular database based on a
domain and collection of business rules or specifications are illustrated using a data
model.
Problem Domain
It is a database model that utilizes a single table design. It may have many fields
that are prone to data inconsistency, redundancy, and corruption. You can use
the copy and paste method to copy data from different flat files, and automation
is not allowed. Delimiters like tabs and commas are used to separate files in the
record.
16
Source: https://www.researchgate.net/figure/Example-of-a-Flat
File_fig1_291448084
2. Hierarchical Model
17
3. Network Model
The network model is known for its flexible way of representing data. The
structure follows a graph format where objects are nodes and relationships are
arcs.
Source: Carlos Coronel, Steve Morris, Peter Rob, Database Systems: Design,
Implementation, and Management, Ninth Edition 2015
4. Object-Oriented Model
Source: Carlos Coronel, Steve Morris, Peter Rob, Database Systems: Design,
Implementation, and Management, Ninth Edition 2015
18
5. Relational Model
The relational model views a database as a set of tables with columns and rows.
Each table represents an entity or a data source. Each row is an instance of that
entity. Keys uniquely identify such rows. And each column is the attribute or
property of the entity.
Source: Carlos Coronel, Steve Morris, Peter Rob, Database Systems: Design,
Implementation, and Management, Ninth Edition 2015
• Every row is unique so that there is a specific value in each row that is different
from the value in the other row.
19
Entity Relationship Diagram (ERD)
ERD Components
1. Entity
• denoted by a NOUN
2. Relationship
3. Attribute
20
4. Cardinalities
Basic Cardinalities
Other Symbols/Notations:
Examples:
21
Three ways to do ERD
22
Degree of Relationships
The degree of a relationship is based on the entities that are related to each
other. There are three types of degree and these are as follow:
• Unary Relationship – when the relationship that exists is within the same entity.
23
Business Rules
Bi-directional: Each employee works in one store. Each store has many
employees.
Example:
Business rule: Each student can register for one or more classes.
Example:
Business rule: Each student can register for one or more classes.
Relationship: registers
Examples:
25
UNIT III
LEARNING OBJECTIVES
LESSON PROPER
Relational Database Model (RDM) – is presented as data tables that collect groups of
elements into relations. These models work based on the idea that each table setup will
include a primary key or identifier. Relations are represented by tables.
2. Each table row is called a tuple representing a single instance of an entity within a
set.
3. An attribute is represented by the table's column and should have a unique name
or identifier in the table.
26
4. A single data value is represented in each point where the row and column meet.
5. The attribute domain defines the valid values for the columns.
6. The placements of each row and column or their orders in relation to each other
are of no consequence in a database's definition or identity.
7. Each row should have a unique combination of values and its attributes
compared to other rows in the table.
There are two main types of integrity that can be enforced in a table:
• Entity Integrity – Usually implemented by creating primary keys for each row
in the table that is unique from all other rows.
Key – it consists of a group of attributes that can be used as a basis for getting other
attributes in the row.
1. Primary Key
• Requirements:
o the value must be different from all other values for that attribute;
unique
27
2. Foreign Key
• It is safeguards the tables from actions that would discredit links between
tables.
• It ensures that the valuess being entered in the foreign key column is valid
and exists in the table it points to.
Relational Schema
28
Data Dictionary and System Catalogs
A system catalog is more detailed and greater in scope as it can include database
details and all objects in the database.
Table: Student
1. SELECT – this command will produce the selected values of attributes for every
row that is true for a set of specified conditions.
2. PROJECT – this command will show all values of the selected fields/attributes.
3. UNION – this command will show the union of two tables (A and B). The
duplicates of A+B will not be shown. A + B – ( A ∩ B) = A U B
4. INTERSECT – this command will show the rows in which A and B intersect or are
the same. A ∩ B
5. DIFFERENCE – this command will show the rows in two tables that only appear in
one table and do not appear in the other. A U B – (A ∩ B)
29
6. PRODUCT – produces all combinations of rows from two tables (A and B) where
the first part of the row is from table A and the second part is table B.
7. JOIN – this command combines rows from two tables that have shared values on
a selected attribute
8. DIVIDE – this command takes two tables, one two-column table, and one one-
column table. The latter table acts as a divisor to the former.
E. F. Codd invented and formalized the concept of the relational database in 1970
at IBM. According to his idea, a relational database contains several relations, with
tuples represented mostly as rows related in many ways.
Moreover, a relational database is composed of rows where each row satisfies the
integrity constraints. Such that any operation done on the rows does not violate the
integrity constraints.
Dr. E. F. Codd also defined 12 rules that a relational database system should
always follow. These rules help ensure that the database design will be free of or at
least minimized anomalies.
Let’s revisit the three anomalies introduced in the previous topic usually
encountered in file and database systems. These anomalies are classified as:
30
Having a well-structured and well-designed database can eliminate or minimize
occurrences of such anomalies. Dr. Codd’s 12 rules for relational databases can provide
useful guidelines in creating a sound relational database design. For each rule and its
description, we can refer to the figure below.
Source: Carlos Coronel, Steve Morris, Peter Rob, Database Systems: Design,
Implementation, and Management, Ninth Edition 2015
31
UNIT IV
LEARNING OBJECTIVES
LESSON PROPER
SQL includes commands to create database objects such as tables, indexes, and
views and commands to define access rights to those database objects.
32
2. Data Manipulation Language
SQL includes commands to insert, update, delete, and retrieve data within the
database tables.
1. Creating Database
Example:
If you want to create a database named DBCLASS, the command will be:
CREATE DATABASE DBCLASS;
33
2. Use Database – it is essential to set which database will be the default.
Whichever is set as default will be the database that the commands will pertain or
be performed to.
Example:
To make the newly created database the default database:
USE DBCLASS;
3. Create Table – the column parameter refers to the attributes, while the data type
parameter refers to the type of values each column can hold.
Example:
If we want to add a new table called tblstudent with attributes s_id, s_fname,
s_mname,s_lname, s_section, s_age - the code will be:
34
4. Alter Table – in case you needed to change something in the table (add/edit
columns)
Example:
If we want to add s_bday column to tblstudent, the code will be:
Example:
Suppose we need to update the data type of s_bday to DATE, the code will be
something like this:
35
Example:
Suppose we need to change the column name, s_bday to s_birthday, the code
will be:
NOTE: If you do this, all data stored in this column will be deleted as well.
Example:
If we want to delete the column, s_age, the code will be:
ALTER TABLE tblstudent
DROP COLUMN s_age;
5. Insert Values
Example:
From the examples we did above, our final table structure for tblstudent is:
36
To insert value using Syntax1:
INSERT INTO tblstudent(s_id, s_fname, s_mname, s_lname, s_section, s_birthday)
VALUES(20090001, 'Juan', 'Mabini', 'Dela Cruz', '2W', '1990-03-14');
Example:
If we want to correct Maria's middle name to "Santos," the code will be:
UPDATE tblstudent
SET s_mname = 'Santos'
WHERE s_id = 20090002;
37
The table has been updated. And tblstudent now looks like this:
For all examples, assume we have the table named tblstudent with the following
contents:
EXAMPLE:
OUTPUT:
38
Syntax to retrieve only the contents of specific column/columns:
EXAMPLE:
OUTPUT:
Note: if you want to display data from multiple columns, separate the column
names by a comma.
EXAMPLE:
OUTPUT:
39
EXAMPLES:
SELECT * FROM tblstudent
WHERE s_lname = 'Dela Cruz';
OUTPUT:
OUTPUT:
3. AND, OR, NOT – these can be combined with the WHERE clause to filter data
using more than one condition.
AND will display a record only if all the conditions joined by the AND operator
are TRUE.
40
EXAMPLE:
OUTPUT:
EXAMPLE:
OUTPUT:
EXAMPLE:
41
OUTPUT:
4. IN – is used when you need to include multiple values of a column in the WHERE
clause.
EXAMPLE:
OUTPUT: Note that only the record of Juan was retrieved since the table has no
s_id 20090003
5. BETWEEN – get the values within a given range. The values can be numbers, text,
or dates.
EXAMPLE:
42
OUTPUT:
EXAMPLES:
OUTPUT:
OUTPUT:
43
7. ORDER BY – is used to display the data in an ascending or descending order.
EXAMPLES:
OUTPUT:
OUTPUT:
44
Basic SQL Commands – Part 3
Note: SQL commands are not case sensitive.
1. DELETING
Basic functions:
a. AVG() –for averaging
45
b. SUM() –computes for the sum of the data stored in the specified column.
46
d. MAX() - returns the column’s highest value.
47
3. CONSTRAINTS – These can be used to identify the primary key, foreign key, and
which values should not accept null and duplicates.
EXAMPLE:
48
EXAMPLE :Assume we have this diagram:
Notes:
• During the table creation, add cust_id in the product table to have a column
created for it.
• The cust_id data type in the product table should match the data type of the
cust_id in the customer table.
• Then, declare it as a foreign key. The “REFERENCES” part is where you define
the original table it belongs to.
49
50
References:
Pratt, Philip and Last, Mary. (2011). A Complete Guide to MYSQL. Cengage Learning
https://computersciencewiki.org/images/b/b1/Databases_2.pdf
https://www.researchgate.net/figure/Example-of-a-Flat
https://quizlet.com/237169032/chapter-2-data-models-10-25-2017-diagram/
https://www.tlu.ee/~sirvir/Information%20and%20Knowledge%20Management/Key_Conc
epts_of_IKM/information_management.html
https://keydifferences.com/difference-between-information-and-knowledge.html
https://www.smartdraw.com/entity-relationship-diagram/
51