0% found this document useful (0 votes)
28 views7 pages

DB 1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views7 pages

DB 1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Al-Nahrain University, Information Engineering College 1

Subject: Database
Class: 2nd Year
By: Lahieb M. AL-Yassiry

Lecture One
Introduction

1. Introduction
A database system is basically a computerized record-keeping system. The
database itself can be regarded as a kind of electronic filling cabinet; i.e., it is a
container for a collection of computerized data files. Users of the system can
perform a variety of operations on such files – for example:
 Adding new, empty files to the database;
 Inserting data into existing files;
 Changing data in existing files;
 Deleting data from existing files;
 Removing existing files from the database.

Fig.1 shows a very small database containing just one file, called TEST, which
in turn contains data of Suppliers.

S# SNAME STATUS CITY


S1 SMITH 20 LONDON
S2 JONES 10 PARIS
S3 BLAKE 30 PARIS
S4 CLARK 20 LONDON
S5 SMITH 40 LONDON

Fig.1 Suppliers database (file Test)

Fig.2 shows an example of a retrieval operation against that database, with the
data returned by the operation.

Retrieval:
Select SNAME, S#, CITY
From TEST
Where STATUS=20;
Result:
SNAME S# CITY
SMITH S1 LONDON
CLARK S4 LONDON

Fig.2 Example of retrieval operation

There are many operations can be applied on the same file like (Insert, Change
& Delete), as shown bellow:
Al-Nahrain University, Information Engineering College 2
Subject: Database
Class: 2nd Year
By: Lahieb M. AL-Yassiry

Insert new data:


