logo

8 JPMorgan Chase SQL Interview Questions (Updated 2024)

Updated on

June 30, 2024

At JPMorgan Chase, SQL is crucial for analyzing financial transaction patterns and predicting future investment trends. So, it shouldn't surprise you that JPMorgan Chase almost always asks SQL questions during interviews for Data Analytics, Data Science, and Data Engineering jobs.

To help you ace the JPMorgan Chase SQL interview, we've collected 8 JPMorgan Chase SQL interview questions in this article.

JPMorgan Chase SQL Interview Questions

8 JPMorgan Chase SQL Interview Questions

SQL Question 1: Cards Issued Difference

Your team at JPMorgan Chase is preparing to launch a new credit card, and to gain some insights, you're analyzing how many credit cards were issued each month.

Write a query that outputs the name of each credit card and the difference in the number of issued cards between the month with the highest issuance cards and the lowest issuance. Arrange the results based on the largest disparity.

Table:

Column NameType
card_namestring
issued_amountinteger
issue_monthinteger
issue_yearinteger

Example Input:

card_nameissued_amountissue_monthissue_year
Chase Freedom Flex5500012021
Chase Freedom Flex6000022021
Chase Freedom Flex6500032021
Chase Freedom Flex7000042021
Chase Sapphire Reserve17000012021
Chase Sapphire Reserve17500022021
Chase Sapphire Reserve18000032021

Example Output:

card_namedifference
Chase Freedom Flex15000
Chase Sapphire Reserve10000

Answer:


Solve this JP Morgan Chase SQL question for FREE on our interactive coding environment.

JPMorgan Chase SQL Interview Question

SQL Question 2: Card Launch Success

Your team at JPMorgan Chase is soon launching a new credit card. You are asked to estimate how many cards you'll issue in the first month.

Before you can answer this question, you want to first get some perspective on how well new credit card launches typically do in their first month.

Write a query that outputs the name of the credit card, and how many cards were issued in its launch month. The launch month is the earliest record in the table for a given card. Order the results starting from the biggest issued amount.

Table:

Column NameType
issue_monthinteger
issue_yearinteger
card_namestring
issued_amountinteger

Example Input:

issue_monthissue_yearcard_nameissued_amount
12021Chase Sapphire Reserve170000
22021Chase Sapphire Reserve175000
32021Chase Sapphire Reserve180000
32021Chase Freedom Flex65000
42021Chase Freedom Flex70000

Example Output:

card_nameissued_amount
Chase Sapphire Reserve170000
Chase Freedom Flex65000

Answer:


You can find a step-by-step solution with hints here: Card Launch Success.

JPMorgan ChaseSQL Interview Question

SQL Question 3: Can you provide an example of two entities that have a one-to-one relationship, and another example of a one-to-many relationship?

In database schema design, a one-to-one relationship between two entities is where each entity is associated with only one instance of the other entity. For example, the relationship between a car and a license plate is one-to-one, because each car can only have one licensce plate, and each licensce plate belongs to exactly one car.

On the other hand, a one-to-many relationship is where one entity can be associated with multiple instances of the 2nd entity. For example, a teacher can teach multiple classes, but each class is associated with only one teacher.

JPMorgan Chase SQL Interview Questions

SQL Question 4: Customer Account Activity Filter

As a data analyst for JPMorgan Chase, you have been tasked to identify accounts with either abnormally high transactions or dormant status. The brief is as follows:

  • High transaction account: An account where the total number of transactions exceeds 100 in the last 30 days.
  • Dormant account: An account with no transaction in the past 60 days.

You have the following dataset at your disposal:

Example Input:
account_idaccount_nameaccount_open_date
5551John Doe01/05/2020
6625Jane Smith06/18/2021
7142Peter Parker12/07/2019
8883Tony Stark12/15/2018
Example Input:
transaction_idaccount_idtransaction_datetransaction_amount
1011555109/02/2022200.00
2022662510/01/2022350.00
3033888308/01/20221500.00
4044555110/02/2022100.00
............
20235888310/10/20222000.00

Write a SQL Query to filter down and bring out these two categories of account from the dataset.

Answer:


This query first fetches all accounts with more than 100 transactions in the last 30 days using a subquery and joins it with the accounts table. It then combines these results with the accounts that haven't had any transactions in the last 60 days using UNION. UNION ensures we don't have duplicate accounts in case an account falls in both categories.

SQL Question 5: What's the SQL command do, and can you give an example?

When using , only rows that are identical in both sets will be returned.

