© 2024 Larragueta César - Maulard Jules - François Mathieu - Derache Cédric. All rights reserved.
This project was developed as part of an academic assignment by a team of four students. No part of this project may be reproduced, distributed, or transmitted in any form or by any means without the prior written permission of the authors.
This project consists of designing a database for managing a fleet of trucks in a freight transportation company. The objective is to implement DBMS concepts such as data modeling, creating a relational database, and implementing various operations (queries, updates, etc.).
The application allows users to view information about trucks, drivers, depots, and deliveries, as well as perform statistics and updates on the database.
Here is the data modeling diagram (Entity-Relationship) of the project.
Note: This diagram represents the main entities (trucks, drivers, depots, products, deliveries) as well as their relationships (for example, a driver can drive multiple trucks, a truck can transport multiple products, etc.).
The relational model of the project is based on the following tables:
-
Truck
license_plate(PK)brandtypemodelservice_datepurchase_datemileagecapacitycondition
-
Driver
driver_id(PK)last_namefirst_nameaddresscitysenioritylicense_typeperformance_rating
-
Depot
depot_id(PK)numbernamecity
-
Product
product_id(PK)product_nameweight
-
Delivery
delivery_id(PK)delivery_datetruck_id(FK)driver_id(FK)departure_depot_id(FK)arrival_depot_id(FK)
-
Product_Delivery (Association table between Delivery and Product)
delivery_id(FK)product_id(FK)
- Primary and foreign keys to ensure referential integrity.
- Check constraints on columns such as mileage, capacity, and truck condition.
- Performance indexes to optimize queries on trucks and drivers.
All tables have been normalized to 3NF to ensure absence of redundancies and guarantee good data organization.
- Node.js: Version >= 14
- DBMS: MySQL, PostgreSQL (or any other SQL-compatible relational system)
- Framework: Using Node.js with a simple architecture for the interface.
-
Clone the repository
Clone this project to your local machine with the following command:
git clone https://github.com/project-name.git cd project-name -
Install dependencies
-
Configure the database Make sure you have a MySQL or PostgreSQL database server running. Create an empty database, then execute the creation scripts to set up the database. For MySQL, connect to your database and execute:
SOURCE path/to/your/sql/create.sql;
The following scripts are included to manipulate the database:
Creates the database and its tables.
Inserts sample data into the database.
Contains examples of query operations.
Contains examples of update operations.
Drops the database.
