Data Scientists, Analysts, and Data Engineers at Raymond James Financial use SQL for analyzing financial data trends and managing customer databases for portfolio management. That's why Raymond James Financial usually asks SQL interview problems.
To help you ace the Raymond James Financial SQL interview, here's 10 Raymond James Financial SQL interview questions in this blog.
At Raymond James Financial, we deal with a vast amount of stock trade data. For this question, you are tasked with analyzing monthly trade volume for a subset of stocks. Given a table of trade data, write a SQL query to calculate the monthly average trade volume for each stock symbol for the year 2022. Consider 'trade_volume' as the number of shares traded in a single transaction.
The trade data is stored in a table with the following columns:
trade_id | trade_date | symbol | trade_volume |
---|---|---|---|
1243 | 01/13/2022 | AAPL | 2000 |
3542 | 01/29/2022 | AAPL | 2500 |
4312 | 02/15/2022 | AAPL | 3000 |
5467 | 02/21/2022 | GOOG | 4000 |
6213 | 03/05/2022 | AAPL | 1500 |
7218 | 03/20/2022 | GOOG | 3500 |
8495 | 04/10/2022 | GOOG | 2200 |
We want to get an output that displays the stock symbol, the month of the year 2022, and the average trading volume for that month. The month should be represented as an integer between 1 and 12.
symbol | month | avg_volume |
---|---|---|
AAPL | 1 | 2250 |
AAPL | 2 | 3000 |
AAPL | 3 | 1500 |
GOOG | 2 | 4000 |
GOOG | 3 | 3500 |
GOOG | 4 | 2200 |
The query first extracts the year and month from the trade date, and then groups the data by the stock symbol and month. The average trading volume is calculated for each of these groups. The data are then sorted by symbol and month.
p.s. Window functions show up super frequently during SQL interviews, so practice the 27+ window function questions on DataLemur
Suppose you had a table of Raymond James Financial employee salaries, along with which department they belonged to. Write a query to compare the average salary of employees in each department to the company's average salary. Return the comparison result as 'higher', 'lower', or 'same' for each department. Display the department ID, payment month (in MM-YYYY format), and the comparison.
You can solve this problem directly within the browser on DataLemur:
The answer is LONG – 30+ lines of SQL. You can find a detailed solution here: Department Salaries.
A UNIQUE constraint ensures that all values in a column are different. This provides uniqueness for the column(s) and helps identify each row uniquely. Unlike primary key, there can be multiple unique constraints defined per table.
Raymond James Financial offers various distinct investment products like stocks, bonds, and mutual funds. They want a detailed analysis of the performance of their users' portfolios. Each portfolio contains different investment products and respective quantities. They also want to keep track of portfolio performances on a monthly basis.
The company has a table that records the different investment items in each user portfolio.
portfolio_id | user_id | product_id | quantity |
---|---|---|---|
112 | 652 | 101 | 50 |
257 | 239 | 102 | 30 |
320 | 652 | 103 | 20 |
478 | 392 | 101 | 15 |
968 | 239 | 101 | 10 |
They also track the pricing of these different product types in a table
product_id | month | price |
---|---|---|
101 | 5 | 200 |
101 | 6 | 180 |
102 | 5 | 150 |
102 | 6 | 160 |
103 | 5 | 50 |
103 | 6 | 45 |
The company wants to evaluate the total value of each user's portfolio for each month.
This SQL query joins the table and the table on the . Then it groups by the and the . The sum of the product of the price of each product and its quantity provides the total value of each user's portfolio for each month.
This analysis can help the company and its users to monitor and evaluate their investment decisions over time.
The operator is used to select rows that fall within a certain range of values, while the operator is used to select rows that match values in a specified list.
For example, suppose you are a data analyst at Raymond James Financial and have a table of advertising campaign data. To find campaigns with a spend between 5k, you could use BETWEEN:
To find advertising campaigns that were video and image based (as opposed to text or billboard ads), you could use the operator:
Given a table named 'Clients', your task is to filter clients with a total portfolio value over $1 million, are based in Florida, and whose point of contact is a portfolio manager named 'Jane Smith'.
Table: Example Input:
client_id | client_name | total_portfolio_value | location | point_of_contact |
---|---|---|---|---|
101 | John Doe | 800000 | Florida | Jane Smith |
102 | Alice Johnson | 1200000 | Florida | Jane Smith |
103 | Bob Williams | 1500000 | New York | Robert Brown |
104 | Sarah Davis | 2000000 | Texas | Jane Smith |
105 | Charlie Wilson | 1100000 | Florida | Jane Smith |
Expected Output:
client_id | client_name | total_portfolio_value | location | point_of_contact |
---|---|---|---|---|
102 | Alice Johnson | 1200000 | Florida | Jane Smith |
105 | Charlie Wilson | 1100000 | Florida | Jane Smith |
This SQL statement filters the clients based on the conditions specified - clients who have a total portfolio value of over $1 million, location in Florida and the point of contact is 'Jane Smith'. This helps portfolio manager 'Jane Smith' focus on high-value clients based in Florida.
Check out the Raymond James career page, and see what skills you jeed to get the role that you want!
A full outer join returns all rows from both tables, including any unmatched rows, whereas an inner join only returns rows that match the join condition between the two tables.
For a tangible example, suppose you had a table of Raymond James Financial orders and Raymond James Financial customers.
Here's a SQL inner join using the orders and customers tables:
This query will return rows from the orders and customers tables that have matching values. Only rows with matching values will be included in the results.
Here is an example of a using the orders and customers tables:
This query will return all rows from both the orders and customers tables, including any rows that do not have matching values. Any rows with null values for either table will be included in the results.
Raymond James Financial customer service department maintains a database to keep track of all customer interactions. The database contains a table named "CustomerInteractions" that records the date, advisor handling the case, the type of interaction, and the customer's name.
You need to create an SQL query that will retrieve all records where the type of interaction contains the word 'complaint', 'Complaint', or any variation of the word complaint in any case.
Here is the schema of the table:
interaction_id | interaction_date | advisor_id | interaction_type | customer_name |
---|---|---|---|---|
101 | 2022-04-25 14:30:00 | 20051 | Advice on stocks | John Doe |
102 | 2022-04-25 15:22:00 | 20232 | complaint about service | Jane Smith |
103 | 2022-04-27 09:50:00 | 20098 | Discussion on Bonds | Richard Roe |
104 | 2022-04-28 16:30:00 | 20051 | Complaint about fees | John Doe |
You need to retrieve all records in which the "interaction_type" contains the word "complaint".
Here is a PostgreSQL query to get that:
This SQL query will return all records from the table where the field contains the word 'complaint', regardless of the case. The in the clause acts as a wildcard allowing for a word to have characters before or after it in the field. The function is used to make the comparison case insensitive.
Given a customer table and an accounts table, write a SQL Postgres command to retrieve the customer's full name, account status and total amount in the account. The customer table contains rows of customers while the accounts table stores actions related to their bank accounts. Join the two tables on the customer id.
customer_id | first_name | last_name |
---|---|---|
1 | John | Doe |
2 | Jane | Smith |
3 | Alice | Johnson |
4 | Bob | Anderson |
account_id | customer_id | status | amount |
---|---|---|---|
001 | 1 | active | 50000 |
002 | 2 | active | 20000 |
003 | 3 | inactive | 10000 |
004 | 4 | active | 40000 |
The output should contain the customer's full name, account status and total amount in the account.
full_name | status | amount |
---|---|---|
John Doe | active | 50000 |
Jane Smith | active | 20000 |
Alice Johnson | inactive | 10000 |
Bob Anderson | active | 40000 |
This query first concatenates the and from the table to produce a full name. It then looks up the corresponding account using the command. Finally, it extracts the account status and amount from the table. The result is a list of all customers, their account status and the total amount in their accounts.
Since joins come up frequently during SQL interviews, practice an interactive SQL join question from Spotify:
To explain the difference between a primary key and foreign key, let's inspect employee data from Raymond James Financial's HR database:
:
+------------+------------+------------+------------+ | employee_id| first_name | last_name | manager_id | +------------+------------+------------+------------+ | 1 | Aubrey | Graham | 3 | | 2 | Marshal | Mathers | 3 | | 3 | Dwayne | Carter | 4 | | 4 | Shawn | Carter | | +------------+------------+------------+------------+
In this table, could be a primary key. It is unique for each row in the table and cannot contain null values.
could be a foreign key. It references the of the manager of each employee in the table, establishing a relationship between the employees and their managers. This foreign key allows you to easily query the table to find out who a specific employee's manager is, or to find out which employees report to a specific manager.
It is also possible for a table to have multiple foreign keys that reference different primary keys in other tables. For example, the table could have additional foreign keys for the of the department where each employee works, and the l of the location where each employee is based.
The key to acing a Raymond James Financial SQL interview is to practice, practice, and then practice some more! Beyond just solving the above Raymond James Financial SQL interview questions, you should also solve the 200+ FAANG SQL Questions on DataLemur which come from companies like FAANG tech companies and tech startups.
Each exercise has hints to guide you, detailed solutions and crucially, there's an online SQL code editor so you can right online code up your SQL query and have it checked.
To prep for the Raymond James Financial SQL interview it is also useful to practice interview questions from other investment management and private equity companies like:
In case your SQL skills are weak, don't worry about diving straight into solving questions – improve your SQL foundations with this DataLemur SQL Tutorial.
This tutorial covers SQL concepts such as LAG window function and inner vs. outer JOIN – both of these pop up often in SQL interviews at Raymond James Financial.
In addition to SQL query questions, the other question categories to prepare for the Raymond James Financial Data Science Interview include:
To prepare for Raymond James Financial Data Science interviews read the book Ace the Data Science Interview because it's got: