Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Week 04 Data Base Design: Database System

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

Week 04

Data Base Design


Zahid aslam
Zahid.aslam@iub.edu.pk
Database System
COSC-2103

Database Systems (Fall 2021) - Zahid.aslam@iub 1


Database Application
Development Process

Involves
 Database Design
 Application Programs
 Implementation

Database Systems (Fall 2021) - Zahid.aslam@iub


Database Design

 A DB Design is a model of a particular real-world


system
 It provides a picture of reality
 Should be simple and self- explanatory

Database Systems (Fall 2021) - Zahid.aslam@iub


Database
Development
Process
Database Systems (Fall 2021) - Zahid.aslam@iub
Database Development Process
 Similar to
Preliminary Study software
Requirement Analysis
development
process
DB Design

Physical Design

Implementation

Maintenance

Database Systems (Fall 2021) - Zahid.aslam@iub


Design Stages
Analyze User Environment

Develop Conceptual Model

Map Conceptual Model to Logical

Choose DBMS

Develop Physical Design

Implement System

Test System

Operational
Database SystemsMaintenance
(Fall 2021) - Zahid.aslam@iub
Analyze Existing
System
 Objective: To understand the working of existing
system
 Analyze users’ requirements

Database Systems (Fall 2021) - Zahid.aslam@iub


Tool Used

 Why to use at all?

 Data Flow Diagrams

Database Systems (Fall 2021) - Zahid.aslam@iub


Data Flow
Diagrams

Database Systems (Fall 2021) - Zahid.aslam@iub


Data Flow Diagrams (DFDs)

 Represent the flow of data between different


processes within a system

Database Systems (Fall 2021) - Zahid.aslam@iub


Data Flow Diagrams

 Simple & intuitive, not focusing on details


 To describe, what users do, rather than what
computers do

Database Systems (Fall 2021) - Zahid.aslam@iub


Data Flow Diagrams

 Limitations
 Focus only on flows of information
 Decision points/basis not included

Database Systems (Fall 2021) - Zahid.aslam@iub


DFD-Symbols

Dataflow: pipelines through which packets of


information flow. Arrows are labeled with name of the
data that moves through

Database Systems (Fall 2021) - Zahid.aslam@iub


Symbols in DFD
Symbols in DFDs
DFDs uses the following symbols:
1. Data Flow:
The purpose of the dataflow in a DFD is to
express the flow of information from one
entity to another entity in the system.
Some Rules for Data Flows
• Data in motion, moving from
one place to another in the
system Data Flow Symbol
–From external entity (source) to
system
–From system to external entity
(sink)
–From internal symbol to internal
symbol, but always either start or
end at a process
Symbols in DFDs
2. Data Store:
Data store is a repository for the storage of
the data. When in a system the data is to
be permanently stored somewhere for
future reference or use the data store is
used for this purpose.
Some Rules for Data Stores
• Internal to the system
• Data at rest
• Include in system if the system D1 Data Stores

processes transform the data


– Store, Add, Delete, Update
• Every data store on DFD should
correspond to an entity on an ERD
• Data stores can come in many
forms:
– Hanging file folders
– Computer-based files
– Notebooks
Symbols in DFDs
3. Process:
Processes are expressed with ovals or
rounded rectangles. Processes are used to
express the transformation of incoming
dataflow into outgoing dataflow.

1.0 1.0
Process OR Process
Some Rules for Processes
• Always internal to system 0.
• Law of conservation of data: Processes
#1: Data stays at rest
unless
#2: Processes
moved cannot consume or create data
by a process.
–Must have at least 1 input data flow (to avoid miracles)
–Must have at least 1 output data flow (to avoid black holes)
–Should have sufficient inputs to create outputs (to avoid gray
holes)
Processes
• Logical process models omit any processes
that do nothing more than move or route
data, thus leaving the data unchanged. Valid
processes include those that:
– Perform computations (e.g., calculate grade
point average)
– Make decisions (determine
availa
bility of
ordered products)
– Sort, filter or
otherwise summarize data
Processes
• Logical process models omit any processes
that do nothing more than move or route data,
thus leaving the data unchanged. Valid
processes include those that:
– Organize data into useful information (e.g.,
generate a report or answer a question)
– Trigger other processes (e.g., turn on the furnace
or instruct a robot)
– Use stored data (create, read, update or delete a
record)
Symbols in DFDs
4. External Entities:
These are the entities interacting with the
system in any of two different ways. They
may be either receiving the data from the
system, or may be producing the data for
the system to consume.
Some Rules for External
Entities
• External people, systems and data
stores
• Reside outside the system, but
interact with system
• Either a) receive info from system,
b) trigger system into motion, or c) External
provide new information to system Entities

• e.g. Customers, managers


• Not clerks or other staff who simply
move data
Symbols in DFDs
6. Separator:
The dataflow symbol which is used for
separating data from a single source to
multiple sinks is known as a separator.
Symbols in DFDs
5. Collector:
This DFD shape is used to express several
dataflow connections terminating at a single
location. Collector is used to show the
convergence of data to a single point.
Types of DFD

 Context diagram
 Level 0 diagram
 Detailed diagram

Database Systems (Fall 2021) - Zahid.aslam@iub


Context Diagram

 Consists of single Process/System


 Represents the system/process being analyzed
 Name: Usually a Noun phrase

Database Systems (Fall 2021) - Zahid.aslam@iub


Context Diagram

 Show Context Only


 Inputs/outputs
 External Entities
 No Data Stores
 No flows between external entities

Database Systems (Fall 2021) - Zahid.aslam@iub


Context Diagram

Database Systems (Fall 2021) - Zahid.aslam@iub


Context Diagram

Student Dean

Admission
System

Faculty
Registrar
Member
Database Systems (Fall 2021) - Zahid.aslam@iub
Diagram 0 Class
Requests Old Class Data
1.0 Class
Student Process C
Request Requests Updated Registration
Status Class Data
Updated
2.0 Student 7.0
Produce Produce
Data
Student
Faculty
Schedule
S Student Load
Registration Sheets
5.0 6.0
Produce Produce
Class Class
3.0 4.0
Lists Counts
Create Create
Student Class
Student
File File
Data
Course
Faculty
Registrar Offering member Dean
Database Systems (Fall 2021) - Zahid.aslam@iub
Detailed Diagram
Class
C
Registration

Updated Class Data


Class
1.2
Requests 1.1
Check
Student Edit
Class
Invalid Requests Valid
Counts
Request Requests

Request
Accepted
Rejected Request
1.4
Update
1.3 Class
S Student Update Data
Registration Student
Data
Context diagram of Food ordering
system – Level 0

8.27
Context diagram of Food
ordering system –
Level 1

8.28
Database Systems (Fall 2021) - Zahid.aslam@iub 37
Context Diagram-0-level DFD:
It is also known as a context diagram. It’s designed to be an abstraction view, showing
the system as a single process with its relationship to external entities. It represents the
entire system as a single bubble with input and output data indicated by
incoming/outgoing arrows.

Database Systems (Fall 2021) - Zahid.aslam@iub 38


1-level DFD:
In 1-level DFD, the context diagram is decomposed into multiple bubbles/processes. In
this level, we highlight the main functions of the system and breakdown the high-level
process of 0-level DFD into sub processes.

Database Systems (Fall 2021) - Zahid.aslam@iub 39


2-level DFD:
2-level DFD goes one step deeper into parts of 1-level DFD. It can be used to plan or
record the specific/necessary detail about the system’s functioning.

Database Systems (Fall 2021) - Zahid.aslam@iub 40


How do you create a process flow diagram?

The 6 steps to making a business process flow diagram


1. Determine the main components of the process.
2. Ordered the activities.
3. Choose the correct symbols for each activity.
4. Make the connection between the activities.
5. Indicate the beginning and end of the process.
6. Review your business process diagram.

Database Systems (Fall 2021) - Zahid.aslam@iub 41


Data Dictionary
Data dictionary is a repository of information
that describes the logical structures of the
database.

It contains record types, data item types and


data aggregates etc.

Data dictionary contains metadata.


Uses of Data Dictionary

Data dictionary contains Information about


data, i.e. data about data.

Data dictionary is used for communication with


different users of the database.

Keeps record of change in Database


Structure, like creation, deletion or updating of
elements.
Uses of Data Dictionary
Determining the impact of change by analyzing
its relationships with other items.

It Keeps Record of all Access Control


Information and authorized accesses.

Its stored Information is also usedlater for


system and organization’s audit.
Types of Data Dictionary

Different types data dictionaries are as


follows:
1.Integrated Data Dictionary

2.Freestanding Data Dictionary


Types of Data Dictionary
Integrated Data Dictionary: it is part of DBMS
and it performs many functions throughout the
life of the database not only during design phase
but also during running
.
1.Active Data Dictionary: which is checked for every
access to the DBMS.

2.Passive Data Dictionary: which is checked


periodically.
Types of Data Dictionary

Freestanding Data Dictionary: it is not part of


DBMS and is available by some third
commercial product and mostly it is used till to
design phase before the selection of a
commercial DBMS.

You might also like