Pages

Sunday 29 August 2021

Data Models

Data Models: A Model is the representation of real world objects, events and their relationship (association). 

A Data model can be defined as an integrated collection of concepts for describing and manipulating data, relationship between data and constraints on the data in an organisation.

Relational Model Concepts

Attribute: Each column in a Table. Attributes are the properties which define a relation. e.g., Student_Rollno, NAME,etc.

Tables: In the Relational model the, relations are saved in the table format. It is stored along with its entities. A table has two properties rows and columns.

Rows represent records and columns represent attributes.

Tuple: It is nothing but a single row of a table, which contains a single record.

Relation Schema: A relation schema represents the name of the relation with its attributes.

Degree: The total number of attributes in a relation is called the degree of the relation.

Cardinality: Total number of rows present in a Table.

Column: The column represents the set of values for a specific attribute.

Relation instance: Relation instance is a finite set of tuples in the RDBMS system. Relation instances never have duplicate tuples.

Relation key: Every row has one, two or multiple attributes, which is called relation key.

Attribute domain: Every attribute has some pre-defined value and scope which is known as attribute domain

Data Model basic building blocks:

1.  Entities

2.  Attributes

3.  Relationships

4.  Constraints

1.  Entities:   A Entity represents a particular type of object in the real world which are unique and distinct.

Ex:  Student, Employee etc,.

2.Attributes:   A Attribute is a characteristics of an entity.

Ex:  S.no, S name, Employee no, etc,.

3. Relationships:

Association among entity sets(entities) is called relationship. A relationship describes how two or more entity sets are related. It shows the relationship among entities, a diamond is used to symbolically represent a relationship in the ER diagram. Generally a verb in a sentence signifies a relationship.

Example:

An employee assigned a project.

Teacher teaches a student.

Author writes a book.

There are four types of relationships:

a. One to One

b. One to Many

c. Many to One

d. Many to Many

a.One to One Relationship

When a single instance of an entity is associated with a single instance of another entity then it is called one to one relationship.

Example: A person has only one passport and a passport is given to one person.

   
b.One to Many Relationship
When a single instance of an entity is associated with more than one instances of another entity then it is called one to many relationship.

Example: A customer can place many orders but a order cannot be placed by many customers.


c.Many to One Relationship

When more than one instances of an entity is associated with a single instance of another entity then it is called many to one relationship.

Example: Many students can study in a single college but a student cannot study in many colleges at the same time.    

   

d.Many to One Relationship

When more than one instances of an entity is associated with more than one instances of another entity then it is called many to many relationship.

Example: A student can be assigned to many projects and a project can be assigned to many students.  

4. Constraints:

A  Constraint is a restriction placed on the data.

 

Evaluation of Data Models:

Data Models are categorized as follows

 

1. Object-based data model:

(a) Entity Relationship data model (ER).

(b) Object oriented data model.

(c) Semantic data model.

(d) Functional data model.

 

2. Record-based data model (Logical)

(a) Hieratical data model.

(b) Network data model.

(c) Relation data model.


3. Physical data model:

(a) UML (unified modelling language).

No comments:

Post a Comment

Conflict Serializability

Find out conflict serializability for the given transactions T1 T2 T3 R(X)     ...