You are on page 1of 7

Chapter 6.

Foundations of Business Intelligence: Databases and Information


Management

What is a database and how does a relational database organize data?

bit (0/1, true/false, on/off)-> byte (8 bits) -> field -> record -> file (table) -> database

Entities (entiteit) and Attributes (characteristic, kenmerk)

Entity: Thing in which we are interested, thing on which we store data/information.

The Data Hierarchy

Table
Primary Key: One of more fields that identify a record uniquely.

Key field: unique field.

Referential Integrity

Record = Tuple = set of fields = Row in a table

Key field, Primary key (PK), Foreign Key (FK)

How are tables connected in a relational database? Entity Relationship Diagram (ERD) using Crow's Foot
Notation.
A one-to-one (1:1) relationship is when at most one instance of an entity A is associated with
one instance of entity B. For example, take the relationship between board members and
offices, where each office is held by one member and no member may hold more than one
office.

A one-to-many (1:N) relationship is when for one instance of entity A, there are zero, one, or
many instances of entity B but for one instance of entity B, there is only one instance of entity
A. An example of a 1:N relationships is

a department has many employees;


each employee is assigned to one department.

A many-to-many (M:N) relationship, sometimes called non-specific, is when for one instance
of entity A, there are zero, one, or many instances of entity B and for one instance of entity B
there are zero, one, or many instances of entity A. An example is employees may be assigned
to no more than three projects at a time; every project has at least two employees assigned to
it.
Database model (ERD) Actual/Real Database (e.g. in Access)

Entity ----> Table


Attribute ----> Field

Steps to create ERD's.


1. Read the narrative (Twice)
2. List all relevant entities
3. Find pairs of entities that are related, and draw the Relationship between the pair. In
case of many to many relationship, work that out.
4. Combine all to one ERD.
5. Add attributes to the entities
ERD Exercise 1
Develop E-R diagrams for the following:

a) Customers place orders.


- Customer
- Order
Place
Customer Order

b) People work in departments.


c) Customers buy items.
d) Vehicles are owned by persons.
e) Athletes take part in events.
f) Deliveries of parts are made to customers.

ERD Exercise 2
Draw E-R diagrams showing the cardinality for the following:
a) An invoice is sent to one customer, and many invoices can be sent to the same
customer
b) A part is used in many projects, and many projects use the part
c) A person works in one department, and there are many persons in a department.
d) A vehicle is owned by one person, and a person can own many vehicles.
e) Students take subjects. Each subject can be taken by many students, and each
student can take many subjects
f) Persons apply for loans. Each loan must be made to one person, but each person can
make many applications.
g) An operator can work on many machines, and each machine has many operators.
Each machine belongs to one department, but a department can have many machines.
ERD Exercise 3
Pick and Shovel Construction Company is a multi-state building
contractor specializing in medium-priced town homes. A customer
can hire the company for more than one project, and employees
sometimes work on more than one project at a time. Equipment,
however, is assigned to only one project at a time.

ERD Exercise 4
Each of the MegaCo Corporation’s divisions is composed of many
departments. Each of the departments has many employees
assigned to it, but each employee works for only one department.
Each department is managed by one employee, and each of these
managers can manage only one department at a time.

ERD Exercise 5
The KwikTite Corporation operates many factories. Each factory is
located in a region. Each region can be "home" to many of KwikTite’s
factories. Each factory employs many employees, but each of these
employees is employed by only one factory. An employee may have
earned many degrees, and each degree may have been earned by
many employees.
join table or intersection relation (intersect table)

You might also like