Nvidia (NVDA 1.75%) has been one of the hottest stocks on the market in the past 18 months. Shares jumped sixfold thanks to the crucial role it is playing in the proliferation of artificial intelligence (AI). But Nvidia has also crushed the broader market by a big margin over the past decade as well.

The stock has shot up over 20,000% in the past 10 years, with these stunning gains crushing the Nasdaq-100 Technology Sector index's 428% jump by an astronomic margin. With an investment of $5,000 made in the stock a decade ago, Nvidia has become a millionaire-maker. 

NVDA Chart

NVDA data by YCharts

Not everyone may be comfortable paying 38 times sales and 55 times earnings for Nvidia stock right now, even though it may be able to justify that expensive valuation because of a huge total addressable market worth $1 trillion. Investors looking to buy attractively valued stocks that could make them richer in the long run should instead consider Meta Platforms (META 0.11%) and Oracle (ORCL -1.23%).

These companies are not only significantly cheaper than Nvidia, but they are on track to benefit from a couple of massive growth opportunities that could send their share prices soaring over the long term. Let's look at the reasons Meta and Oracle could be ideal picks for investors hoping to construct a million-dollar portfolio.

1. Meta Platforms

Meta Platforms stock shot up 92% in the past year, and the company's recent quarterly report indicates that it is built for more upside because of its accelerating growth. The social media giant's first-quarter revenue increased 27% year over year to $36.5 billion, while adjusted earnings shot up 114% year over year to $4.71 per share.

Meta's impressive year-over-year growth was driven by a solid 20% year-over-year jump in ad impressions, as well as a 6% jump in the average price of each ad. AI is playing an important role in driving stronger growth in Meta's ad business by delivering relevant content to users across its family of apps, which is in turn driving an increase in the number of relevant ads served to its users.

CEO Mark Zuckerberg said on the company's April earnings conference call that its AI recommendation system accounts for 30% of the posts that are delivered to the Facebook feeds of its users, while more than 50% of the content on Instagram is recommended by AI. It is worth noting that Meta has been continuously introducing AI-related tools for advertisers, making it easier for them to create and optimize ad campaigns.

The company will be rolling out more generative AI tools as the year progresses to help advertisers improve the performance of their ads and allow them to boost the returns on the ad dollars that they spend. The good part is that advertisers are already reaping the benefits of Meta's AI tools. In January this year, a Meta executive said that AI is driving a 32% increase in returns on advertising spending for advertisers while helping them reduce acquisition costs by 17%.

Based upon this performance, Meta Platforms is forecasting another quarter of solid growth. The company expects Q2 revenue to land at $37.8 billion at the midpoint of its guidance range, which would be an 18% jump over the year-ago period when it reported 11% top-line growth. Even better, analysts are forecasting the company's earnings to increase at an annual rate of 30% for the next five years, which would be an acceleration over the 11% annual earnings growth it has clocked in the past five years.

It won't be surprising to see Meta delivering such impressive growth as AI is helping it corner a bigger share of the digital ad market. Digital ad spending is forecasted to grow 13.2% in 2024, and Meta's Q1 growth and Q2 forecast tells us that it is growing at a faster pace than the end market. More importantly, digital ad spending is expected to increase at an annual rate of 14.5% through 2030, according to KBV Research, generating an annual revenue of just over $1 trillion.

Meta generated $143 billion in revenue in the past 12 months, which means that it still has a lot of room for growth in the future. Investors would do well to buy Meta stock while it is trading at 27 times trailing earnings, which is significantly lower than Nvidia's trailing earnings multiple. Its stronger earnings growth could reward investors with more upside.

2. Oracle

The demand for cloud-based AI services has been booming as companies across the globe are looking to develop AI applications, and this has turned out to be a boon for Oracle. The company, which made its name by providing database software, is now witnessing solid growth in its cloud computing business.

In the third quarter of fiscal 2024 (for the three months ended Feb. 29, 2024), Oracle reported a 25% year-over-year increase in cloud revenue to $5.1 billion. The segment's growth outpaced the company's overall revenue increase of 7% to $13.3 billion. More specifically, the demand for Oracle's cloud infrastructure shot up and its revenue from this niche jumped 49% year over year to $1.8 billion.

The good thing for Oracle investors is that AI has helped the company build a healthy revenue pipeline. This was evident from the 29% year-over-year increase in the company's remaining performance obligation (RPO) last quarter, a metric that refers to the total value of future contracts that Oracle has to fulfill. The fact that this metric increased at a faster pace than Oracle's revenue is a positive sign.

Oracle pointed out that it has been "receiving large contracts reserving cloud infrastructure capacity because the demand for our Gen2 AI infrastructure substantially exceeds supply." The company has been bringing new cloud data centers online very rapidly to cater to the healthy demand that it has been witnessing, so it won't be surprising to see the company's cloud AI-focused revenue pipeline improving further in the future.

The cloud AI market is forecasted to grow at an annual rate of 31% through the end of the decade, generating an annual revenue of $398 billion at the end of the forecast period, according to Fortune Business Insights. As a result, there is a good chance that Oracle's growth could accelerate over the long run. Analysts, for instance, are expecting Oracle's earnings growth to accelerate over the next couple of years as compared to the $5.12 per share in earnings it delivered in fiscal 2023.

ORCL EPS Estimates for Current Fiscal Year Chart

ORCL EPS Estimates for Current Fiscal Year data by YCharts

Considering that Oracle is currently trading at 6.6 times sales and 20 times forward earnings, investors can buy it at a much cheaper valuation compared to Nvidia. That could turn out to be a smart move -- the terrific opportunity for Oracle in the cloud AI market could translate into stronger earnings growth in the long run and lead the market to reward the stock with more gains. Investors wanting to add a cloud stock to their portfolios that could help them attain their goal of becoming millionaires would do well to buy Oracle right away.