Wednesday, 30 March 2011

DBMS: Difference between a RELATION and a RELVAR

Sometimes it is difficult to determine the diferrence between a Relation and a Relvar. Both of them occurs in the question as synonyms. But I found them different. Here is a discussion on it...
In relational databases, a relvar is a term coined by C. J. Date as an abbreviation for the concept of relation variable, which is the actual term used by the inventor of the relational model, E. F. Codd, regarding the same concept. The term is used in Date's well-known database textbook "An Introduction to Database Systems" to differentiate between a variable that contains a relation and the relation itself.
Relvar is not universally accepted as a term, and it certainly has no meaning in the context of existing database management system products that support SQL. Other database textbooks use the term relation (or table) for both the variable and the data it contains. This is most likely because in SQL there are no variables, nor are there assignment operators.

For more information:
Click Here

Now I want to expand my thought with respect to the difference:
Let us consider a query in Oracle:
CREATE TABLE students (roll NUMBER(3), name VARCHAR2(30)) According to SQL standard it is a TABLE. But, look at the next statement in C Language.
int x=55;
it doesn't mean x 55, rather x is a variable and 55 is its value. Similarly "students" is a
relational variable (relvar) and it hols a relation (table). The SLQ INSERT statement actually insert a relation (table).

1 comment:

  1. So you defined the RELVAR but what about the RELATION?

    ReplyDelete