Stock Ticker Find

ASKED IN INTERVIEW
2pts
Robinhood

Problem Statement

Robinhood users are currently interested in the artificial intelligence sector. To help them find relevant stocks, the engineering team needs to generate a list of all stocks where the ticker symbol contains the letters AI.

Write an SQL query to retrieve these stocks.

Rules:

  • The string AI must appear anywhere within the ticker_symbol.
  • The search should be case-sensitive (standard for tickers).
  • Output columns: ticker_symbol, company_name.
  • Results must be returned in ascending order by ticker_symbol.

Table Schema:

  • Stocks: stock_id, ticker_symbol (VARCHAR), company_name (VARCHAR), exchange.
Tests your understanding of
Basic SQL, Pattern Matching and String Functions

Input Tables

Stocks
ticker_symbol(VARCHAR)company_name(VARCHAR)
AAPLApple Inc.
AIC3.ai Inc.
NVDANVIDIA Corp.
BAIDUBaidu Inc.
MSFTMicrosoft Corp.
MAILMail.ru Group
PLTRPalantir Technologies

Expected Output

ticker_symbol(VARCHAR)company_name(VARCHAR)
AIC3.ai Inc.
BAIDUBaidu Inc.
MAILMail.ru Group

Tags

EasyASKED IN INTERVIEWBasic SQLPattern MatchingString Functions
5 min
94%

Hints