Insert
INTO TEST (S#, SNAME, STATUS, CITY)
VALUE (s6, ban, 50, IRAQ);

Changing existing data:


Update TEST
SET STATUS=40
Where S#=S5;

Deleting existing data:


Delete
From TEST
Where S#=3;

There are many points can be shown on the above examples:


1. A computerized file such as TEST in Fig.1 are often called table (relational
table).
2. The rows of such a table can be thought of as the record of the file, & the
columns can be regarded as the fields of those records. When we are talking
about database system we will use terminals (records & fields), but when we
are talking about relational system we will use (rows & columns).
3. Columns S# constitutes the Primary Key (no two TEST rows ever contain
the same S# value) for table TEST.
4. Select, Insert, Delete are all expressed in a language called SQL (Structured
Query Language). SQL is the standard language for interacting with
relational database, and it is supported by just about every database product
on the marked today.
5. UPDATE mean change, but update mean (Insert, Delete, Update) groups.

2. What is a database system?

A database system is basically a computerized record-keeping system; i.e.,


it's a computerized system whose over all purpose is to store information and to
allow users to retrieve and update that information on demand.

The database system involves four major components as shown in Fig.3.


Al-Nahrain University, Information Engineering College 3
Subject: Database
Class: 2nd Year
By: Lahieb M. AL-Yassiry

Database Management System


( DBMS )

Database

Application End User


Programs

Fig. 3 Simplified Picture of a database system

Note: We must first distinguish between two terms "data" & "information".
Data: it refers to what is actually stored in the database.
Information: it refers to the meaning of that data as understood by some user.

A: Data:
Database system is available on machines that range all the way from the
smallest personal computers to the large mainframes. Systems on large machine
("large systems") tend to be multi-user, whereas those on smaller machines
("small systems") tend to be single-user.

Single-user system: is a system in which at most one user can access the
database at any given time;
Multi-user system: is a system in which many users can access the database at
the same time.

The data is all stored in a single database. The data in the database-at least
in a large system, will be both integrated & shared. These two aspects, data
integration & data sharing, represent a major advantage of the database systems.

Integrated: it's mean that the database can be thought of as a unification of


several otherwise distinct files, with any redundancy among those files at least
parity eliminated.

Ex:
Employee NAME ADDRESS DEPARTMENT SALARY -----
Al-Nahrain University, Information Engineering College 4
Subject: Database
Class: 2nd Year
By: Lahieb M. AL-Yassiry

Enrollment NAME COURSE ---------

Shared: it's mean that individual pieces of data in the database can be shared
among different users. Each of those users can have access to the same piece of
data, possibly for different purpose. Which mean different users can effectively
even access the same piece of data at the same time ("concurrent access").

B: Hardware: It consist of
 The secondary storage volumes: mostly magnetic disk that are used to hold
the stored data together with (the I/O devices, device controllers, I/O
channels)
 The hardware processor(s) & main memory that are used to support the
execution of the database system software.

C: Software:
The software between the data as physically stored & the users of the
system is known as DBMS. It is software that all requests for access to the
database are handled by it.

D: Users:
There are three types of users:
 Application Programmers: responsible for writing database application
program in some programming language such as (Java, Coble, PL/I, C++).
The programs can be batch application or online application.
 Database Administrator (DBA).
 End users: Who interact with the system from online workstation or
terminals. A given end user can access the database via one of the online
applications. Those applications are built-in not user-written. Most database
systems include at least one such built-in application namely a query
language processor, by which the user can issue database requests
(commands) such as Select, Insert to the DBMS.

3. What is a Database?

You must first understand the meaning of Persistent data.


Persistent data: We say that data in the database "Persistent “ because, once it
has been accepted by the DBMS for entry in to the database in the first place.
Database: is a collection of persistent data (operational data) that is used by the
application systems of some given enterprise (ex: a manufacturing company, a
bank, hospital, university & government department).
Al-Nahrain University, Information Engineering College 5
Subject: Database
Class: 2nd Year
By: Lahieb M. AL-Yassiry

Entities: is commonly used in database circles to mean any distinguishable


object that is to represent in the database.

Relationships: it’s represented by connecting lines. The relationships are all


bidirectional as shown in the following example.
Fig. 4 shows the diagram between Entity/Relationship.

Suppliers Project

Warehouse Parts

Fig. 4 Entity/Relationship (E/R) Diagram

4. Data & Database Administrator:

Data Administrator (DA): It is a manager who understands the data & need to
enterprise with respect to the data at a senior management level.
DA's job: To decide what data should be stored in the database in the first place,
& to establish policies for maintaining & dealing with that data once it has been
stored.

Database Administrator: The technical person responsible for implementing


the data administrator's decisions is the DBA.
DBA job: is to create the actual database & to implement the technical controls
needed to enforce the various policy decisions made by DB. It is responsible for
ensuring that the system operates with adequate performance & for providing a
variety of other related technical services. DBA will be performed by a team of
several people, not just one person.
Al-Nahrain University, Information Engineering College 6
Subject: Database
Class: 2nd Year
By: Lahieb M. AL-Yassiry

5. Advantage of Database:

1. Redundancy can be reduced:


In non-database systems each application has its own private files.
This fact can lead to considerable redundancy is stored data, with resultant
waste in storage space. Suppose you have two files that include the same
specific fields. Those two files can be integrated and the redundancy
eliminated, if the DA is aware of the data requirements for both
applications.
Not all redundancy should be eliminated, which mean redundancy should
be controlled by DBMS.

2. Inconsistency can be avoided:


Suppose that Employee E3works in Department D8 – is represented
by two distinct entries in the stored database. Suppose also DBMS is not a
ware of this duplication (i.e., the redundancy is not controlled). Then there
will be some occasions on which the two entries will not agree, when one
and only one of the two has been updated. At this time the DB is said to be
inconsistent. It's clear that a database that is an inconsistent state is
compatable of supplying incorrect information to its users.
If the redundancy is removed then an inconsistency cannot occur. If
the redundancy is not removed but is controlled (by DBMS) then DBMS
could guarantee that the DB is never inconsistent as seen by user, by
ensuring that any change made to either of the two entries is automatically
applied to other one also.

3. The data can be shared:


Sharing means not only that existing applications can share the data in the
database, but also that new applications can be developed to operate
against that same stored data.

4. Standards could be enforced:


The DBA can ensure that all applications standards are observed in the
representation of the data.

5. Security restrictions can be applied:


Different checks can established for each type of access (retrieve, modify,
delete) to each piece of information in the database.
Al-Nahrain University, Information Engineering College 7
Subject: Database
Class: 2nd Year
By: Lahieb M. AL-Yassiry

6. Integrity can be maintained:


The problem of integrity is the problem of ensuring that the data in
the database is accurate. Inconsistency between two entries that purport to
represent the same “fact” is lake of integrity. The particular problem can
arise only if redundancy exists in the stored data. Even if there is no
redundancy, the database of course still contain incorrect information.
Control of the database can help in avoiding such problems. The data
integrity is even more important in a mutiuser database system because
the database is shared. Without appropriate controls it would be possible
for one to update the database incorrectly.

7. Conflicting requirements can be balanced:


The DBA can so structure the system as to provide an over all
service. Ex: a representation can be chosen for the data in storage that
gives fast access for the most important applications.

6. Data Independence:
It can most easily be understood by first considering its opposite.

Data-Dependent: It is impossible to change the storage structure (how the


data is physically stored) or access technique (how it is accessed) without
affecting the applications probably drastically.

In Database System: It would be extremely undesirable to allow


applications to be data-dependent. For two reasons:
a- Different applications will need different views at the same data.
b- The DBA must have the freedom to change the storage structure or
access technique (or both) in response to changing requirement with
out having to modify existing applications.

Data Independence: It's a major objective of database system. It is the


immunity of applications to change in storage structure & access technique,
which mean the applications concurred do not depend on any particular
storage structure or access technique.

You might also like