You probably can't afford to live near good schools

ca school map

It's the holy grail of parenting: Moving to a town or neighborhood with a good public school system.

For most families, though, the major obstacle is cost. Neighborhoods with the best schools also tend to be the most expensive.

The country's least affordable? Atherton, California, 94027, which is located in San Mateo County.

To live near the highly rated Encinal Elementary School there, parents would be faced with a median home price just north of $6 million, which translates to monthly payments near $37,000, according to housing data provider RealtyTrac. That's a mere 412% more than the average monthly wage of $8,953 for the area.

RealtyTrac scanned more than 1,800 zip codes nationwide that have at least one "good" elementary school. "Good" is defined as schools that post higher-than-average test scores for their given state. Then RealtyTrac compared median home prices in those zip codes with the average wage for the area.

Related: The most expensive housing market is...

To anyone who watches a lot of TV shows focusing on rich kids and housewives, it won't be surprising to learn that zip codes in California dominate the top 16 least affordable "good school" areas.

Beverly Hills, 90210, took the No. 2 spot. There parents would pay close to $20,000 a month for a median-priced home, or about 405% more than the $4,853 in average monthly wages for the surrounding Los Angeles county.

Taking 3rd, 4th and 5th place were Santa Barbara, 93108; Santa Monica, 90402; and Rancho Santa Fe, 92067.

Overall, the study found that 65% of the "good school" zip codes were unaffordable for average wage earners.

Related: How to buy a home without a 20% down payment

At the other end of the spectrum, the most affordable place with a good school is in Harvey, IL 60426.

Harvey is located in Cook County, just south of Chicago. While it calls itself "a new city rising," it has been plagued by high crime and reported corruption, according to the Chicago Tribune.

Nevertheless, its Whittier Elementary School gets high marks. And with a rock-bottom median home price of $21,000 -- or just $128 a month -- that compares quite favorably to the $5,547 in average monthly wages reported for the county.

The next four most affordable zip codes with good schools -- Chicago, IL 60621; Detroit, Mich. 48235; Louisville, Ky. 40211; and Chicago, IL 60628 -- all had median home prices nearly as low as Harvey's with monthly payments that ranged between $134 and $220 compared to average monthly wages of between $4,400 and $5,500.

Have you recently achieved a financial goal? Paid off debt? Built up a large savings account? Purchased a new home? Tell us how you did it. Share your saving success stories and you could be featured in an upcoming article on CNNMoney.

Social Surge - What's Trending

Find Homes For Sale

LendingTree

CNNMoney Sponsors