# rachaita20/sql-query-collection architecture

> Architecture diagram of the GitHub repository rachaita20/sql-query-collection, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rachaita20/sql-query-collection
- Repository: https://github.com/rachaita20/sql-query-collection

## Overview

##### Main Components Organization

- DDL (Data Definition Language)
- DML (Data Manipulation Language)
- DCL (Data Control Language)
- TCL (Transaction Control Language)

##### Component Relationships

a) Top Level (Core Components):

b) Second Level (Statements):
- Under each main category, create sub-components for specific statements
- DDL: CREATE, ALTER, DROP, TRUNCATE
- DML: SELECT, INSERT, UPDATE, DELETE
- DCL: GRANT, REVOKE
- TCL: COMMIT, ROLLBACK, SAVEPOINT

c) Third Level (Supporting Elements):
Create connected sections for:
- Data Types (with subcategories):
- Numeric
- Character
- Date/Time
- Binary
- Miscellaneous

- Constraints:
- NOT NULL
- UNIQUE
- PRIMARY KEY
- FOREIGN KEY
- CHECK
- DEFAULT
- INDEX

- Operators:
- Arithmetic
- Comparison
- Logical
- String
- Set
- Null
- Conditional
- Aggregate

##### Additional Details

Include:
- Version information if applicable
- Notes about database system compatibility
- Common use cases or scenarios

##### Documentation

Create accompanying documentation that explains:
- The purpose of each component
- How components interact
- Common usage patterns
- Best practices
- Implementation considerations

- Export to various formats
- Collaboration features
- Version control

## Diagram (Mermaid)

```mermaid
graph TB
    %% Main Categories
    DDL[DDL - Data Definition Language]:::ddl
    DML[DML - Data Manipulation Language]:::dml
    DCL[DCL - Data Control Language]:::dcl
    TCL[TCL - Transaction Control Language]:::tcl

    %% DDL Statements
    subgraph DDLStatements
        CREATE[CREATE]:::ddl
        ALTER[ALTER]:::ddl
        DROP[DROP]:::ddl
        TRUNCATE[TRUNCATE]:::ddl
    end

    %% DML Statements
    subgraph DMLStatements
        SELECT[SELECT]:::dml
        INSERT[INSERT]:::dml
        UPDATE[UPDATE]:::dml
        DELETE[DELETE]:::dml
    end

    %% DCL Statements
    subgraph DCLStatements
        GRANT[GRANT]:::dcl
        REVOKE[REVOKE]:::dcl
    end

    %% TCL Statements
    subgraph TCLStatements
        COMMIT[COMMIT]:::tcl
        ROLLBACK[ROLLBACK]:::tcl
        SAVEPOINT[SAVEPOINT]:::tcl
    end

    %% Data Types
    subgraph DataTypes
        NUMERIC[Numeric Types]:::datatype
        CHARACTER[Character Types]:::datatype
        DATETIME[Date/Time Types]:::datatype
        BINARY[Binary Types]:::datatype
        MISC[Miscellaneous Types]:::datatype
    end

    %% Constraints
    subgraph Constraints
        NOTNULL[NOT NULL]:::constraint
        UNIQUE[UNIQUE]:::constraint
        PK[PRIMARY KEY]:::constraint
        FK[FOREIGN KEY]:::constraint
        CHECK[CHECK]:::constraint
        DEFAULT[DEFAULT]:::constraint
        INDEX[INDEX]:::constraint
    end

    %% Operators
    subgraph Operators
        ARITHMETIC[Arithmetic]:::operator
        COMPARISON[Comparison]:::operator
        LOGICAL[Logical]:::operator
        STRING[String]:::operator
        SET[Set]:::operator
        NULL[Null]:::operator
        CONDITIONAL[Conditional]:::operator
        AGGREGATE[Aggregate]:::operator
    end

    %% Relationships
    DDL --> DDLStatements
    DML --> DMLStatements
    DCL --> DCLStatements
    TCL --> TCLStatements

    DDL -.-> DataTypes
    DDL -.-> Constraints
    DML -.-> Operators
    DML -.-> DataTypes

    %% Style Classes
    classDef ddl fill:#2374ab,stroke:#000,color:#fff
    classDef dml fill:#2a9d8f,stroke:#000,color:#fff
    classDef dcl fill:#e76f51,stroke:#000,color:#fff
    classDef tcl fill:#f4a261,stroke:#000,color:#fff
    classDef datatype fill:#8338ec,stroke:#000,color:#fff
    classDef constraint fill:#ff006e,stroke:#000,color:#fff
    classDef operator fill:#3a86ff,stroke:#000,color:#fff

    %% Legend
    subgraph Legend
        L1[DDL Components]:::ddl
        L2[DML Components]:::dml
        L3[DCL Components]:::dcl
        L4[TCL Components]:::tcl
        L5[Data Types]:::datatype
        L6[Constraints]:::constraint
        L7[Operators]:::operator
    end
```