For a concrete example, say you were a Data Analyst supporting the Sales Analytics team at JPMorgan Chase, and data on potential sales leads lived in both Salesforce and Hubspot CRMs. To write a query to analyze leads created before 2023 started, that show up in BOTH CRMs, you would use the command:


SQL Question 6: Calculate The Average Transaction Amount per Branch

The table logs each transaction that takes place at various branches of JPMorgan Chase. Each row records the transaction id (), the branch id (), the customer id (), the transaction amount () and the date of the transaction ().

The interviewee is expected to write a SQL query that calculates the average transaction amount per branch for the year 2023.

Example Input:

transaction_idbranch_idcustomer_idtransaction_amounttransaction_date
110012001$600001/01/2023
210022002$700001/02/2023
310022003$800001/03/2023
410032004$900001/04/2023
510012005$1000001/05/2023

Example Output:

branch_idavg_transaction_amount
1001$8000.00
1002$7500.00
1003$9000.00

Answer:


The SQL query finds the average transaction amount for each branch for the year 2023. It first filters the transactions for the year 2023 with the WHERE clause, then groups the transactions by branch id using the GROUP BY clause. Finally, it calculates the average transaction amount for each group using the AVG aggregate function.

To practice a very similar question try this interactive Stripe Repeated Payments Question which is similar for dealing with transaction data or this Uber User's Third Transaction Question which is similar for calculating statistics based on transactions.

SQL Question 7: What's the purpose of the constraint?

A is a field in a table that references the of another table. It creates a link between the two tables and ensures that the data in the field is valid.

Say for example you had sales analytics data from JPMorgan Chase's CRM (customer-relationship management) tool.


The FOREIGN KEY constraint ensures that the data in the field of the "opportunities" table is valid, and prevents the insertion of rows in the table that do not have corresponding entries in the table. It also helps to enforce the relationship between the two tables and can be used to ensure that data is not deleted from the accounts table if there are still references to it in the opportunities.

Read about JPMorgan's Data and Analytics suite and how they utilize it to reach their business goals.

SQL Question 8: Find Customer Information for a JPMorgan Chase Campaign

JPMorgan Chase wants to launch a marketing campaign for clients who are living in New York and have their names starting with 'A'. For this project, they want to obtain a list that includes the client's id, first name, last name, email and phone number. Please write a SQL query that will help obtain this list from the customer database.

Assuming we have a table with data arranged as follows:

Example Input:
customer_idfirst_namelast_nameemailphonecity
1AndrewJohnsonandrewj@email.com1383754928New York
2BethDavisbethd@email.com1435874590California
3AaronMorganaaronm@email.com1562749392New York
4ChrisWhitechrisw@email.com1698432075Texas
5AlexRussellalexr@email.com1526374980New York

The SQL query to obtain the required information:

Answer:


This query will filter out customers with the first name starting with 'A' and lives in New York as they are the target for the upcoming marketing campaign. The LIKE keyword in SQL is used to search for a specified pattern in a column. 'A%' is a pattern that matches any string that starts with 'A'.

How To Prepare for the JPMorgan Chase SQL Interview

The best way to prepare for a SQL interview, besides making sure you have strong SQL fundamentals, is to practice a ton of real SQL questions that were asked in recent job interviews. Besides solving the earlier JPMorgan Chase SQL interview questions, you should also solve the 200+ SQL questions from real Data Science & Analytics interviews which come from companies like Google, Microsoft and Silicon Valley startups. DataLemur SQL Interview Questions

Each problem on DataLemur has hints to guide you, full answers and best of all, there's an interactive coding environment so you can right online code up your SQL query answer and have it checked.

To prep for the JPMorgan Chase SQL interview it is also helpful to practice SQL problems from other banking & finanacial services companies like:

In case your SQL query skills are weak, don't worry about diving straight into solving questions – improve your SQL foundations with this free SQL for Data Analytics course.

Free SQL tutorial

This tutorial covers SQL topics like working with string/text data and how window functions work – both of these come up frequently in SQL job interviews at JPMorgan Chase.

JPMorgan Chase Data Science Interview Tips

What Do JPMorgan Chase Data Science Interviews Cover?

In addition to SQL interview questions, the other question categories to practice for the JPMorgan Chase Data Science Interview are:

JPMorgan Chase Data Scientist

How To Prepare for JPMorgan Chase Data Science Interviews?

To prepare for JPMorgan Chase Data Science interviews read the book Ace the Data Science Interview because it's got:

  • 201 interview questions sourced from tech companies like Netflix, Google, & Airbnb
  • a crash course on SQL, Product-Sense & ML
  • over 1000+ reviews on Amazon & 4.5-star rating

Acing Data Science Interview