I did not get any result from querying notes and attachment.
Setup I create a custom object. I added notes and attachment to the custom object I created soql that filter by parentId and it looks like this.
I created a record on the custom object named 'record1', and on the related tab, I upload notes and attachments named attachment1.
I created a query that looks like this
Select name from attachment where parentId =:(record1 Id);
same with note
Select title from Notes where parentId =:(recordthe 1 Id);
result is 0 record.