9 FM Global SQL Interview Questions (Updated 2024)

Updated on

August 11, 2024

Data Analysts and Data Engineers at FM Global uses SQL to analyze risk management data, including property valuation and natural disaster risk assessments, as well as optimizing property insurance predictions, such as identifying high-risk properties. Because of this, FM Global often tests jobseekers SQL interview problems.

So, to help you practice, here’s 9 FM Global SQL interview questions – can you solve them?

FM Global SQL Interview Questions

9 FM Global SQL Interview Questions

SQL Question 1: Analyze Property Risk Data

You are given a table with historical data about properties insured by FM Global. The data includes property id, inspection date, and risk score assigned during each inspection. The risk score ranges from 1 to 10, with 1 indicating the lowest risk and 10 the highest.

Write a SQL query to find the difference in the risk scores between the latest and second latest inspections for each property. Include only properties that have had at least two inspections.

Example Input:
property_idinspection_daterisk_score
10012012-03-156
10022012-05-017
10012014-06-208
10032010-11-125
10022014-07-217
10012016-09-307
Example Output:
property_idlatest_risk_scoresecond_latest_risk_scorescore_diff
100178-1
1002770

Answer:


In this query, we are using window functions and to get the latest and second latest risk scores for each property. We then subtract the second latest score from the latest to find the difference. We include only properties that have a count greater than 1 in the clause to filter out properties that have had only one inspection.

To practice another window function question on DataLemur's free interactive SQL code editor, solve this Amazon SQL Interview Question:

Amazon Window Function SQL Interview Problem

SQL Question 2: Second Highest Salary

Given a table of FM Global employee salary data, write a SQL query to find the 2nd highest salary at the company.

FM Global Example Input:

employee_idsalary
12500
2800
31000
41200

Example Output:

second_highest_salary
1200

Check your SQL query for this problem directly within the browser on DataLemur:

2nd Highest Salary SQL Interview Question

Answer:


You can find a detailed solution here: 2nd Highest Salary.

SQL Question 3: Can you explain the distinction between a clustered and a non-clustered index?

Clustered and non-clustered indexes are both used to improve query performance, but they differ in how they are implemented.

A clustered index determines the physical order of the data rows in a table, while a non-clustered index does not. As a result, a table can have only one clustered index, but it can have multiple non-clustered indexes.

In terms of query efficiency & performance, a clustered index is generally faster for SELECT queries (reads) but updates (writes) to a clustered index are slower, as they require the data rows to be physically rearranged.

FM Global SQL Interview Questions

SQL Question 4: Building Policies and Claims Analysis for FM Global.

FM Global provides comprehensive commercial and industrial property insurance, engineering-driven underwriting and risk management solutions. You have been given three tables: , , and . table has , , and . table has , , , . table has , , , , .

Your task is to find out the total policy coverage amount and total claim amount per client for the year 2021 so the company can evaluate risk and formulate its strategy for the next year.

Example Input:
policy_idclient_idcoverage_amount
11011000000
21022500000
31033000000
41045000000
Example Input:
client_idclient_nameaddressindustry_type
101Client AStreet 1, City AIT
102Client BStreet 2, City BFinancial Services
103Client CStreet 3, City CHealth Care
104Client DStreet 4, City DManufacturing
Example Input:
claim_idpolicy_idclaim_amountclaim_statusdate_of_claim
11500000Approved10/01/2021
22800000Approved12/05/2021
331000000Denied05/01/2021
442000000Approved07/02/2021

Answer:


This query joins the three tables together. It calculates the total coverage for each client by grouping on from the table and sums the . It calculates the total claim amount only for approved claims in the year 2021. If a client has no claims in 2021, it shows a of 0 using the function. It returns the , , , and .

SQL Question 5: Could you describe the function of UNION in SQL?

is used to combine the results of multiple statements into a single result set.

Suppose you were doing an HR Analytics project for FM Global, and needed to analyze both FM Global's contractors and employees. You could use in the following way:


This statement would return a combined result set of FM Global contractors and employees who were hired after the start of the year 2023.

SQL Question 6: Filtering Client Risk Ratings

Suppose you have been given a task at FM Global, your task is to filter all the client records based on their risk rating. FM Global uses risk ratings to quantify each client's potential risk. You need to find all those clients which have high (3) risk rating, are from the 'USA', and were last assessed after .

Assume you have a table in your database:

Example Input:
client_idclient_namecountrylast_assessment_daterisk_rating
101ANG EnterpriseUSA05/05/20223
102BGH CorporationCanada04/10/20222
103CHELL IndustriesUSA02/14/20222
104DELL TechnologiesUSA03/05/20221
105ESOFT SolutionsUSA05/25/20223

