So how come Picard and co act like Starfleet has never encountered anything like the Borg in "Q Who?" ?
Probably because no one thought (at the time) to look in the database to see if the Federation had encountered what Picard and his crew believed was a new alien race that far out from Federation space. Afterwards--once they had stopped running for their lives--they likely were able to review previous encounters.
You can explain that by saying it was on a "need to know" basis. Until Q shot the Enterprise into the Delta Quadrant, Picard had "no need to know".
That could work too. Even Starfleet has big things that are classified to all but those with the highest security clearance, IMO.