Is season 2 of Game of Thrones based on book 2?

Most of the episodes of season 2 were based on A Clash of Kings, book 2 of the series. There were 3 episodes that were based on A Storm of Swords, book 3 of the series.