Question

In: Computer Science

In a construction business, an employee can work on at least one or many projects at...

In a construction business, an employee can work on at least one or many projects at the same time. And each project should have at least one employee or can have multiple employees working on it.

  • Draw the entities, the relationship and the cardinalities for the above business rule.
  • Identify what kind of relationship is established between the entities
  • Don’t do anything if it’s a one-to-one or one-to-many relationship. But if it’s a many-to-many relationship then resolve it so that it could be implemented in a relational model. If it's a many-to-many relationship, show all relationships and cardinalities.

Solutions

Expert Solution

Explanation :

Cardinality and Relationships in Data Models :

In terms of data models, cardinality refers to the relationship between two tables.

Relationship can be of four types as we have already seen in Entity relationship guide:

  1. One to One – A single row of first table associates with single row of second table. For example, a relationship between person and passport table is one to one because a person can have only one passport and a passport can be assigned to only one person.
  2. One to Many – A single row of first table associates with more than one rows of second table. For example, relationship between customer and order table is one to many because a customer can place many orders but a order can be placed by a single customer alone.
  3. Many to One – Many rows of first table associate with a single row of second table. For example, relationship between student and university is many to one because a university can have many students but a student can only study only in single university at a time.
  4. Many to Many – Many rows of first table associate with many rows of second table. For example, relationship between student and course table is many to many because a student can take many courses at a time and a course can be assigned to many students.

Complexity of many to many :

Many-to-many (m:n) relationships add complexity and confusion to the data model and to the application development process and thus need to be resolved using some technique to be implemented in a relational data model.

Overcoming the Complexity of many to many :

The key to resolve m:n relationships is to separate the two entities and create two one-to-many (1:n) relationships between them with a third intersect entity. The intersect entity usually contains attributes from both connecting entities.

In order to overcome this situation, a concept called a joining table or a bridging table can be used.

A joining table is a table that sits between the two other tables of a many-to-many relationship. Its purpose is to store a record for each of the combinations of these other two tables. It might seem like a bit of work to create, but it’s simple to do and provides a much better data structure.

In the light of the above discussions, the solution to the given set of business rules are as follows:

The Solution :

The given business rules for the construction business:

1. An employee can work on at least one or many projects at the same time.

2. And each project should have at least one employee or can have multiple employees working on it.

The Entity-Relationship or ER diagram for the above business rule is depicted as follows:

Employees Projects

emp_id ( pk ) MANY TO MANY   project_id ( pk )

emp_name       project_name

emp_address description

projects_involved emp_working ( not null )

In the above diagram, ( pk ) refers to the primary key of the entities.

Clearly in the above ER diagram, the cardinality which refers to the relationship between the 2 entities employees and project is that of many to many as an employee can work in multiple projects and a project can have multiple employees.

The above complexity can be resolved by introducing an intermediary entity called the Job which contains and relates the primary keys of the 2 entities Employees and Projects to a specific job with an unique job_id as the primary key.

The above resolution of the complexity is depicted in the diagram below:

Employees Projects

emp_id ( pk ) JOB project_id ( pk )

emp_name ONE TO ONE Job_id ( pk )   ONE TO ONE project_name

emp_address emp_id    description

projects_involved project_id emp_working ( not null )

In the above diagram the cardinality which refers to the relationship between the entities has been reduced to 2 one to one relationships instead of 1 one to many relationship which now be easily implemented in the data model.

This concludes the answer to all parts of the question along with the necessary explanations.

Please do not forget to like the answer if it helps you. Thank you.


Related Solutions

The complexity of construction projects stems from different types of projects, the many stake holders, the...
The complexity of construction projects stems from different types of projects, the many stake holders, the different delivery approaches, and different contracts to carry out the projects. please discuss this statement.
4. Draft and develop at least one policy initiative for at least one business unit or...
4. Draft and develop at least one policy initiative for at least one business unit or organisation: a. Facilitate consultation about draft policies b. Modify drafts according to consultation outcomes c. Identify implementation issues d. Notify stakeholders of rollout time frames
Electricians work in many different occupations, a small percentage of which are in construction. All the...
Electricians work in many different occupations, a small percentage of which are in construction. All the construction companies operating in the greater Pittsburgh, Pennsylvania, region have signed an agreement with each other that they will form a single entity to hire all electricians on each of their construction jobs. Assume this agreement is not illegal under the antitrust laws.  There is only one union of electricians in this geographic area, the International Brotherhood of Electrical Workers (“IBEW”), but some electricians do...
If you toss five fair coins, in how many ways can you obtain at least one...
If you toss five fair coins, in how many ways can you obtain at least one tail?
You work for a large, successful organization, but lately many of the IT projects have experienced...
You work for a large, successful organization, but lately many of the IT projects have experienced disappointing results. You have been put on the steering committee to improve the selection process. The organization has decided that any new projects selected for implementation must first meet strict financial measures. It has set minimum values for ROI, NPV and Payback periods based on a three (3) year investment period. Based solely on the financial numbers presented below, answer the following questions: Project...
6. A construction company has two types of employees: skilled and unskilled. A skilled employee can...
6. A construction company has two types of employees: skilled and unskilled. A skilled employee can build 1 yard of a brick wall in one hour. An unskilled employee needs twice as much time to build the same wall. The hourly wage of a skilled employee is $15. the hourly wage of an unskilled employee is $8. a. Write down a production function with the inputs of LS and LU, where LS is the number of hours of skilled workers...
Health care administration offers many opportunities to work on committees, teams, or special projects in an...
Health care administration offers many opportunities to work on committees, teams, or special projects in an HCO. Discuss one such environment and what regulatory entity may have jurisdiction over the work product. Include how you would ensure that the needs of accreditation or regulatory compliance are being met if leadership designated as an approving body for your team or committee does not support your product or value. How does the National Committee for Quality Assurance impact these teams and what...
There are many examples of improvement projects conducted by healthcare organizations that can be found on...
There are many examples of improvement projects conducted by healthcare organizations that can be found on the Internet. Here are just a few websites where improvement project descriptions may be found: •Institute for Healthcare Improvement . •Clinical Microsystems, The Dartmouth Institute . •Quality Improvement Organizations provides a list of individual websites Other sites providing project examples can be located using search engines and keywords such as PDSA, CQI, TQM, and healthcare improvement. Identify two projects, each using a different improvement...
How many 5-card hands have at least one pair?
How many 5-card hands have at least one pair?
Find at least one international project on the Internet. Describe as many of the following for...
Find at least one international project on the Internet. Describe as many of the following for the project(s): 1. Project Name 2. Sponsoring organization or project sponsor 3. Project duration 4. Country where the project is located 5. Human Labor source (local, foreign workers, offshoring) 6. Total cost in labor 7. Total cost in capital 8. Environmental Factors 9. Cultural impact or cultural sensitivity or culture shock 10. Project site selection 11. Legal and Political Climate 12. Economic Factors 13....
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT