Explain cartesian product with example-01304
This subjective question is related to the book/course vu eng201 Business and Technical English Writing. It can also be found in vu eng201 Mid Term Solved Past Paper No. 4.
Cartesian product:
The Cartesian product needs not to be union compatible. It means they can be of different degree. It is denoted by X. suppose there is a relation R with attributes (A1,A2,...,An) and S with attributes (B1, B2, …, Bn). The Cartesian product will be:
- R X S
The resulting relation will be containing all the attributes of R and all of S. Moreover,all the rows of R will be merged with all the rows of S. So if there are m attributes andC rows in R and n attributes and D rows in S then the relations R x S will contain m +n columns and C * D rows. It is also called as cross product. The Cartesian product isalso commutative and associative. For Example there are two relations COURSE and STUEDNT.
[Cource]
- crId, courseTitle
[Student]
- stId, stName
[Course x Student]
- crId, courseTitle, stId, stName