Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 20

MODELS OF

DATABASE AND
DATABASE DESIGN
LECTURE ONE
OBJECTIVES

By the end of this lecture students should be able to


understand the basic concepts of database design including
differentiating a database from a database management
system (DBMS), describing the properties of a database,
describing the DBMS languages and comparing the different
data models that exist .
WHAT IS A DATABASE?

• A shared collection of logically related data and a description of this


data designed to meet the information needs of an organisation
• Is a single repository possibly large repository of data that can be
used simultaneously by many departments and users
Alternatively it can be defined as a collection of persistent data that
can be shared and is interrelated.
I like this definition because it points out some important properties
that a database possesses. These properties have been underlined
above. Now lets discuss what these properties mean.
FILING SYSTEM VS DATABASE
SYSTEM
Lets discuss the difference between the filing system and the database
system in light of the features below:
i)Query Ability
ii)Redundancy Control
iii)Access Control related to permissions
iv)Backup and Migration
v)Integrity Constraints
DATABASE MANAGEMENT SYSTEM

A software that interacts with the users’ application programs and


the database
A software system that enables users to define, create, maintain
and control access to the database
The 2nd definition is very comprehensive. It describes the various
operations that can be performed on the database through the
DBMS. Let us discuss these operations…
A DBMS has the following languages

Data Definition Language (DDL)


Data Manipulation Language (DML)
Structured Query Language (SQL)

Let us discuss these languages ….


Data Definition Language

The DDL allows users to specify the data types and structures of the
constraints on the data to be stored in the database.
E.G.
Create table Employees (empid INT UNIQUE NOT NULL, empname
varchar (15), empaddress varchar (25), primary key (empid))
Data Manipulation Language

It allows users to insert, update, delete and


retrieve data from the database
E.G.
Insert into Employees values (23, “Tawanda Shoko”,
“15 Nehanda Road Senga”);
Having a central repository for all data and data descriptions allows
the DML to provide a general inquiry facility to this data called a query
language; the most common query language is the Structured Query
Language (SQL)

Now what is SQL?????


Structured Query Language

Is a relational database language which contains 2 kinds of statements:


i)Data definition statements that lets a user define and modify the
schema of the database
ii)Data manipulation statements that lets a user create, access and
modify data in the database
DDL statements

Statement Description
CREATE TABLE Defines a table in a database
DROP TABLE Deletes a table from a database

ALTER TABLE Modifies a table in a database

CREATE INDEX Adds an index to a table


DROP INDEX Deletes an index from a table
DML statements

Statement Description
SELECT Retrieves and displays one or more
rows from a table
INSERT INTO Adds news rows to a table
UPDATE Changes column values in one or more
rows of a table
DELETE FROM Deletes one or more rows from a table

UNION Combines two or more SELECT


statements to create a complex query
DATABASE MODELS
• Model- is an abstraction or representation of
the real world that reveals all features of
interest to the users of the information in the
model
• Models are created to better understand a
process/ phenomenon/activity
• A model is used to provide a representation of
items, events and relationship sets between
them and to provide all the basic concepts and
rules for good communication between
developers and users
• A data model is defined as a way finding tool for both
business and IT professionals which uses a set of
symbols and text to precisely explain a subset of real
information to improve communication within the
organization and thereby lead to a more flexible and
stable application environment
• Data model is a tool for data abstraction representing
the organization itself and helps users clearly and
accurately communicate their understanding of the
organization data
• It organizes data elements and standardizes
how the data elements relate to one
another. Since data elements document real
life people, places and things and the events
between them, the data model represents
reality, for example a student registers for
many modules or a lecturer teaches many
students
DATA MODEL CATEGORIES
High Level/ Object Based/ Conceptual Based
They provide concepts that are close to the user or
close to the way the user sees the database
They describe data at the conceptual and external
view levels
Allows one to specify data constraints explicitly
e.g. ER model, Object oriented model, semantic
model
Implementation/ Record Based/ Representational
They are used to specify the logical structure
of the database
The database is structured in fixed format
records of several types and each record type
defines a fixed number of fields/ attributes and
each field is usually of a fixed length
E.g. hierarchical, relational and network
Physical/ Low Level data model
They provide concepts that describe the data
of how data (metadata) is stored in the
computer
Concepts at this level are meant for computer
specialists and not meant for typical end users
THANK YOU
QUESTIONS????

You might also like