Introduction To Databases and Database Design Process

You might also like

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

Introduction to Databases and

Database Design Process


Topics
• Introduction: definitions
• Data and Information
• Field, Record, File
• Metadata
• Database Systems
• Data Modelling
• Database Management Systems
• Database Design Process
• Oracle
Data and information
Data
● Raw, unorganized fact that doesn’t have meaning
● Can be in the form of a number, figure, character, symbol, audio, video and so on
Data and information
Information
● Processed data that gives meaning
● Suitable for human interpretation
● Can be used for decision-making
Data and information

Data Processing Information

Process involves Information is collective


Data are raw facts; or
acquisition, storage, data that have been
Unprocessed
manipulation, processed and
information
retrieval and presented in a form
distribution. suitable for human
interpretation
Data
Baker, Kenneth 98778373 19.01.83
Bagum, Ammena 97327627 01.02.82
Ako, Sarah 98737373 08.08.83
Finkle, Clive 93838383 09.09.83
Mc Farren, Debra 98383837 01.01.83
Sinseros, Douglas 99344222 27.05.82
Information
Class List for Module Database
Autumn Semester 2023
Student Name Student ID Date of Birth
Baker, Kenneth 98778373 19-JAN-1983
Bagum, Ammena 97327627 01-FEB-1982
Ako, Sarah 98737373 08-AUG-1983
Finkle, Clive 93838383 09-SEP-1983
Mc Farren, Debra 98383837 01-JAN-1983
Sinseros, Douglas 99344222 27-MAY-1982
Information - Relevance

What will you do if you see


What will you do if you see such
such sign while driving ?
sign while driving ?
Data versus Information
• Data constitutes building blocks of Information

• Information produced by processing Data

• Information reveals meaning of Data

• Good, timely and relevant Information keys to

decision making
• Good decision making keys to organizational

survival
Q. Which of the following statements is correct?

A. Data can only be understood by highly skilled people.


B. Data is described as the processed information.
C. Data refers to the raw and unprocessed facts and figures that have no
context or purposeful meaning.
D. Data is irrelevant facts and is worthless.
Q. Which of the following statements is correct?

A. Data can only be understood by highly skilled people.


B. Data is described as the processed information.
C. Data refers to the raw and unprocessed facts and figures that have no
context or purposeful meaning.
D. Data is irrelevant facts and is worthless.
Manual File Systems
• Traditionally composed of collection of File Folders kept in
File Cabinet
• Organization within Folders was based on data’s expected
use (Ideally Logically related)
• System was adequate for small amounts of data with few
reporting requirements
• Finding and using data in growing collections of File Folders
became time-consuming and cumbersome
File Processing Approach
• A file processing system is a collection of programs that
store and manage files in computer hard-disk.
• Traditional approach to Information System Design.
• In a typical file processing system, each department or
area within an organization has its own set of files.
• The records in one file may not relate to the records in
any other file.
• Organizations have used file processing systems for many
years.
File Processing Approach
• Many of these systems, however, have two major weaknesses: they have redundant data and they
isolate data.
• Data separated and isolated.
Five major operations can be performed on file are:
• Creation of a new file.
• Opening an existing file.
• Reading data from a file.
• Writing data in a file.
• Closing a file.
File Processing Approach
• Focuses on data processing needs of individual
departments.
• Data often duplicated
• Application programs dependent on file formats
• Files often incompatible with one another
• Difficult to represent data in a user’s perspective
Evolution of Simple File System
• As number of files increased, small file
system evolved
• Each file used its own application programs
• Each file was owned by individual or
department who commissioned its creation
File Processing Approach

Account Account
Customer details
processing file

Loan
Customer details Loan file
processing
File Processing Approach

First_name Last_name Phone Address Email


James Smith 12345667 Chicago james@gmail.com

Last_name First_name Phone Address Email


Smith James 00977-12345667 Chicago, USA james@gmail.com

Last_name First_name Phone Address Email


00977-12345667 7th Eads St Chicago,
Smith Jaames USA james@gmail.com
Bank process
• Account Department

• Deposit Department

• Remittance Department

• Debit Cards, ATM Facilities

• Loan Department

• Notary Service

• Account Closing Department


File Processing Approach
Disadvantages
• Uncontrolled Redundancy
• Inconsistent Data
• Inflexibility
• Limited Data Sharing
• Poor Enforcement of Standards
• Excessive Program Maintenance
Data Redundancy
• Redundancy means having multiple copies of
same data in the database.
• Data Redundancy results in data inconsistency
as different versions of same data appear in
different places
• Errors more likely to occur when complex
entries are made in several different files and
recur frequently in one or more files
Data Redundancy
• Let's consider a scenario where a bank has a customer database
with the following data for each customer: Customer ID, Name,
Address, Phone Number, and Account Number.
• Now, bank's system ends up storing customer’s information in
multiple places:
• Customer Database
• Loan Database: Credit Card Database
• Savings Account Database
• Backup Systems
Data Anomalies
• Also known as irregularity.

• Update (Modification) Anomalies

▪ Occur when changes must be made to existing records

• Insertion Anomalies

▪ Occur when entering new records

