DBMS Week 3

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 17

CS311 Introduction to

Database systems
W EE K 3
C O U R SE IN ST R U C TO R : R U Q Q I YA A S A D
NATURE OF DATA
Three realms or levels of abstraction must be considered in describing data. These realms are
i) Reality (the real world)
ii) Meta Data (Information about data)
iii) Actual Data
i) Reality
Reality consists of the organization itself, the various components of the organization and the
environment in which the organization operates.

Entity: An entity is any object or event about which the organization chooses to collect and store data.
An entity may be a tangible object such as an employee, a product, a computer, a country or a customer
or it may be an intangible item such as a bank account, a part failure or an airline flight.

Entity Class: An entity class is a collection of entities that possess similar characteristics. Examples are
customers, students and patients. Entity class is also called Entity Set or Entity Type.
The number of entity classes for an organization depends on the complexity and size of that
organization. For example, a medium sized corporation typically defines several hundred entity classes
where as a small company may have less than a hundred entity classes.
Attribute: An attribute is a property of an entity that we choose to record. For example, two entity classes at a
merchandising company are customers and products. Some of the attributes for these entities are:

Identifier: Each entity in an entity class must possess at least one attribute that distinguishes it from other
entities in that class. This unique property of an entity is called an identifier. For example a product number is
an identifier for a product. In some situations, the identifier will be a combination of two or more attributes -
for example, invoice number and product number.
Association: Association is some form of relationship between two (or more) entities. Association may exist
between entities of the same entity class or between entities from two (or more) entity classes. For example,
there is an entity class called customers and another called orders. By defining an association called open
orders between entities from these two entity classes, we can determine all outstanding orders for a given
customer.
ii) Metadata
Metadata is information about data in an organization. It is used by database administrators and others to
develop logical models of an organization’s entities and the associations between those entities. Metadata is
stored and maintained in the organization’s data dictionary/directory.
Corresponding to each entity class in the real world, there is normally one record type defined in the Meta data
realm. Also corresponding to each attribute, there is a data item type defined in the Meta data realm.

Data Item: It is the smallest named unit of data in the database that has meaning to the user. Examples of data
items are EMPLOYEE_NAME, STUDENT_NO, ORDER_DATE, POPULATION etc. Information that is normally
catalogued in the data dictionary/directory for each data item type includes the data item name, length, type
and a brief narrative description.
In contrast to data item, which is a logical term, field is a physical term that refers to the column positions within
a record where a data item is located.

Data Aggregate: It is a collection of data items that is named and referred to as a whole. For example, a data
aggregate called NAME might be composed of the data items like LASTNAME, FIRST_NAME and
MIDDLE_INITIAL. Similarly, the data aggregate DATE is composed of DAY, MONTH and YEAR.
Record: A record is a named collection of data items and data aggregates. Most organizations define one record
type for each entity class. Thus, if there is an entity class called Sales Orders, we might choose to define a record
type called SALES_ORDER_RECORD.
Metadata defining each record type are catalogued in the data dictionary/directory. These Meta data include
the record name, description, size (or length), component data items and aggregates and identification of
primary and secondary keys.

Key: It is a data item used to identify a record. There are two basic types of keys: Primary keys and Secondary
keys.
Primary key: It is a data item that uniquely identifies a record: The primary key of a record corresponds to the
identifier of a real-world entity. For example, ROLLNO would normally be the primary key for STUDENT
records. There may be several possible primary keys for the same records. Also two or more data items may be
required to identify a record.

Secondary Key: A secondary key is a data item that normally does not uniquely identify a record but identifies
a number of records in a set that share the same property. For example, the data item CONTINENT might be
used as a secondary key for COUNTRY record, the data item MAJOR might be used as a secondary key for
STUDENT records.
iii) Actual Data
The third realm consists of data occurrences.

Record occurrence: For each entity in the real world, there is normally a record occurrence that contains data item values
describing that entity. For example, if there are 50 employees in the Employee Entity Class then there are 50 employee
record occurrences in the data base. However, there is only one definition of this record type in the meta data.

File: A file is a named collection of all occurrences of a given record type. e.g. the employee file consists of 50 employee
records at the present time.

Metadata (such as data item definitions) are not stored in the database. Conversely, occurrences of user data are not stored
in the data dictionary/directory.

A database is a named collection of interrelated files. Thus a database contains data occurrences that describes one or more
entity classes and the association between those entity classes.
Client Server Architecture A/C to database
Difference Between Two-Tier And Three-Tier Database Architecture

S.NO Two-Tier Database Architecture Three-Tier Database Architecture

1 It is a Client-Server Architecture. It is a Web-based application.

In two-tier, the application logic is either buried inside In three-tier, the application logic or process resides in the
2 the user interface on the client or within the database on middle-tier, it is separated from the data and the user
the server (or both). interface.

Two-tier architecture consists of two layers : Client Tier Three-tier architecture consists of three layers : Client Layer,
3 and Database (Data Tier). Business Layer and Data Layer.

4 It is easy to build and maintain. It is complex to build and maintain

It is less secured as client can communicate with It is secured as client is not allowed to communicate with
6 database directly. database directly.

It results in performance loss whenever the users It results in performance loss whenever the system is run on
7 increase rapidly. Internet but gives more performance than two-tier
architecture.

8 Example – Contact Management System created using Example – Designing registration form which contains text
MS-Access or Railway Reservation System, etc. box, label, button or a large website on the Internet, etc.
QUIZ:

1. In the three-tier architecture, the intermediate layer between database and client servers is
classified as _________
2. The architecture of database in which the characteristics such as program insulations, multiple
user support and the use of catalogs are achieved is classified as ________
3. The smallest named unit of data in the database that has meaning to the user. ____
4. a data item that normally does not uniquely identify a record but identifies a number of
records in a set that share the same property. ______
5. Two-Tier Database Architecture is a Web-based application. (T/F)

You might also like