### Task 2: Data Dictionary for Bloomfield Garden Centre Database
Below is the **Data Dictionary**, detailing the attributes, their data types, constraints, and
field lengths, along with primary and foreign keys for each entity.
---
#### **1. Inventory Table**
| **Attribute** | **Data Type** | **Field Length** | **Constraint** |
**Description** |
|----------------------|------------------|------------------|---------------------------|----------------------------
---------------|
| ProductID | INT |- | Primary Key | Unique identifier for each
product |
| ProductName | VARCHAR | 50 | Not Null | Name of the product
|
| Type | VARCHAR | 20 | Not Null | Type of product (e.g., plant,
tool) |
| Price | DECIMAL(10,2) | - | Not Null | Price of the product
|
| Description | VARCHAR | 255 |- | Short description of the
product |
---
#### **2. Employee Table**
| **Attribute** | **Data Type** | **Field Length** | **Constraint** |
**Description** |
|----------------------|------------------|------------------|---------------------------|----------------------------
---------------|
| EmployeeID | INT |- | Primary Key | Unique identifier for each
employee |
| Name | VARCHAR | 50 | Not Null | Employee name
|
| ContactDetails | VARCHAR | 100 | Not Null | Contact details of the
employee |
| Role | VARCHAR | 30 | Not Null | Employee role (e.g., sales
associate) |
| WorkHours | INT |- | Not Null | Total working hours
|
| TrainingRecords | VARCHAR | 255 |- | Training records of the
employee |
---
#### **3. Customer Table**
| **Attribute** | **Data Type** | **Field Length** | **Constraint** |
**Description** |
|----------------------|------------------|------------------|---------------------------|----------------------------
---------------|
| CustomerID | INT |- | Primary Key | Unique identifier for each
customer |
| Name | VARCHAR | 50 | Not Null | Customer name
|
| ContactDetails | VARCHAR | 100 | Not Null | Contact details of the
customer |
---
#### **4. SalesTransaction Table**
| **Attribute** | **Data Type** | **Field Length** | **Constraint** |
**Description** |
|----------------------|------------------|------------------|---------------------------|----------------------------
---------------|
| TransactionID | INT |- | Primary Key | Unique identifier for each
transaction |
| Date | DATE |- | Not Null | Date of the transaction |
| TotalAmount | DECIMAL(10,2) | - | Not Null | Total amount for the
transaction |
| EmployeeID | INT |- | Foreign Key (Employee) | Employee who
processed the transaction |
| CustomerID | INT |- | Foreign Key (Customer) | Customer involved in
the transaction |
---
#### **5. SalesDetails Table**
| **Attribute** | **Data Type** | **Field Length** | **Constraint** |
**Description** |
|----------------------|------------------|------------------|---------------------------|----------------------------
---------------|
| TransactionID | INT |- | Composite Primary Key, FK | Part of transaction-
product relationship |
| ProductID | INT |- | Composite Primary Key, FK | Part of transaction-
product relationship |
| Quantity | INT |- | Not Null | Quantity of the product
purchased |
| Price | DECIMAL(10,2) | - | Not Null | Price of the product
|
---
#### **6. Workshop Table**
| **Attribute** | **Data Type** | **Field Length** | **Constraint** |
**Description** |
|----------------------|------------------|------------------|---------------------------|----------------------------
---------------|
| WorkshopID | INT |- | Primary Key | Unique identifier for each
workshop |
| Title | VARCHAR | 50 | Not Null | Title of the workshop
|
| Description | VARCHAR | 255 |- | Description of the workshop
|
| Date | DATE |- | Not Null | Date of the workshop |
| Time | TIME |- | Not Null | Time of the workshop |
| ExpectedAttendance | INT |- |- | Number of attendees expected
|
| Equipment | VARCHAR | 255 |- | Equipment required for the
workshop |
---
### **Primary and Foreign Keys**
1. **Primary Keys**
- Inventory: `ProductID`
- Employee: `EmployeeID`
- Customer: `CustomerID`
- SalesTransaction: `TransactionID`
- Workshop: `WorkshopID`
- SalesDetails: Composite Primary Key (`TransactionID`, `ProductID`)
2. **Foreign Keys**
- SalesTransaction: `EmployeeID` (Employee Table), `CustomerID` (Customer Table)
- SalesDetails: `TransactionID` (SalesTransaction Table), `ProductID` (Inventory Table)
If you need additional details or adjustments, let me know!