According to this article, there is a discussion whether it is possible to choose the sex of your baby by altering one’s diet or by orchestrating when and how to have sex. There are many different superstitions and old wives’ tales regarding this; equally a number of different studies have been conducted to determine whether a woman’s diet has any impact on whether a boy or a girl is conceived.
According to one study conducted by Maastricht University in The Netherlands, to have a girl, the mother must eat foods rich in calcium and magnesium (good sources are spinach, tofu, yoghurt, certain nuts, broccoli, beans, oranges and oatmeal). Also salt and potassium should be avoided.
Also if it is the color pink that you want your nursery to be swathed in, then it is best not to have sex very close to the time of ovulation. If one wants a boy, have sex close to the time of ovulation, because the male sperm are faster swimmers.
However, the female sperm are hardier and live longer so if one has sex a couple of days before or after ovulation, the likelihood of having a girl is higher. Though many have tried and failed, you can say that this is certainly not an exact science.