# ngockhanh21/store-management-system architecture

> Architecture diagram of the GitHub repository ngockhanh21/store-management-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ngockhanh21/store-management-system
- Repository: https://github.com/ngockhanh21/store-management-system

## Overview

This repository is a SQL Server phone-store management database project, not an application with a user interface. Its documented workflow is to create the database, define its relational schema, load sample records, then run member-authored business-analysis queries. The schema covers store operations, procurement, sales, and warranty service. The README documents these capabilities and deployment order; source excerpts were not provided, so relationships below are limited to those documented there.

Main entry points: [`KhoiTaoCSDL/CreateTable.sql`](https://github.com/ngockhanh21/store-management-system/blob/main/KhoiTaoCSDL/CreateTable.sql) (CUAHANG_DT), [`KhoiTaoCSDL/CreateDatabase.sql`](https://github.com/ngockhanh21/store-management-system/blob/main/KhoiTaoCSDL/CreateDatabase.sql) (Create database), [`KhoiTaoCSDL/AddData.sql`](https://github.com/ngockhanh21/store-management-system/blob/main/KhoiTaoCSDL/AddData.sql) (Sample data), [`TruyVanCaNhan/BuiNgocKhanh.sql`](https://github.com/ngockhanh21/store-management-system/blob/main/TruyVanCaNhan/BuiNgocKhanh.sql) (Bui Ngoc Khanh queries)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Database setup"]
  node_create_db["Create database<br/>[CreateDatabase.sql]"]
  node_schema["Relational schema<br/>[CreateTable.sql]"]
  node_seed["Sample data<br/>[AddData.sql]"]
end

subgraph group_domains["Store domains"]
  node_store[("CUAHANG_DT<br/>[CreateTable.sql]")]
  node_operations["Stores and people<br/>[CreateTable.sql]"]
  node_procurement["Supply and purchasing<br/>[CreateTable.sql]"]
  node_sales["Customers and sales<br/>[CreateTable.sql]"]
  node_warranty["Warranty service<br/>[CreateTable.sql]"]
end

subgraph group_analysis["Business analysis"]
  node_khanh_queries["Bui Ngoc Khanh queries<br/>[BuiNgocKhanh.sql]"]
  node_quantri_queries["Dang Quan Tri queries<br/>[DangQuanTri.sql]"]
  node_nam_queries["Nguyen Dang Thanh Nam queries"]
  node_huy_queries["Nguyen Duc Huy queries<br/>[NguyenDucHuy.sql]"]
  node_nhatkhanh_queries["Truong Hong Nhat Khanh queries"]
end

node_operator(("Database operator"))

node_operator -->|"runs first"| node_create_db
node_operator -->|"runs next"| node_schema
node_operator -->|"loads afterward"| node_seed
node_create_db -->|"creates"| node_store
node_schema -->|"defines tables"| node_store
node_seed -->|"loads records"| node_store
node_schema -->|"defines entities"| node_operations
node_schema -->|"defines entities"| node_procurement
node_schema -->|"defines entities"| node_sales
node_schema -->|"defines entities"| node_warranty
node_operator -->|"runs reports"| node_khanh_queries
node_operator -->|"runs reports"| node_quantri_queries
node_operator -->|"runs reports"| node_nam_queries
node_operator -->|"runs reports"| node_huy_queries
node_operator -->|"runs reports"| node_nhatkhanh_queries
node_khanh_queries -->|"queries"| node_store
node_quantri_queries -->|"queries"| node_store
node_nam_queries -->|"queries"| node_store
node_huy_queries -->|"queries"| node_store
node_nhatkhanh_queries -->|"queries"| node_store

click node_create_db "https://github.com/ngockhanh21/store-management-system/blob/main/KhoiTaoCSDL/CreateDatabase.sql"
click node_schema "https://github.com/ngockhanh21/store-management-system/blob/main/KhoiTaoCSDL/CreateTable.sql"
click node_seed "https://github.com/ngockhanh21/store-management-system/blob/main/KhoiTaoCSDL/AddData.sql"
click node_store "https://github.com/ngockhanh21/store-management-system/blob/main/KhoiTaoCSDL/CreateTable.sql"
click node_operations "https://github.com/ngockhanh21/store-management-system/blob/main/KhoiTaoCSDL/CreateTable.sql"
click node_procurement "https://github.com/ngockhanh21/store-management-system/blob/main/KhoiTaoCSDL/CreateTable.sql"
click node_sales "https://github.com/ngockhanh21/store-management-system/blob/main/KhoiTaoCSDL/CreateTable.sql"
click node_warranty "https://github.com/ngockhanh21/store-management-system/blob/main/KhoiTaoCSDL/CreateTable.sql"
click node_khanh_queries "https://github.com/ngockhanh21/store-management-system/blob/main/TruyVanCaNhan/BuiNgocKhanh.sql"
click node_quantri_queries "https://github.com/ngockhanh21/store-management-system/blob/main/TruyVanCaNhan/DangQuanTri.sql"
click node_nam_queries "https://github.com/ngockhanh21/store-management-system/blob/main/TruyVanCaNhan/NguyenDangThanhNam.sql"
click node_huy_queries "https://github.com/ngockhanh21/store-management-system/blob/main/TruyVanCaNhan/NguyenDucHuy.sql"
click node_nhatkhanh_queries "https://github.com/ngockhanh21/store-management-system/blob/main/TruyVanCaNhan/TruongHongNhatKhanh.sql"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_create_db,node_schema,node_seed toneBlue
class node_store,node_operations,node_procurement,node_sales,node_warranty,node_operator toneAmber
class node_khanh_queries,node_quantri_queries,node_nam_queries,node_huy_queries,node_nhatkhanh_queries toneMint
```

## Components

### Database setup

- [Create database](https://github.com/ngockhanh21/store-management-system/blob/main/KhoiTaoCSDL/CreateDatabase.sql): `KhoiTaoCSDL/CreateDatabase.sql`
- [Relational schema](https://github.com/ngockhanh21/store-management-system/blob/main/KhoiTaoCSDL/CreateTable.sql): `KhoiTaoCSDL/CreateTable.sql`
- [Sample data](https://github.com/ngockhanh21/store-management-system/blob/main/KhoiTaoCSDL/AddData.sql): `KhoiTaoCSDL/AddData.sql`

### Store domains

- [CUAHANG_DT](https://github.com/ngockhanh21/store-management-system/blob/main/KhoiTaoCSDL/CreateTable.sql): `KhoiTaoCSDL/CreateTable.sql`
- [Stores and people](https://github.com/ngockhanh21/store-management-system/blob/main/KhoiTaoCSDL/CreateTable.sql): `KhoiTaoCSDL/CreateTable.sql`
- [Supply and purchasing](https://github.com/ngockhanh21/store-management-system/blob/main/KhoiTaoCSDL/CreateTable.sql): `KhoiTaoCSDL/CreateTable.sql`
- [Customers and sales](https://github.com/ngockhanh21/store-management-system/blob/main/KhoiTaoCSDL/CreateTable.sql): `KhoiTaoCSDL/CreateTable.sql`
- [Warranty service](https://github.com/ngockhanh21/store-management-system/blob/main/KhoiTaoCSDL/CreateTable.sql): `KhoiTaoCSDL/CreateTable.sql`

### Business analysis

- [Bui Ngoc Khanh queries](https://github.com/ngockhanh21/store-management-system/blob/main/TruyVanCaNhan/BuiNgocKhanh.sql): `TruyVanCaNhan/BuiNgocKhanh.sql`
- [Dang Quan Tri queries](https://github.com/ngockhanh21/store-management-system/blob/main/TruyVanCaNhan/DangQuanTri.sql): `TruyVanCaNhan/DangQuanTri.sql`
- [Nguyen Dang Thanh Nam queries](https://github.com/ngockhanh21/store-management-system/blob/main/TruyVanCaNhan/NguyenDangThanhNam.sql): `TruyVanCaNhan/NguyenDangThanhNam.sql`
- [Nguyen Duc Huy queries](https://github.com/ngockhanh21/store-management-system/blob/main/TruyVanCaNhan/NguyenDucHuy.sql): `TruyVanCaNhan/NguyenDucHuy.sql`
- [Truong Hong Nhat Khanh queries](https://github.com/ngockhanh21/store-management-system/blob/main/TruyVanCaNhan/TruongHongNhatKhanh.sql): `TruyVanCaNhan/TruongHongNhatKhanh.sql`

### Other components

- **Database operator**

## Connections

- Database operator → Create database: runs first (evidence: `README.md`)
- Database operator → Relational schema: runs next (evidence: `README.md`)
- Database operator → Sample data: loads afterward (evidence: `README.md`)
- Create database → CUAHANG_DT: creates (evidence: `README.md`)
- Relational schema → CUAHANG_DT: defines tables (evidence: `README.md`)
- Sample data → CUAHANG_DT: loads records (evidence: `README.md`)
- Relational schema → Stores and people: defines entities (evidence: `README.md`)
- Relational schema → Supply and purchasing: defines entities (evidence: `README.md`)
- Relational schema → Customers and sales: defines entities (evidence: `README.md`)
- Relational schema → Warranty service: defines entities (evidence: `README.md`)
- Database operator → Bui Ngoc Khanh queries: runs reports (evidence: `README.md`)
- Database operator → Dang Quan Tri queries: runs reports (evidence: `README.md`)
- Database operator → Nguyen Dang Thanh Nam queries: runs reports (evidence: `README.md`)
- Database operator → Nguyen Duc Huy queries: runs reports (evidence: `README.md`)
- Database operator → Truong Hong Nhat Khanh queries: runs reports (evidence: `README.md`)
- Bui Ngoc Khanh queries → CUAHANG_DT: queries (evidence: `README.md`)
- Dang Quan Tri queries → CUAHANG_DT: queries (evidence: `README.md`)
- Nguyen Dang Thanh Nam queries → CUAHANG_DT: queries (evidence: `README.md`)
- Nguyen Duc Huy queries → CUAHANG_DT: queries (evidence: `README.md`)
- Truong Hong Nhat Khanh queries → CUAHANG_DT: queries (evidence: `README.md`)
