Fixed an error in the Notes_TABLE CREATE statement

The old version had a foreign key constraint on a non-existing
column (NOTE_DATE).
While fixing this I've decided to replace the (missing) NOTE_DATE
column with the new NOTE_ENTRYID one and to update the foreign key
constraint accordingly.
In other words, the Notes_TABLE now has a foreign key that references
Entry_TABLE.ENTRY_ID (the primary key) instead of Entry_TABLE.DATE.
And I've also rewrited the SQL statements in getEntryOfTheDay() and
getEntry() methods to use correctly the new database schema.