• Deletion Anomalies

▪ Occur when deleting records


Data Redundancy issue
• Inconsistencies: If any one customer updates his address or phone number, the bank needs to ensure
that all instances of his data are updated. Failure to do so can lead to inconsistencies in customer records.

• Wasted Storage: Storing the same data multiple times consumes more storage space than necessary.

• Data Integrity: If updates are made to one instance of customer’s data but not others, it can lead to
discrepancies and impact the integrity of the data.

• Increased Maintenance: When changes need to be made to customer data, they have to be made in
multiple places, which increases the complexity of maintenance and the likelihood of errors.

• Security Concerns: Storing redundant data increases the surface area for potential security breaches. If
one set of data is compromised, it can lead to leaks in multiple systems.
Database Concept

Is a collection of
information that is
organized so that it
can be easily accessed,
managed and
updated.
Database
• It is collection of interrelated data stored
together without unnecessary redundancy to
serve multiple operations.
• Databases can store, manipulate and retrieve
data
• Used across wide range of organizations
• Single user to hundreds (or thousands) of users
Database vs. File System
• Problems inherent in File Systems make using a Database System
desirable
• File system

▪ Many separate and unrelated files

• Database

▪ Logically related data stored in a single Logical Data Source


Database management system (DBMS)

● A group of programs or software which allows data organised in a


database to be added to, deleted, modified or retrieved.
Contrasting Database and File Systems
Objectives of Database System
• Database must be shared by community of
users.
• Integrity of Database must be preserved.
• Database should integrate operational files
of corporate organization.
• Database should be capable of evolving,
both in short term and in longer term.
Database System Environment
Database system is composed of 5 parts:
▪ Hardware
▪ Software
⮚Operating System Software
⮚DBMS Software
⮚Application Programs and Utility
Software
▪ People
▪ Procedures
▪ Data
Key Message

DATABASE DBMS END USER

DBMS acts as Facilitator/Interface


for us to Interact with Database
Basic Concept of Database System
• Concept of database begins by considering what information could be provided,
rather than what information needs of particular applications.
Basic Concept of Database System
• Different programs can be written, each using same
Database.
• Database is collection of Logically related Data Files
which is integrated and organized so as to provide
single comprehensive File System.
• Purpose of Database is to provide convenient access
to common data for wide variety of users and user
needs.
Database Management System (DBMS)
• A database management system (DBMS) is system
software for creating and managing databases.
• It is suite of programs which allow data housed in
Database to be added to, deleted, modified or retrieved
• DBMS facilitates concurrent processing.
• It can enforce security and integrity.
• It provides other utilities e.g. bulk loader, interface
design, report generation.
Database model
• Prior to building a house, an architect
gathers the client's requirements and
creates a blueprint of the house.

• Blueprints sets guidelines to achieve


the set results.

• Only after the blueprint is finalized,


the construction work starts.
Database model
● A database model is a blueprint for the database that can be implemented
later.
● It is something that determines the logical structure of a database.
● It also determines how records are stored in the database and how
relationships between records are established.
Types of database models

○ Hierarchical database model


○ Network database model
○ Relational model
○ Entity-relationship model
○ Object-oriented model
○ Centralized database model
○ Graph database model
○ Document database model
Hierarchical database model

● It is a basic logic structure that is represented by an


upside-down tree.
● The table of this model takes on a child-parent
relationship.
● Each child table has a single parent table, and each
parent table can have multiple child tables.
● It supports one-to-many relationships between a
parent and its child segments.
Hierarchical database model - Example
The company is the root segment

The company is the root segment There is a one-to-


many relationship
department is a root child between
companies and
departments

You cannot search for


employee without first
finding the company, the
department and the
employee's manager.
Network database model
● It was created to represent complex data relationships
more effectively than hierarchical models and to improve
database performance.
● A user can perceive the network database as a collection
of records in one-to-many relationships.
● Unlike the hierarchical model, it allows a record to have
more than one parent.
Network database model - Example

• The node 'student' has two parents, the


CSE department and the library

• Each student is part of the CSE


department as well as the library

• This model can manage one-to-one


relationships as well as many-to-many
relationships.
Relational database model

● It is the data model that represents data in the form of relation.


● A relation is basically a table of values
Relational database model
● It consists of three components:
○ Data structure - Data are organized in a structured manner in the form of
tables or relations.
○ Data manipulation - Powerful operations such as structured query
languages are used to manipulate data stored in databases.
○ Data integrity - Business rules are specified to maintain the integrity of
data when they are manipulated.
Relational database model
Entity-relationship database model
● It is a graphical representation of entities and
their relationships in database structure.
● Using it, we can represent the real-world problem
diagrammatically to make it easy for the
stakeholders to understand.
● ER models are usually represented in entity-
relationship diagrams (ERD) to model database
components.
Entity relationship database model

● It complements the relational data


model.
● Relational data model and ERM are
combined to provide foundation for
structured database design.
Entity-relationship database model
Object-oriented database model

● In this model, both data and their relationships


are contained in a single structure known as an
object.
● It reflects different ways to define and use
entities.
● An object is described by its factual content.
Object-oriented database model

