Posts

Showing posts from August, 2021

Unified Modeling Language (UML)

The Unified Modeling Language (UML) is a graphical model used to create specifications for various components of a software system. The parts of UML include:  Class Diagram : similar to E – R diagram  Use case Diagram : shows the interaction between users and the system, and the steps of tasks that user performs.   Activity Diagram : depicts the flow of tasks between various components of the system.  Implementation Diagram : shows the system components (both, software level and hardware level) and their interconnections

Entity - Relationship features

Image
The features of the E – R includes specialization, generalization, higher level & lower level entity sets, attribute inheritance, and aggregation. 1. Specialization An entity set may have subgrouping of entities that are different from other entity set in some form. These entity grouping can be represented using E – R model. The process of describing subgrouping within an entity set is known as Specialization . An entity set may be specialized by more than one distinguish feature. For example, consider an entity set named person , having attributes name , street , and city . The person can be classified as: customer or employee . A set of attributes that includes all the attributes of entity person are described by each of these person type. For example, customer entities may be further described by attribute customer_id , and the employee entities can be further described by attributes employee_id, employee_salary. Consider another example, suppose bank decides to d

Weak Entity Set

Image
A weak entity set is an entity set which does not have sufficient attributes to form a primary key. A strong entity set is an entity set with primary key. For example, the entity set payment has three attributes: payment_number, payment_date and payment_amount . Each payment entity is distinct, but payments for different loans may share same payment number. Hence, this entity set does not have a primary key, and it is a weak entity set. A weak entity set must be associated with another entity set, called the owner or identifying entity set . The weak entity set is said to be existence dependent on the identifying entity set. The relationship associating weak entity set with identifying entity set is called identifying relationship. In the above example, the identifying entity set for  payment is loan , and the relationship loan_payment that associates payments and loan entities is an identifying relationship. The discriminator of a weak entity set, also called part

E - R Diagram

Image
The E – R Diagram consists of the following major components: Rectangles : represent entity sets  Ellipses : represent attributes Diamonds : represent relationship sets Lines : links attributes to entity sets and vice versa Double ellipses : represents multivalued attributes Dashed ellipses : represents derived attributes Double lines : represents total participation of an entity in a relationship set Double rectangles : represents weak entity sets Figure – 1: An illustration of E – R diagram corresponding to customers and loans Figure – 2 depicts two entity sets, customer and loans , related through relationship set borrower. The attributes associated with customer are customer_id, customer_name, customer_munber, customer_address, customer_pincode, customer_city .  The attributes associated with loan are loan_number, loan_amount . The customer_id and loan_number are primary keys. The relationship set borrower may have one-to-one, one-to-many, many-to-one, many-to-man

Keys in DBMS

Individual entities are distinct and the difference among them is expressed through attributes. The values of the attributes should be such that it uniquely identifies the values of the entities. In other words, no two entities are allowed to have same value for all the attributes. Hence a Key is used to identify a set of attributes, relationships, and thus distinguish entities and relationships from each other. 1. Entity Set A superkey is a set of one or more attributes that allows us to uniquely identify an entity in entity set. For example, the customer_id attribute of entity set customer distinguishes one customer from another. Hence, customer_id is a superkey. The customer_name attribute of entity customer cannot be superkey because, two customers can have same name. Another example, the combination of customer_id and customer_name is also a superkey for entity customer. The superkey which does not have any subset is known as candidate key (or primary key) . For examp

Constraints

Image
There are two types of constraints:  Mapping cardinalities,  Participation constraints 1. Mapping cardinalities Mapping cardinalities, also known as cardinality ratio, expresses the number of entities to which another entities can be associated via relationship set. The mapping cardinality must be one of the following types for describing a binary relationship set R between entity set A and B :  One to one : An entity in A is associated with at most one entity in B , and entity in B is associated with at most one entity in A .  One to many : An entity in A is associated with zero or more number of entities in B . While an entity in B can be associated with at most one entity in A .  Many to one : An entity in A is associated with at most one entity in B . While an entity in B , can be associated with zero or more number of entities in A .  Many to many : An entity in A is associated with zero or more number of entities in B , and an entity in B is associa