0% found this document useful (0 votes)
46 views

Relational Data Model

The document discusses key concepts in relational data modeling including: - Attributes define the columns in a relation/table and tuples define the rows. A relation represents a set of tuples that share the same attributes. - The degree of a relation refers to the number of attributes it contains. Relations can be unary, binary, or n-ary depending on their degree. - Relational algebra provides operators for manipulating relations/tables like select, project, join, union, difference, and product. These allow retrieving subsets of data or combining information from multiple relations.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views

Relational Data Model

The document discusses key concepts in relational data modeling including: - Attributes define the columns in a relation/table and tuples define the rows. A relation represents a set of tuples that share the same attributes. - The degree of a relation refers to the number of attributes it contains. Relations can be unary, binary, or n-ary depending on their degree. - Relational algebra provides operators for manipulating relations/tables like select, project, join, union, difference, and product. These allow retrieving subsets of data or combining information from multiple relations.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

F3038

RELATIONAL DATA MODEL

Prepared by: Munirah Abd

Relational Data Structure

ATTRIBUTE
One column named for one relation Also known as field in MS Access table

TUPLE
One row in one relation Also known as one record in MS Access table

CARDINALITY
Number of tuple of one relation

DOMAIN
One set values for one or more attributes Each attributes in relation database is a definition for domain A domain is simply a data type

DEGREE
Number of attributes which belongs by table

Relational Data Structure

RELATION Is a table of records, not a linkage between records

The potential confusion

RELATION or table

A relation is defined as a set of tuples that all have the same attributes. This is usually represented by a table, which is organized into rows and columns. In a relational database, all of the data stored in a column should be in the same domain. In practice this means that values stored in a single column must all be of the same data type and conform to the same constraints.

DEGREE of relation
the degree of a relation is the number of attributes in the table

1 attribute is a unary relation


2 attributes is a binary relation
n attributes is an n-ary relation

DEGREE of relation
UNARY
COURSE(Subject)

BINARY

PERSON(Name, Address)

TERNARY

HOUSES(Address, Price, Size)

RELATION SCHEMA
SYNTAX:Relation Name(attribute-1, attribute-2,attribute-n); EXAMPLE :EMPLOYEE(EmpID, EmpName, Address, BranchNO); BRANCH(BranchNO, Address, TelNO, FaxNO);

RELATIONAL ALGEBRA

DEFINITION

Is a data manipulation language that provides a set of operators for manipulating one or two files

USAGE

Retrieving horizontal subset of data from relation (certain rows) Retrieving vertical subset of data from relation (certain columns) joining relations on foreign keys

OPERATORs of relational algebra


UNION
Combines all rows from two tables The tables must have same attribute characteristics to be used in the UNION UNION compatible exists when two or more tables are sharing the same columns and domains

Acts on two relations and produces the set of tuples from the first relation that do not exist in the second relation

DIFFERENCE

PRODUCT

The Cartesian product of two relations is a join that is not restricted by any criteria, resulting in every tuple of the first relation being matched with every tuple of the second relation

OPERATORs of relational algebra


Is essentially a selection operation in which duplicate tuples are removed from the result

PROJECT

SELECT

Operation retrieves tuples from a relation, limiting the results to only those that meet a specific criteria

OPERATORs of relational algebra


Defined for relational databases is often referred to as a natural join Two relations are connected by their common attributes

JOIN

INTERSECT

Produces the set of tuples that two relations share in common

THE END

You might also like