she has been to shanghai.
现在完成时have/has done表示动作发生在过去并对现在产生了影响.
(其实现在完成时还可以表示动作发生在过去并持续到现在.eg:I have lived here for 3 years.)
I (had) learned 5000 words before I entered this school.
Before he slept,he had worked for 12 hours.
had done不是现在完成时,而是过去完成时,过去完成时表示到过去某个时间为止已经完成的动作,通俗说法是表示“过去的过去”(过去动作的过去,即发生在某个过去动作之前).在这两个句子中,learn/work分别发生在过去动作entered/slep之前,所以用了过去完成时.
I (had) learned 5000 words before I entered this school.这个句子主句可以不用过去完成时是因为:在有before的情况下,即使不用过去完成时也可以表达出两个动作谁先谁后,所以就用了简单的一般过去时.