If you just announced your engagement, you don’t want anyone mentioning the divorce rate. But if you’re about to start a business, knowing the stats on survival is useful. And some industries, like some couples, have better odds than others.

While a few of the numbers might seem gloomy at first glance, small business owners are more optimistic than they’ve been since before the Great Recession. According to the Wells Fargo/Gallup Small Business Index, small business optimism is at its highest point since April 2007. What’s cheering them up, according to the survey, is the ease with which they can obtain credit, healthy revenues, and more hiring.

Making It to the Two-Year Mark

Overall, about two out of every three businesses with employees will last two years, according to the U.S. Bureau of Labor Statistics. About half will last five years.

“Over 99% of all American companies with employees are small businesses,” writes Scott Shane, professor of economics and entrepreneurial studies at Case Western Reserve University. “And that pattern is clear. While recessions cause spikes in business failure rates—the long-term tendency is toward more, not fewer, small businesses surviving.”

Shane also pointed to the steadily declining exit rate for small businesses, which is different than the survival rate. The exit rate measures the failure of establishments from the prior year, and it has been declining during the past four decades, according to data from the Census Bureau. In 1977, 12.9% of businesses with paid employees failed. By 2013, that dropped to 9%.

One reason for this improvement could be that entrepreneurs are getting better at understanding their products and their market.

“Many MBA students wrongly assume you need disruptive technology or something radically different,” says Brian Hamilton, the co-founder Sageworks. “That’s not necessarily true. But you do have to take a deep look at your customers and what their needs are, then offer something that’s different enough that your offering is compelling. And that difference had better not be a lower price.”

Survival Rate Depends on Your Industry

In today’s economic climate it seems that only one major industry—mining—should be worried about its future, despite what President Donald Trump has said.

“Let me tell you: the miners in West Virginia and Pennsylvania, which was so great to me last week and Ohio and all over, they’re going to start to work again, believe me,” Trump said during a campaign stop in 2016. “You’re going to be proud again to be miners.”

Regardless of his continuing rhetoric, even his supporters in the mining industry know that their businesses are on their last breaths.

“I don’t think it will be a thriving industry ever again,” Robert Murray, a Trump supporter and CEO of the nation’s largest privately held coal mining firm, Murray Energy Corp., said in an interview with SNL Financial. “The coal mines cannot come back to where they were or anywhere near it.”

The Critical Years

The industries that saw the biggest leaps in their fifth-year survival rates from companies started in 2006, just before the recession, and those started in 2011, include real estate and finance—obvious choices for a rebound since they are the very industries that helped plunge the country into the recession. But alongside them are agriculture, construction, entertainment, transportation, and health care. For most of these industries, technological advances during the past decade are helping to boost their longevity.

The Economist pointed to an almond farmer in California named Tom Rogers as an example of what the future of agriculture might look like: “His farm is wired up like a lab rat. Or, to be more accurate, it is wirelessed up. Moisture sensors planted throughout the nut groves keep track of what is going on in the soil. They send their results to a computer in the cloud (the network of servers that does an increasing amount of the world’s heavy-duty computing) to be crunched. The results are passed back to the farm’s irrigation system—a grid of drip tapes (hoses with holes punched in them) that are filled by pumps.”

The health care industry has benefited from advances in technology that help with minimally invasive surgeries, bionic limbs, stem cell and genetic research, and targeted cancer therapies.

The transportation industry is embarking on one of the most dramatic changes in its history through advances with drones, which Amazon hopes to use to deliver packages, and driverless vehicles, which have already delivered a truckload of beer and are delivering pizzas, too. (Let’s just combine those two things—what else could we ever want?)

Arts, Entertainment, and Recreation

Started in 2006

Started in 2011

Accommodation and Food Services

Started in 2006

Started in 2011

1st year: 80.9%

5th year: 52.5%

Other Services (Except Public Administration)

Started in 2006

1st year: 80.9%

5th year: 51.2%

10th year: 37.3%

Started in 2011

1st year: 81.7%

5th year: 54.9%

Editorial Note: Any opinions, analyses, reviews or recommendations expressed in this article are those of the author’s alone, and have not been reviewed, approved, or otherwise endorsed by any of these entities.