SQLProject_8

Analyzing Electric Vehicle Charging Habits

Project Overview

charging station

As electric vehicles (EVs) become increasingly popular, the demand for accessible charging stations in residential spaces is growing rapidly. This project analyzes EV charging usage data to help apartment building managers better understand tenant charging habits. The goal is to provide insights into peak usage times, station availability issues, and overall demand patterns, enabling better planning for future infrastructure upgrades and improved tenant satisfaction.

Data Sources

The data obtained from Kaggle and has been loaded into a PostgreSQL database with a table named charging_sessions with the following columns:

charging_sessions table

Column Definition Data Type
garage_id Identifier for the garage/building VARCHAR
user_id Identifier for the individual user VARCHAR
user_type Indicating whether the station is Shared or Private VARCHAR
start_plugin The date and time the session started DATETIME
start_plugin_hour The hour (in military time) that the session started NUMERIC
end_plugout The date and time the session ended DATETIME
end_plugout_hour The hour (in military time) that the session ended NUMERIC
duration_hours The length of the session, in hours NUMERIC
el_kwh Amount of electricity used (in Kilowatt hours) NUMERIC
month_plugin The month that the session started VARCHAR
weekdays_plugin The day of the week that the session started VARCHAR

Exploratory Data Analysis (EDA)

EDA involved exploring charging sessions table using key questions, such as:

Data Analysis

Including some interesting code/features worked with

-- unique_users_per_garage
SELECT garage_id, 
       COUNT(DISTINCT user_id) AS num_unique_users
FROM charging_sessions
WHERE user_type = 'Shared'
GROUP BY garage_id
ORDER BY num_unique_users DESC;
-- most_popular_shared_start_times
SELECT weekdays_plugin, start_plugin_hour, COUNT(start_plugin_hour) AS num_charging_sessions
FROM charging_sessions
WHERE user_type = 'Shared'
GROUP BY weekdays_plugin, start_plugin_hour
ORDER BY num_charging_sessions DESC
LIMIT 10;
-- long_duration_shared_users
SELECT user_id,
       AVG(duration_hours) avg_charging_duration
FROM charging_sessions
WHERE user_type = 'Shared'
GROUP BY user_id
HAVING AVG(duration_hours) > 10
ORDER BY avg_charging_duration DESC;

Results/Findings

The analysis results are summarized as follows:

Recommendations

Based on the analysis, we recommend following actions: