Is a magpie from the same bird family as the raven?

Yes, the Magpie and the Raven are both Corvids.