Artificial intelligence (AI) has the potential to change the world. It has already sparked an arms race among the world's largest technology companies to provide leading data center infrastructure to their business customers. Plus, enterprises of all sizes are finding new ways to embed AI applications into their everyday operations to boost productivity.

Depending which Wall Street estimate you rely upon, AI could add anywhere between $7 trillion and $200 trillion to the global economy over the next decade. That will create enormous investment opportunities.

Speaking of enormous investing opportunities, Oracle (ORCL 2.02%) and Amazon (AMZN 3.43%) have created many stock millionaires already for those smart enough (or lucky enough) to buy in on their previous growth. Here's how these two companies could ride the AI boom to mint even more going forward.

A person looking at server hardware while holding a laptop computer.

Image source Getty Images.

1. Oracle

Oracle has been one of the most innovative technology companies in the world since its founding in 1977, when it launched its original database management software. Today, it plays a pivotal role in helping companies transition into the digital age. It offers a portfolio of cloud-based applications designed to improve efficiency for dozens of different industries, with the help of automation and AI.

But investors' attention is currently focused on Oracle Cloud Infrastructure (OCI), which delivers critical computing infrastructure to its business customers so they can design, build, and deploy their own cloud-based applications. However, OCI is now tackling its most lucrative opportunity ever: artificial intelligence.

Oracle's data center infrastructure is powered by Nvidia's leading graphics processing chips (GPUs), and it has become a top destination for developers of generative AI applications. Chairman Larry Ellison says Oracle's GPU cluster technology can train AI models at twice the speed and half the cost of competing clouds. As a result, it has attracted leading AI start-ups like Adept AI, Cohere, and even Elon Musk's xAI.

In the recent fiscal 2024 second quarter (ended Nov. 30), Oracle's cloud infrastructure revenue came in at $1.6 billion. While that was a small piece of the company's overall $12.9 billion in revenue, it increased by a whopping 52% year over year. Ellison says that pace of advancement will likely continue for years, and if he's right, it means cloud infrastructure revenue will more than double every two years. As a result, it could eventually become a more significant growth driver for the entire company.

But it might get even better because that growth is hampered by supply constraints right now. Oracle operates 66 data centers, and not only is it expanding them at the moment, but it's also building 100 more. That takes time, and the company also can't get its hands on enough Nvidia chips. In fact, Ellison said Oracle couldn't provide anywhere close to enough GPU capacity for Elon Musk's xAI venture recently, and those circumstances will lead to lost revenue (in the short term).

Oracle stock has soared 229,095% since it came public in 1986, so an investment of $440 back then would be worth more than $1 million today. While that pace of growth probably won't be repeated over the next three-plus decades, Oracle is valued at just $290 billion, so it's one of the smallest of the big-tech companies and still has room for significant growth.

Wall Street estimates Oracle will deliver $5.55 in earnings per share during fiscal 2024, placing its stock at a forward price-to-earnings (P/E) ratio of just 19. By comparison, competing AI cloud company Microsoft trades at a forward P/E of 33.5. Oracle stock would have to rise 76% just to catch up, without factoring in any future growth.

Over the long term, it's conceivable Oracle's fast-growing presence in AI will give it a chance to join its tech peers that sport trillion-dollar market capitalizations. It could take a decade (or more) while OCI grows to account for more of the company's total revenue, but it implies its stock could triple from here, so an investor starting with $300,000 today might eventually become a millionaire.

A person placing an Amazon box at a customer's doorstep.

Image source: Amazon.

2. Amazon

Amazon is an e-commerce pioneer, and online sales are still the company's largest source of revenue despite expansions into cloud computing, digital advertising, and streaming services. E-commerce has had an impact on millions of people; it saves time, it lowers prices because merchants can sell more volume, and it allows consumers to buy products from all over the world.

But a seismic amount of work happens behind the scenes at Amazon to deliver a great e-commerce experience for customers, and a growing amount of that work is powered by artificial intelligence. Amazon uses AI to learn what customers are likely to buy, creating a highly personalized shopping experience with targeted product recommendations. Plus, Amazon uses over 750,000 AI-powered autonomous robots in its fulfillment centers to speed up logistics, ensuring customers receive their goods in a timely manner.

But Amazon is also using AI extensively in its industry-leading cloud services platform, Amazon Web Services (AWS). It developed its own data center AI chips, including the new Trainium2, which is 4 times faster than its predecessor, empowering developers to accelerate the training phase of their AI models. AWS also offers a host of large language models (LLMs) to its business customers, including its own called Titan, as well as third-party models from leading start-ups like Anthropic, in which Amazon bought an equity stake worth $4 billion.

Simply put, AWS offers all the hardware and software businesses need to build AI applications for their own purposes.

The Amazon story is incredibly attractive from a value perspective. Its stock is part of the "Magnificent Seven," a group of technology giants that outperformed the S&P 500 index by a wide margin in 2023. But Amazon stock is the cheapest of the group by far based on its price-to-sales (P/S) ratio.

A chart comparing the price to sales valuations of the Magnificent Seven technology stocks.

Data source: YCharts.

Amazon is on track to deliver $570 billion in total revenue in 2023 (pending its official Q4 results). That's more than any other company in the Magnificent Seven, yet it trades at less than half the P/S valuation of the next-cheapest stock in the group, Alphabet.

Amazon shares have delivered a 202,486% gain since the company came public in 1997, which means an investment of just $500 back then would be worth over $1 million today. It's unlikely to repeat that rate of growth, but an investor who starts with $200,000 today could join the millionaires' club within the next 20 years so long as Amazon increases its revenue by 8.3% annually (it's on track to rise by more than 11% in both 2023 and 2024, according to Wall Street estimates).

Plus, Amazon stock would have to quadruple just to trade in line with the average P/S ratio of the other six Magnificent Seven stocks, without factoring in any further revenue growth at all.