Database-Management-System
August 29, 2024Database-Management-System
August 29, 2024Database-Management-System
Question 602
|
Which of the following is true ?
I. Implementation of self-join is possible in SQL with table alias.
II. Outer-join operation is basic operation in relational algebra.
III. Natural join and outer join operations are equivalent.
I. Implementation of self-join is possible in SQL with table alias.
II. Outer-join operation is basic operation in relational algebra.
III. Natural join and outer join operations are equivalent.
I and II are correct.
|
|
II and III are correct.
|
|
Only III is correct.
|
|
Only I is correct.
|
Question 602 Explanation:
NATURAL JOIN requires that the two join attributes (or each pair of join attributes) have the same name in both relations. If this is not the case, a renaming operation is applied first.
OUTER JOIN: A set of operations, called outer joins, were developed for the case where the user wants to keep all the tuples in R, or all those in S, or all those in both relations in the result
of the JOIN, regardless of whether or not they have matching tuples in the other relation.
In SQL, the same name can be used for two (or more) attributes as long as the attributes are in different relations. If this is the case, and a multi table query refers to two (or more) attributes with the same name, we must qualify the attribute name with the relation name to prevent ambiguity. The ambiguity of attribute names also arises in the case of queries that refer to the same relation twice. In this case, we are required to declare alternative relation names, called aliases or tuple variables.
An alias can follow the keyword “AS” , as shown below
SELECT E.Fname, E.Lname, S.Fname, S.Lname
FROM EMPLOYEE AS E, EMPLOYEE AS S
WHERE E.Super_ssn=S.Ssn;
In above query relation names E and S, called aliases or tuple variables, for the EMPLOYEE relation.
From above explanation it is clear that only option (D) is correct.
OUTER JOIN: A set of operations, called outer joins, were developed for the case where the user wants to keep all the tuples in R, or all those in S, or all those in both relations in the result
of the JOIN, regardless of whether or not they have matching tuples in the other relation.
In SQL, the same name can be used for two (or more) attributes as long as the attributes are in different relations. If this is the case, and a multi table query refers to two (or more) attributes with the same name, we must qualify the attribute name with the relation name to prevent ambiguity. The ambiguity of attribute names also arises in the case of queries that refer to the same relation twice. In this case, we are required to declare alternative relation names, called aliases or tuple variables.
An alias can follow the keyword “AS” , as shown below
SELECT E.Fname, E.Lname, S.Fname, S.Lname
FROM EMPLOYEE AS E, EMPLOYEE AS S
WHERE E.Super_ssn=S.Ssn;
In above query relation names E and S, called aliases or tuple variables, for the EMPLOYEE relation.
From above explanation it is clear that only option (D) is correct.
Correct Answer: D
Question 602 Explanation:
NATURAL JOIN requires that the two join attributes (or each pair of join attributes) have the same name in both relations. If this is not the case, a renaming operation is applied first.
OUTER JOIN: A set of operations, called outer joins, were developed for the case where the user wants to keep all the tuples in R, or all those in S, or all those in both relations in the result
of the JOIN, regardless of whether or not they have matching tuples in the other relation.
In SQL, the same name can be used for two (or more) attributes as long as the attributes are in different relations. If this is the case, and a multi table query refers to two (or more) attributes with the same name, we must qualify the attribute name with the relation name to prevent ambiguity. The ambiguity of attribute names also arises in the case of queries that refer to the same relation twice. In this case, we are required to declare alternative relation names, called aliases or tuple variables.
An alias can follow the keyword “AS” , as shown below
SELECT E.Fname, E.Lname, S.Fname, S.Lname
FROM EMPLOYEE AS E, EMPLOYEE AS S
WHERE E.Super_ssn=S.Ssn;
In above query relation names E and S, called aliases or tuple variables, for the EMPLOYEE relation.
From above explanation it is clear that only option (D) is correct.
OUTER JOIN: A set of operations, called outer joins, were developed for the case where the user wants to keep all the tuples in R, or all those in S, or all those in both relations in the result
of the JOIN, regardless of whether or not they have matching tuples in the other relation.
In SQL, the same name can be used for two (or more) attributes as long as the attributes are in different relations. If this is the case, and a multi table query refers to two (or more) attributes with the same name, we must qualify the attribute name with the relation name to prevent ambiguity. The ambiguity of attribute names also arises in the case of queries that refer to the same relation twice. In this case, we are required to declare alternative relation names, called aliases or tuple variables.
An alias can follow the keyword “AS” , as shown below
SELECT E.Fname, E.Lname, S.Fname, S.Lname
FROM EMPLOYEE AS E, EMPLOYEE AS S
WHERE E.Super_ssn=S.Ssn;
In above query relation names E and S, called aliases or tuple variables, for the EMPLOYEE relation.
From above explanation it is clear that only option (D) is correct.
Subscribe
Login
0 Comments