• It includes information about


relationships between
• facts within an object
• Its relationships with other objects.
MetaData
• Database is self-describing, which means that it contains description of its

structure as part of itself.

• This description of structure is called metadata.


Name Type Length Description
Student Character 50 Student’s full name
Unique identification
Student ID Number 8
number for each student
Student’s date of birth in
Date of Birth Date 8
the format ’01.01.80’
MetaData in Microsoft Access and Oracle
Data in Microsoft Access and Oracle
Field, Record, File
• Field: Character or group of characters that
has specific meaning.
▪ Field is used to define and store data
• Record: Logically connected set of one or
more fields describing something.
• File: Collection of related records is called file
Database Processing Systems Users/Programmers

Database
• Integrated Data System
Application Programs/Queries

• Reduced Data Duplication


DBMS
• Program / Data Independence Software
Software: Query Processing & Programs
• Easier Representation of Users
Perspectives
Software: Data Access
• A database processing system is
a combination of machines,
people, and processes involved
in the database Database Database
Definition
DBMS Functions
• Performs functions that guarantee integrity and consistency of data

▪ Data Dictionary Management: Defines data elements and their


relationships.
▪ Data Storage Management: Stores data and related data entry forms,

report definitions, etc.


▪ Data Transformation and Presentation: Translates logical requests into

commands to physically locate and retrieve the requested data


DBMS Functions
• Security Management: enforces user
security and data privacy within database
• Multi-User Access Control: creates
structures that allow multiple users to
access data
• Backup and Recovery Management:
provides backup and data recovery.
DBMS Functions
• Data Integrity Management: promotes and enforces
integrity rules to eliminate data integrity problems
• Database Access Languages and Application
Programming Interfaces: provides data access
through a query language
• Database Communication Interfaces: allows
database to accept end-user requests within a
computer network environment
Advantages of Database System
• Avoidance of unnecessary duplication of data.

• Multiple use of data

• It follows that although data is input once, can be used for several purposes.

• Database provides data for organization as whole, not just for individual departments.

• Organization of data into Database, rather than into separate files, encourages

integration of data.
• Because data held only once, easier to ensure that it’s up-to-date.
Database Design Process
• Main phases in Database Design Process
• Requirement's collection and analysis: Fact finding (interviews, observation,
looking at current data)
• Conceptual Database Design: Entities, ER modelling, function specs.
• Choice of DBMS
• Data Model mapping (logical database design): ER model 🡪 Relations,
Normalization
• Physical Database Design: Indexes, physical storage etc.
Database Users
Users are differentiated by way they expect to interact with system
• Application programmers – interact with system through DML.
• Sophisticated users – form requests in Database query language
• Specialized users – write specialized Database applications that do not fit into
traditional data processing framework (knowledge base and expert systems, CAD, etc)
• Naïve users – invoke one of permanent application programs that have been written
previously. E.g. people accessing database over web, bank tellers, clerical staff
Database Administrator
• Coordinates all activities of Database system

(has a good understanding of enterprise’s


information resources and needs)
• Database Administrator's duties include
• Schema definition
• Storage structure and access method definition
• Schema and physical organization modification
Database Administrator
• Database Administrator's duties include

• Granting user authority to access Database

• Specifying integrity constraints

• Acting as liaison with users

• Routine Maintenance

• Monitoring performance, responding to changes in requirements,


backups, etc.
About Oracle Database XE
Oracle Database Express Edition (XE) is a free, lightweight, and entry-level
version of the Oracle Database software designed for small-scale development,
testing, and educational purposes.
Key features of Oracle Database XE include:
• Free to Use
• Limited Resources
• User-Friendly Installer
• Data Security
About Oracle Database XE
1. SYS user is the superuser in Oracle Database.
• It has highest level of administrative privileges and is responsible for
managing the database.
• The SYS user is used for tasks like database creation, configuration, and
maintenance.
2. SYSTEM user has administrative privileges but lower than the "SYS” user.
3. USERS in Oracle provide a flexible and organized way to manage user permissions.
• This role-based approach enhances security, simplifies administration, and
promotes consistent access control across the database environment.
About Oracle Database XE
Sys: perform all administrative
Sys: owns the oracle functions
data dictionary System: perform all
administrative functions
SYSTEM: the Excepts for Backup, recovery, and
master DBA user Database upgrade
USER User: Someone who can connect to
a database
Different views of users in the database
• DBA_USERS: It is a system view in Oracle Database that provides information about all users in
the database and is accessible to administrators only (DBAs)
• Example query: SELECT * FROM DBA_USERS;

• ALL_USERS: Provides information about all users visible to the currently logged-in user and
accessible to the querying user.
• Example query: SELECT * FROM ALL_USERS;

• USER_USERS: Placeholder or potentially a custom view name that needs to verify its existence or
context in specific database environment.
• Example query: SELECT * FROM user_users;
Types of users
SELECT * FROM dba_users;
SELECT * FROM all_users;
• DBA_USERS SELECT * FROM user_users;

• ALL_USERS DBA Users List the users in the Oracle


Database:
• USER_USERS
All users
User
users

You might also like