Actually, the Y chromosome only contains the code for the testes, which, if they work correctly, will produce testosterone, and testosterone, will, if other parts of the body work correctly, make them develop as male rather than female. Around 1.7% of babies that are issued with female birth certificates actually have XY chromosomes, and a condition that means the testosterone isn't produced, or doesn't work. They have testes where you would normally expect to find ovaries, but other than that, look exactly like girls.
There are other conditions that cause the kidneys to produce testosterone, so around 1 in 20000 babies that are issued with male birth certificates actually have XX chromosomes.
Another thing, thanks to microchimerism, around 22% of women have cells in their bodies with XY chromosomes. Being pregnant with a son increases the chance of this happening, 10% of women who have never been pregnant have cells with XY chromosomes, and many of them have an older brother.
You almost certainly have cells in your body that 100% match your mother's DNA, in addition to the majority that match 50% plus whatever your mother and father have in common.