You are on page 1of 22

Database 521

Chapter 1 Database Systems


Learning outcomes

 After studying this topic you should be able to:


 Understand the difference between data and information
 Understand database approach
 Identify different user types of database
 Understand database architecture
Data vs information
 Data is a collection of values, these values can be characters, numbers or any
other data type.
 Information is processed, organized and structured or presented in a context.
 Information is in a sense that a human can read and understand.
Example of Data

Example of information
Database approach
 Database system – is a computer based system used to record and maintain
information. The information concerned can be anything of significance to the
organisation for whose use it is intended.
 Database can hold different types of data, to make things straight forward,
database contents are divided up into two concepts:
 Schema – Structure of Data, it defines how data is organized and how the relations
among them are related.
 Data – These are facts.
Imagine a case where we want to store facts about employees in a company. Such
facts could include name, address, date of birth, and salary, these are all related so
they represent some particular customer.
In a database all this information will be held in single storage container called a
table. We can call this table an Employee table.
Employee Table
Name Surname Address Date of Birth Salary

Dakalo Rambevha Lind haven 1995/12/20 R12000


Murendeni Masakona Kagiso 1998/18/2 R10000
Gloria Manoko Thembisa 1992/10/12 R13000

From this table, the schema would define that Employee table has 5 components.
NAME,SURNAME,ADDRESS,DATE OF BIRTH AND SALARY.

As a database designer, you can name the column any name but it is much better
make them meaningful because it helps. Date of birth cannot be stored in name
column. We must avoid these types of errors in databases.
 From what we know about the facts, we can say things like:
 NAME is a string and needs to hold at least 12 characters.
 ADDRESS is a string and needs to hold at least 12 Characters
 DOB is a date; the company forbids people over 100 years old or younger than
18 years old working for them.
 SALARY is a number. It must be greater than 0
These rules are enforced by a database designer.
Database users
 Database users are the one who really use and take the benefits of database.
There will be different types of users depending on their need and way of
accessing the database.
 Application Programmers – They are the developers who interact with the database
by means of DML queries. These DML queries are written in the application programs
like C, C++, JAVA, Pascal etc.
 Sophisticated Users(End-user) – They are database developers, who write SQL
queries to select/insert/delete/update data. They do not use any application or
programs to request the database. They directly interact with the database by means
of query language like SQL
 Database Admin – responsible for installing and maintaining DBMS
Database architecture
 DBMS architecture helps in design, development, implementation, and maintenance of
a database.
 A database stores critical information for a business. Selecting the correct Database
Architecture helps in quick and secure access to data.

1 tier architecture
 The simplest Database Architecture is 1 tier where the Client, Server, and Database all
reside on the same machine.
 Anytime you install a DB in your system and access it to practice SQL queries it is 1 tier
architecture. But such architecture is rarely used in production.
2 tier architecture

 A two-tier architecture is a database architecture where:


Presentation layer runs on a client (PC, Mobile, Tablet, etc.)
Data is stored on a Server.

In the above diagram we can see that one server is connected with clients 1, 2 and 3. This
architecture provides Direct and faster communication.
3 tier architecture
 3-tier schema is an extension of the 2-tier architecture. 3-tier architecture
has following layers.
 Presentation layer (your PC, Tablet, Mobile, etc.)
 Application layer (server)
 Database Server
 3 tier architecture contains an Application layer between the user and the
DBMS, which is responsible for communicating the user's request to the DBMS
system and send the response from the DBMS to the user.
 The application layer(business logic layer) also processes functional logic,
constraint, and rules before passing data to the user or down to the DBMS
 Three tier architecture is the most popular DBMS architecture.
The 3 architectures in detail
 Presentation layer/User layer is the layer where user uses the database. He
does not have any knowledge about underlying database. He simply
interacts with the database as though he has all data in front of him.
You can imagine this layer as a registration form where you will be inputting
your details.  Did you ever guessed, after pressing ‘submit’ button where the
data goes? No right? You just know that your details are saved. This is the
presentation layer where all the details from the user are taken, sent to the
next layer for processing.
 Application layer is the underlying program which is responsible for saving
the details that you have entered and retrieving your details to show up in
the page.
This layer has all the business logics like validation, calculations and
manipulations of data, and then sends the requests to database to get the actual
data. If this layer sees that the request is invalid, it sends back the message
to presentation layer.  It will not hit the database layer at all.
 Database layer is the layer where actual database resides. In this layer, all
the tables, their mappings and the actual data present.
 When you save your details from the front end, it will be inserted into the
respective tables in the database layer, by using the programs in the
application layer.
 When you want to view your details in the web browser, a request is sent to
database layer by application layer.
 The database layer fires queries and gets the data. These data are then
transferred to the browser (presentation layer) by the programs in the
application layer.
Data abstraction

 Database systems are made-up of complex data structures. To ease the user interaction


with database, developers hide internal irrelevant details from users. This process of
hiding irrelevant details from user is called data abstraction.

 There are mainly three levels of data abstraction


 Internal Level:
 Conceptual or Logical Level:
 External or View level:

Let us look at these in detail..


Internal level/Physical
 It describes how the data is stored on storage devices
 The internal schema defines the physical storage structure of the database
 The internal schema is a very low-level representation of the entire
database.
Conceptual schema
 It describes what data are stored in the database and What relationships exist
among those data.
 This schema hides information about the physical storage structures and
focuses on describing data types, entities, relationships, etc.
 Database administrator and designers work at this level to determine What
data to keep in database.
External level/End user

 An external schema describes the part of the database which specific user is
interested in. It hides the unrelated details of the database from the user.
 An external view is just the content of the database as it is seen by some
specific particular user.
 For example, a user from the sales department will see only sales related
data.
Database management system
 A database management system (DBMS) is a software package designed to
define, manipulate, retrieve and manage data in a database. A DBMS
generally manipulates the data itself, the data format, field names, record
structure and file structure. It also defines rules to validate and manipulate
this data.

 MySQL
 SQL server
 Oracle
 Microsoft access
Database administrator
 The database administrator (DBA) is a person (or group of people) responsible
for overall control of the database system.

 Their role may include the following:


 installation,
 configuration,
 database design,
 migration,
 performance monitoring,
 security,
 troubleshooting, as well as backup and data recovery
Data redundancy
 In simple words redundancy means repetition. In database terms, redundancy
refers to the fact that the same data is repeated multiple times in a table.
 The more data redundancy occurs in your database, the more it is difficult to
maintain your database.
 In order to reduce data redundancy we do a process called Database
normalization. You will see this in later chapters.
Student ID Name Age Grade City
1001 John 21 Grade 12 Pretoria
1002 Ferry 19 Grade 12 Pretoria
1003 Smith 18 Grade 12 Pretoria
1004 Billy 21 Grade 12 Pretoria
1005 Tom 18 Grade 12 Pretoria
Data integrity
 Data integrity refers to the fact that data must be reliable and accurate.
 In simple terms: data integrity helps us prevent inserting the wrong types of
entries in our database records.

ID NAME Age Salary


1001 Dakalo 26 3000
1002 Billy 30 2000
1003 Kent 26 4000

 In this example you cannot insert text in Age and salary column. Only
numbers can be inserted. Each value in age and salary must be an integer.
End of slides
 Do Review questions from page 13.

You might also like