Select from following answers:- Inner Join
- Left Outer Join
- Self Join
- Cross Join
- All Above
Cross join is used to get the Cartesian products of the given tables rows. Inner join is used to map matching rows where as outer join is used to get all records of one table and matching records of another table depending on types of outer join. Self join used to join the same table.
So using cross join:
SELECT * FROM tblShape
CROSS JOIN tblColors
isizeID sSName iSArea iColorID sColorName
1 Circle 12 1 Yellow
1 Circle 12 2 Green
1 Circle 12 3 Orange
1 Circle 12 4 Blue
1 Circle 12 5 Rose
2 Square 8 1 Yellow
2 Square 8 2 Green
2 Square 8 3 Orange
2 Square 8 4 Blue
2 Square 8 5 Rose
3 Rectangle 40 1 Yellow
3 Rectangle 40 2 Green
3 Rectangle 40 3 Orange
3 Rectangle 40 4 Blue
3 Rectangle 40 5 Rose
4 Triangle 15 1 Yellow
4 Triangle 15 2 Green
4 Triangle 15 3 Orange
4 Triangle 15 4 Blue
4 Triangle 15 5 Rose
Show Correct Answer
Asked In: NIIT Interview |
Alert Moderator