Edo University Iyamho, Nigeria. Department of Computer Science
Edo University Iyamho, Nigeria. Department of Computer Science
Instructor:
Uddin, Osemengbe O.
Office: Faculty of Science OA9
Office Hours: Monday/Tuesday 11pm - 2pm
Email: [email protected]
Course Logistics
Lectures
Tuesday: 8am – 10am
Exams
70% of the grade
A database management system (DBMS) is system software for creating and managing
databases. The DBMS provides users and programmers with a systematic way to create,
retrieve, update and manage data.
A DBMS makes it possible for end users to create, read, update and delete data in a database.
The DBMS essentially serves as an interface between the database and end users or
application programs, ensuring that data is consistently organized and remains easily
accessible.
The DBMS manages three important things: the data, the database engine that allows data to
be accessed, locked and modified -- and the database schema, which defines the database’s
logical structure. These three foundational elements help provide concurrency, security, data
integrity and uniform administration procedures. Typical database administration tasks
supported by the DBMS include change management, performance monitoring/tuning and
backup and recovery. Many database management systems are also responsible for automated
rollbacks, restarts and recovery as well as the logging and auditing of activity.
The DBMS is perhaps most useful for providing a centralized view of data that can be
accessed by multiple users, from multiple locations, in a controlled manner. A DBMS can
limit what data the end user sees, as well as how that end user can view the data, providing
many views of a single database schema. End users and software programs are free from
having to understand where the data is physically located or on what type of storage media it
resides because the DBMS handles all requests.
The DBMS can offer both logical and physical data independence. That means it can protect
users and applications from needing to know where data is stored or having to be concerned
about changes to the physical structure of data (storage and hardware). As long as programs
use the application programming interface (API) for the database that is provided by the
DBMS, developers won't have to modify programs just because changes have been made to
the database.
With relational DBMSs (RDBMSs), this API is SQL, a standard programming language for
defining, protecting and accessing data in a RDBMS.
Relational Database Management System (RDMS) - adaptable to most use cases, but
RDBMS Tier-1 products can be quite expensive.
NoSQL DBMS - well-suited for loosely defined data structures that may evolve over time.
Columnar Database Management System (CDBMS) - well-suited for data warehouses that
have a large number of similar data items.
Cloud-based Data Management System - the cloud service provider is responsible for
providing and maintaining the DBMS.
Advantages of a DBMS
Using a DBMS to store and manage data comes with advantages, but also overhead. One of
the biggest advantages of using a DBMS is that it lets end users and application programmers
access and use the same data while managing data integrity. Data is better protected and
maintained when it can be shared using a DBMS instead of creating new iterations of the
same data stored in new files for every new application. The DBMS provides a central store
of data that can be accessed by multiple users in a controlled manner.
Central storage and management of data within the DBMS provides:
A DBMS can also provide many views of a single database schema. A view defines what
data the user sees and how that user sees the data. The DBMS provides a level of abstraction
between the conceptual schema that defines the logical structure of the database and the
physical schema that describes the files, indexes and other physical mechanisms used by the
database. When a DBMS is used, systems can be modified much more easily when business
requirements change. New categories of data can be added to the database without disrupting
the existing system and applications can be insulated from how data is structured and stored.
Of course, a DBMS must perform additional work to provide these advantages, thereby
bringing with it the overhead. A DBMS will use more memory and CPU than a simple file
storage system. And, of course, different types of DBMSes will require different types and
levels of system resources.
DBMS - Architecture
In 1-tier architecture, the DBMS is the only entity where the user directly sits on the
DBMS and uses it. Any changes done here will directly be done on the DBMS itself.
It does not provide handy tools for end-users. Database designers and programmers
normally prefer to use single-tier architecture.
If the architecture of DBMS is 2-tier, then it must have an application through which
the DBMS can be accessed. Programmers use 2-tier architecture where they access the
DBMS by means of an application. Here the application tier is entirely independent of
the database in terms of operation, design, and programming.
3-tier Architecture
A 3-tier architecture separates its tiers from each other based on the complexity of the
users and how they use the data present in the database. It is the most widely used
architecture to design a DBMS.
Relational Model
This is most common model. The relational model sorts data into tables, also known
as relations, each of which consists of columns and rows. Each column lists an
attribute of the entity in question, such as price, zip code, or birth date. Together, the
attributes in a relation are called a domain. A particular attribute or combination of
attributes is chosen as a primary key that can be referred to in other tables, when it’s
called a foreign key. Each row, also called a tuple, includes data about a specific
instance of the entity in question, such as a particular employee.
The model also accounts for the types of relationships between those tables, including
one-to-one, one-to-many, and many-to-many relationships. Here’s an example:
Another example is:
Relational databases are typically written in Structured Query Language (SQL). The
model was introduced by E.F. Codd in 1970.
Codd's 12 Rules
Dr Edgar F. Codd, after his extensive research on the Relational Model of database
systems, came up with twelve rules of his own, which according to him, a database
must obey in order to be regarded as a true relational database.
These rules can be applied on any database system that manages stored data using
only its relational capabilities. This is a foundation rule, which acts as a base for all
the other rules.
Assignment
a. Write a detailed note on Database Languages based on
1. Relational Algebra
2. Relational Calculus
b. List and explain the different database keys (Primary key, Super key,
Candidate key, Alternate key, Composite key, Foreign key) and write on
Database Integrity Rules
This model was primarily used by IBM’s Information Management Systems in the 60s
and 70s, but they are rarely seen today due to certain operational inefficiencies.
Network Model
The network model builds on the hierarchical model by allowing many-to-many
relationships between linked records, implying multiple parent records. Based on
mathematical set theory, the model is constructed with sets of related records. Each set
consists of one owner or parent record and one or more member or child records. A
record can be a member or child in multiple sets, allowing this model to convey
complex relationships. It was most popular in the 70s after it was formally defined by
the Conference on Data Systems Languages (CODASYL).
Object-Relational Model
This model combines the two (Object and Relational) that make up its name. You may
choose to describe a database with any one of these depending on several factors. The
biggest factor is whether the database management system you are using supports a
particular model. Most database management systems are built with a particular data
model in mind and require their users to adopt that model, although some do support
multiple models.
One can also say that this hybrid database model combines the simplicity of the
relational model with some of the advanced functionality of the object-oriented
database model. In essence, it allows designers to incorporate objects into the familiar
table structure. Languages and call interfaces include SQL3, vendor languages,
ODBC, JDBC, and proprietary call interfaces that are extensions of the languages and
interfaces used by the relational model.
Entity-Relationship Model
This model captures the relationships between real-world entities much like the
network model, but it isn’t as directly tied to the physical structure of the database.
Instead, it’s often used for designing a database conceptually. Here, the people, places,
and things about which data points are stored are referred to as entities, each of which
has certain attributes that together make up their domain. The cardinality, or
relationships between entities, are mapped as well.
Mapping Cardinalities −
one to one
one to many
many to one
many to many
Flat model
The flat model is the earliest, simplest data model. It simply lists all the data in a
single table, consisting of columns and rows. In order to access or manipulate the data,
the computer has to read the entire flat file into memory, which makes this model
inefficient for all but the smallest data sets.
Multidimensional model
This is a variation of the relational model designed to facilitate improved analytical
processing. While the relational model is optimized for online transaction processing
(OLTP), this model is designed for online analytical processing (OLAP).
Each cell in a dimensional database contains data about the dimensions tracked by the
database. Visually, it’s like a collection of cubes, rather than two-dimensional tables.
Semi-structured model
In this model, the structural data usually contained in the database schema is
embedded with the data itself. Here the distinction between data and schema is vague
at best. This model is useful for describing systems, such as certain Web-based data
sources, which we treat as databases but cannot constrain with a schema. It’s also
useful for describing interactions between databases that don’t adhere to the same
schema.
Context model
This model can incorporate elements from other database models as needed. It cobbles
together elements from object-oriented, semi-structured, and network models.
Associative model
This model divides all the data points based on whether they describe an entity or an
association. In this model, an entity is anything that exists independently, whereas an
association is something that only exists in relation to something else.
The associative model structures the data into two sets:
A set of items, each with a unique identifier, a name, and a type
A set of links, each with a unique identifier and the unique identifiers of a
source, verb, and target. The stored fact has to do with the source, and each of
the three identifiers may refer either to a link or an item.
Other, less common database models include:
Semantic model, which includes information about how the stored data relates
to the real world
XML database, which allows data to be specified and even stored in XML
format
Named graph
Triplestore
The graph database model, which is even more flexible than a network model,
allowing any node to connect with any other.
The multivalue model, which breaks from the relational model by allowing attributes
to contain a list of data rather than a single data point.
The document model, which is designed for storing and managing documents or
semi-structured data, rather than atomic data.
Further Reading