written 8.4 years ago by | modified 2.2 years ago by |
The terms are:
(i) Set difference
(ii) Generalized Projection
(iii) Natural join
(iv) Rename
written 8.4 years ago by | modified 2.2 years ago by |
The terms are:
(i) Set difference
(ii) Generalized Projection
(iii) Natural join
(iv) Rename
written 8.4 years ago by | • modified 8.4 years ago |
Set Difference
Returns all rows that are in the result of query 1 but not in the result of query.
The relations R and S must be union-compatible, and the schema of the result is defined to be identical to the schema of R.
Generalized Projection
Syntax: П F1,F2 … Fn (E)
Where E: relational algebra expression
$\hspace{1cm}$Fi: arithmetic expression.
Example:
Consider the Table "Credit-info" :
Customer-name | Limit | Credit_Balance |
---|---|---|
abc | 2000 | 500 |
xyz | 500 | 250 |
pqr | 700 | 100 |
mno | 1500 | 1000 |
i. Find how much money a person can spend.
$Π_{Customer-name,(Limit-Credit_balance)}(Credit-info)$
iii. Natural Join A natural join returns all rows by matching values in common columns having same name and data type of columns and that column should be present in both tables.
In above example both tables having ‘did’ as common column so this column is called joining column based on matching of this column, tables are joined.
iv. Rename