Posts

Showing posts with the label Attributes

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

Entity - Relationship model

Image
The E – R data model employs three notations:  Entity sets,  Relationship sets, and  Attributes. 1.  Entity sets An entity is a thing or object in real world that is different from other objects. For example, each employee in a company is an entity. An entity has a set of properties, and unique value for some properties. For example, the employee may have employee_id property whose value uniquely identifies the employee. Thus, 0201 value for employee_id would uniquely identify the employee in a company. An entity set is a set of entities of the same type that may share same properties, or attributes. For example, the set of all persons who are employees at a company can be defined as the entity set employee. Entity sets do not need to be disjoint. For example, a person may be an employee entity, a customer entity, both or neither. An entity is represented by set of attributes . Attributes are properties possessed by each member of the entity set. Each entity may