Docsity

Database Systems: Understanding Different Architectures and Objects, Slides of Fundamentals of E-Commerce

Partial preview of the text

Download Database Systems: Understanding Different Architectures and Objects and more Slides Fundamentals of E-Commerce in PDF only on Docsity!

Introduction to Databases

Docsity.com

Learning Objectives

  • To describe a database
  • Understand hierarchical, relational, and object- oriented databases
  • Understand the process for developing a database system
  • Create entity relationship models to describe a database design
  • Derive database tables using an entity relationship model

Overview of Databases

  • Data file approach to data processing

Overview of Databases (cont’d)

  • In the case above (data file approach), each

application must have its own tools for:

  • Inserting new data
  • Viewing existing data
  • Updating existing data
  • Deleting existing data

Overview of Databases (cont’d)

Database Objects & Structures

  • How do databases store data?
    • In data files
    • DBMS manages data files
    • DBMS enables users to perform basic data-handling procedures
  • How should we organize data files?
    • Understand the structure of the database
    • Understand the database objects

Database Objects (cont’d)

  • Attribute
    • Data value of an entity
    • Examples
      • StudentID
      • Firstname
  • Relationship
    • Used to represent a connection among related entities, like a link

Database Objects (cont’d)

Database Structures

  • Three primary database structures
    • Hierarchical databases
    • Relational databases
    • Object-Oriented databases
  • Each structure stores data entity instance

values and represents relationships

differently

Hierarchical Databases

  • Entities have parent-to-child relationship
  • Uses pointers to create relationship between associated data items
  • Pointer
    • Unique address value that defines the physical location of where data is stored on a storage device
    • Links data values of the parent entity instance with multiple child entity instances

Hierarchical Databases (cont’d)

  • Problems with Hierarchical Databases
    • Difficult to move to new storage medium
      • Data is physically dependent on its location on the storage media
    • Changes to database structure require rewriting of programs - Time-consuming - Expensive

Relational Databases

Understand or memorize this info!

  • Tables
    • Stores the data
  • Records (like a row in a table)
    • Contains data about an individual entity instance
  • Fields (table columns)
    • Attributes that are associated with individual data values
  • Key fields
    • Create relationship among records in different tables

Relational Databases – Key Fields

  • Primary key
    • Table field that uniquely identifies a record
    • Cannot be NULL
    • Mandatory for each table
  • Surrogate key (SUK)
    • Fields that did not appear automatically (VIN or SIN) but were created by designers to be a designated primary key (e.g., student #, customer ID)
    • Unique, can be generated automatically for new records

Relational Databases – Key Fields

(cont’d)

  • Foreign keys
    • Create a relationship between two tables
    • A primary key field in one table (parent) and acts as a foreign key in another table (child)
    • Enforces referential integrity
      • When a table is created with a foreign key, all foreign key values must exist in the parent table
      • Populate the table with primary keys first!!!