Dbms Module 2 Part2
Dbms Module 2 Part2
EER is a high-level data model that incorporates the extensions to the original ER model.
Enhanced ERD are high level models that represent the requirements and complexities of
complex database.
Sub classes are the group of entities with some unique attributes. Sub class inherits the
properties and attributes from super class.
It is a Bottom up process i.e. consider we have 3 sub entities Car, Truck and Motorcycle. Now
these three entities can be generalized into one super class named as Vehicle.
Specialization is a process of identifying subsets of an entity that share some different
characteristic. It is a top down approach in which one entity is broken down into low level entity.
Category or union:-
Relationship of one super or sub class with more than one super class.
Owner is the subset of two super class: Vehicle and House.
Aggregation:-
Represents relationship between a whole object and its component.
A higher-level abstraction that groups together entities and their relationships. This is
used to simplify complex ER diagrams by treating a collection of entities and their
relationships as a single unit.
Relation Table
Tuple: The rows of a relation that contain the values corresponding to the attributes are
called tuples.
Data Item: The smallest unit of data in the relation is the individual data item. It is stored
at the intersection of rows and columns are also known as cells.
Domain: It contains a set of atomic values that an attribute can take. It could be
accomplish explicitly by listing all possible values or specifying conditions that all values
in that domain must be confirmed.
Attribute: The smallest unit of data in relational model is an attribute. It contains the
name of a column in a particular table.
Cardinality: The total number of rows at a time in a relation is called the cardinality of
that relation.
Degree: The degree of association is called the total number of attributes in a
relationship. The relation with one attribute is called unary relation, with two attributes is
known a binary relation and with three attributes is known as ternary relation.
Relational schema: A relational schema contains the name of the relation and name of
all columns or attributes.
Relational key: In the relational key, each row has one or more attributes. It can identify
the row in the relation uniquely.
o This model is very easy to design. Tables can use different attributes as per
requirements.
o The relational model supports data independence. In a relational database the data is
stored in tables so that we can modify the data without changing the physical structure.
o Relational database helps the user to use a query language to query the database.
o It offers more flexibility than other models.
o It is useful for representing most real world objects and the relationships between them.
o Insertion Operation
o Deletion Operation
o Update Operation
o Retrieval Operation
1. Insert operation: It is used to insert a new record in the table. Adding new records to the
table is much easier than other models.
2. DELETE operation: This operation is used to delete records from the table but
problems arise when the rows to be deleted have some attributes which are foreign key
attributes.
3. Update operation: It is used to modify or change the data value of a record in a table.
4. Retrieval operation: It is used to save a record from a relation. This operation is very
simple and homogeneous.
Constraints:-
Every relation has some conditions that must hold for it to be a valid relation. These conditions
are called Relational Integrity Constraints.
Key constraints
Domain constraints
Referential integrity constraints
1) Key constraints:-
There must be at least one minimal subset of attributes in the relation, which can identify a tuple
uniquely. This minimal subset of attributes is called key for that relation. If there are more than
one such minimal subsets, these are called candidate keys.
Types of key constraints : Primary Key Constraint, Unique Constraint
2) Domain Constraints:-
Specify the data type (e.g., integer, string, date) and any additional restrictions (e.g., range
of values, allowed patterns).
Referential integrity constraints work on the concept of Foreign Keys. A foreign key is a key
attribute of a relation that can be referred in other relation.