Draw an ERD for marriages between two people. For persons include birthdate, first name, last name, and a unique person id. Consider marriage to be a relationship between two people and suppose we want our model to allow for people to have more than one marriage. Use the date of the marriage as a discriminator.

Short Answer

Expert verified
The ERD should contain two entities: 'Person' and 'Marriage'. Properties of 'Person' entity are person id, first name, last name, and birthdate. 'Marriage' entity has marriage date as a property. The relationship is a 'Many-to-Many' relationship between 'Person' and 'Marriage', discriminated by the date of marriage.

Step by step solution

01

Identify the Entities

In this problem, the entities are the 'Person' and 'Marriage'. The 'Person' entity will be represented by an oval shape, enclosing the entity's name.
02

Identify the Attributes of Each Entity

Attributes for the 'Person' entity include the person id (a unique identifier), first name, last name, and birthdate. Attributes for the 'Marriage' entity is the marriage date. A rectangle is bounded around each attribute, and these rectangles are connected to their respective entity using a straight line.
03

Identify the Relationships

There is a relationship entity identified in the problem statement, defined as a marriage between two 'Person' entities. This relationship is represented with a diamond shape connected to both 'Person' entities. Since a 'Person' can have more than one 'Marriage', this indicates a 'Many-to-Many' (M:N) relationship between 'Person' and 'Marriage'.
04

Implement Discriminator

The marriage date acts as a discriminator here, differentiating multiple marriages. This can be shown in the ERD diagram as a role attached to the relationship entity.

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

Key Concepts

These are the key concepts you need to understand to accurately answer the question.

Database Design
Database design is a critical process in creating a database system that effectively manages data. It involves defining the structure of the database, including the organization of data, the relationships among data elements, and the constraints imposed on the database. A well-designed database should ensure data consistency, integrity, and optimum performance.

In the context of an ERD for marriages, database design begins with understanding the requirements: What information do we need to store about individuals and their marriages? The answer leads to the creation of entities, setting up attributes for these entities, and defining the relationships between them. Database design is an iterative process, where normalization often plays a role in eliminating redundancies to enhance data integrity and efficiency.
ERD Entities
In an Entity-Relationship Diagram (ERD), an entity represents a real-world object or concept that has an independent existence. Entities are typically depicted as rectangles or ovals in the diagram.

In our marriage ERD example, the main entity is 'Person,' which would represent individuals who can enter into marriages. Critical to the ERD's clarity, each entity must have attributes that describe its properties. For 'Person,' these attributes include personal identification details such as birthdate, first name, and last name. The unique identifier for each person, such as a person ID, ensures that each record is distinguishable from another, imperative for accurately modeling and querying the database.
ERD Relationships
Relationships in an ERD illustrate how entities associate with each other within the database. They are depicted by lines connecting entities, often with a diamond shape signifying the nature of the relationship.

In our exercise, a 'Marriage' is depicted as a relationship between two 'Person' entities. This relationship can have its attributes, such as the marriage date, which gives specific context to the association. The cardinality of the relationship dictates how one entity relates to another in terms of numbers; one-to-one, one-to-many, or many-to-many. In the provided exercise, it is crucial to note that one person can have multiple marriages over time, showcasing the need for a 'Many-to-Many' relationship.
Many-to-Many Relationship
A many-to-many relationship occurs when multiple records in one entity can relate to multiple records in another. In an ERD, we resolve a many-to-many relationship using an associative entity that enables us to break down this complex relationship into two one-to-many relationships.

The marriage ERD illustrates a many-to-many relationship as people can have multiple marriages, and each marriage can involve two different people. To model this in a database, typically, a join table is created, which includes foreign keys referencing the primary keys of the associated entities. This way, one can track and distinguish each unique pairing of persons and marriages.
Unique Identifiers in Databases
Unique identifiers, or primary keys, are crucial elements in database design. They ensure that each record within a table can be uniquely identified and referenced. These identifiers are necessary for preventing ambiguity and ensuring the integrity of relationships within the database.

In our scenario of the marriage ERD, every person is given a unique person ID. This attribute guarantees that even two persons with the same name and birthdate can be differentiated. Unique identifiers are often an incremental number, a UUID (Universally Unique Identifier), or a combination of multiple fields to establish uniqueness. They also play a pivotal role in establishing relationships by acting as foreign keys in related tables.

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

Create an ERD suitable for a database that will keep genealogy data. Suppose there is one entity type Person and you must model the two relationships: marries and child of. Develop an ERD to support home real estate sales. Consider there are several sales employees who list and sell properties. For each employee we need to know their name (first and last), the date they started working for this company, and the number of years they have been with the company. Each property has owners (one or more people), and may have certain features such as number of baths, number of levels, number of bedrooms. For each owner we must keep track of their names (first and last). Each property has an address; each address has the usual attributes: street (comprising apartment number, street number, street name), city, province, and postal code. A home is listed at a certain price and sold at possibly a different price. Of course, we need to track the names of the buyers, the date of a listing and the date of a sale.

How would you use a composite attribute to model a phone number.

Consider a company that owns and operates parking lots. Develop an ERD with two entity types Parking Lot and Space and where: The address of a parking lot serves to identify the lot. Each space within a lot is rented at the same monthly rental charge. Each parking space is known by its number within the lot (within a lot these always start at 1). Each parking space is rented out to at most one vehicle. The vehicle’s identifier must be recorded. The identifier comprises a province code and license plate number.

Consider a library application that needs to keep track of books that have been borrowed. Suppose there is an entity type Loan that has attributes bookID, memberID, dateBorrowed and dateDue. Suppose the due date is always 2 weeks after the borrowed date. Show Loan and its attributes in an ERD.

Consider an educational institution that has departments and where each department offers courses. Suppose departments are assigned unique identifiers and so deptCode is a key for the department entity type. Courses are identified within a department by a course number; course numbers are unique within a department but not across departments. So, History may have a course numbered 215, and English could have a course numbered 215 too. In order to identify a particular course we need to know the department and we need to know the course number. Illustrate an ERD including department and course entity types. Include attributes for the Department (department code and department name), and for Course (course number, title, and description).

See all solutions

Recommended explanations on Computer Science Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.

Sign-up for free