Class 11 Database RDBMS notes

The Relational Data Model is a way of structuring data using relations (tables) to organize and manage data efficiently. Here are the key concepts within this model:



Concepts of the Relational Data Model

  1. Domain

    • Domain: The set of permissible values that a given attribute (or column) can take. For example, if an attribute is "Age," its domain might be the set of non-negative integers.
  2. Tuple

    • Tuple: A single row in a table, representing a specific instance of data. Each tuple is a collection of values, one for each attribute in the relation.
  3. Relation

    • Relation: A table in the relational model. It consists of rows (tuples) and columns (attributes). Each relation has a unique name and the data within it is structured according to predefined domains for each attribute.
  4. Candidate Key

    • Candidate Key: An attribute or a set of attributes that can uniquely identify a tuple within a relation. There can be multiple candidate keys in a relation, but each candidate key must be unique and minimal (i.e., removing any attribute would make it non-unique).
  5. Primary Key

    • Primary Key: A candidate key chosen by the database designer to uniquely identify tuples in a relation. Each relation can have only one primary key. It ensures that no two tuples have the same value for the primary key attribute(s).
  6. Alternate Key

    • Alternate Key: A candidate key that is not selected as the primary key but can still uniquely identify tuples in the relation. Essentially, these are the candidate keys that are not chosen to be the primary key.

Example

Consider a simple table for storing information about students:

  • Domain: The domain for StudentID might be integers; for Email, it might be a string that follows email format rules.
  • Tuple: (101, Alice Smith, alice@example.com, 555-1234) is a tuple in the relation.
  • Relation: The table itself represents a relation.
  • Candidate Key: StudentID and Email could both serve as candidate keys as they uniquely identify each student.
  • Primary Key: Suppose we choose StudentID as the primary key.
  • Alternate Key: Email would be the alternate key in this case



  • Post a Comment

    0 Comments