Chapter 3
Chapter 3
✓ Requirements Analysis,
✓ Implementation
1. Conceptual Design
3. Physical Design
✓ What are the other requirements of the Organization and the Users.
✓ Attributes
✓ Relationships
✓ Constraints
• All these entities have some attributes or properties that give them
their identity.
• For example, a Students set may contain all the students of a school;
likewise a Teachers set may contain all the teachers of a school from
all faculties.
• For example, a student entity may have name, class, and age as attributes.
• For example, a person can have more than one phone number,
email_address, etc.
• A super key such that no proper subset is a super key within the
relation
Relationship
Entities
• Represented by Rectangle
Attributes
• Represented by Oval
Relationships
• Represented by Diamond
Constraints
➢ The process is repeated until the end users and designers agree that the E-R
diagram is a fair representation of the organization’s activities and functions.
➢Relationships between entities indicate access from one entity to another -it is
therefore possible to access one entity occurrence from another entity occurrence
even if there are other entities and relationships that separate them - this is often
referred to as Navigation' of the ER diagram
• Students will have an Id, Name, Dept, Age, GPA, DOB, and Course
will have an Id, Name, Credit Hours Whenever a student enroll in a
course in a specific Academic Year and Semester, the Student will
have a grade for the course.
• Employee will have an Id, Name, DoB, Age, Tel and Department will
have an Id, Name, Location Whenever an Employee is assigned in one
Department, the duration of his stay in the respective department
should be registered.
• A customer is associated with at most one loan via the relationship borrower A
loan is associated with at most one customer via borrower.
• This means, every tuple in a relation will be attached with at least one
other tuple.
• This means, there is at least one tuple from that Relation not taking
any role in that specific relationship.
• EMPLOYEE is total since every department should have more than one
employee.
• Here the PK of the Employee can be posted to the Department or the PK of the
Department can be posted to the Employee.
• The same approach should be used for relationships with degree greater than binary.
✓ For a relationship having Associative Entity property: in cases where the relationship
has its own attributes (associative entity), one has to create a new table for the
associative entity and post primary key or candidate key from the participating entities as
foreign key attributes in the new table.
• After we have drawn the ER diagram, the next thing is to map the ER
into relational schema so as the rules of the relational data model can
be tested for each relational schema.
• There will be Employee table with EID, Salary, FName and LName being the
columns.
• There will be Department table with DID, DName, and DLoc being the columns.
• There will be Project table with PID, PName, and PFund being the columns.
• We can give the foreign key another name which is MEID to mean
"managers employee id". this will affect the degree of the Department
table.
• We can give a descriptive new name for the new table like Emp_Partc_Project to
mean "Employee participate in a project".
• As the relationship is associative entity, we are supposed to create a table for the
associative entity where the PK of Employee and Project tables will be posted in
the new table as a foreign key.
• The new table will have the attributes of the associative entity as columns.
• We can give a descriptive new name for the new table like Emp_Lead_Project to
mean "Employee leads a project".