2 - Database Design
2 - Database Design
Database Design
School of Computing and Information Technology -
University of Wollongong
Database Design
Outline
TOP Created by Janusz R. Getta, CSIT115/CSIT815 Data Management and Security, Summer 2020/2021 2/16
TOP Created by Janusz R. Getta, CSIT115/CSIT815 Data Management and Security, Summer 2020/2021 3/16
Database Design
Outline
TOP Created by Janusz R. Getta, CSIT115/CSIT815 Data Management and Security, Summer 2020/2021 4/16
Database Domain
A database domain is a selected fragment of the real world to be
described by the contents of a database
For example, a typical simple business domain can be described as a
sequence of statements:
- A company would like to store and to maintain information about its suppliers
and the parts shipped by the suppliers
- A supplier is described by a supplier name, date of birth, salary, and city he/she
lives in
- A part is described by a part number, part name, colour and price
- A shipment is described by a supplier number, part name and the quantity of
ordered parts
- A supplier is identified by its supplier number and a part is identified by its part
number
TOP Created by Janusz R. Getta, CSIT115/CSIT815 Data Management and Security, Summer 2020/2021 5/16
Database Design
Outline
TOP Created by Janusz R. Getta, CSIT115/CSIT815 Data Management and Security, Summer 2020/2021 6/16
Database Schema
A database schema is a description of stored data expressed in the
terms of a particular data abstraction level
- For example, a conceptual schema is a description of stored data expressed in
the terms of classes objects, properties of objects, identifiers of classes of
objects, associations between the classes of objects, multiplicities of attributes
and associations and generalization hierarchies
- For example, a logical schema is a description of stored data expressed in the
terms of attributes, values of attributes, rows, columns, headers and tables
- For example, a physical schema is a description of stored data expressed in the
terms of files, indexes, clusters, partitions, materializations, segments, extents
and data blocks
TOP Created by Janusz R. Getta, CSIT115/CSIT815 Data Management and Security, Summer 2020/2021 7/16
Database Design
Outline
TOP Created by Janusz R. Getta, CSIT115/CSIT815 Data Management and Security, Summer 2020/2021 8/16
Object Modeling
Object modeling is a special kind of conceptual modeling where a
specification of a database domain is transformed into a simplified class
diagram (conceptual schema)
Principles of object modeling:
- Contents of a database is quantised into discrete objects
- Objects are described by the attributes (properties) and operations (methods)
- Good news: we ignore the operations !
- Objects are identified by the values of selected attributes
- A class of objects is a group of homogeneous objects with common properties,
common semantics and common identifiers
TOP Created by Janusz R. Getta, CSIT115/CSIT815 Data Management and Security, Summer 2020/2021 9/16
Object Modeling
Examples:
- A student is an object, a lecturer is an object, a lecture hall is an object, a
shipment is an object, an accident is an object, etc
- A student is described by the attributes student number, first name, last name,
date of birth, etc
- A student is identified by a student number, a lecture hall is identified by
building number and room number, a shipment is identified by a supplier
name, date, and time, etc
- A group of students forms a class STUDENT, a group of lecturers forms a class
LECTURER, a group of shipments forms a class SHIPMENT, etc
TOP Created by Janusz R. Getta, CSIT115/CSIT815 Data Management and Security, Summer 2020/2021 10/16
Object Modeling
More object modeling concepts:
- A link a conceptual connection between two or more objects
- An association represents a group of homogeneous links with a common
structure, common attributes, common semantics and common identifiers
Examples of links:
- James talks to Janusz
- Lecture 1 in CSIT115 is in building 3 room 2
- Peter supplies bolts to James
Examples of associations:
- STUDENT Talks-to LECTURER
- LECTURE Is-in BUILDING
- SUPPLIER Supplies PART To MANUFACTURER
TOP Created by Janusz R. Getta, CSIT115/CSIT815 Data Management and Security, Summer 2020/2021 11/16
Object Modeling
Visualizations of objects, links, classes, and associations
TOP Created by Janusz R. Getta, CSIT115/CSIT815 Data Management and Security, Summer 2020/2021 12/16
Object Modeling
More object modeling principles:
- A generalization hierarchy represents Is-a-subset relation between the classes
of objects
- If a set of all objects in a class X is a subset of a set of all objects in a class Y then
class Y is a generalization of class X
- In other words, if a class Y is a generalization of class X then a set of all objects
in Y includes a set of all objects in X
Example of generalization:
- A class STUDENT is a generalization of classes UNDERGRADUATE STUDENT
and POSTGRADUATE STUDENT
- This is so, because a set of all undergraduate students is a subset of a set of all
students and a set of all postgraduate students is a subset of a set of all
students
- In other words, a set of all students includes a set of all postgraduate students
and it also includes a set of all undergraduate students
TOP Created by Janusz R. Getta, CSIT115/CSIT815 Data Management and Security, Summer 2020/2021 13/16
Object Modeling
Visualizations of generalizations UNDERGRADUATE STUDENT ISa
STUDENT and POSTGRADUATE STUDENT ISA STUDENT
TOP Created by Janusz R. Getta, CSIT115/CSIT815 Data Management and Security, Summer 2020/2021 14/16
Object Modeling
Another example of generalization:
- A class HUMAN is a generalization of classes STUDENT and LECTURER
- This is so because a set of all students is a subset of a set of all humans and a
set of all lecturers is a subset of a set of all humans
- In other words, a set of all humans includes a set of all students and it also
includes a set of all lecturers
Yet another (... and it is my favorite ...) example of generalization:
- A class BAT is a generalization of classes GREY-BAT, VAMPIRE-BAT, and
BATMAN
- This is so because a set of all grey bats is a subset of a set of all bats and a set of
all vampire bats is a subset of a set of all bats and a set of all batmen is a subset
of a set of all bats
TOP Created by Janusz R. Getta, CSIT115/CSIT815 Data Management and Security, Summer 2020/2021 15/16
References
C. Coronel, S. Morris, A. Basta, M. Zgola, Data Management and Security,
Chapter 2, Cengage Compose eBook, 2018, eBook: Data Management
and Security, 1st Edition
T. Connoly, C. Begg, Database Systems, A Practical Approach to Design,
Implementation, and Management, Chapter 10 Database System
Development Cycle, Pearson Education Ltd, 2015
TOP Created by Janusz R. Getta, CSIT115/CSIT815 Data Management and Security, Summer 2020/2021 16/16