Anda di halaman 1dari 3

1.

Components of the Relational Model

The relational model consists of three major components:


1. The set of relations and set of domains that defines the way data can be
represented (data structure).
2. Integrity rules that define the procedure to protect the data (data integrity).
3. The operations that can be performed on data (data manipulation).

2. A relation is a table, which is the most basic part of the data structure model. The
term relation in this model refers to a two-dimensional table of data. In other
words, according to the model, information is arranged in columns and rows. It
must
be
composed
of
2
parts:
Relation
Heading
A relation heading is a set of (attribute, domain) pairs (i.e., (column, column-type) pairs). For the
relation above, the relation heading is: { (ID, integer), (Name, string), (Dept, string) }. The number
of these pairs is known as the relation degree, therefore, the relation above is a degree three
relation.

Relation Body
A relation body is a set of tuples (i.e., rows). A tuple (row) can be thought of as an instance of the
Employee relation. Formally, a tuple is a set of (attribute, value) pairs, in other words (column,
value) pairs. The tuple represented by ID of 1, is actually this set { (ID, 1), (Name, Smith), (Dept,
Sales) }. The number of tuples is known as the relation cardinality. For the relation above, it has a
cardinality of 2.

Being able to reference attributes (columns) by name and tuples (rows) by primary key values provides a
data model that has no physical storage model associated with the data organization. The relational data
model is the only one that achieves complete physical data independence. Applications do not need to
know at all how data is organized as long as the database takes care of finding the right data when the
application provides table and column names along with primary key values
3. What is an Integrity Constraint? What are the types of integrity constraints?

Integrity constraints provide a mechanism for ensuring that


data conforms to guidelines specified by the database
administrator.
Three types of integrity constraints are an inherent part of the relational data model: entity integrity,
referential integrity and domain integrity:

Entity integrity concerns the concept of a primary key. Entity integrity is an integrity rule
which states that every table must have a primary key and that the column or columns chosen to
be the primary key should be unique and not null.

Referential integrity concerns the concept of a foreign key. The referential integrity rule
states that any foreign-key value can only be in one of two states. The usual state of affairs is
that the foreign-key value refers to a primary key value of some table in the database.
Occasionally, and this will depend on the rules of the data owner, a foreign-key value can
be null. In this case we are explicitly saying that either there is no relationship between the
objects represented in the database or that this relationship is unknown.

Domain integrity specifies that all columns in a relational database must be declared upon a
defined domain. The primary unit of data in the relational data model is the data item. Such data
items are said to be non-decomposable or atomic. A domain is a set of values of the same type.
Domains are therefore pools of values from which actual values appearing in the columns of a
table are drawn.
4. What is Data Normalization?
Data normalization is a process in which data attributes (values) within an entity (table) are
organized to increase the cohesion of entity types (tables) and to reduce coupling between entity
types (tables). In other words,normalization is the process of splitting tables with redundant
information into two or more tables. Denormalization on the other hand, is the exact
opposite of normalization - it is the process of combining two or more tables together.
The goal of normalization is to reduce or even eliminate data redundancy. This is an
important consideration for data developers because in an object-relational map it can be difficult
to translate objects to their corresponding tables. The advantage of having a highly
normalized data schema is that information is stored in one place and one place only,
reducing the possibility of inconsistent data. Also, highly normalized data schema are close in
general to object-oriented schemas and this makes it much easier to map objects (data access
objects) to your schema.

5. What is an Anomaly? What are the types of anomalies?

Problems that can occur in poorly planned, un-normalized databases where all the data is
storedin one table (a flat-file database).
Insert Anomaly An Insert Anomaly occurs when certainattributes cannot be inserted into
thedatabase without the presence of otherattributes.
Delete Anomaly A Delete Anomaly exists when certainattributes are lost because of the
deletion ofother attributes
Update Anomaly An Update Anomaly exists when one or moreinstances of duplicated data
is updated, butnot all.
6. How to you transform a table to 1NF,2NF,3NF?
First normal form (1NF)
As per the rule of first normal form, an attribute (column) of a table cannot hold multiple values. It
should hold only atomic values.
Second normal form (2NF)

A table is said to be in 2NF if both the following conditions hold:


Table is in 1NF (First normal form)
No non-prime attribute is dependent on the proper subset of any candidate key of table.
An attribute that is not part of any candidate key is known as non-prime attribute.
A table design is said to be in 3NF if both the following conditions hold:
Table must be in 2NF
Transitive functional dependency of non-prime attribute on any super key should be removed.
An attribute that is not part of any candidate key is known as non-prime attribute.
In other words 3NF can be explained like this: A table is in 3NF if it is in 2NF and for each
functional dependency X-> Y at least one of the following conditions hold:
X is a super key of table
Y is a prime attribute of table
An attribute that is a part of one of the candidate keys is known as prime attribute.
http://beginnersbook.com/2015/05/normalization-in-dbms/
http://ecomputernotes.com/fundamental/what-is-a-database/relational-model
http://coronet.iicm.edu/Dbase1/scripts/rdbh02.htm
http://www.diranieh.com/Database/RelationalDatabaseModel.htm

Anda mungkin juga menyukai