Assume that R and S are tables representing the relations of the previous exercise. Design SQL queries that will return the results of each of the expressions of that exercise.
What will be an ideal response?
a. ```
SELECT * FROM R
UNION
SELECT * FROM S
```
b. ```
SELECT * FROM R
INTERSECT
SELECT * FROM S
```
c. ```
SELECT * FROM R
EXCEPT
SELECT * FROM S
```
d. ```
SELECT * FROM R,S
```
e. ```
SELECT All attributes of R plus all attributes of S
FROM R, S
WHERE R.A1=S.A1 AND ... AND R.An=S.An
```
where A1,...,An are all the attributes that R and S have in common.
f. Assume that S has attributes B1,...,Bm and that R has in addition the attributes A1,...,An.
```
SELECT A1, ..., An
FROM R r
WHERE NOT EXISTS (
(SELECT * FROM S)
EXCEPT
(SELECT r 2.B1, ..., r 2.Bm
FROM R r 2
WHERE r .A1= r 2.A1 AND ...
AND r .An= r 2.An))
```
g. Assume that R has s among its attributes and S has s and t :
```
SELECT All attributes of R, S.s,S.t
FROM R, S
WHERE R.s =4
```
You might also like to view...
Answer the following statements true (T) or false (F)
11. You often need to call the ignore function when using getline and the extraction operator to read from the same stream. 12. If the manipulator showpoint is used then trailing zeros in real numbers will not be shown. 13. The default for output is right-justification. 14. If the open function fails to open a file successfully you will always get an error message. 15. If the data types in the file do not match the data types inused in a << operation you will always get an error message.
A(n) ____________________ is an HTML coding statement used to describe some aspect of a Web page's content.
Fill in the blank(s) with the appropriate word(s).