If you regularly invest in the stock market, you've probably come across the phrase "sell in May and go away." The adage came about when investors realized the six-month period between May and October often delivers weaker returns than the six-month period from November to April.

Seasonality is one of the most likely causes of the disparity. There is often less trading activity in the warmer spring and summer months, because Wall Street bankers and fund managers are away on vacation like everybody else.

According to the Corporate Finance Institute, the S&P 500 index has delivered an average return of 2% during the May-to-October period each year since 1945, compared to a 6.7% gain from November to April. That's a substantial difference, so with May just a couple of weeks away, should you sell your stocks?

Absolutely not. First of all, you're actually better off buying stocks in May considering they will likely deliver a positive return based on the above information. Second of all, it's always best to take a long-term approach to investing by assessing opportunities based on a period of five or 10 years. With that in mind, here's why you should consider buying shares of Oracle (ORCL 0.60%) and Uber Technologies (UBER 1.75%) today.

1. Oracle is one of the cheapest ways to play the artificial intelligence (AI) boom

Oracle was founded in 1977 so it has survived its fair share of Mays and, in fact, its stock price is currently near an all-time high. The company helps businesses shift into the digital age, whether it was through its original database management systems decades ago, or its current portfolio of cloud applications and data center infrastructure.

Data center infrastructure has been a core focus for Oracle over the last couple of years, because the rise of artificial intelligence (AI) is fueling significant demand for computing power among developers. Oracle Cloud Infrastructure (OCI) is currently upgrading its 66 existing data centers to support AI with new graphics processing chips (GPUs) from suppliers like Nvidia, but it's also building 100 more.

Oracle chairman Larry Ellison says the company's GPU cluster technology allows developers to build generative AI models twice as fast and for half the cost of competing infrastructure. As a result, demand for OCI's Gen2 Cloud capacity is soaring from leading AI start-ups like Cohere and Elon Musk's xAI. In fact, CEO Safra Catz recently said Oracle has at least 40 new AI bookings worth over $1 billion each, which haven't even come online yet because they are waiting for new data centers to be built.

Oracle generated $13.3 billion in total revenue during the recent fiscal 2024 third quarter (ended Feb. 29), which represented a 7% year-over-year increase. However, while OCI only accounted for $1.8 billion of that revenue, the segment grew by an impressive 49%. Ellison believes OCI will grow by 50% for years to come on the back of surging demand for AI.

The AI bookings I mentioned earlier support that, and during Q3, Oracle's total bookings soared 29% to a record-high $80 billion, which suggests an overall acceleration in revenue growth might be on the horizon.

Oracle's fiscal 2024 year will wrap up in May, and Wall Street analysts predict the company's earnings per share will land at $5.59. That places Oracle stock at a price-to-earnings (P/E) ratio of 21.2, which is 31% cheaper than the 30.8 P/E ratio of the Nasdaq-100 technology index. Therefore, this stock looks like a great buy no matter the time of year.

2. Uber is a long-term bet on autonomous technologies

Uber operates the largest ride-hailing platform in the world, but it also runs a dominant food delivery service and a growing commercial freight network. The company is set to benefit significantly from AI over the long term, because it paves the way for autonomous self-driving vehicles.

Uber accepted $137.8 billion in bookings from its 150 million monthly active platform customers during 2023. That figure includes the total dollar value of every ride, every food order, and every freight order. Around 6.8 million monthly active drivers are working within its ecosystem to fulfill those orders, and they earned $62 billion throughout the year.

Uber is a platform company, so its job is to connect people and collect a fee for doing so. Therefore, after stripping out what it paid to drivers and restaurants, for example, the company's $137.8 billion in bookings translated to $37.2 billion in revenue. But what if Uber could eliminate the cost of its drivers by using autonomous vehicles?

Theoretically, it would lead to $62 billion in additional revenue (less any fees owed to the owners and developers of said vehicles). Even if the company split the savings with its customers by slashing prices, it might still be billions of dollars better off.

Uber has already inked a number of partnerships on that front. Customers in Phoenix, Arizona, can hail a self-driving ride through Uber today, which is serviced by Alphabet's Waymo autonomous vehicles. The company also has a 10-year deal with Motional, a joint venture between Aptiv and Hyundai that has developed an electric self-driving car. Uber also owns equity stakes in autonomous technology companies Aurora and Joby Aviation.

Uber is clearly preparing for an autonomous future, even if it might be a decade (or more) away. But investors don't have to bank on that to buy the stock today -- it has soared 126% over the past 12 months, and an analyst from Jefferies Research thinks it could jump another 39% to reach $100 in the next year or so.

Uber has matured beyond its days as a disruptive tech start-up. The company is now profitable, having delivered $2.1 billion in net income during 2023, which paved the way for its admission into the prestigious S&P 500 index. Buying this stock is a bet on a growing business with significant untapped long-term potential thanks to AI and autonomous technologies.