Before we pile on Donald Trump over his lack of historical knowledge, it's important to remember that he is very very old. When he was in school, Frederick Douglass was still alive.
Trump was shocked to find out that Abraham Lincoln was a Republican for a good reason. Of course, he wasn't in school way back in 1860 when Lincoln ran as a Republican. That would be ridiculous; he's not that old. But Trump was in school in 1864 when Lincoln ran on the National Union Party ticket.
There's a good explanation for why Trump had no idea that a fundamental disagreement between the North and South over the institution of slavery spreading into the territories caused the Civil War. Back when Trump went to school, the education system was horrendous due to lack of federal oversight. This also explains why Trump lacks even the most basic knowledge of how government works.