This repository contains the database schema for a mechanic workshop management system. The database schema is defined in the SQL script file named OficinaMecanincaDB.sql
. Additionally, there are two visual representations of the database model in the form of MySQL Workbench files: OficinaMecanincaDB.png
and OficinaMecanincaDB.mwb
.
-
customers
- Fields: id, name, email, phone, city, state
- Primary Key: id
-
mechanics
- Fields: id, name, specialization
- Primary Key: id
-
services
- Fields: id, description, labor_cost
- Primary Key: id
-
parts
- Fields: id, description, price
- Primary Key: id
-
work_orders
- Fields: id, number, issue_date, total_value, status, delivery_date, customer_id, mechanic_id, execution_authorization
- Primary Key: id
- Foreign Keys: customer_id (references customers.id), mechanic_id (references mechanics.id)
-
work_orders_services
- Fields: work_order_id, service_id
- Primary Key: work_order_id, service_id
- Foreign Keys: work_order_id (references work_orders.id), service_id (references services.id)
-
work_orders_parts
- Fields: work_order_id, part_id, quantity
- Primary Key: work_order_id, part_id
- Foreign Keys: work_order_id (references work_orders.id), part_id (references parts.id)
- work_orders table:
- Added
mechanic_id
field to reference the mechanic responsible for the work order. - Added
execution_authorization
field to indicate whether the execution was authorized.
- Added
-
OficinaMecanincaDB.png: A visual representation of the database schema.
-
OficinaMecanincaDB.mwb: MySQL Workbench file containing the database model.
-
SQL Script:
- Execute the SQL script
OficinaMecanincaDB.sql
on your MySQL database server to create the database and tables.
- Execute the SQL script
-
MySQL Workbench:
- Open the MySQL Workbench files (
OficinaMecanincaDB.mwb
) to visualize and interact with the database model using MySQL Workbench.
- Open the MySQL Workbench files (
Feel free to customize the database according to your specific requirements.
- Luis Gustavo Cezar Puga (lgustavopuga)
This project is licensed under the [MIT] License - see the LICENSE.md file for details.