Professional Documents
Culture Documents
Databases Y11 1
Databases Y11 1
Data Redundancy
Data integrity
Copyright ©2016 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. MIS5 | CH3 10
Methods for Accessing Files
Sequential access file structure
• Records are organized and processed in numerical or sequential
order
• Organized based on a primary key
Social Security numbers or account numbers
• Used for backup and archive files as they rarely need updating
Types of Data in a Database
Internal
• Collected from within an organization
• Stored in the organization’s internal databases
External
• Comes from a variety of resources
• Stored in a data warehouse
Methods for Accessing Files
Random access file structure
• Records can be accessed in any order irrespective of the physical
locations in storage media
• Fast and very effective when a small number of records need to be
processed daily or weekly
• Records are stored on magnetic tapes
Methods for Accessing Files
Indexed sequential access method (ISAM)
• Records are accessed sequentially or randomly depending on the
number being accessed
Random access is used for a small number
Sequential access is used for a large number
• Uses an index structure and has two parts
Indexed value
Pointer to the disk location of the record matching the indexed value
Logical Database Design
Physical view
• Involves how data is stored on and retrieved from storage media
Hard disks, magnetic tapes, or CDs
Logical view
• Involves how information appears to users and how it can be
organized and retrieved
• Includes more than one logical view of data, depending on the user
Logical Database Design
Data model
Determines how data is created, represented, organized, and
maintained
Contains
Data structure
Operations
Integrity rules
Hierarchical model
Relationships between records form a treelike structure
Exhibit 3.3 A Hierarchical Model
Copyright ©2016 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. MIS5 | CH3 17
Logical Database Design
Network model
• Similar to the hierarchical model but records are organized differently
• Includes multiple parent and child records
Exhibit 3.4 A Network Model
Copyright ©2016 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. MIS5 | CH3 19
Relational Model
Uses a two-dimensional table of rows and columns of data
• Rows are records
• Columns are fields
Data dictionary: Stores definitions
• Data types for fields, default values, and validation rules for data in
each field
Relational Model
Primary key
• Uniquely identifies every record in a relational database
Foreign key
• Field in a relational table that matches the primary key column of
another table
• Used to cross-reference tables
Creating a relational database
Band
Band members
Access
Understanding relational tables & keys
MemberID MemberGivenName MemberFamilyName BandName
BandName AgentID
ComputerKidz 01
ITWhizz 07
What do these terms mean?
1. Relation – A special/specific type of table used in relational databases
2. Attribute – A field name e.g. BandName, Name, Surname, Age
3. Tuple – A row or record in a database, so one entity with all it's
attributes
4. Atomic values (in a database table) - A single value to represent an
attribute or none
5. Candidate key – A suitable candidate as a primary key (Unique)
6. Primary key - A unique attribute field e.g. Member ID
Cont…
1. Foreign key – A key used to link back to the primary table
2. Secondary key - a second suitable primary key that wasn't chosen
3. Referential integrity – links two tables so that records cannot be
entered in a table where a foreign key is that do not exist in the table
with the primary key linked to it.