Notes know their index in the database. Queries for last note