Uploaded by Yibeltal Gashaw

Abebe Bihonegn DBMS Assignment

advertisement
ARBA MINCH UNIVERSITY INSTITUTE OF TECHNOLOGY
Faculty of Computing and Software Engineering
ADVANCED DATABASE MANAGEMENT SYSTEM
INDIVIDUAL ASSIGNEMENT
G3: SOFTWARE ENGINEERING
Name: ABEBE BIHONEGN
ID no_: NSR/050/12
ARBA MINCH, ETHIOPIA
Submitted to: Seada Yimer
Submission date: Friday 5/09/2014 E.C
1. Define and Describe Integrity Concept & Subsystem.
Integrity: means that personal data should be accurate and suitable for which it is processed.
Data integrity refers to the correctness and accuracy of the data in the database. In other words, the
data available in the database is a reliable data. Data integrity provides a mechanism to maintain data
consistency for operations like INSERT, UPDATE, and DELETE.
Relational integrity: is accuracy in database of relation by using tables and rule set for it.
System integrity: refers to adequate and reliable state of operation of the transmission in system
delivery.
Integrity subsystem is a component of DBMS which is responsible for maintaining the overall system
data integrity. This subsystem helps to keep the state of a certain system the same from the time it built
there by it prevents undesired modification on specific system files from users.
The role of integrity subsystem is:
Take appropriate actions given a violation
Determine integrity violation
Monitor transaction
2. Describe Integrity Constraints.
Integrity constraints in DBMS: integrity constraints are pre-defined set of rules that are applied on the
table fields (columns) or relations to ensure that the overall validity, quality, integrity, and consistency of
the data present in the database table is maintained.
Evaluation of all the conditions or rules mentioned in the integrity constraint is done every time
a table insert, update, delete, or alter operation is performed. The data can be inserted,
updated, deleted, or altered only if the result of the constraint comes out to be true.
Thus, integrity constraints are useful in preventing any accidental damage to the database by
an authorized user.
3. Define and Describe different types of Integrity Constraints.
There are four types of integrity constraints in DBMS:
a. Domain Constraint
b. Entity Constraint
c. Referential Integrity Constraint
d. Key Constraint
a. Domain Integrity Constraint: contains a certain set of rules or conditions to restrict the
kind of attributes or values a column can hold in the database table. The data type of a
domain can be string, integer, character, Date Time, currency, etc.
Example: Consider a Student's table having Roll No, Name, Age, Class of students.
Roll No
101
102
103
104
105
Name
Abebe
Senait
Yibeltal
Tesfaye
Tamirat
Age
23
16
21
23
30
Class
6
8
4
12
A
In the above student's table, the value A in the last row last column violates the domain
integrity constraint because the Class attribute contains only integer values while A is a
character.
b. Entity Integrity Constraint: is used to ensure that the primary key cannot be null. A
primary key is used to identify individual records in a table and if the primary key has a
null value, then we can't identify those records. There can be null values anywhere in the
table except the primary key column.
Example: Consider Employees table having Id, Name, and salary of employees
ID
1101
1102
1103
1104
Name
Abebe
Senait
Yibeltal
Tesfaye
Seble
Salary
40000
60000
80000
18000
36000
In the above employee's table, we can see that the ID column is the primary key and contains a
null value in the last row which violates the entity integrity constraint.
c. Referential Integrity Constraint: ensures that there must always exist a valid relationship
between two relational database tables. This valid relationship between the two tables
confirms that a foreign key exists in a table. It should always reference a corresponding
value or attribute in the other table or be null.
Example: Consider an Employee and a Department table where Dept_ID acts as a foreign key
between the two tables
Employees Table
ID
1101
1102
1103
1104
1105
Name
Abebe
Senait
Yibeltal
Tesfaye
Seble
Salary
40000
60000
80000
18000
36000
Dept_ID
3
2
4
3
1
Department Table
Dept_ID
1
2
3
Dept_Name
Software Engineering
Information Technology
Computer Science
In the above example, Dept_ID acts as a foreign key in the Employees table and a primary key in
the Department table. Row having DeptID=4 violates the referential integrity constraint since
DeptID 4 is not defined as a primary key column in the Departments table.
d. Key constraint: is set of entities that are used to identify an entity within its entity set
uniquely. There could be multiple keys in a single entity set, but out of these multiple
keys, only one key will be the primary key. A primary key can only contain unique and
not null values in the relational database table.
Example: Consider a student's table
Roll No
101
102
103
104
102
Name
Abebe
Senait
Dawit
Yibeltal
Tesfaye
Age
23
16
8
25
23
Class
6
8
4
12
2
The last row of the student's table violates the key integrity constraint since Roll No 102 is
repeated twice in the primary key column. A primary key must be unique and not null therefore
duplicate values are not allowed in the Roll No column of the above student's table.
4. Define and Describe Object Oriented Concepts (Abstraction,
Encapsulation, and Information hiding).
Object Oriented Concept: is concepts of objects organization and development that attempt to
eliminate some of the pitfalls of conventional concepts by incorporating the best of structural
objects with its components (state and attribute).
A/ Abstraction: refers to the act of representing essential features without including the
background details or explanations. Classes use the concept of abstraction and are defined as a
list of abstract attributes and functions to operate in these attributes
B/ Encapsulation: The wrapping up of data and functions (that operate upon the data) into a
single unit (called class) is known as encapsulation. This is a way to implement abstraction. We
can access the data only through the functions (known as member functions) that are
combined along with the data. They cannot be accessed directly
C/ Information hiding: it is also called data hiding
Thus we can say that data is hidden and so it is safe from accidental alteration. Data and
functions are said to be encapsulated into a single entity. This insulation of the data from direct
access by the program
D/ Polymorphism: This term means the ‘ability to take more than one form’. Thus
Polymorphism can be defined as the ability for a message or data to be processed in more
than one form.
Polymorphism which is of two types:
 Function overloading, which refers to a function’s ability to be applied to different types
