file and database design; logic modeling class 24
TRANSCRIPT
![Page 1: File and Database Design; Logic Modeling Class 24](https://reader035.vdocuments.us/reader035/viewer/2022062715/56649da35503460f94a8fdf7/html5/thumbnails/1.jpg)
File and Database Design; Logic Modeling
Class 24
![Page 2: File and Database Design; Logic Modeling Class 24](https://reader035.vdocuments.us/reader035/viewer/2022062715/56649da35503460f94a8fdf7/html5/thumbnails/2.jpg)
SDLCProject Identification
& Selection
Project Initiation& Planning
Analysis
Logical Design
Physical Design***
Implementation
Maintenance
![Page 3: File and Database Design; Logic Modeling Class 24](https://reader035.vdocuments.us/reader035/viewer/2022062715/56649da35503460f94a8fdf7/html5/thumbnails/3.jpg)
Databases File Systems Databases
Hierarchical Database Model Network Database Model Relational Database Model Object Oriented Database Model
![Page 4: File and Database Design; Logic Modeling Class 24](https://reader035.vdocuments.us/reader035/viewer/2022062715/56649da35503460f94a8fdf7/html5/thumbnails/4.jpg)
File Systems Each new application is designed
with its own set of files. Problems:
Changes in files require changes to programs.
Uncontrolled redundancy Inconsistent data Limited data sharing
![Page 5: File and Database Design; Logic Modeling Class 24](https://reader035.vdocuments.us/reader035/viewer/2022062715/56649da35503460f94a8fdf7/html5/thumbnails/5.jpg)
Database Approach Negatives
Need new, specialized personnel
Need for explicit backups
Interference due to shared data
Organizational conflict
Postives Minimal data
redundancy Consistent data Integration of data Sharing of data Data independence Ease of application
development Reduced program
maintenance
![Page 6: File and Database Design; Logic Modeling Class 24](https://reader035.vdocuments.us/reader035/viewer/2022062715/56649da35503460f94a8fdf7/html5/thumbnails/6.jpg)
Designing a relational database Create a table (file) for each entity type. Choose a primary key for each table. Choose appropriate data types and value
restrictions for each field. Create new tables to represent many-to-many
relationships. Add foreign keys to represent one-to-many
relationships. Define referential integrity constraints. Evaluate schema quality and make necessary
improvements.
![Page 7: File and Database Design; Logic Modeling Class 24](https://reader035.vdocuments.us/reader035/viewer/2022062715/56649da35503460f94a8fdf7/html5/thumbnails/7.jpg)
What we’re looking at Databases, Tables (files, entities),
Records, Fields (attributes)
How we’ll define above in the Data Dictionary
![Page 8: File and Database Design; Logic Modeling Class 24](https://reader035.vdocuments.us/reader035/viewer/2022062715/56649da35503460f94a8fdf7/html5/thumbnails/8.jpg)
Tables Each entity on your ER diagram
will become a table in your database.
![Page 9: File and Database Design; Logic Modeling Class 24](https://reader035.vdocuments.us/reader035/viewer/2022062715/56649da35503460f94a8fdf7/html5/thumbnails/9.jpg)
Records A row in the table. A group of fields (or attributes)
stored in adjacent memory locations and retrieved together as a unit.
![Page 10: File and Database Design; Logic Modeling Class 24](https://reader035.vdocuments.us/reader035/viewer/2022062715/56649da35503460f94a8fdf7/html5/thumbnails/10.jpg)
Fields May also be called an attribute or
data element.
All fields (or attributes on your ER diagram) will be defined in the Data Dictionary.
![Page 11: File and Database Design; Logic Modeling Class 24](https://reader035.vdocuments.us/reader035/viewer/2022062715/56649da35503460f94a8fdf7/html5/thumbnails/11.jpg)
Fields Name Data type Primary key(s) Data integrity Handling missing data Ownership
![Page 12: File and Database Design; Logic Modeling Class 24](https://reader035.vdocuments.us/reader035/viewer/2022062715/56649da35503460f94a8fdf7/html5/thumbnails/12.jpg)
Data Integrity Default value Picture control Range controls Null Value controls
![Page 13: File and Database Design; Logic Modeling Class 24](https://reader035.vdocuments.us/reader035/viewer/2022062715/56649da35503460f94a8fdf7/html5/thumbnails/13.jpg)
Data Dictionary The repository of all data
definitions for all organizational applications.
![Page 14: File and Database Design; Logic Modeling Class 24](https://reader035.vdocuments.us/reader035/viewer/2022062715/56649da35503460f94a8fdf7/html5/thumbnails/14.jpg)
What we’ll show in a DD: Table (file) (entity) name All fields (attributes) within the
table. For each field:
Name Note if primary key Definition/description of field Data type (page 352, or whether its
numeric or character plus the length)
![Page 15: File and Database Design; Logic Modeling Class 24](https://reader035.vdocuments.us/reader035/viewer/2022062715/56649da35503460f94a8fdf7/html5/thumbnails/15.jpg)
TABLE: PIG
Primary Key Attribute
NameAttribute Definition Attribute Type
* PigID The unique identifier of the pig
5 numeric characters
PigName The name of the pig 15 alpha characters
PigWeight The weight, in pounds and ounces of the pig
6 numeric characters, with 2 numbers after the decimal
PigGender The gender of the pig – either male or female
1 alpha character, M or F are allowed
![Page 16: File and Database Design; Logic Modeling Class 24](https://reader035.vdocuments.us/reader035/viewer/2022062715/56649da35503460f94a8fdf7/html5/thumbnails/16.jpg)
Logic Modeling Knowing what’s going on inside the
programs. What is the logic to create the reports, calculated fields?
We’ll show logic modeling through use of decision trees and decision tables.
![Page 17: File and Database Design; Logic Modeling Class 24](https://reader035.vdocuments.us/reader035/viewer/2022062715/56649da35503460f94a8fdf7/html5/thumbnails/17.jpg)
![Page 18: File and Database Design; Logic Modeling Class 24](https://reader035.vdocuments.us/reader035/viewer/2022062715/56649da35503460f94a8fdf7/html5/thumbnails/18.jpg)
![Page 19: File and Database Design; Logic Modeling Class 24](https://reader035.vdocuments.us/reader035/viewer/2022062715/56649da35503460f94a8fdf7/html5/thumbnails/19.jpg)
Decision Tables A matrix representation of the
logic of a decision, which specifies the possible conditions for the decision and the resulting actions. Condition stubs Action stubs Rules
![Page 20: File and Database Design; Logic Modeling Class 24](https://reader035.vdocuments.us/reader035/viewer/2022062715/56649da35503460f94a8fdf7/html5/thumbnails/20.jpg)
Steps in creating Decision tables: Name all conditions and the values each
condition can assume. Name all possible actions that can occur. List all possible rules based on every
possible combination of conditions. Define the actions for each rule. Simplify the decision table by removing
“indifferent conditions”.
![Page 21: File and Database Design; Logic Modeling Class 24](https://reader035.vdocuments.us/reader035/viewer/2022062715/56649da35503460f94a8fdf7/html5/thumbnails/21.jpg)
Examples!
![Page 22: File and Database Design; Logic Modeling Class 24](https://reader035.vdocuments.us/reader035/viewer/2022062715/56649da35503460f94a8fdf7/html5/thumbnails/22.jpg)
Decision Trees A graphical representation of a
decision situation in which decision situation points (nodes) are connected together by arcs (one for each alternative on a decision) and terminate in ovals (the action that is the result of all of the decisions made on the path leading to the oval
![Page 23: File and Database Design; Logic Modeling Class 24](https://reader035.vdocuments.us/reader035/viewer/2022062715/56649da35503460f94a8fdf7/html5/thumbnails/23.jpg)
Decision trees Often used for statistical reasons –
for calculating probabilities and making choices based on probabilities.
Used more often for “simpler” problems.
![Page 24: File and Database Design; Logic Modeling Class 24](https://reader035.vdocuments.us/reader035/viewer/2022062715/56649da35503460f94a8fdf7/html5/thumbnails/24.jpg)
Examples!