Hi,
1. While using sqlite, boolean datatypes are converted to integers. For this question you could have instead used an integer.
2. Pi underscore (column names), indicates which columns to display. Just writing the name of the relation without Pi means show the complete table.
3. It shows logical AND operator. Because we want single rooms that cost less than $20. This means we want both the conditions to be true.
4. Yes B and C both are correct for Q4 in mock exam.
5. We don't use Right -outer join. We can just move tables around and then apply left outer join. We discussed the in the lecture.
Cheers
ANONYMOUS wrote:
> Hi,
>
> While I am practicing for the midterm exam, I have following questions:
>
> 1. On worksheet 1, at the query for CREATE TABLE, I am not so sure about the type of isOwnerOccupied is BOOLEAN. As I look up on the internet, I don't think SQLite3 has type of BOOLEAN, instead it uses INT and store 0 | 1. Is this a typo or
>
> 2. On worksheet 3, at Q5.1, is the RA for "List all hotels" just Hotels ? I think it is missing the pi letter ?
>
> 3. On worksheet 3, at Q5.2, what is the meaning of this symbol "^" in the middle of "select type S, with price < 20, in relation named Room" ?
>
> 4. In lecture slide for week 3, slide 40 (EquiJoin) and slide 43 (Natural Join) both give same result. Both RA is just different by the predicate. So in the mock exam, at Q4, is B also a correct answer ? If not, what is the real difference here ? Does the slide give wrong information ?
>
> 5. We are studying what covered the past weeks. But we have not looked at Right Outer Join. Will this be include in the exam as well ?
>
> Thank you