CXZ7720 / Join-Join

2018-2 Database PBL Project Repository
1 stars 4 forks source link

Empty room select query error #35

Open CXZ7720 opened 5 years ago

CXZ7720 commented 5 years ago

The query what we use now can't select all rooms.

For example, assume that we select date between 2018-12-08 ~ 2018-12-11 the query will be like this : SELECT grade, room_number FROM Room WHERE room_number NOT IN (SELECT distinct room_number FROM Reservation WHERE check_in >='2018-12-08' AND check_out <= '2018-12-11') group BY grade order by room_number;

the subquery in the sql only select the rom that check_in / out dates are beween these date. It can't select the room like 2018-12-08 ~ 2018-12-14.(Left tail is over what we actually selected)

CXZ7720 commented 5 years ago

@onnoo Did it solved by #36 ? https://github.com/CXZ7720/Join-Join/pull/36/files#diff-ba2bf376a0413916bf23cb2ddf8a1b5dR40

onnoo commented 5 years ago

@CXZ7720 Yes I did maybe. the WHERE is constructed to judge the two date value that we want is belong to either check_in or check_out in reservation table.

CXZ7720 commented 5 years ago

Okay. I'll check about it later.