Relational Model Concepts

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Which of the following best describes the significance of E.F. Codd's relational model proposal in 1970?

  • It focused primarily on improving the physical storage of data to minimize redundancy.
  • It standardized the use of network databases, which were popular at the time.
  • It laid the groundwork for relational database management systems (RDBMS). (correct)
  • It introduced the concept of data warehousing for large-scale data analysis.

Within the relational model, what role does 'data integrity' play?

  • It manages user access permissions to different parts of the database.
  • It ensures the accuracy and consistency of data within the database. (correct)
  • It defines the specific hardware requirements for database servers.
  • It outlines the procedures for backing up and restoring the database.

How does a 'domain' constrain attribute values in a relational database?

  • It specifies the range of allowed values for an attribute, ensuring data validity. (correct)
  • It dictates the physical location where data is stored on the hard drive.
  • It defines the relationships between different tables in the database.
  • It encrypts data to protect it from unauthorized access.

What distinguishes a 'NULL' value from other values in a database?

<p>It signifies that a value is either unknown or not applicable. (A)</p> Signup and view all the answers

In the context of relational databases, what does a 'relation' represent?

<p>A set of attributes that defines the structure and properties of an entity. (A)</p> Signup and view all the answers

What does it mean to say that tuples in a relation are 'unordered'?

<p>Their sequence has no significance for data access or manipulation. (B)</p> Signup and view all the answers

Why is structural independence considered an advantage of the relational database model?

<p>Because changes to the database structure do not necessarily require changes to the applications that access the database. (C)</p> Signup and view all the answers

What is the role of attributes within an entity in a relational database?

<p>They describe the characteristics of the entity. (D)</p> Signup and view all the answers

In the context of database design, what is the purpose of the Chen model and Crow's Foot model?

<p>To provide visual representations of entities and their relationships. (A)</p> Signup and view all the answers

Which of the following best describes a composite attribute?

<p>An attribute that can be divided into smaller sub-attributes. (B)</p> Signup and view all the answers

What is the key difference between a single-valued attribute and a multi-valued attribute?

<p>A single-valued attribute can hold only one value, while a multi-valued attribute can hold multiple values. (A)</p> Signup and view all the answers

What is the primary consequence of directly implementing a multi-valued attribute in a relational model without proper normalization?

<p>Major structural problems and difficulties in data manipulation. (B)</p> Signup and view all the answers

How is a multi-valued attribute typically resolved within a relational database to adhere to normalization principles?

<p>By creating a new entity and relating it to the original entity in a 1:M relationship. (D)</p> Signup and view all the answers

What is the role of candidate key in a relational database?

<p>It's any attribute that can uniquely identify a tuple, potentially becoming the primary key. (A)</p> Signup and view all the answers

How does a foreign key enforce data integrity in a relational database?

<p>By requiring that values match a primary key in a related table. (D)</p> Signup and view all the answers

Which of the following is the correct definition of the term 'Connectivity' in the context of relationships?

<p>The classification of a relationship, such as 1:1, 1:M, or M:N. (B)</p> Signup and view all the answers

What does 'cardinality' express in the context of relationships between entities?

<p>The number of instances of one entity that can be associated with another entity. (B)</p> Signup and view all the answers

In Crow's Foot notation, what does the symbol for mandatory participation on the 'one' side of a relationship indicate?

<p>The entity occurrence is required. (D)</p> Signup and view all the answers

What is the key difference between optional and mandatory participation in a relationship?

<p>In optional relationships, entity instances are not required to participate, whereas in mandatory relationships, they are. (A)</p> Signup and view all the answers

What does 'existence dependence' signify in the context of entity relationships?

<p>An entity only exists if it is related to another entity. (C)</p> Signup and view all the answers

In database modeling, what does the 'degree' of a relationship refer to?

<p>The number of entities involved in the relationship. (A)</p> Signup and view all the answers

What distinguishes a Unary relationship from Binary and Ternary relationships?

<p>Unary relationships maintain association within one entity, while Binary and Ternary relate two or three separate entities. (A)</p> Signup and view all the answers

Under what circumstance is a composite or associative entity typically introduced in a database design?

<p>When there is a M:N relationship that needs to be resolved. (D)</p> Signup and view all the answers

A university database needs to model the relationship between students and courses. A student can enroll in multiple courses, and a course can have multiple students. How would you properly represent this relationship in a relational database, adhering to normalization principles?

<p>By creating a new entity (e.g., Enrollment) with foreign keys referencing both the Student and Course entities. (B)</p> Signup and view all the answers

Which of the following best describes the purpose of relational algebra and relational calculus in the context of relational databases?

