Lecture 1 - Intro to DB and Modelling
Lecture 1 - Intro to DB and Modelling
Level 4
1
Overview
Introduction to the module
What are databases, who uses them and
◦ Entities
◦ Entity Relationship Diagrams
◦ Entity Descriptions
2
Module Aims
To introduce you to the stages involved in the
development of database systems
◦ Analysis & Design - Data modelling
Introduces the basic development processes used to
build a database
◦ Using ORACLE 19c
with Application Express (APEX 21.1.2 )
3
Learning Outcomes
1. Produce database models and design
for a complex set of user
requirements.
4
Learning Methods
Lectures – Vital as introduction to key topics
◦ Videos of the lectures will be available on MyBeckett
Workbook - used in practical sessions
4 Hours of self study per module per week
◦ MyBeckett – a range of additional activities e.g.
additional exercises, online quizzes, reading, practical
exercises, self assessment etc.
◦ All weekly tasks listed in workbook should be
completed before the following week’s practical
session.
Module Handbook lists the weekly topics,
assessments, dates
5
Who uses Databases?
Who uses Databases - nearly
everyone?
SOCIAL NETWORKS – Facebook, Twitter
UNIVERSITY – student records, results
BANKS – bank accounts, transactions
POLICE – national computer, links to other
systems, international
INLAND REVENUE – tax and payment records
NHS – medical records, appointments, tests
GOVERNMENT – council tax, electoral role
BUSINESS large and small – accounts, payroll,
stock control, data warehousing, data mining,
auction sites, …
7
Types of Databases
Hierarchical Databases – represents data as hierarchical tree
structure starting at a single root to which all other data is
linked
8
Types of Databases
Object-Oriented Databases – defined in
terms of objects, their properties and
their Hierarchical Model operations
9
Types of Databases
Relational Databases – data organised in two dimensional
tables with relationships maintained between tables
10
The Relational Database
Management System (RDBMS)
Jobs in Oracle (IT Jobs Watch
Nov 2022)
Database Design Stages
Analysis from a
Data driven
perspective
Logical
Design
Physical Implementation
13
Entity Relationship
Diagram
Entities and their relationships shown as a
MUSICIAN EVENT
has
play s in
is made up of is av ailable f or
14
Entities or more formally Entity
Types
◦ Entity (Type) - something the system needs to store data
about
◦ ‘An entity is a thing of interest to a system about which
data is kept’ (Lejk and Deeks, 2002)
◦ They can be:
Tangible Objects
Roles played
Sites or Locations
Organisational Units
Events or Transactions
◦ Defined in the singular and named in uppercase
◦ Represented as a rectangle on Entity Relational Diagrams
◦ Entity Descriptions are also an important part of the data
dictionary
Attributes of Entities
‘An attribute is an item of data held about
an entity’ (Lejk and Deeks, 2002)
Each entity has defined an attribute
structure
For an entity BOOK, what attributes might
there be?
What about an entity STUDENT?
How do you know which BOOK or
structure
For an entity BOOK, what attributes might
there be?
What about an entity STUDENT?
How do you know which BOOK or
by identifying attribute
For the STUDENT entity – the full student name
will be an occurrence
For the entity BOOK – the actual title will be an
occurrence
Entities, Attributes and
Occurrences
Entity Type FOOTBALLER
entities)
Ensure all 4 Tests of an entity type apply
Test one The object should be of importance in the
system being studied
Test two There should be data attributes that can be
associated with the entity
Test There should be more than one occurrence of
three this entity type
Test four It should not be an attribute of an entity
20
Identify Entity Types
Formula One example
There are 11 F1 Teams e.g. Mercedes,
McLaren, Ferrari, Williams etc. which engage
drivers to take part in the F1 World
Championship. Each F1 Team is based in
one country e.g. Williams and McLaren are
British, Mercedes is German etc. F1 Teams
contract drivers to race for them in the 20
races which take place each year.
21
Identify Candidate Entity
Types
Formula One example
There are 11 F1 Teams e.g. Mercedes,
McLaren, Ferrari, Williams etc. which engage
drivers to take part in the F1 World
Championship. Each F1 Team is based in
one country e.g. Williams and McLaren are
British, Mercedes is German etc. F1 Teams
contract drivers to race for them in the 20
races which take place each year.
22
Identify Candidate Entity
Types
Formula One example
There are 11 F1 Teams e.g. Mercedes,
McLaren, Ferrari, Williams etc. which engage
drivers to take part in the F1 World
Championship. Each F1 Team is based in
one country e.g. Williams and McLaren are
British, Mercedes is German etc. F1 Teams
contract drivers to race for them in the 20
races which take place each year.
23
Remove Candidate Entity Types
failing any of the 4 tests
Formula One example
There are 11 F1 Teams e.g. Mercedes, McLaren,
Ferrari, Williams etc. which engage drivers to take
part in the F1 World Championship. Each F1 Team
is based in one country e.g. Williams and McLaren
are British, Mercedes is German etc.. F1 Teams
contract drivers to race for them in the 20 races
which take place each year.
24
Remove Candidate Entity Types
failing any of the 4 tests
Formula One example
There are 11 F1 Teams e.g. Mercedes, McLaren,
Ferrari, Williams etc. which engage drivers to take
part in the F1 World Championship. Each F1 Team
is based in one country e.g. Williams and McLaren
are British, Mercedes is German etc.. F1 Teams
contract drivers to race for them in the 20 races
which take place each year.
25
Remove Candidate Entity Types
failing any of the 4 tests
Formula One example
There are 11 F1 Teams e.g. Mercedes, McLaren,
Ferrari, Williams etc. which engage drivers to take
part in the F1 World Championship. Each F1 Team
is based in one country e.g. Williams and McLaren
are British, Mercedes is German etc.. F1 Teams
contract drivers to race for them in the 20 races
which take place each year.
26
Identify Attributes
Formula One example
There are 11 F1 Teams e.g. Mercedes,
McLaren, Ferrari, Williams etc. which engage
drivers to take part in the F1 World
Championship. Each F1 Team is based in
one country e.g. Williams and McLaren are
British, Mercedes is German etc.. F1 Teams
contract drivers to race for them in the 20
races which take place each year.
27
Entity Type Definition
Entity Attributes Entity Description
Type
TEAM Teamname, Base, … A support team in the
Formula One
Championship
DRIVER Surname, Firstnames, A driver contracted to
country, … drive in the Formula One
Championship
RACE RaceNumber, raceyear, A date at an approved
racedate, … location at which the
Formula One
Championship takes place
Entity Type Definition - more
attributes
Entity Attributes Entity Description
Type
TEAM Teamname, FullTeamname, A support team in the
Base, FirstYear, Powerunit Formula One
Championship
DRIVER Surname, Firstnames, A driver contracted to
Dateofbirth, country, place drive in the Formula One
ofbirth Championship
RACE RaceNumber, trackname, A date at an approved
raceyear, racedate location at which the
Formula One
Championship takes place
Entity Type Definition - more
attributes
Entity Attributes Entity Description
Type
TEAM Teamname, FullTeamname, A support team in the
Base, FirstYear, Powerunit Formula One
Championship
DRIVER Surname, Firstnames, A driver contracted to
Dateofbirth, country, place drive in the Formula One
ofbirth Championship
RACE RaceNumber, trackname, A date at an approved
raceyear, racedate location at which the
Formula One
Championship takes place
Identifying Attributes?
Entity Type Definition with
identifying attribute
Entity Attributes Entity Description
Type
TEAM Teamname, FullTeamname, A support team in the
Base, FirstYear, Powerunit Formula One
Championship
DRIVER Surname, Firstnames, A driver contracted to
Dateofbirth, country, place drive in the Formula One
ofbirth Championship
RACE RaceNumber, trackname, A date at an approved
raceyear, racedate location at which the
Formula One
Championship takes place
Review
Introduction to the module – Assessment overview, dates
and times (in Module handbook), types
What are databases, who uses them
Database Design Stages – Conceptual Analysis, Logical
Analysis, Physical Implementation
Conceptual Analysis - Entity Types, Candidate Entity
Types, 4 tests of Entity Types, Attributes, Entity
Descriptions, Identifying Attributes,
Occurrences, Attribute Values
More Data Modelling next week – Relationships