Relational Algebra

Relational algebra is the basic set of operations for the relational model. Relational Algebra is algebra whose operands are relations and operators are designed to do the most common things that we need to do with relations. A relation schema is given by R(A1,....,Ak), the name of the relation and the list of the attributes in the relation. A relation is a set of tuples that are valid instances of its schema. Relational algebra expressions take as input relations and produce as output new relations. After each operation, the attributes of the participating relations are carried to the new relation. The attributes may be renamed, but their domain remains the same. The basic relational algebra operations are: Select; Project; Union; Set difference; Cartesian product. The select operations are also called unary operations. The SELECT operations denoted byσ (sigma) is used to select a subset of the tuples from a relation based on a selection condition. Notation: σp(r) where p is called the selection predicate. Defined as: σp(r) = { t | t∈ r and p(t) } where p is a formula in propositional calculus consisting of terms connected by:∧ (and),∨ (or),¬ (not). The project operations are also called unary operations. Notation for the project operation is presented as ∏ A1,A2,....,Ak(r) ∏ A1,A2,....,Ak(r) where A1, A2 are attribute names and r is a relation name. The union operations are also called as binary operations. Notation for union operation is presented as r ∪ s. It is defined as r∪ s = {t | t∈ r or t∈ s}. Notation for set difference operation is r− s. Defined as r− s = {t | t∈ r and t ∉s}. Notation for cartesian-product operation is r× s Defined as r× s ={t q | t ∈ r and q ∈ s}

Summary

Relational algebra is the basic set of operations for the relational model. Relational Algebra is algebra whose operands are relations and operators are designed to do the most common things that we need to do with relations. A relation schema is given by R(A1,....,Ak), the name of the relation and the list of the attributes in the relation. A relation is a set of tuples that are valid instances of its schema. Relational algebra expressions take as input relations and produce as output new relations. After each operation, the attributes of the participating relations are carried to the new relation. The attributes may be renamed, but their domain remains the same. The basic relational algebra operations are: Select; Project; Union; Set difference; Cartesian product. The select operations are also called unary operations. The SELECT operations denoted byσ (sigma) is used to select a subset of the tuples from a relation based on a selection condition. Notation: σp(r) where p is called the selection predicate. Defined as: σp(r) = { t | t∈ r and p(t) } where p is a formula in propositional calculus consisting of terms connected by:∧ (and),∨ (or),¬ (not). The project operations are also called unary operations. Notation for the project operation is presented as ∏ A1,A2,....,Ak(r) ∏ A1,A2,....,Ak(r) where A1, A2 are attribute names and r is a relation name. The union operations are also called as binary operations. Notation for union operation is presented as r ∪ s. It is defined as r∪ s = {t | t∈ r or t∈ s}. Notation for set difference operation is r− s. Defined as r− s = {t | t∈ r and t ∉s}. Notation for cartesian-product operation is r× s Defined as r× s ={t q | t ∈ r and q ∈ s}

Things to Remember

  • Relational algebra is the basic set of operations for the relational model. Relational Algebra is algebra whose operands are relations and operators are designed to do the most common things that we need to do with relations.
  • A relation schema is given by R(A1,....,Ak), the name of the relation and the list of the attributes in the relation. A relation is a set of tuples that are valid instances of its schema.
  • Relational algebra expressions take as input relations and produce as output new relations. After each operation, the attributes of the participating relations are carried to the new relation. The attributes may be renamed, but their domain remains the same.
  • The basic relational algebra operations are: Select; Project; Union; Set difference; Cartesian product. 
  • The select operations are also called unary operations. The SELECT operations denoted byσ (sigma) is used to select a subset of the tuples from a relation based on a selection condition. Notation: σp(r) where p is called the selection predicate. Defined as: σp(r) = { t | t∈ r and p(t) } where p is a formula in propositional calculus consisting of terms connected by:∧ (and),∨ (or),¬ (not).
  • The project operations are also called unary operations. Notation for the project operation is presented as ∏ A1,A2,....,Ak(r) ∏ A1,A2,....,Ak(r) where A1, A2 are attribute names and r is a relation name. 
  • The union operations are also called as binary operations. Notation for union operation is presented as r ∪ s. It is defined as r∪ s = {t | t∈ r or t∈ s}.
  • Notation for set difference operation is r− s. Defined as r− s = {t | t∈ r and t ∉s}. 
  • Notation for cartesian-product operation is r× s
  • Defined as r× s ={t q | t ∈ r and q ∈ s}

