There's no secret to long-term investing. Buying high-quality stocks with solid growth prospects, sound financials, and a good management team can lead to compounding returns for decades if you are willing to hold on to them.

In March of 1986, investors had an opportunity to buy one such company for the very first time, when Oracle (ORCL 2.02%) had its initial public offering (IPO). Back then, the company was selling revolutionary database software, but it has since evolved to offer an entire portfolio of cloud-based products spanning financial management, supply chain management, and human resources. Now, it's tackling a new frontier: artificial intelligence (AI).

The company's relentless appetite for innovation has led to a surging stock price over the last 37 years, and had you invested $1,000 in its stock in 1986, here's exactly how much money you would have today. 

Oracle revolutionized the database, but it has since done so much more

Oracle was founded in 1977, almost a decade earlier than its IPO. Back then, the company was called Software Development Laboratories, and it produced the first-ever "Oracle" -- its relational database management software. In those times, programs that could display information in rows and columns were true game changers.

It wasn't until 1982 that the company adopted the name of its flagship product to become Oracle Software Corp., and in the following years, it continued to be a leading innovator in database technologies. 

But in the most recent decade, cloud computing has surged to prominence, with just about every business in the developed world using it to host websites, access software, and store valuable data online. It prompted Oracle to launch Oracle Cloud Infrastructure in 2016 to focus on cloud products rather than traditional on-premise software, and it has led to a new growth era for the company. 

Through continued innovation combined with dozens of strategic acquisitions of smaller companies, Oracle built a portfolio of cloud-based applications that do everything from help businesses automate their manufacturing, to manage entire workforces with payroll, safety, and scheduling tools. 

AI is at the heart of automation, and Oracle gradually introduced the technology into its cloud products. The company signed multiple deals with Nvidia (NVDA 6.18%), the global leader in data center chips used for AI workloads. In late 2022, the companies announced a new collaboration to bring tens of thousands of Nvidia's A100 and H100 chips into its data centers to help Oracle's cloud customers access accelerated computing. 

Then, in March of this year, Nvidia selected Oracle as the first hyperscale cloud provider to offer the DGX Cloud platform, an AI supercomputer that all businesses can access in the cloud without having to invest billions of dollars in the infrastructure. Wins like that are likely to keep Oracle at the forefront of innovation for years to come. 

Oracle's financial growth has been unstoppable over the long term

When Oracle went public in 1986, it was generating $55 million in annual revenue. But the company is coming off a blockbuster fiscal 2023 (ended May 31), where it delivered a whopping $50 billion in revenue. That's an increase of about 90,800% in 37 years.

A chart of Oracle's annual revenue from fiscal 1986 to fiscal 2023.

The cloud and AI were behind the company's stellar results recently. Management said both of its strategic cloud businesses were getting bigger and growing at an accelerated pace, and that the Oracle Gen2 Cloud was the No. 1 choice for running generative AI workloads. 

Chairman Larry Ellison (who recently became richer than Bill Gates) said Oracle's infrastructure has the highest performance and lowest-cost GPU cluster technology in the world, to the point that even Nvidia is a customer.

Speaking of which, more than 30 AI developers recently committed to buying $2 billion worth of Gen2 Cloud capacity, which is a sign of Oracle's leadership in this new, emerging industry. 

The value of a $1,000 investment in Oracle's IPO today

Oracle completed its IPO on March 12, 1986, at a price of $15 per share. But since then, the company has created so much value, and its stock price has surged so high, that it decided to execute 10 stock splits between the years 1987 and 2000. This ensured it remained accessible to small investors. 

If you had invested $1,000 in Oracle stock at its IPO, you would have acquired 66 shares. But after adjusting for the stock splits, you would have 21,384 shares today with a cost basis of $0.046 per share.

Given that Oracle stock now trades at $120.77, that translates to a return of 260,800%! In dollar terms, your $1,000 investment would be worth a whopping $2.6 million today. 

But it gets better, because Oracle has paid a dividend since 2009. Assuming you never sold a single share along the way, you would have also received $201,864 in dividend payments. Since the stock continues to pay a quarterly dividend of $0.40 per share (and rising), you would still be collecting $34,214 in payments each year -- that's more than 34 times your initial $1,000 investment in 1986!

With the AI tailwind at Oracle's back, the company's incredible run of value creation is likely to continue for the foreseeable future. Therefore, it's not too late for investors to buy the stock.