Skip to content

CompanyDB is a database design that models a company's employees, departments, projects, and customer relationships. The database uses primary and foreign keys to ensure data integrity. The project allows you to easily create the database using table structures and SQL scripts.

Notifications You must be signed in to change notification settings

bahadirverir/CompanyDatabaseDesign

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🔷 Company Database Design

This repository contains a database called CompanyDB. The database stores data about a company’s employees, departments, projects, and customers — along with their relationships and associated details.

🚀 Project Overview

The CompanyDB database models a company’s employees, departments, projects, and customer relationships. It ensures consistent and secure storage of data while maintaining accurate connections between different organizational units.

📋 Content

This repository includes the following components related to the database design:

Entity–Relationship Diagram:

alt text The diagram above visualizes the relationships and structure between the database tables.

Database Tables:

The file Database-Tables.xlsx contains all database tables, filled with sample data to enhance clarity and readability. Additional supporting tables used to establish relational structures are also included in this file.

* The first and underlined columns in each table represent the primary key fields.

* The columns highlighted in orange indicate foreign key fields

Database Creation Script:

The file DatabaseScript.sql contains SQL code for creating the database.

⚠️ Note: The script is specifically designed to run on MySQL

📊 Relationships

  • The Employees table is related to the Departments table through DepartmentID, forming a one-to-many (1–N) relationship.

  • The Employees table is related to the Offices table through OfficeID, forming a one-to-many (1–N) relationship.

  • The Employees table is related to the Projects table through ProjectID, forming a one-to-many (1–N) relationship.

  • The Customers table is related to the Orders table through CustomerID, forming a one-to-many (1–N) relationship.

  • The Departments and Customers tables are related through both DepartmentID and CustomerID, forming a many-to-many (N–N) relationship. This relationship is implemented via a junction table named Department-Customer.

  • The Products and Customers tables are related through both ProductID and CustomerID, forming a many-to-many (N–N) relationship. This relationship is implemented via a junction table named Customer-Product.

🧑‍💻 Usage

To create the database locally:

  1. Clone the repository to your computer.
  2. Open the DatabaseScript.sql file in MySQL Workbench and execute it to generate the database.

You can clone the project using the following command:

git clone https://github.com/bahadirverir/CompanyDatabaseDesign.git 

About

CompanyDB is a database design that models a company's employees, departments, projects, and customer relationships. The database uses primary and foreign keys to ensure data integrity. The project allows you to easily create the database using table structures and SQL scripts.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published