04 - Relational Databases
04 - Relational Databases
Relational Databases
4-1
Learning Objectives
Describe the difference between database systems and file-based legacy systems.
Explain fundamental concepts of database systems such as DBMS, schemas, the data dictionary, and
DBMS languages.
4-2
Data Hierarchy
Field
Attributes about
an entity
Record
Related group of
fields
File
Related group of
records
Database
Related group of
files
4-3
Advantages of Database Systems
Data Integration
Files are logically combined and made accessible to various systems.
Data Sharing
With data in one place it is more easily accessed by authorized users.
Data Independence
Data is separate from the programs that access it. Changes can be made to the data
without necessitating a change in the programs and vice versa.
Cross-Functional Analysis
Relationships between data from various organizational departments can be more easily
combined.
4-4
Database Terminology
Data Dictionary
Information about the structure of the database
Field names, descriptions, uses
4-5
Logical vs. Physical
Physical View
Depends on explicitly knowing:
How is the data actually arranged in a file
Where is the data stored on the computer
Logical View
A Schema separates storage of data from use of the data
Unnecessary to explicitly know how and where data is stored.
4-6
Schemas
4-7
DBMS Languages
4-8
Relational Database
Table
Each row, a tuple, contains data about one instance of an entity.
This is equivalent to a record
Each column contains data about one attribute of an entity.
This is equivalent to a field
4-9
Row (Record) A Relational Table
4-10
Attributes
Primary Key
An attribute or combination of attributes that can be used to uniquely
identify a specific row (record) in a table.
Foreign Key
An attribute in one table that is a primary key in another table.
Used to link the two tables
4-11
Database Design Errors
4-12
Design Requirements for Relational Database
3. Foreign keys must contain the same data as the primary key in
another table.
4-13
Normalizing Relational Databases
4-14