<p>They are theoretical foundations for querying and manipulating data in relational databases. (A)</p> Signup and view all the answers

In a relational model, if an employee can have multiple phone numbers, how should this be addressed according to normalization principles?

<p>Create a separate table for phone numbers with a foreign key referencing the employee table. (D)</p> Signup and view all the answers

When is a NULL value appropriate for the 'salary' attribute in an 'Employee' table?

<p>When the employee's salary is currently unknown or not applicable. (A)</p> Signup and view all the answers

Consider two tables: 'Customer' (CustomerID, Name) and 'Orders' (OrderID, CustomerID, OrderDate). Which column would be best suited as a foreign key?

<p>CustomerID in the Orders table. (C)</p> Signup and view all the answers

What would the degree be in a relationsip that models a marriage between two people?

<p>Binary (A)</p> Signup and view all the answers

What is the purpose of the 'primary key'?

<p>Uniquely identifies each entity (A)</p> Signup and view all the answers

What is the purpose of a foreign key?

<p>References a matching primary key in the related table (B)</p> Signup and view all the answers

What will be indicated by the absence of a value in an 'optional' (as opposed to mandatory) relationship?

<p>The value can remain as NULL (C)</p> Signup and view all the answers

What is the key advantage of including 'related records stored in independent tables'?

<p>Structural and data independence (D)</p> Signup and view all the answers

In which situation would it be most appropriate to create an associative entity?

<p>When implementing a relationship with degree of N (B)</p> Signup and view all the answers

What is another name for Ternary relationship?

<p>Three-way relationship (D)</p> Signup and view all the answers

What can a relation be mapped to?

<p>A concept of a table (A)</p> Signup and view all the answers

Given EMPLOYEE(emp#,.........,taxfile#), what is true?

<p>Each key implies a candidate key (A)</p> Signup and view all the answers

What is another name for 'associative entity'?

<p>Bridging entity (C)</p> Signup and view all the answers

What notation from Crow's Foot Participation refers to when the 'many' side is optional?

<p>∝ (C)</p> Signup and view all the answers

Which of the following options best describes the characteristics of entities?

<p>Domain is the set of all possible values (B)</p> Signup and view all the answers

Why is it inappropriate to create several new attributes? (One for each of the original multivalued attribute's components)

<p>Lead to major structural problems with the table (A)</p> Signup and view all the answers

Flashcards

Relational Model

A model proposed by Dr. E. F. Codd in 1970, forming the basis for relational database management systems (RDBMS).

Domain

A collection of atomic (indivisible) values specifying the possible values for an attribute.

NULL

A representation of the absence of a value; it is not a value itself.

Relation

A named set of attributes consisting of a heading (schema) and a body (data rows). It can be thought of as a table.

Signup and view all the flashcards

Tuple

A row in a relation, representing a single data entry.

Signup and view all the flashcards

Relation Body

The tabular representation of data, consisting of data rows.

Signup and view all the flashcards

Logical View of Data

Focuses on logical data representation, offering structural and data independence, related records in independent tables, and simplicity.

Signup and view all the flashcards

Attribute

A characteristic of an entity.

Signup and view all the flashcards

Entities

Refers to a collection of entities, represented by a table in the relational environment.

Signup and view all the flashcards

Chen Model

A type of entity relationship model.

Signup and view all the flashcards

Crow's Foot Model

Another type of entity relationship model.

Signup and view all the flashcards

Simple Attribute

An attribute that cannot be further subdivided.

Signup and view all the flashcards

Composite Attribute

Attribute that has component parts.

Signup and view all the flashcards

Required Attribute

An attribute that must always have a value.

Signup and view all the flashcards

Optional attribute

An attribute that may or may not have a value.

Signup and view all the flashcards

Single Valued Attribute

May only have a single value.

Signup and view all the flashcards

Multi-Valued Attribute

May have many values.

Signup and view all the flashcards

Key Attribute

Uniquely identify the entity.

Signup and view all the flashcards

Non Key Attribute

All attributes other than the key.

Signup and view all the flashcards

Stored Attribute

Stored and supplied to another attribute.

Signup and view all the flashcards

Derived Attribute

Value is calculated or derived.

Signup and view all the flashcards

Primary Key (PK)

Subset of attributes which uniquely identifies a row.

Signup and view all the flashcards

Foreign Key

Attribute whose values match the primary key in the related table.

Signup and view all the flashcards

Candidate key

Has more than one potential primary key.

Signup and view all the flashcards

Primary key

Uniquely identifies each entity.

Signup and view all the flashcards

Candidate key

A potential primary key.

Signup and view all the flashcards

Composite key

Composed of more than one key attribute.

Signup and view all the flashcards

Relationships

Association between entities.

Signup and view all the flashcards

Connected entities

Connected entities are called participants.

Signup and view all the flashcards

Connectivity

Describes relationship classification.

Signup and view all the flashcards

Cardinality

Expresses number of entity occurrences associated with one occurrence of related entity.

Signup and view all the flashcards

Optional

One entity occurrence does not require a corresponding entity occurrence in a particular relationship.

Signup and view all the flashcards

Mandatory

One entity occurrence requires a corresponding entity occurrence in a particular relationship.

Signup and view all the flashcards

Unary relationship

Association is maintained within a single entity.

Signup and view all the flashcards

Binary relationship

Two entities are associated.

Signup and view all the flashcards

Ternary relationship

Three entities are associated.

Signup and view all the flashcards

BRIDGING ENTITY

associative entity is existence-dependent

Signup and view all the flashcards

Study Notes

  • Dr. E. F. Codd proposed the relational model for database systems in 1970.
  • Relational database management systems (RDBMS) are based on the relational model.
  • The relational model consists of the following:
    • Objects like domain, attribute, relation, tuple, primary key, degree, and cardinality.
    • Data integrity measures for accuracy and consistency, including entity and referential integrity.
    • Operators to act on the relations using relational algebra and relational calculus.

Relational Model Objects

  • A domain is a set of atomic, indivisible values.
  • A domain specifies name, data type, and format.
  • Values in attributes are drawn from these domains.
  • Examples of domains:
    • Gender domain: a one-character string with "M", "m", "F", or "f".
    • Name domain: a twenty-character string.
    • Credit limit domain: money in the range of $1,000 to $99,999.

Concept of NULL

  • NULL is not a value.
  • NULL represents that there is NO VALUE.
  • Reasons for a NULL:
    • VALUE NOT APPLICABLE:
      • In an employee relation with employee number, department number, salary, and commission, commission applies only to staff in the sales department.
    • VALUE UNKNOWN:
      • An employee's salary is currently unknown.
  • Other reasons for NULL:
    • VALUE DOES NOT EXIST:
      • A tax file number does not exist for an employee.
    • VALUE UNDEFINED:
      • Certain items explicitly undefined, such as division by zero.
      • If number of payments = 0, then average is undefined.

Relations

  • Relation is a named set of attributes that
    • Consists of two parts: a heading and a body.
    • May map to the concept of a table.

Relation Heading

  • Also called a relational schema with a fixed set of attributes.

Relation Body

  • Tabular data rows representation

Relation Properties

  • No duplicate tuples are allowed, as sets do not contain duplicate elements; tuples are unique.
  • Tuples are unordered within a relation, by definition sets are not ordered; tuples can only be accessed by content.
  • No ordering of attributes is allowed within a tuple, as sets are not ordered.
  • No multivalued attributes are allowed in a relation; an entry at an intersection of each row and column is atomic (single-valued).

Logical View of Data

  • Relational databases focus on logical representation rather than physical specifics.
  • Using a logical tabular data representation offers advantages:
    • Structural and data independence
    • Records are stored in independent tables
    • Logical simplicity
  • Allows for more effective design strategies.
  • An entity is a person, place, event, or concept about which data is collected.
  • Attributes are characteristics of the entity.
  • Tables include related entity occurrences (an entity set) and consist of rows and columns.

Basic Building Blocks

  • Entities refer to the entity set and not to a single entity occurrence (instance)
    • For example, the 'set' of all students.
  • Entities correspond to a table and not to a row in the relational environment.
  • Entities are represented by a rectangle containing the entity's name in both the Chen and Crow's Foot models.
  • Attributes are characteristics of entities
    • Attributes include a domain which is the set of all possible values.
    • Primary keys are underlined.

Entity Relationship (ER) Models

  • There are two types of Entity Relationship Model:
    • Chen Model
    • Crow's Foot Model
  • In both models, an entity is represented by a rectangle containing the entity's name.
  • Typically, an entity name is a noun written in capital letters in singular form e.g. STUDENT, not STUDENTS.

Types of attributes

  • The Student entity may be described with the following attributes: stu_Email, stu_MiddleName, stu_FirstName, stu_DOB, stu_Phone, stu_LastName.

Simple attributes

  • Cannot be subdivided.
    • Example: stu_firstname, stu_lastname.

Composite Attributes:

  • Can be subdivided.
    • Example: stu_Name, which could be divided into stu_FirstName, stu_LastName, stu_MiddleName.

Required Attributes:

  • Must have a value.
    • Example: stu_FirstName, stu_LastName.

Optional Attributes:

  • May not have a value.
    • Example: stu_MiddleName.

Single-valued Attribute:

  • Can have only one value.
    • Example: stu_LastName.

Multi-Valued Attribute:

  • Can have multiple values.
    • Example: stu_Address

Key Attribute:

  • Attribute or group of attributes that uniquely identify that entity (usually the primary, composite key).
    • Example: stu_EMAIL.

Non-key Attribute:

  • All attributes other than key attributes.
    • Example: stu_MiddleName, stu_FirstName, stu_DOB, stu_Phone, stu_LastName.

Stored Attribute:

  • Value is stored and supplied to another attribute.
    • Example: stu_DOB.

Derived Attribute

  • Value is calculated or derived.
    • Example: stu_Age.

Resolving Multivalued Attribute Problems

  • The conceptual model can depict multivalued attributes, but those attributes cannot be implemented directly in the relational model.
  • When creating several new attributes for each component of the original multivalued attribute can cause major structural problems in the table.
  • Create a new entity composed of original multivalued attribute's components.
    • The new entity is related to the original entity in a 1:M relationship.
  • Office phone numbers only needs to be defined for offices that have phone numbers.
    • This is done in the PHONE_SERIALNO attribute of the new entity OFFICE_PHONE.

Key constraints

  • A primary key (PK) is a subset of attributes which uniquely identify a row.
    • A primary key in one entity cannot be the same as the primary key in another entity i.e. it must be unique.
    • Primary keys for the CUSTOMER relation can be PK(Customer) = (custno, custname) or PK(Customer) = (custno)
  • A relation may have more than one potential primary key, this is known as a candidate key.
    • EMPLOYEE(emp#,taxfile#)
    • Each key is a candidate key (CK) that is chosen as the primary key (PK).
  • A Foreign Key is an attribute whose values match the primary key in the related table.

Types of Keys

  • Primary key
    • Uniquely identifies each entity.
  • Candidate key
    • Any potential primary key.
  • Secondary key
    • Used only for data retrieval.
  • Composite key
    • Composed of more than one key attribute.
  • Key attribute
    • Any attribute that is part of a key.
  • Foreign key
    • Values must match a primary key in another table.

Relationships

  • Relationships are associations between entities
  • Entities that are connected called participants.
  • Relationships between entities always operate in both directions.

Connectivity

  • Describes relationship classification
    • 1:1
    • 1:M
    • M:N

Cardinality

  • Expresses number of entity occurrences associated with one occurrence of related entity.

Crow's Foot Participation Symbols

  • (0,N) means "Many" side is optional.
  • (1,N) means "Many" side is mandatory.
  • (1,1) means "1" side is mandatory.
  • (0,1) means "1" side is optional.

Relationship Participation

  • Optional:
    • One entity occurrence does not require a corresponding entity occurrence in a particular relationship.
  • Mandatory:
    • One entity occurrence requires a corresponding entity occurrence in a particular relationship.

Existence dependence

  • An entity exists in a database only when it is associated with another related entity occurrence.
    • e.g. CUSTOMER places ORDER

Existence independence

  • Entity can exist apart from one or more related entities.
  • Sometimes such an entity is referred to as a strong or regular entity.
  • Many (most) entities on an ER are existence dependant

Relationship Degree

  • Indicates number of associated entities or participants.

Unary relationship

  • Association is maintained within a single entity

Binary relationship

  • Two entities are associated

Ternary relationship

  • Three entities are associated

Composite Entity

  • The entity composed of keys of the two related entities is known as a COMPOSITE or ASSOCIATIVE or BRIDGING ENTITY
    • associative entity is existence-dependent
  • M:N is equivalent to two 1:M and M:1 relationships
    • Sometimes better to model in this manner, especially when composite is a 'real' thing or you wish to add relationships to composite

This lecture explained

  • Features of the Relational Model:
    • Components of a relation
    • Properties of a relation
    • Null values
    • Relational Operators
  • Relational database model takes a logical view of data and how data redundancy is dealt with.
  • Described basic relational database components:
    • Entities
    • Attributes
    • Relationships amongst entities
    • Integrity constraints
    • Data Dictionary
  • The relational table's components and characteristics and contrast of the table with the relation.
  • How keys are used in the relational database environment:
    • Candidate keys
    • Primary keys
    • Alternate keys
    • Foreign keys
    • Secondary keys

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

More Like This

Relational Model in Database Systems Quiz
3 questions
Database System Concepts Quiz
10 questions

Database System Concepts Quiz

UnforgettableTropicalIsland avatar
UnforgettableTropicalIsland
Database Systems Evolution Quiz
7 questions
Database Systems Overview
39 questions

Database Systems Overview

EuphoricCuboFuturism4388 avatar
EuphoricCuboFuturism4388
Use Quizgecko on...
Browser
Browser