CIS275 - Chapter 3: Database Design Flashcards
An _____ is a high-level representation of data requirements, ignoring implementation details.
entity-relationship model
An entity-relationship model guides implementation in a particular database system, such as MySQL.
Example:
- In an airline reservation system, Passenger and Booking are entities.
- Holds is a relationship between Passenger and Booking.
- PassengerNumber, PassengerName, BookingCode, BookingCost are attributes.
An ___ is a person, place, product, concept, or activity.
entity
A relationship is a statement about two entities.
relationship
An ______ is a descriptive property of an entity.
attribute
Attribute is used in both entity-relationship and relational models. In the relational model, attribute is a formal term for column. Since entity-relationship attributes typically become relational columns, the meaning of attribute is similar in both models.
An _____ diagram is a schematic picture of entities, relationships, and attributes.
entity-relationship diagram
ER diagramEntities are drawn as rectangles. Relationships are drawn as lines connecting rectangles. Attributes appear as additional text within an entity rectangle, under the entity name.
Entities and relationships always appear in ER diagrams. Attributes are optional and only appear when additional detail is needed.
A ____, also known as a _____ or _____, documents additional detail in text format.
glossary
also known as a data dictionary or repository
A glossary includes names, synonyms, and descriptions of entities, relationships, and attributes.
The ER diagram and glossary are complementary and, together, completely describe an entity-relationship model.
An _____ is a set of things. Ex: All employees in a company.
entity type
Entity, relationship, and attribute types usually become tables, foreign keys, and columns, respectively.
A _____ is a statement about entity types. Ex: Employee-Manages-Department.
relationship type
Entity, relationship, and attribute types usually become tables, foreign keys, and columns, respectively.
An _____ is a set of values. Ex: All employee salaries.
attribute type
Entity, relationship, and attribute types usually become tables, foreign keys, and columns, respectively.
An _____ is an individual thing. Ex: The employee Sam Snead.
entity instance
Entity, relationship, and attribute instances usually become rows, foreign key values, and column values, respectively
A _____ is a statement about entity instances. Ex: “Maria Rodriguez manages Sales.”
relationship instance
Entity, relationship, and attribute instances usually become rows, foreign key values, and column values, respectively
An _____ is an individual value. Ex: The salary $35,000.
attribute instance
Entity, relationship, and attribute instances usually become rows, foreign key values, and column values, respectively
Complex databases are developed in three phases:
- Analysis develops an entity-relationship model, capturing data requirements while ignoring implementation details.
Analysis is particularly important for complex databases with many users when documenting requirements is challenging. For small databases with just a few tables and users, analysis is less important and often omitted.
- Logical design converts the entity-relationship model into tables, columns, and keys for a particular database system.
Analysis and logical design steps are summarized in the table below. Although these steps are presented in sequence, in practice execution is not always sequential. Often an early step is revisited after a later step is completed.
- Physical design adds indexes and specifies how tables are organized on storage media.
Physical design is dependent on specific index and table structures, which vary greatly across relational databases. Physical design is discussed elsewhere in this material.
Discover relationships
- Flight-ArrivesAt-Airport, Flight-DepartsFrom-Airport, and Passenger-Makes-Booking are relationships.
- Passenger can be determined from booking. Replace Flight-Has-Passenger with Flight-Includes-Booking.
- Further interviews determine the database does not track parts. Part-ShippedTo-Airport is not a relationship.
Discover entities.
- In an interview with a database user, flight, airport, aircraft, passenger, and booking are entities.
- Airplane is another word for aircraft. Traveler is another word for passenger.
- Usually, address and credit card have many details and are entities.
- Further interviews determine the database does not track parts. Part is not an entity.
Discover attributes
- Airport code, total cost, and name are attributes of Airport, Booking, and Passenger.
- Mileage plan number is an attribute of Passenger or, if additional mileage plan information is tracked, a separate entity.
Attribute names have the form _____, such as EmployeeFirstName:
EntityQualifierType
Entity is the name of the entity that the attribute describes. When the entity is obvious, in ER diagrams or informal conversation, QualifierType is sufficient and the entity name can be omitted.
Qualifier describes the meaning of the attribute. Ex: First, Last, and Alternate. Sometimes a qualifier is unnecessary and can be omitted. Ex: StudentNumber.
Type is chosen from a list of standard attribute types such as Name, Number, and Count. Attribute types are not identical to SQL data types. Ex: “Amount” might be an attribute type representing monetary values, implemented as the MONEY data type in SQL. “Count” might be an attribute type representing quantity, implemented as NUMBER in SQL.
In entity-relationship modeling, _____ refers to maxima and minima of relationships and attributes.
cardinality
The greatest number of instances of one entity that can relate to a single instance of another entity.
Relationship maximum
_____ is the least number of instances of one entity that can relate to a single instance of another entity.
Relationship minimum
A relationship has two minima, one for each of the related entities. Minima are usually specified as zero or one. On ER diagrams, minima are shown after maxima in parentheses. Ex: M(1) or M(0).
Entities have an implicit relationship with their attributes, called _____.
Entity-Has-Attribute
This relationship, like any other, has maxima and minima.
The following terms describe Entity-Has-Attribute maxima:
_____— each entity instance has at most one attribute instance.
Singular attribute
The following terms describe Entity-Has-Attribute maxima:
_____ — each entity instance can have many attribute instances.
Plural attribute
The following terms describe Entity-Has-Attribute maxima:
_____ — each attribute instance describes at most one entity instance.
Unique attribute
The following terms describe Entity-Has-Attribute minima:
_____ — each entity instance has at least one attribute instance.
Required attribute
The following terms describe Entity-Has-Attribute minima:
_____— each entity instance can have zero attribute instances.
Optional attribute
A _____ depends on another entity, called the _____.
dependent entity
master entity
The dependent and master entities are related by a _____.
dependency relationship
Ex: Task-BelongsTo-Project is a dependency relationship. On ER diagrams, the dependency relationship is drawn as an arrow pointing to the master entity.
An _____ does not depend on any other entity.
independent entity
Ex: In a university database, students and departments can be created without reference to any other entity, so Student and Department are independent entities.
In the entity-relationship model, dependence means each instance of a dependent entity always relates to an instance of another entity.
Entity-relationship dependence is called _____.
existence dependence
In the relational model, dependence means each value of a column relates to at most one value of another column.
Relational dependence is called _____.
functional dependence
All exams belong to a course. A course must exist before course exams are created. When a course is deleted, course exams are also deleted. Courses are always part of an academic department. We set up academic departments in the database before we add courses.
UML
Unified Modeling Language