Professional Documents
Culture Documents
(Module 3)
Database Management System
Head Of Department
A Database Table
Key One or more fields of a database record that uniquely identifies it among all other records in the table We can express the schema for this part of the database as follows:
Movie (MovieId:key, Title, Genre, Rating)
Database Management
Database is shared, integrated computer structure housing:
End user data Metadata
Importance of DBMS
Makes data management more efficient and effective Query language allows quick answers to ad hoc queries Provides better access to more and bettermanaged data Promotes integrated view of organizations operations Reduces the probability of inconsistent data
Figure 1.2
Database Design
Importance of Good Design
Poor design results in unwanted data redundancy Poor design generates errors leading to bad decisions
Practical Approach
Focus on principles and concepts of database design Importance of logical design
View of Data
An architecture for a database system
Data Models
A collection of tools for describing
data data relationships data semantics data constraints
Entity-Relationship Model
Example of schema in the entityrelationship model
File Terminology
Data
Raw Facts
Field
Group of characters with specific meaning
Record
Logically connected fields that describe a person, place, or thing
File
Collection of related records
Database Systems
Database consists of logically related data stored in a single repository Provides advantages over file system management approach
Eliminates inconsistency, data anomalies, data dependency, and structural dependency problems Stores data structures, relationships, and access paths
Figure 1.7
DBMS Functions
Data dictionary management Data storage management Data transformation and presentation Security management Multiuser access control Backup and recovery management Data integrity management Database language and application programming interfaces Database communication interfaces
Database Models
Collection of logical constructs used to represent data structure and relationships within the database
Conceptual models: logical nature of data representation Implementation models: emphasis on how the data are represented in the database
Disadvantages
Complex implementation Difficult to manage and lack of standards Lacks structural independence Applications programming and use complexity Implementation limitations
Figure 1.10
Disadvantages
System complexity Lack of structural independence
Figure 1.11
Tables
Holds related entities or entity set Also called relations Comprised of rows and columns
Table Characteristics
Two-dimensional structure with rows and columns Rows (tuples) represent single entity Columns represent attributes Row/column intersection represents single value Tables must have an attribute to uniquely identify each row
Keys
One or more attributes that determine other attributes
Key attribute Composite key
Example Tables
Figure 2.1
Figure 2.2
Keys (cont.)
Superkey
Uniquely identifies each entity
Candidate key
Minimal superkey
Primary key
Candidate key to uniquely identify all other attributes in a given row
Secondary key
Used only for data retrieval
Foreign key
Values must match primary key in another table
Integrity Rules
Entity integrity
Ensures all entities are unique Each entity has unique key
Referential integrity
Foreign key must have null value or match primary key values Makes it impossible to delete row whose primary key has mandatory matching foreign key values in another table
Other operators
INTERSECT UNION DIFFERENCE PRODUCT DIVIDE
Union
Combines all rows
Figure 2.5
Intersect
Yields rows that appear in both tables
Figure 2.6
Difference
Yields rows not found in other tables
Figure 2.7
Product
Yields all possible pairs from two tables
Figure 2.8
Select
Yields a subset of rows based on specified criterion
Project
Yields all values for selected attributes
Figure 2.10
Join
Information from two or more tables is combined
Figure 2.11
Figure 2.14
Data dictionary
Provides detailed account of all tables found within database Metadata Attribute names and characteristics
System catalog
Detailed data dictionary System-created database Stores database characteristics and contents Tables can be queried just like any other tables Automatically produces database documentation
E-R Model
ERD Maps E-R model Chen Crows Feet
ERD Symbols
Rectangles represent entities Diamonds represent the relationship(s) between the entities 1 side of relationship
Number 1 in Chen Model Bar crossing line in Crows Feet Model
Many relationships
Letter M and N in Chen Model Three pronged Crows foot in Crows Feet Model
Attributes Relationships
Attributes
Characteristics of entities Domain is set of possible values Primary keys underlined
Figure 3.6
Attributes (cont.)
Simple
Cannot be subdivided Age, sex, marital status
Multi-valued
Can have many values Person may have several college degrees
Composite
Can be subdivided into additional attributes Address into street, city, zip
Derived
Can be derived with algorithm Age can be derived from date of birth
Single-valued
Can have only a single value Person has one social security number
Relationships
Association between entities Connected entities are called participants Operate in both directions Connectivity describes relationship classification
1:1, 1:M, M:N
Cardinality
Expresses number of entity occurrences associated with one occurrence of related entity
Introduction
Information Systems Analysis and Design
Complex process whereby computer-based information systems are developed and maintained
Application Software
Result of systems analysis and design Designed to support specific organizational functions or processes
1.5
Introduction
Software engineering processes have been developed to assist in analysis and design
Methodologies
Comprehensive, multi-step approaches to systems development
Techniques
Processes that are followed to ensure that work is well thought-out, complete and comprehensible to others on the project team
Tools
Computer programs to assist in application of techniques to the analysis and design process
1.6
Introduction
Information Systems Analysis and Design
A method used by companies to create and maintain systems that perform basic business functions Main goal is to improve employee efficiency by applying software solutions to key business tasks A structured approach must be used in order to ensure success
1.7
Introduction
Systems Analyst performs analysis and design based upon:
Understanding of organizations objectives, structure and processes Knowledge of how to exploit information technology for advantage
1.8
Systems Analysis
Focus is the logical view of the system, not the physical What the system is to accomplish, not how Tools:
data flow diagrams data dictionary process specification entity-relationship diagrams
Techniques
Processes that the analyst follows to ensure thorough, complete and comprehensive analysis and design
Tools
Computer programs that aid in applying techniques
1.11
Information
Derived from data Organized in a manner that humans can understand.
Data Flows
Groups of data that move and flow through the system
1.67
Processing Logic
Describe steps that transform data and events that trigger the steps
1.68
1.69
1.70
Application Independence
Separation of data and definition of data from applications
1.71
Systems Analyst
Key individuals in the systems development process
Technical
Understanding of potential and limitations of technology
Management
Ability to manage projects, resources, risk and change
Interpersonal
Effective written and oral communication skills
Business Managers
Have power to fund projects and allocate resources Set general requirements and constraints for projects
1.75
Internal Auditors
Ensure that required controls are built into the system
1.78
1.79
Project Identification and Selection Project Initiation and Planning Analysis Design Implementation Maintenance
1.81
Physical Design
Technical specifications
Implementation
Implementation
Hardware and software installation Programming User Training Documentation
1.85
Approaches to Development
Prototyping
Building a scaled-down working version of the system Advantages:
Users are involved in design Captures requirements in concrete form
1.86
Approaches to Development
Joint Application Design (JAD)
Users, Managers and Analysts work together for several days System requirements are reviewed Structured meetings
1.87
1.88
Systems Analysis
Focus is the logical view of the system, not the physical What the system is to accomplish, not how Tools: data flow diagrams data dictionary process specification entity-relationship diagrams
data flow
process
external entity
Understand components of current logical or physical system for purpose of rebuilding in a different physical form/technology, possibly with some changed functionality Find inefficiencies in current system Re-engineer current system
Any class of people, an organization, or another system which exists outside the system you are studying. Form the boundaries of the system. The system and external entities exchange data in the form of data flows. Must be named, titles preferred to names of individuals - use a noun
(external entities)
Sources/Sinks
source / sink
Data Flows
data in motion marks movement of data through the system - a pipeline to carry data connects the processes, external entities and data stores Unidirectional originate OR end at a process (or both) name as specifically as possible reflect the composition of the data - a noun do not show control flow! Control flow is easy to identify- a signal with only one byte - (on/off). HINT: if you can't name it: either it's control flow, doesn't exist or you need to get more information!
Processes
transform incoming data flows into outgoing data flows represent with a bubble or rounded square name with a strong VERB/OBJECT combination; examples: create_exception_report validate_input_characters calculate_discount
process
Data Stores
data at rest represents holding areas for collection of data, processes add or retrieve data from these stores name using a noun (do not use file) only processes are connected to data stores show net flow of data between data store and process. For instance, when access a DBMS, show only the result flow, not the request
data store
Diagramming A System
multiple DFDs are required to represent a system DFDs are created at increasing levels of detail
Context Diagram
defines the scope of the system by identifying the system boundary contains: one process (which represents the entire system) all sources/sinks (external entities) data flows linking the process to the sources and sinks (external entities)
student
schedule
Registration System
Registration details
business office
Level-0 Diagram
describes the overall processing of the system show one process for each major processing step or functional requirement data flows from the context appear on system diagram also (level balancing) can show a single data store to represent all data in aggregate at this level can draw duplicate sources, sinks and data stores to increase legibility
Functional Decomposition
similar to a series of more detailed maps iterative process of breaking the description of a system into finer and finer detail to create a set of charts in which one process on a given chart is explained in greater detail on another chart referred to as exploding, partitioning, or leveling must use your judgment to decide what goes on each level show error and exception handling on lower levels (if at all)
each lower level shows greater and greater detail follow numbering convention
Balancing DFDs
conserve data from level to level inputs and outputs on the higher level must appears somewhere on the lower level
Advanced Rules
Composite data flow on one level can be split into its component data flows on the next level - but new data cannot be added and all data in the composite must be included in the sub-flows The inputs to a process must be sufficient to produce the outputs. Lowest level DFDs may add new data flows to represent exception handling, i.e., error messages May repeat data stores or sources/sink to avoid crossing lines
the inputs to a process are different from the outputs of that process objects in a set of DFDs have unique names do not change data flow names on lower levels unless you are decomposing a data flow into component pieces. never explode a single process into another single process. If you cannot partition the process, then the lower level DFD is not needed. expect to iterate, put down the DFD and go back to it a few times to create something satisfactory.
Additional Guidelines
Quality Guidelines
Completeness
all components included & in project dictionary
Consistency
between levels: balancing, leveling
Timing considerations
assume system never starts and never stops
Iterative nature
revisions are common
Process Specifications
Process Specifications
Processing and control information omitted from a DFD belongs in a process specification Each functional primitive has one process specification Process Specifications can be represented in a variety of languages, the most popular are:
Structured English Decision Tables and Decision Trees
Structured English
A rigid subset of the English language omitting adjectives, adverbs, compound and complex sentences, all verb modes except imperative and most punctuation Result: A language containing a limited set of conditional and logic statements with nouns and strong verbs Standards vary between organisations objectives of: conciseness, preciseness and lack of ambiguity apply to all variants
and
primitive actions
should be concise
avoiding vague words (e.g. process / handle) containing a strong verb identifying the function stating explicitly the object of the statement, which is selected from the data dictionary
Decision Tables
A tabular of conditions and actions and an indication under which conditions, which actions must be performed Consists of four quadrants
Condition Stub
a list of all possible conditions that can arise within the process
Rules
contains selectors which identify different combinations of the possible conditions
Action Stub
a list of all possible actions that occur within the process
Action Entries
indicators which select the actions to beperformed
Credit Satisfactory Prompt Payer Special Clearance Accept Order Return Order
Y Y X
N N X
N N Y
N N
Decision Trees
Alternative to Decision Tables Employ tree structures which show conditions and actions within a problem Advantage: Easy to understand, no need for special training Root of tree -> name of process Nodes -> conditions Leaves -> actions to be performed
A system is described using three modes of representation: data flow diagrams process specifications
show relationships between processes, data flows, data repositories and external infulences beyond the system boundary in a graphical and structured manner
structured english, decision trees or tables: they document in a precise and consice fashion the elementary processing operations performed by each functional primitive in a set of dfds
Process Specifications
Structure Chart
To Implementation
Data Structures
Introduction Self-Referential Structures Dynamic Memory Allocation Linked Lists Stacks Queues Trees
Introduction
Dynamic data structures Data structures that grow and shrink during execution Linked lists Allow insertions and removals anywhere Stacks Allow insertions and removals only at top of stack Queues Allow insertions at the back and removals from the front Binary trees High-speed searching and sorting of data and efficient elimination of duplicate data items
Self-Referential Structures
Self-referential structures Structure that contains a pointer to a structure of the same type Can be linked together to form useful data structures such as lists, queues, stacks and trees Terminated with a NULL pointer (0) Diagram of two self-referential structure objects linked together
15
10
Linked Lists
Linked list
Linear collection of self-referential class objects, called nodes Connected by pointer links Accessed via a pointer to the first node of the list Subsequent nodes are accessed via the link-pointer member of the current node Link pointer in the last node is set to null to mark the lists end
Stacks
Stack
New nodes can be added and removed only at the top Similar to a pile of dishes Last-in, first-out (LIFO) Bottom of stack indicated by a link member to NULL Constrained version of a linked list
push
Adds a new node to the top of the stack
pop
Removes a node from the top Stores the popped value Returns true if pop was successful
Queues
Queue
Similar to a supermarket checkout line First-in, first-out (FIFO) Nodes are removed only from the head Nodes are inserted only at the tail
Trees
Tree nodes contain two or more links
All other data structures we have discussed only contain one
Binary trees
All nodes contain two links
None, one, or both of which may be NULL
The root node is the first node in a tree. Each link in the root node refers to a child A node with no children is called a leaf node
Trees
Diagram of a binary tree
B
A C
Trees
Binary search tree
Values in left subtree less than parent Values in right subtree greater than parent Facilitates duplicate elimination 2 Fast searches - for a balanced tree, 47 maximum of log n comparisons
25 11 7 17 43 31 44 65 68 77 93
Tree traversals:
Trees
Inorder traversal prints the node values in ascending order 1. Traverse the left subtree with an inorder traversal 2. Process the value in the node (i.e., print the node value) 3. Traverse the right subtree with an inorder traversal Preorder traversal 1. Process the value in the node 2. Traverse the left subtree with a preorder traversal 3. Traverse the right subtree with a preorder traversal Postorder traversal 1. Traverse the left subtree with a postorder traversal 2. Traverse the right subtree with a postorder traversal