Insurance Dataset
This project explores an insurance dataset containing demographic and health‑related information such as age, gender, BMI (body mass index), blood pressure, smoking habits, and more. By analyzing the dataset with SQL, valuable insights can be gained about how various factors influence insurance claims.
Description
Insurance Dataset SQL Project
Dataset Overview
Project Introduction
This project explores an insurance dataset that includes demographic and health‑related data such as age, gender, BMI (body mass index), blood pressure, smoking habits, and more. Using SQL to analyze the dataset provides valuable insights into how various factors affect insurance claims.
Project Objectives
- Analyze insurance claim data and demographic patterns.
- Provide insights into risk factors influencing insurance claims, such as health status and smoking.
- Assist beginners, intermediate, and advanced learners in practicing SQL skills with real‑world data.
Column Descriptions
- PatientID: Unique identifier for each patient.
- Age: Patient's age.
- Gender: Patient's gender (Male/Female).
- BMI: Patient's body mass index.
- BloodPressure: Patient's blood pressure.
- Diabetic: Whether the patient has diabetes (Yes/No).
- Children: Number of children the patient has.
- Smoker: Whether the patient smokes (Yes/No).
- Region: Geographic region where the patient resides.
- Claim: Insurance claim amount.
SQL Query Examples
Beginner Level Questions
- Select all columns: Retrieve all columns from the dataset.
- Distinct regions: Retrieve a list of distinct regions.
- Total number of patients: Find the total number of patients.
- Total number of smokers: Get the total number of smokers.
- Diabetic patients: Retrieve patient IDs and claims for diabetic patients.
- Total number of children: Compute the total number of children across all patients.
- Male patients: Find all male patients.
- Patients with BMI > 25: Select all columns for patients whose BMI is greater than 25.
- Average age: Get the average age of all patients.
- Patients from Southwest region: Find the total number of patients from the Southwest region.
Intermediate Level Questions
- Total insurance claim for smokers: Compute the total insurance claim amount for smokers.
- Average blood pressure for diabetic patients: Retrieve the average blood pressure for diabetic patients.
- Female patients with more than two children: Find the total number of female patients who have more than two children.
- Highest claim amount: Retrieve the highest claim amount among all patients.
- Patients over 40 years old, BMI > 30, and smokers: List patients over 40 years old, with BMI greater than 30, who also smoke.
- Number of patients per region: Retrieve the patient count for each region.
- Minimum claim amount for non‑diabetic patients: Find the minimum claim amount among non‑diabetic patients.
- Total claim amount for Northeast region: Compute the total insurance claim amount for patients from the Northeast region.
- Patients with claim > 10,000 and more than two children: List all patients whose claim exceeds 10,000 and who have more than two children.
- Diabetic patients per region: Retrieve the count of diabetic patients for each region.
Advanced Level Questions
- Total insurance claim grouped by gender and smoking status: Compute the total insurance claim amount for patients grouped by gender and smoking status.
- Top three regions where smokers have the highest average claim: Identify the three regions where smokers have the highest average claim amount.
- Diabetic patients over 50 years old with blood pressure above average: Identify diabetic patients over 50 years old whose blood pressure is above the overall average.
- Top five patients with highest claims: Find the five patients with the highest claim amounts.
- Percentage of smokers per region: Calculate the percentage of smokers in each region.
- Average claim for patients with at least two children, grouped by region: Retrieve the average claim for patients with at least two children, grouped by region.
- Average claim for diabetic patients grouped by smoking status and region: Compute the average claim amount for diabetic patients, grouped by smoking status and region.
- Top five claimants per region: List the top five patients with the highest claim amounts in each region.
- Claim variance per region: Calculate the variance of insurance claim amounts for each region.
- Highest claim amount for smokers over 50 years old per region: Identify the highest claim amount for smokers over 50 years old in each region.
CampusX Questions
- Male patients from Southwest region: Display records of male patients from the Southwest region.
- Patients with BMI between 30 and 45: Show all patient records with BMI in the range 30‑45.
- Minimum and maximum blood pressure for smoking diabetic patients: Show the minimum and maximum blood pressure for smoking diabetic patients, with column names MinBP and MaxBP.
- Unique patient count outside Southwest region: Find the number of unique patients outside the Southwest region.
- Total claim amount for male smokers: Compute the total claim amount for male smokers.
- All records from Southern region: Select all patient records from the Southern region.
- Patients with normal blood pressure (90‑120): Find the number of patients whose blood pressure falls within the normal range (90‑120).
- Patients under 17 with normal blood pressure: Find the number of patients under 17 years old whose blood pressure is within the normal range.
- Average claim for non‑smoking diabetic females: Compute the average claim amount for non‑smoking diabetic female patients.
- Update claim for PatientID 1234 to 5000: Set the claim amount to 5000 for the patient whose PatientID is 1234.
- Delete records of smokers without children: Remove all smoker records where the patient has no children.
AI studio
Generate PPTs instantly with Nano Banana Pro.
Generate PPT NowAccess Dataset
Please login to view download links and access full dataset details.
Topics
Source
Organization: github
Created: 10/11/2024
Power Your Data Analysis with Premium AI Models
Supporting GPT-5, Claude-4, DeepSeek v3, Gemini and more.
Enjoy a free trial and save 20%+ compared to official pricing.