As electronic vehicles (EVs) become more popular, there is an increasing need for access to charging stations, also known as ports. To that end, many modern apartment buildings have begun retrofitting their parking garages to include shared charging stations. A charging station is shared if it is accessible by anyone in the building.
But with increasing demand comes competition for these ports — nothing is more frustrating than coming home to find no charging stations available! In this project, you will use a dataset to help apartment building managers better understand their tenants’ EV charging habits.
The data has been loaded into a PostgreSQL database with a table named charging_sessions with the following columns:
charging_sessions
| 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 |
Let’s get started!
Sources
Problem Statement:
As the popularity of electric vehicles (EVs) continues to grow, the demand for accessible charging stations in apartment buildings has increased. This rising demand can lead to competition for available charging ports, causing frustration among tenants. To address this issue, it is essential to understand the charging habits of tenants and the utilization patterns of the existing charging infrastructure. This analysis aims to provide apartment building managers with actionable insights into EV charging behavior, identify peak usage times, compare the usage of shared versus private stations, and highlight any patterns that could inform better management and expansion of charging facilities. By answering these key questions, we can help optimize the availability and efficiency of EV charging stations, ensuring a better experience for all residents.Let us start the analysis to understand EV charging habits of tenants in apartment buildings.
Let us start the Analysis......
-- Return a tibble of the table charging_sessions to take a look
SELECT *
FROM charging_sessions
LIMIT 10;1. What are the peak hours for EV charging?
-- Identifying peak hours helps in managing and possibly expanding charging infrastructure to accommodate high demand times.
SELECT start_plugin_hour, COUNT(*) AS total_sessions
FROM charging_sessions
GROUP BY start_plugin_hour
ORDER BY total_sessions DESC;
/* Looking at the total number of sessions by hour (0 to 23), most people try to charge between 15 (3 PM) to 19 (7 PM). */
2. What is the average duration of charging sessions?
-- Understanding the average duration can help in optimizing charging schedules and informing users about expected charging times.
SELECT AVG(duration_hours) AS avg_duration
FROM charging_sessions;
/* Average Duration of charging time is 11.5 Hours. */3. How does the usage of shared vs. private stations compare along with number of unique users in each station ?
-- This comparison helps in determining if shared stations are sufficient or if more private stations are needed. Also, Number of Unique users based on station.
SELECT user_type,
COUNT(*) AS total_sessions,
SUM(el_kwh) AS total_kwh,
COUNT(DISTINCT user_id) AS unique_users
FROM charging_sessions
GROUP BY user_type;
/* Looking into this information seems like 4. What are the most common days for charging sessions?
-- Knowing the most common days can assist in planning maintenance and ensuring availability during high-demand days.
SELECT weekdays_plugin, COUNT(*) AS total_sessions
FROM charging_sessions
GROUP BY weekdays_plugin
ORDER BY total_sessions DESC;
/* Most common weekdays to charge EV vehicles are Thursday, Wednesday and Friday. */5. How does charging activity vary by month?
-- Seasonal trends in charging can help in predicting future needs and planning for infrastructure upgrades.
SELECT month_plugin, COUNT(*) AS total_sessions, SUM(el_kwh) AS total_kwh
FROM charging_sessions
GROUP BY month_plugin
ORDER BY total_sessions DESC;
/* Months during the Fall highlight excessive need for the chaging stations. */6. Which garages/buildings have the highest usage?
-- Identifying high-usage garages can highlight areas needing more charging stations or better management.
SELECT garage_id, COUNT(*) AS total_sessions, SUM(el_kwh) AS total_kwh
FROM charging_sessions
GROUP BY garage_id
ORDER BY total_sessions DESC;
/* Need to Investigate more about on BI2 garage */