We need to filter out those records which are from 'USA', have a risk_rating of 3, and were last assessed after .

Answer:


This query joins the boolean conditions using so that all conditions must be true for a row in to be selected. It matches clients based on their risk_rating, country, and the date they were last assessed. The date comparison only matches dates after January 1, 2022. This allows us to select high-risk clients from the USA, who were last assessed after .

SQL Question 7: How would you speed up a slow SQL query?

First things first, figure out why the query is slow! You can use and commands in PostgreSQL to identify any performance bottlenecks. You might discover that your query is inefficient, or that there are many database writes at the same time you are doing a read, or maybe too many people are concurrently running queries on the same database server.

For Data Analyst and Data Science positions, knowing the ins-and-outs of SQL performance tuning is out-of-scope for the SQL interview round. However, knowing that joins are expensive, and indexes can speed up queries, is generally enough of an answer for FM Global SQL interviews.

SQL Question 8: Average Claim Value by Policy Type

FM Global is a company that specializes in mutual insurance, so it handles policies for various types of properties and navigates numerous insurance claims. As an analyst for the company, you might be interested in finding out the average claim value per policy type in the past year.

In order to accomplish this, consider the following tables:

Example Input:
policy_idproperty_typecustomer_id
101Commercial5001
102Residential4025
103Industrial3502
104Commercial4750
105Industrial8921
Example Input:
claim_idpolicy_idclaim_valueclaim_date
9001101500002021-06-07
9002102250002021-07-10
9003103750002021-08-18
9004104400002021-09-26
90051051000002021-10-05

Now, you need to write a SQL query to find the average claim value by policy type in the past year.

Answer:


This query joins the and tables on the column, then filters for claims from the past year. It then groups the data by , and calculates the average for each .

SQL Question 9: Finding Specific Customers from USA

As a data analyst for FM Global, your task is to find all the customers whose name starts with 'J', end with an 'N' and are based in the USA. Your filtered list should only include their customer_id, full_name, and country.

Example Input:
customer_idfull_namecountry
1001John DawsonUSA
1002James BrownCanada
1003Jennifer AnistonUSA
1004Justin TimberlakeUSA
1005Janet JacksonUSA
1006Jack NicholsonUK
1007Jill JohnsonUSA
1008Henry FordUSA
Example Output:
customer_idfull_namecountry
1001John DawsonUSA
1003Jennifer AnistonUSA
1004Justin TimberlakeUSA
1005Janet JacksonUSA
1007Jill JohnsonUSA

Answer:


The above SQL query uses the LIKE keyword to filter the 'full_name' column where the string starts with 'J' and ends with 'N'. The '%' is used as a wildcard character that matches any sequence of characters. The statement 'country = 'USA'' ensures only customers based in USA are included in the result.

How To Prepare for the FM Global SQL Interview

The key to acing a FM Global SQL interview is to practice, practice, and then practice some more! Besides solving the earlier FM Global SQL interview questions, you should also solve the 200+ SQL questions on DataLemur which come from companies like Google, Microsoft and Silicon Valley startups.

DataLemur SQL Interview Questions

Each interview question has multiple hints, step-by-step solutions and best of all, there's an interactive coding environment so you can right online code up your SQL query and have it graded.

To prep for the FM Global SQL interview it is also a great idea to solve interview questions from other insurance companies like:

Stay ahead of the curve with FM Global's latest news and research on commercial property insurance and risk management!

But if your SQL foundations are weak, don't worry about going right into solving questions – strengthen your SQL foundations with this DataLemur SQL tutorial.

Interactive SQL tutorial

This tutorial covers SQL concepts such as creating summary stats with GROUP BY and CASE/WHEN/ELSE statements – both of which pop up routinely during FM Global interviews.

FM Global Data Science Interview Tips

What Do FM Global Data Science Interviews Cover?

Besides SQL interview questions, the other types of problems covered in the FM Global Data Science Interview include:

FM Global Data Scientist

How To Prepare for FM Global Data Science Interviews?

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

  • 201 interview questions taken from Google, Microsoft & tech startups
  • a crash course covering Product Analytics, SQL & ML
  • over 1000+ 5-star reviews on Amazon

Ace the DS Interview

Also focus on the behavioral interview – prepare for it using this behavioral interview question bank.

© 2024 DataLemur, Inc

Career Resources

Free 9-Day Data Interview Crash CourseFree SQL Tutorial for Data AnalyticsSQL Interview Cheat Sheet PDFUltimate SQL Interview GuideAce the Data Job Hunt Video CourseAce the Data Science InterviewBest Books for Data Analysts