Lesson 3: Relational Data Model

Subdecks (1)

Cards (30)

  • Relational Data Model
    Represent data in the form of tables, where a named, two-dimensional table is called a relation. Each relation consists of named columns (attributes) and an arbitrary number of unnamed rows (records).
  • Classification of Attributes
    • Required vs. Optional Attributes
    • Simple vs. Composite Attributes
    • Single-valued vs. Multivalued Attributes
    • Stored vs. Derived Attributes
    • Identifier
  • Required vs. Optional Attributes
    • Required attributes must be provided, optional attributes may be left blank
  • Simple vs. Composite Attributes
    • Simple attributes have a single value, composite attributes have multiple values
  • Single-valued Attribute

    • StudentID
    • STudName
    • BirthDate
  • Multivalued Attribute

    • ContactNo
  • Stored vs. Derived Attributes
    • Stored attributes are directly stored in the database, derived attributes are calculated from other attributes
  • Stored Attribute
    • StudentID
    • STudName
    • BirthDate
  • Derived Attribute
    • Age
  • Identifier
    • An attribute or combination of attributes that uniquely identifies each row in a relation. Must not change in value, must not be null, and must be unique.
  • Properties of a Relation
    • Unique name
    2. No multivalued attributes
    3. Each row is unique
    4. Each attribute has a unique name
    5. Sequence of columns and rows is insignificant
  • Primary Key
    An attribute or combination of attributes that uniquely identifies each row in a relation
  • Foreign Key
    Attribute used to establish the relationship between two tables, pointing to the primary key of another table
  • Composite Key
    A key that consists of more than one attribute
  • Cust_ID is a foreign key in ORDER, allowing an order to be associated with a particular customer
  • Integrity Constraints
    • Domain Constraints
    • Entity Integrity
    • Referential Integrity
  • Integrity Constraints
    Rules limiting acceptable values and actions to facilitate maintaining the accuracy and integrity of data
  • Entity Integrity
    Ensures that every relation has a valid primary key
  • Referential Integrity
    Rule that maintains consistency among the rows of two relations, where a foreign key value must match a primary key value or be null
  • Domain Constraints
    a domain definition consists of domain name, meaning, data type, size and allowable values for the domain values
  • Domain Constraints
     it is an attribute that specifies all the possible values that the attribute can hold like integer, character, date, time, string, etc.
  • Domain Constraints
    are user-defined columns that help the user to enter the value according to the data type.