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
```

Computer Science & Information Technology

You might also like to view...

One of the biggest difference between C and C++ is:

a. C is object-oriented b. C++ is object-oriented c. All C++ programs are also C programs d. C only runs on UNIX computers

Computer Science & Information Technology

How would you write the following algebraic equation in C++? c = (a + b )2 (a - b )2

A. c = (a+b)^2 * (a-b)^2 B. c = a+b^2*a-b^2 C. c = (a+b^2)(a-b)^2 D. c = sqrt(a+b)(a-b)

Computer Science & Information Technology

Define each of the categories to which the operations used to construct algorithms belong. Provide two to three examples within each category.

What will be an ideal response?

Computer Science & Information Technology

When you create a layer mask, the link icon automatically appears above the layer thumbnail and the layer mask thumbnail, indicating that the layer and the layer mask are linked together.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology