***Welcome to ashrafedu.blogspot.com * * * This website is maintained by ASHRAF***

Posts

    Thursday, 5 December 2019

    Relational Data Model


    Relation Data Model                         

    Relational data model is the primary data model, which is used widely around the world for data storage and processing. This model is simple and it has all the properties and capabilities required to process data with storage efficiency.

    Relational Model was proposed by E.F. Codd to model data in the form of relations or tables. After designing the conceptual model of Database using ER diagram, the conceptual model has to be converted into the relational model which can be implemented using any RDMBS languages like Oracle SQL, MySQL etc.

    Relational Model represents how data is stored in Relational Databases.  A relational database stores data in the form of relations (tables).

    Concepts of Relational Data Model

    Tables − In relational data model, relations are saved in the format of Tables. This format stores the relation among entities. A table has rows and columns, where rows represent records and columns represent the attributes.
    Tuple − A single row of a table, which contains a single record for that relation is called a tuple.
    Relation instance − A finite set of tuples in the relational database system represents relation instance. Relation instances do not have duplicate tuples.
    Relation schema − A relation schema describes the relation name (table name), attributes, and their names.
    Relation key − Each row has one or more attributes, known as relation key, which can identify the row in the relation (table) uniquely.
    Attribute domain − Every attribute has some pre-defined value scope, known as attribute domain.

    Relational Constraints

    Key Constraints

    There must be at least one minimal subset of attributes in the relation, which can identify a tuple uniquely. This minimal subset of attributes is called key for that relation. If there are more than one such minimal subsets, these are called candidate keys.
    Key constraints states that −
    ·        in a relation with a key attribute, no two tuples can have identical values for key attributes.
    ·        a key attribute cannot have NULL values.
    Key constraints are also referred to as Entity Constraints. A key constraint is unique and not null.

    Domain Constraints

    Domain constraints specify specific type of data to be hold, size of data and range of data to hold. For example, age can only be a positive integer, age cannot be less than zero.

    Referential integrity Constraints

    Referential integrity constraints work on the concept of Foreign Keys. A foreign key is a key attribute of a relation that can be referred in other relation.

    Referential integrity constraint states that if a relation refers to a key attribute of a different or same relation, then that key element must exist.

    No comments:

    Post a Comment