Given the relation Married that consists of tuples of the form a, b, where a is the husband and b is the wife, the relation Brother that has tuples of the form c, d , where c is the brother of d ,and the relation Sibling, which has tuples of the form e, f , where e and f are siblings, use SQL to de?ne the relation Brother-In-Law, where tuples have the form x , y with x being the brother-in-law of y. (Hint : This query can be represented as a union of three separate SQL queries. SQL provides the operator UNION to achieve this e?ect.)
What will be an ideal response?
The ?rst SQL query, below, describes the situation where someone is the brother of the wife and hence the brother-in-law of the husband. The second disjunct describes the situation where someone is the brother of the husband and hence the brother-in-law
of the wife. The third disjunct describes the situation where, someone is the husband and hence the brother-in-law of all the wife’s brothers and sisters.
```
(SELECT Brother.col1, Married.col1
FROM Married, Brother
WHERE Brother.col2 = Married.col2)
UNION
(SELECT Brother.col1, Married.col2
FROM Married, Brother
WHERE Brother.col2 = Married.col1)
UNION
(SELECT Married.col1, Sibling.col2
FROM Married, Sibling
WHERE Sibling.col1 = Married.col2)
```
You might also like to view...
Another name for a hard drive is USB Flash drive
Indicate whether the statement is true or false
The deadline constraint is a(n) ____ constraint.
A. fixed B. effort-based C. linked D. flexible
A trend that involves powerful programming languages called fourth-generation languages (4GLs) are part of the _________.?
Fill in the blank(s) with the appropriate word(s).
Under what circumstances can you return a reference from a method?
A. Only when the method performing the return is a static type method. B. Only when the reference is for an array defined within the method's scope. C. Only when a method is returning optional parameters with known values as the reference. D. Only when it is safe to return, such as returning a reference from a method if the reference was passed into the method.