Lab 1: Fundamentals of Database Management System: Activity 1A
Lab 1: Fundamentals of Database Management System: Activity 1A
Lab 1: Fundamentals of Database Management System: Activity 1A
Activity 1A
Databases and DBMS are an essential component of life in modern society: most of
several activities every day that involve some interaction with a database. For
example, if we go to the bank to deposit or withdraw funds, if we make a hotel or
airline reservation, if we access a computerized library catalog to search for a
bibliographic item, or if we purchase something online such as a book, toy, or
computer chances are that our activities will involve someone or some computer
program accessing a database. Even purchasing items at a supermarket often
automatically updates the database that holds the inventory of grocery items.
1. Why would you choose a DBMS instead of simply storing data in operating
system files?
This data can be maintained as a collection of operating system files, or stored in
a DBMS (database management system). The advantages of using
a DBMS are: Data independence and efficient access. Database application programs are
independent of the details of data representation and storage.
Overhead for providing generality, security, concurrency control, recovery, and integrity functions.
If the database and applications are simple, well defined, and not expected to change.
If there are stringent real-time requirements that may not be met because of DBMS overhead.
If the database system is not able to handle the complexity of data because of modeling limitations
If the database users need special operations not supported by the DBMS.
If the database and applications are simple, well defined, and not expected to change.
Activity 1B
Diagram 1
There are several different types of databases, but to simplify our discussion, we are
going to suggest that “relational” databases are the primary type of database used in
today’s organizations. Relational databases may be broken into two categories:
1) Databases that run on your desktop computer, and
2) Databases that are running on a separate server, usually in a different location
from your desktop computer.
We will call the first category “desktop databases” and the second category will be
called “client server systems” (Server database). Client server systems are more
complicated because there is a program running on your computer (“client”) that
connects to the database itself on the server (“server”), and this requires a network.
The explosive development and availability of the internet has provided this network
to nearly every organization, and client server database systems are now widely
available.
1. By reading the text above, discuss the differences between Desktop database
and Server database.
Desktop Databases:
Desktop databases are mostly designed to run on “desktop” or personal computers. They are
many times cheap and simple. Most desktop databases are very user-friendly. A user does not
need to understand SQL in order to use them, and contain a fairly graphical interface. They
also often times provide web solutions so that the user can publish data onto the web in various
fashions. Microsoft Access is a very popular, well known, desktop database that many people
already own.
Server Databases:
Server databases are much more complex and expensive than desktop databases. These
databases offer organizations the ability to manage large amounts of data and many users. In a
server database, APIs are used for rapid development of custom applications providing users
with a lot of flexibility. These databases can also expand very quickly if the money is put into
investing the proper hardware into one. Unfortunately this can get rather pricey. Common
server databases include Microsoft SQL Server and Oracle.
Activity 1D
Do it yourself!
Identify the contribution of database technology to the society . You may present your
answer by stating sample of real situation(s) that happen in Philippines currently.
Example: Print report, Retrieve Data ,Flexibility ,Allow evolutionary changes to the structure of database
without affecting the stored data and existing application.
EXERCISES
1. Discuss the main characteristics of the database approach and how it differs from
traditional file systems.
databases are self-contained where database defines its own values and properties in
order to make a reference for it. For example, meta-data are one way of describing what
database contained and more properties. And also, there are some types of data
included in them.
- Self-describing nature of a database system.
A fundamental characteristic of the database approach is that the database system
contains not only the database structure and constrains. this definition is stored in the
system catalog. A DBMS catalog stores the description of a particular database (e.g. data
structures, types, and constraints) The description is called meta-data this allows the DBMS
software to work with different database application.
- Insulation between programs and data.
In traditional file processing, the structures of data files is embedded in the access
programs, so many change to the structure of a file may require changing all programs
that access this file. By constraint, DBMS access programs do not require such changes
in most cases. the structure of data files is stored in the DBMS catalog separately from
the access programs. we call this property program-data independence
program-data independence: allows changing data structures and storage organization
without having to change the DBMS access programs.
- Data abstraction.
The characteristic that allows program-data independence and program-operation
independence is called data abstraction. A data model is a type of data abstraction that is
used to hide storage details and present the users with a conceptual view of the database.
- Support of multiple views of the data.
Each user may see a different view of the database, which describes only the data of
interest to that user. A view may be a subset of the database or it may contain virtual data
that is derived from the database files but is not explicitly stored.
- Sharing of data and multi-user transaction processing.
Allowing a set of concurrent users to retrieve from and to update the database.
concurrency control within the DBMS guarantees that each transaction is correctly
executed or aborted. Recovery subsystem ensures each completed transaction has its
effect permanently recorded in the database. OLTP (online Transaction Processing) is a
major part of database applications. this allows hundreds of concurrent transactions to
execute per second.
Database approach Differs from traditional file system:
A database is a collection of interrelated data’s stored in a database server; these data’s
will be stored in the form of tables. The primary aim of database is to provide a way to store and
retrieve database information in fast and efficient manner.
There are number of characteristics that differs from traditional file management system. In
file system approach, each user defines and implements the needed files for a specific application
to run. For example in sales department of an enterprise, One user will be maintaining the details
of how many sales personnel are there in the sales department and their grades, these details will
be stored and maintained in a separate file.
Another user will be maintaining the salesperson salary details working in the concern, the
detailed salary report will be stored and maintained in a separate file. Although both of the users
are interested in the data’s of the salespersons they will be having their details in a separate files
and they need different programs to manipulate their files. This will lead to wastage of space and
redundancy or replication of data’s, which may lead to confusion, sharing of data among various
users is not possible, data inconsistency may occur. These files will not be having any inter-
relationship among the data’s stored in these files. Therefore in traditional file processing every
user will be defining their own constraints and implement the files needed for the applications.
In database approach, a single repository of data is maintained that is defined once and
then accessed by many users. The fundamental characteristic of database approach is that the
database system not only contains data’s but it contains complete definition or description of the
database structure and constraints. These definitions are stored in a system catalog, which
contains the information about the structure and definitions of the database. The information
stored in the catalog is called the metadata, it describes the primary database. Hence this
approach will work on any type of database for example, insurance database, Airlines, banking
database, Finance details, and Enterprise information database. But in traditional file processing
system the application is developed for a specific purpose and they will access specific database
only.
2. Provide and explain 2 examples of systems in which it may make sense to use
traditional file processing instead of a database approach.
Traditional file processing systems include manual systems and also computer based file systems that were
linked to particular application programs. This is the type of file processing that you used with your 3GL
programming. They share a number of characteristics.
The focus is on the individual processing needs of a particular department or area within an organisation. These may
be, for example, Accounts Receivable, Payroll, or Inventory Control.
Each application is designed with its own set of data files. The data may already be present in files for other applications
but would need to be restructured to meet the needs of the new application. When a new application is required it is
simpler to develop new file structures along with the new application. In a manual system each person or area finds it
easier to keep their own files with the data organised in the way that is most useful to them rather than use files already
existing which may be physically located at some distance or in a less useful format.
Traditional files often exist in environments where there is no overall plan to guide the growth of applications.
There are still file systems in use in organisations. Organisations see no need to change what is already working for
them. Some are small businesses that may not see any requirement to change or indeed find it economical to do so. A
manual file system may also be used as backup systems for the database systems in many cases.
Many of the problems that occur with the use of file processing systems can also occur when using database systems if
these problems have not been eliminated in the design phase. For example, problems with inconsistent data can occur
with both approaches. Being aware of this will allow you to design systems that avoid the problem.
Looking at traditional file systems and their limitations will help you to understand how database systems developed
and the reasons for their development.
3. Define client/server architecture.
Client-server architecture, architecture of a computer network in which many clients
(remote processors) request and receive service from a centralized server (host
computer). Client computers provide an interface to allow a computer user to request
services of the server and to display the results the server returns.
Criteria 1 2 3 4 5 SCORE
Not showing Uses critical and Uses critical and Uses critical and Uses critical and
Critical and creative creative thinking creative thinking
critical and creative thinking creative thinking
thinking skills skills with skills with a high
creative skills with limited skills with moderate
(20 pts.) considerable degree of
thinking skills effectiveness effectiveness
effectiveness effectiveness
Communicates Communicates
Communication of Does not Communicates Communicates information and
information and
communicates information and information and ideas with a high
information and ideas ideas with
information ideas with limited ideas with some degree of clarity
(10 pts.) considerable
and ideas clarity clarity and with
clarity
confidence
LAB 2: RELATIONAL DATA MODEL
ACTIVITY 2A
Relation Schema:
· Syntax:
· Examples:
MANAGER (ID, Name, Address, BranchNO);
BRANCH(BranchNO, Address, TelNO, FaxNO);
Procedure:
a) Degree = 7
b ) Tuple = B101, A To Z C++ , Lee Chung Fung , M. Graw Hill, IT, RM200, 10
= B102, Introduction To Marketing ,David Manickam, G.Board Dee,
Business, RM250, 10
= B103, Panduan Solat , Firdaus Ali ,Telaga Biru, IT, RM230, 12
= B104, Algebra Mathematic , John Thomas , M. Graw Hill, Mathematic,
RM180,11
= B106, Bahasa Melayu Tahun 6 , Ahmad Fadhil , Pustaka Mukmin, Bahasa
Melayu, RM200, 11
c) Cardinality = 5
EXERCISES
a)Degree -6
b)Turple=K003, 781103-03-5333, Abdullah, Lecturer, Kejuruteraan, 09-8840023
=K004, 680923-11-4908, Maimunah, Prof Madya, Sains Komputer, 09-8840024
=W221, 801204-06-2323, Kamal, Lecturer, Sistem maklumat, 09-88840025
=Y001, 600720-06-5380, Jamilah, Prof Madya, Multimedia, 09-8840026
=A400, 590101-01-2425, Hakim, Professor, Kejuruteraan perisian, 09-8840027
=W005, 810303-19-9923, Anis, Lecturer, Multimedia, 09-8840028
c)Cardinality =6
d)Attributes = IDStaff IC Number, StaffName, Position, Department, Tel_Num
e)PrimaryKey = ID Staff
f)ForeignKey = Tel_Num
g) Relation Scheme= Lecturer (IDStaff IC Number, StaffName, Position, Department, Tel_Num)
GRADE
GRADE
a)Degree =3
b)Turple=P1050, SK001, 2.50
=L2115, SM100, 3.00
=L4213, KP222, 3.00
=P2020, SM100, 3.50
c)Cardinality =4
d)Attributes = IDStudent, SubjectCode, Result
e)PrimaryKey = IDStudent
f)ForeignKey = Result
g) Relation Scheme= Grade(IDStudent, SubjectCode, Result)
STUDENT
a)Degree =3
b)Turple=P1050, Azura, SK001
=L2115, Chong, SM100
=L4213, Karim, KP222
=P2020, Ahmad, SM100
c)Cardinality =4
d)Attributes = IDStudent, StudentName, SubjectCode
e)PrimaryKey = IDStudent
f)ForeignKey = SubjectCode
g) Relation Scheme= Student (IDStudent, StudentName, SubjectCode)
SUBJECT
a)Degree =4
b)Turple=SK001, Pengantar system, 2, K003
=SM100, Database system, 4, K004
=KP222, C, 4, W221
=KP400, AI, 4, Y001
c)Cardinality =4
d)Attributes = SubjectCode, CourseName, Unit, IDStaff
e)PrimaryKey = SubjectCode
f)ForeignKey = IDStaff
g) Relation Scheme= Subject (SubjectCode, CourseName, Unit, IDStaff)