answersLogoWhite

0


Best Answer

In computer science, relational algebra is an offshoot of first-order logic and of algebra of sets concerned with operations over finitary relations, usually made more convenient to work with by identifying the components of a tuple by a name (called attribute) rather than by a numeric column index, which is what is called a relation in database terminology.

The main application of relational algebra is providing a theoretical foundation for relational databases, particularly query languages for such databases, chiefly among which is SQLRelational algebra received little attention outside of pure mathematics until the publication of E.F. Codd's relational model of data in 1970. Codd proposed such an algebra as a basis for database query languages. (See section Implementations.)

Both a named and a unnamed perspective are possible for relational algebra, depending on whether the tuples are endowed with component names or not. In the unnamed perspective, a tuple is simply a member of a Cartesian product. In the named perspective, tuples are functions from a finite set U of attributes (of the relation) to a domain of values (assumed distinct from U).[1] The relational algebras obtained from the two perspectives are equivalent.[2] The typical undergraduate textbooks present only the named perspective though,[3][4] and this article follows suit.

Relational algebra is essentially equivalent in expressive power to relational calculus (and thus first-order logic); this result is known as Codd's theorem. One must be careful to avoid a mismatch that may arise between the two languages because negation, applied to a formula of the calculus, constructs a formula that may be true on an infinite set of possible tuples, while the difference operator of relational algebra always returns a finite result. To overcome these difficulties, Codd restricted the operands of relational algebra to finite relations only and also proposed restricted support for negation (NOT) and disjunction (OR). Analogous restrictions are found in many other logic-based computer languages. Codd defined the term relational completeness to refer to a language that is complete with respect to first-order predicate calculus apart from the restrictions he proposed. In practice the restrictions have no adverse effect on the applicability of his relational algebra for database purposes.

Aggregation

Furthermore, computing various functions on a column, like the summing up its elements, is also not possible using the relational algebra introduced insofar. There are five aggregate functions that are included with most relational database systems. These operations are Sum, Count, Average, Maximum and Minimum. In relational algebra the aggregation operation over a schema (A1, A2, ... An) is written as follows:

G1, G2, ..., Gm g f1(A1'), f2(A2'), ..., fk(Ak') (r)

where each Aj', 1 ≤ j ≤ k, is one of the original attributes Ai, 1 ≤ i ≤ n.

The attributes preceding the g are grouping attributes, which function like a "group by" clause in SQL. Then there are an arbitrary number of aggregation functions applied to individual attributes. The operation is applied to an arbitrary relation r. The grouping attributes are optional, and if they are not supplied, the aggregation functions are applied across the entire relation to which the operation is applied.

Let's assume that we have a table named Account with three columns, namely Account_Number, Branch_Name and Balance. We wish to find the maximum balance of each branch. This is accomplished by Branch_NameGMax(Balance)(Account). To find the highest balance of all accounts regardless of branch, we could simply write GMax(Balance)(Account).

Transitive closureAlthough relational algebra seems powerful enough for most practical purposes, there are some simple and natural operators on relations which cannot be expressed by relational algebra. One of them is the transitive closure of a binary relation. Given a domain D, let binary relation R be a subset of D×D. The transitive closure R+ of R is the smallest subset of D×D containing R which satifies the following condition:

There is no relational algebra expression E(R) taking R as a variable argument which produces R+. This can be proved using the fact that, given a relational expression E for which it is claimed that E(R) = R+, where R is a variable, we can always find an instance r of R (and a corresponding domain d) such that E(r) ≠r+.[15]

SQL however officially supports such fixpoint queries since 1999, and it had vendor-specific extensions in this direction well before that.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you explain that relational algebra operators can be composed and why the ability to compose operators is important?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is a relational completeness?

Relational completeness refers to the ability of a database management system to represent all relational operations and constraints. It ensures that the system can handle queries, updates, and integrity constraints effectively without compromising the accuracy or consistency of the data. Relational completeness is a key feature of relational database systems to ensure proper data management.


What is relational reasoning?

Depends on the ability to manipulate mental representations of relations between objects and events in our minds.


What is terminology for ability to adjust the way one communicates with people based on their needs is called?

Relational versatility


Why is ms access called relational database?

It has the ability to set up relational databases. In very simple terms, that means different tables can be connected together through relationships. You could have a table of members of staff and a table of the names of the departments in the company they work in. Then you could make a connection between each member of staff and the details of the department they work in. Why and how you do this and its advantages can take a lot of explanation. You can do a course on relational databases, such is the amount of detail involved, so it is not simple to give a full explanation here. It would also be important to be able to demonstrate it, which cannot be done in an answer like this.


What are the Advantages and disadvantages of relational data base model?

Some of the advantages of relational databases include the ability to link information about a particular person who is in several databases together by simple links. One disadvantage is that once the database is created it is not changed easily so any database forming as part of a relational database must be very carefully planed before anything else can be done


What ability became important during the Renaissance?

Individual ability became important during the renaissance.


What is the important reproductive characteristic in beef cattle?

The most important one is fertility. Second most important is mothering ability; third, milking ability.


What is a unique subtance composed of atoms having the same atomic number?

A element is a unique substance that is composed of atoms having the same atomic number. Energy is the ability to do work.


Why is having a skeleton composed mainly of cartilage an advantage for newborns?

the ability to move the cartilage and squeeze his/her way out of there!!


What is the range of ln x y-1?

Wiki answer limits your ability to insert operators in questions, so please write out the word "equals" or "plus" as it is necessary.


X if and you are given ln 3 1.0986?

Wiki answer limits your ability to insert operators in questions, so please write out the word "equals" or "plus" as it is necessary.


Can you describe your ability for attention to detail?

Attention to detail is an important characteristic for many job opportunities. When asked about this ability, it is important to be affirmative about the ability, while still being honest.