ER Diagram is a graphical representation of database by using some specific symbols and components. All the components are given bellow. For know about ER Model
Entity
Entity are real word object that are distinguish from other real word object on the basis of their property or attribute.
Example:
- Entity set - Teacher,Like Shailendra,Amrit etc..
- Entity set - Student,Like Ram, shyam etc..
Attribute
Attribute describe the property of entity set.
Example: For Teacher entity, Attributes are name,dob,age,phoneno,contact etc.
Type of Attribute
-
Composite Attribute
Those attribute which are further decomposable .
Name(Firstname,Middle name,Last name)
Address (House No,Street,City)
Attribute that are further decomposable into subpart are called composite attribute.But attribute that are not further decomposable are known as simple attribute.
Example of simple attribute are Salary, Marks etc. -
Single valued and Multi valued Attribute
Attribute that posses only one value are called single valued attribute.
Example : Date of Birth of any person is single valued because every person have only one valid date of birth.But attribute that posses more than one value are called multi valued attribute.Example : Phone No. because a person have more than on phone numbers. Stored and Derived Attribute
Stored attribute are the attribute that need to store physically on the storage. Example DOB etc.But derived attribute are the attribute that are derived from stored attribute using some mathematical calculation. Example age (because we can derive age from DOB)-
NULL Attribute
NULL attribute are those attribute which we store NULL value.
Entity Set
There are two type of entity sets
- Strong Entity Set
- Week Entity Set
Strong Entity Set
Entity set in which primary key is easily identified than such entity set are known as strong entity set. Example Student
Week Entity Set
Entity set in which primary key is not available than such entity set are known as week entity set. Example local guardian.
Week entity set are made by the support of strong entity set. Example local guardian of student.Here local guardian(week entity) and student (strong entity)
Relationship
Relationship are possible in tables.We can establish relation between entities sets.
Type of Relation
-
Unary Relation
Those relation in which only one entity set is participated. -
Binary Relation
Those relation which contain two entity set are called binary relation. -
Ternary Relation
Those relation in which three entity set are participated.
Cardinality Set
It is a specific number of instances of entity.
There are two type of cardinality
- Minimum Cardinality
- Maximum Cardinality
Minimum Cardinality Set
The minimum cardinality of a relationship is the minimum number of instances of entity Y that may be associated with each instance of X.
Maximum Cardinality Set
The maximum cardinality of a relationship is the minimum number of instances of entity Y that may be associated with each instance of X..
Basic Type of Cardinality Set are
- 1:1 - One to one relationship
- 1:M - One to many relationship
- M:1 - Many to one relationship
- M:M - Many to many relationship (It is very rare)
Let we know how to find Entity and Attribute for creating any schema by taking an example.
Example 1. Find out entities and attributes for company publish magazine.
-
Entity : Magazine
Attributes:- Name
- Frequency of magazine
-
Entity : Categories
Attributes:- Weak
- Year
-
Entity : Price
Attributes:- MRP
-
Entity : No of Pages
Attributes:- PageNo
-
Entity : Employ
Attributes:- EmpId
- Name
- Address
- ID
- DOB
- Gender
- PhoneNo
- Designation
- Salary
- Qualification
- Date of joining
- facilities
-
Entity : Distributor
Attributes:- DistNo
- Name
- Gander
- PhoneNo
- Deposited Amt or Security Deposit
- Status of Distributor
- Coverage area of distributor
- Balance
-
Entity : Subscribers
Attributes:- SubcNo
- Name
- Address
- PhoneNo
- DOB
- ID
- Duration
- SubcLanguage
-
Entity : Contributor
Attributes:- CodeNo
- Name
- Address
- PhoneNo
- DOB
- ID
- Language
- Magzine name
- Initial Amt
-
Entity : Department
Attributes:- Sales
- Purchase
-
Entity : Language Type
Attributes:- Lang Name
and More......
Example 2. Find out entities and attributes for car service station.
-
Entity : Car
Attributes:- Models
- Model Name
- Servicing Change
- CC
- Standard
- No of Gears
-
Entity : Mechanics
Attributes:- Mechanics Id
- Name
- Address
- Uniform Color
- Date of Joining
- Salary
-
Entity : Spare Parts
Attributes:- PartNo
- Part Color
- Part Name
- Price
- Weight
- Size
- No of Parts
-
Entity : Customer
Attributes:- CustId
- Name
- Gander
- PhoneNo
- CarRegNo
- KeyNo
- DateofServive
and More......
No comments:
Post a Comment