Basic Terminology | Database Management System

Basic Terminology | Database Management System

(a) Entity

An entity is an object that exists and is distinguishable from other objects. Anything about which we store information is called an entity

  • Example: Specific person, company, event, plant, bank account
  • Example: Student, customer, item, order

(b) Attributes

An entity is represented by a set of attributes are descriptive properties possessed by each member of an entity set. Attributes describe the entity to which they are associated. For example: Name, DOB, City, Salary attributes of “Employee” Entity.

(c) Entity Set

It is a set of entities of the same type that share the same properties, or attributes. For example, The Set of all persons who are customers at a given bank can be defined as the entity set customer.

(d) Domain

Is the range of permitted values for a particular attribute. For example, Any integer between 1-100 is domain for age attribute.

(e) Relationship

A relationship is an association among entities. For example, depositor is a relationship between Customer and account entities. Relationship is of many types:

  1. Unary (involving only one type of entity)
  2. Binary (Involving two different types of entities)
  3. Ternary (Involving three different types of entities)
  4. N-ary (Involving many types of entities)

(f) Relationship Set

A relationship set is a set of relationships of same types.

(g) Keys

  • A superkey is a set of one or more attributes which, taken collectively, allow us to identify uniquely an entity in the entity set.
  • For example, in the entity Set Customer, customer-name and passport-number is a superkey.
  • Note that Customer-name alone is not, as two customers could have the same name.
  • A Superkey may contain extraneous attributes, and we are often interested in the smallest Superkey. A Superkey for which no Subset is a Superkey is called a candidate key.
  • In the example above, passport-number is a candidate key, as it is minimal, and uniquely identifies a customer entity.
  • A primary key is a candidate key (there may be more than one) chosen by the DB designer to identify entities in an entity set.
  • In many cases, when We use more than one column as a part of the primary key. These are called composite keys when table contains one to many or many-to many relationship.
  • A Foreign Key is a Column whose values are the same as the primary key of another table. The relationship is made between two relational tables by matching is made between two relational tables by matching the values of the Foreign key in one table with the values of the primary key in another.

(h) Strong Entity

An entity having an attribute which can be used as candidate key or primary key is an strong entity. For example student entity has roll-number, account entity has account-number attribute.

(i) Weak Entity

An entity set that does not possess sufficient attributes to form a primary key is called a weak entity set. For example, The entity set fees deposit has attributes roll number, date and amount. D Same roll number can deposit fees many times. Therefore, same roll number appear many times in the table. These are not sufficient to form a primary key (uniquely identify a transaction). Thus fees deposit is a weak entity set.