ev charging station pricing table structure#
Provides ability to vary charging costs by hour of day on a per EVCS basis. It is linked to the EV_Charging_Stations table through a foreign key on station_id.
Not required by all models and is okay to be empty.
| Field | Type | NULL allowed | Default Value | Foreign key | Description | 
|---|---|---|---|---|---|
| station_id | INTEGER | NO | EV_Charging_Stations(station_id) | Foreign key reference to an electric vehicle charging station found in the EV_Charging_Station table | |
| time_hour | INTEGER | NO | The hour in the day to express the time-varying cost of charging | ||
| unit_price | REAL | NO | the cost (in dollars) per kWh expressed | 
(* - Primary key)
The SQL statement for table and index creation is below.
CREATE TABLE IF NOT EXISTS EV_Charging_Station_Pricing(
    station_id INTEGER NOT NULL,
    time_hour  INTEGER NOT NULL,
    unit_price REAL    NOT NULL,
    CONSTRAINT "fk_stat_id" FOREIGN KEY("station_id") REFERENCES EV_Charging_Stations("ID") ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED
);