of objects. This is termed early (or static) binding.
 Operator overloading, refers to operators’ ability to be applied to different types of
objects in different way. This is often referred to as late (or dynamic) binding.
5. Describe Drawbacks of Relational DBMS.
Weaknesses (drawback) of Relational DBMS are:
 Poor representation of “real world” entities: The process of normalization leads to the
creation of relations that do not correspond to entities in the real world. This
fragmentation of relations is inefficient leading to many joins during query processing.
 Semantic Overloading: Has only one construct to represent data and relationships
between data, that is the relation. There is no methods to represent has, owns, manages
relationships.
 Homogenous data structure: Assumes both Horizontal and vertical homogeneity.
Horizontal homogeneity means that each tuple of a relation must be composed of the
same attributes. Vertical homogeneity means that the values in a particular column of a
relation must all come from the same domain. Intersection of row and column must be an
atomic value. Also it is too restrictive to real world objects that have complex structures.
 Difficulty Handling recursive queries: Atomicity of data means that repeating groups
are not allowed in the relational model. As a result, it is extremely difficult to handle
recursive queries that are queries about relationships that a relation has with itself.
 Limited Operations: Only a fixed set of operations such as set and tuple oriented
relations.
6. Define and Discuss about object oriented DBMS (OODBMS).
OBJECT ORIENTED DBMS (OODBMS): is formal name of object data management systems (ODMS).
Object-Oriented databases are now referred to as object databases (ODB) (previously called OODB).
Object databases were proposed to meet some of the needs of database applications (databases for
engineering design and manufacturing, scientific experiments, telecommunications, geographic
information systems, and multimedia.) more complex applications.
Generally OODBMS is:
 A database system that incorporates all the important object-oriented concepts
 Database + the object oriented paradigm.
 Integration of OO language and database
Reason to creation of OODBMS:


the power they give the designer to specify both the structure of complex objects and
the operations that can be applied to these
The vast increase in the use of object-oriented programming languages for
developing software applications.
7. Discuss Object Oriented Database Design and Implementation.
Object-Oriented Database Design: methodology proposes three phases, such as analysis, design, and
implementation.
At the analysis phase, we propose to use the UML class diagram to design the conceptual schema
instead of the Extended E/R Model (commonly used for relational databases), because UML is the
standard language for object-oriented system design. Unlike E/R, UML has the advantage that it allows
to design the entire system making easier the integration between different system views.
The design phase is divided into two steps:
I.
II.
Standard design, that is, a logical design independent of any product.
Specific design, that is, the design for a specific product (Oracle8i, Informix, etc.)
Without considering tuning or optimization tasks. Standard design is especially
important in object-relational database design because each product implements a
different object-relational model. This phase provides an object-relational specification
independent of the product improving the database maintainability as well as making
easier migration between products.
For the specific design (intermediate stage between design and implementation), we
have to specify the schema in the SQL (language) of the chosen product.
Finally, the implementation phase includes the physical design tasks. In this phase the schema obtained
in the previous phase should be refined, making a tuning to improve the response time and storage
space according to the specific needs of the application.
8. Describe Object Oriented Data modeling and E-R diagramming.
Basic Object-Oriented Modeling: is graphical view, to organize and visualize the structure and
components of objects, when the development is object oriented style (commonly used for ObjectOriented databases).
It is a type of static structure UML CLASS model that describes the structure of systems by showing
system classes, their attributes, operations/methods, and relationships among objects.
ER Diagraming: is a process that used to representing of database schema. We used it in the Extended
E/R Model (commonly used for relational databases),It includes:
– A rectangle represents an entity set.
– An ellipse represents an attribute.
– A diamond represents a relationship.
– Lines represent linking of attributes to entity sets and of entity sets to relationship
sets.
9. Describe Object and Attributes in OODBMS.
An object is often referred to as an instance of a class. A class specification provides the external view of
the instances of that class. A class has an extent (sometimes called an extension), which is the set of all
instances of the class. Implementation of the extent may be transparent to an application, but minimally
provides the ability to visit every instance of the class. Within an OODBMS, the class construct is
normally used to define the database schema. Some OODBMS use the term type instead of class. The
OODBMS schema defines what objects may be stored within the database
An object typically has two components: state (value) and behavior (operations). It can have a complex
data structure as well as specific operations defined by the programmer. Objects in an OOPL exist only
during program execution; therefore, they are called transient objects. An OO database can extend the
existence of objects so that they are stored permanently in a database, and hence the objects become
persistent objects that exist beyond program termination and can be retrieved later and shared by other
programs.
Attributes (State or Fields): represent data components that make up the content of a class
Attribute types are typically a subset of the basic data types supported by the programming language
that interfaces to the OODBMS. Typically this includes enumeration types such as characters and
Booleans, numeric types such as integers and floats, and fixed length arrays of these types such as
strings. The OODBMS may allow variable length arrays, structures (i.e., records), and classes as attribute
types.
10. Discuss about Object Identity in OODBMS.
Object Identity: is unique identity to each independent object stored in the database. This unique
identity is typically implemented via a unique, system-generated object identifier (OID).
The value of an OID is not visible to the external user, but is used internally by the
system to identify each object uniquely and to create and manage inter-object
references. The main property required of an OID is that it be immutable; that is, the
OID value of a particular object should not change.
This preserves the identity of the real-world object being represented. Hence, an ODMS
must have some mechanism for generating OIDs and preserving the immutability
property. It is also desirable that each OID be used only once; that is, even if an object is
removed from the database, its OID should not be assigned to another object.
Every object must have an immutable OID, whereas a literal value has no OID and its
value just stands for itself. Thus, a literal value is typically stored within an object and
cannot be referenced from other objects.
Download