Friday, 11 December 2009

DBMS: Getting Data Together

The Hierarchy of Data

  • Field – a group of one or more characters that has a specific meaning
  • The smallest meaningful unit of data
  • Describes one characteristic of a person, place, or thing
  • Record – the set of fields containing data about a person, place, or thing
  • File – a collection of related records



File System Approach
  • Each application had its own file
Data was not shared among application
  • Resulted in a great deal of data redundancy, the repetition of the same data value
Increased the risk of inaccurate data
Increased the amount of storage space needed.




Database Approach

A collection of related tables
  • In database technology, a file is called a table
  • Each entity is stored in a separate table
  • Tables are linked by a relationship between primary and foreign keys

Primary Key

A field that uniquely identifies a record
  • SalesID can be a primary key for the Salesperson table
  • Once a salesID appear in the table, no other salesperson can have that ID
Foreign Key

A field in one table that is a primary key in another table
  • SalesID can be used in the Customer table to identify the salesperson who serves that customer
  • The same SalesID can appear in many customer records (a salesperson can serve many customers)

DATABASE MODEL

  • Define the way a database organizes data
  • Four main models
  1. Hierarchical
  2. Network
  3. Relational
  4. Object-oriented

Hierarchical Model
1. Arranges data in hierarchical "parent-child" relationship
  • Each parent record can have many child records
  • Each child record has only one parent record
2. Complex and inflexible


Network Model
1. Arranges data in complex network of "parent-child" relationship
  • Each parent record can have many child records
  • Each child record can have many parent records
2. Complex and inflexible

Relational Model
1. Data organized in table format
  • Columns represent fields
  • Row represent record
2. Tables related by primary/foreign key relationship
3. Most current database development uses this model



Object-oriented Model
1. Designed to deal with complex data types
2. Focuses on the object
  • An object represents an entity
  • Represents data about that entity and the types of operations that change that entity

0 komentar:

CLICK TO WRITE YOUR COMMENT

Title