i got a few questions on the black codes and the jim crow laws.

how are they different?
how are they similar?
what did they seek to achieve?
what are some examples of jim crow laws?
what are some examples of black codes?