MCQs

No MCQs found.

Subjective Questions

Q1:

Describes the function and role of nurse in family health care:


Type: Long Difficulty: Easy

Show/Hide Answer
Answer: <p>The roles and function of nurse in family health care ;</p>
<p>&nbsp;</p>
<ol>
<li><strong>Health Educator</strong></li>
</ol>
<p>Health education is not only the most important element of FHC but also has an important role in implementing other elements of FHC e.g. preventive and promotive services, MCH / FP etc. Health cannot be obtained unless people know healthy practice. Nurse comes in contact with people everyday, she knows the need of people so the nurse acts as an educator by providing education and teaching as per their needs.</p>
<p>&nbsp;</p>
<ol start="2">
<li><strong>Motivator</strong></li>
</ol>
<p>A nurse motivates the community people to find their health needs, increase intrest to adopt healthy life style and increase awareness regarding health,sanitation,hygiene etc. Until people are interested and become aware of their neds, they will not consume the health servicr provided to them. So the nurse should increase awareness and motivates them to promote and maintain their health.</p>
<p>&nbsp;</p>
<p><strong>3.Counselor</strong></p>
<p>FHC nurse counsels the people as per their needs,e.g. she provides counseling service on family planning to newly married couple or other couple who had already gave birth to baby, immunization ,use of safe water ,choice to treatment pattern, mental health, rehabilitation etc.</p>
<p>&nbsp;</p>
<p><strong>4.Health care provider</strong></p>
<p>A nurse provides care to patient in FHC and in hospital. In community, a nurse focuses mostly on preventive and promotive care but she does provides curative services by going to community or by providing care in health institute.</p>
<p>&nbsp;</p>
<p><strong>5.Supervisor</strong></p>
<p>A family health nurse supervises subordinates,guide and directs their action to meet the pre -determined objectives or goals. A supervisor inspects ,directs, helps, guides, teaches ,motivates to sub ordinates or community people, and evaluates the progress of program.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong>6.Manager</strong></p>
<p>Management is the process of getting things done through or by others by using man, money, materials and time. For the achievement of good health, only nurse cannot do everything so she should manage program to be done by other for achievement of the goal. She also motivates staff to be more committed in their work.</p>
<p>&nbsp;</p>
<p><strong>7.Change Agent</strong></p>
<p>Community health nurse act as a change agent to change their attitude ,behaviour ,and view of people towards health and eliminate harmful and hazardous practice prevalent in community. People usually resit change . As the proverb is that " Change is needful but painful."</p>
<p>&nbsp;</p>
<p><strong>8.Researcher</strong></p>
<p>The nurse does scientific and systematic investigation of problems and services of the community so that change and improvements are made. The nurse conducts research activites on health problems, health services provided to people, attitude and expectation of people towards health workers,ways of improving health services and so on.</p>
<p>&nbsp;</p>
<p><strong>9.Co ordinator</strong></p>
<p>A FHC nurse works with different sectors in the society to increase the effectiveness of the health programme in the community . She works with all kind of people from different sectors so she has to co - ordinates with these sectors to get intersectoral co operation for maintenance of postive health.</p>
<p>&nbsp;</p>
<p><strong>10.Evaluator</strong></p>
<p>Nurses evalute the work done and work being done to improve its quality and effectiveness. It is a continuous process and done to find out whether the predetermined goals are fulfilled or not. It should be done frequently without any biasness.</p>

Videos

No videos found.

Relational Algebra

Relational Algebra

Relational Algebra

Relational algebra is the basic set of operations for the relational model. Relational Algebra is algebra whose operands are relations and operators are designed to do the most common things that we need to do with relations. A relation schema is given by R(A1,....,Ak), the name of the relation and the list of the attributes in the relation. A relation is a set of tuples that are valid instances of its schema. Relational algebra expressions take as input relations and produce as output new relations. After each operation, the attributes of the participating relations are carried to the new relation. The attributes may be renamed, but their domain remains the same.

Basic Relational Algebra Operations

  • Select
  • Project
  • Union
  • Set Difference (or Subtract or minus)
  • Cartesian Product

Schema Diagram

.

Select Operation

The select operations are also called unary operations. The SELECT operations denoted byσ (sigma) is used to select a subset of the tuples from a relation based on aselection condition

Notation:

σp(r) where p is called the selection predicate

Defined as:

σp(r) = { t | t∈ r and p(t) } where p is a formula in propositional calculus consisting of terms connected by:∧ (and),∨ (or),¬ (not)

Each term is one of:

<Attribute> op <attribute> or <constant> where op is one of: =,≠,>,≥,<,≤

The SELECT operation S<selection condition>(R) produces a relation S that has the same schema (same attributes) as R.

SELECT s is commutative:

  • S<conditional1>(S<condition2>(R)) = s<condition2>(S<condition1>(R))

Because of commutativity property, a cascade or sequence of SELECT operations may be applied in any order:

  • S<cond1>(S<cond2>(S<cond3>(R)) = s<cond2> (S<cond3>(S<cond1>(R)))

A cascade of SELECT operations may be replaced by a single selection with a conjunction of all the conditions:

  • S<cond1>(S<cond2>(S<cond3>(R)) = s<cond1> AND <cond2> AND <cond3> (R)))

The total number of tuples in the result of a SELECT is less than or equal to the number of tuples in the input relation R.

Example of selection:

σ branch_name="Perryridge"(account)

Project Operation

The project operations are also called unary operations. Notation for the project operation is presented below:

  • A1,A2,....,Ak(r)

where A1,A2are attribute names, and r is a relation name.

The result is defined as the relation of k columns obtained by erasing the columns that are not listed. Duplicate rows are removed from result since the relations are set. PROJECT is not commutative. Example: To eliminate the branch_name attribute of account

  • account_number, balance(account)

Union Operations

The union operations are also called as binary operations. Notation for union operation is presented below:

  • r ∪ s

It is defined as:

  • r∪ s = {t | t∈ r or t∈ s}

Duplicate tuples are eliminated.

For r∪ s to be valid,

  • r, s must have the same Arity that is the same number of attributes.
  • The attribute domains must be compatible. For example: 2nd column of r deals with the same type of values as does the2ndcolumn of s)

Example: To find all the customers with either an account or a loan

costumer_name(depositor)∪∏costumer_name(borrower)

Set Difference Operation

Notation for set difference operation is r− s

Defined as:

  • r− s = {t | t∈ r andt ∉s}

The result of R− S is a relation that includes all tuples that are in R but not in S. Set differences must be taken between compatible relations. Here, r and s must have the same Arity. Attribute domains of r and s must be compatible.

Cartesian-Product Operation

Notation for cartesian product operation is r× s

Defined as:

  • r× s ={t q | t ∈ r andq ∈ s}

If attributes of r(R) and s(S) are not disjoint, then renaming must be used. This operation is used to combine tuples from two relations in a combinational fashion, It is denoted by R(A1, A2,......, An) x S(B1, B2,......., Bm). The result is a relation Q with degree n + m attributes in the orderQ(A1, A2,........, An, B1, B2,......, Bm).

The resulting relation state has one tuple for each combination of tuples that is one from R and one from S. Hence, if R has nR tuples which is denoted as |R| =nR, and S has nS tuples, then R× S will havenR * nStuples.

References:

  1. H.F.Korth and A. Silberschatz,"Database system concepts",McGraw Hill,2010
  2. A.K.Majumdar and p, Bhattacharya,"Database Management Systems",Tata McGraw Hill,India,2004
  3. F.Korth, Henry. Database System Concepts. 6th edition.

Lesson

Relational Languages and Relational Model

Subject

Computer Engineering

Grade

Engineering

Recent Notes

No recent notes.

Related Notes

No related notes.