From 89c04a328f2870d7841aa5167e5024fdf6613322 Mon Sep 17 00:00:00 2001 From: Software Shinobi Date: Thu, 19 Jun 2025 12:14:28 -0400 Subject: [PATCH] ready for rewrite of content --- .../old}/004-basic-syntax.md | 0 .../old}/005-select.md | 0 .../old}/006-where.md | 0 .../old}/007-order-and-group-by.md | 0 .../old}/008-insert.md | 0 .../old}/009-update.md | 0 .../old}/010-delete.md | 0 .../old}/011-join.md | 0 .../old}/012-sql-commnad-categories.md | 0 .../old}/013-sub-queries.md | 0 .../old}/014-unions.md | 0 .../old}/015-Keys-in-a-Relational Database.md | 0 .../old}/016-Logical-operator-keywords.md | 0 .../017-having-clause_aggregate-functions.md | 0 .../old}/018-essential-mysql-functions.md | 0 .../old}/020-TCL-commands.md | 0 .../old}/index.md | 0 landing/docs/SQL-101/old/prompt.dat | 37 +++++ landing/docs/megamart.md | 80 ++++++++++ landing/docs/monacomotors.md | 128 ++++++++++++++++ landing/docs/realestate.md | 111 ++++++++++++++ landing/docs/schema.md | 138 ------------------ server/datasets/prompt-description.dat | 61 ++++++++ 23 files changed, 417 insertions(+), 138 deletions(-) rename landing/docs/{Introduction-To-Databases => SQL-101/old}/004-basic-syntax.md (100%) rename landing/docs/{Introduction-To-Databases => SQL-101/old}/005-select.md (100%) rename landing/docs/{Introduction-To-Databases => SQL-101/old}/006-where.md (100%) rename landing/docs/{Introduction-To-Databases => SQL-101/old}/007-order-and-group-by.md (100%) rename landing/docs/{Introduction-To-Databases => SQL-101/old}/008-insert.md (100%) rename landing/docs/{Introduction-To-Databases => SQL-101/old}/009-update.md (100%) rename landing/docs/{Introduction-To-Databases => SQL-101/old}/010-delete.md (100%) rename landing/docs/{Introduction-To-Databases => SQL-101/old}/011-join.md (100%) rename landing/docs/{Introduction-To-Databases => SQL-101/old}/012-sql-commnad-categories.md (100%) rename landing/docs/{Introduction-To-Databases => SQL-101/old}/013-sub-queries.md (100%) rename landing/docs/{Introduction-To-Databases => SQL-101/old}/014-unions.md (100%) rename landing/docs/{Introduction-To-Databases => SQL-101/old}/015-Keys-in-a-Relational Database.md (100%) rename landing/docs/{Introduction-To-Databases => SQL-101/old}/016-Logical-operator-keywords.md (100%) rename landing/docs/{Introduction-To-Databases => SQL-101/old}/017-having-clause_aggregate-functions.md (100%) rename landing/docs/{Introduction-To-Databases => SQL-101/old}/018-essential-mysql-functions.md (100%) rename landing/docs/{Introduction-To-Databases => SQL-101/old}/020-TCL-commands.md (100%) rename landing/docs/{Introduction-To-Databases => SQL-101/old}/index.md (100%) create mode 100644 landing/docs/SQL-101/old/prompt.dat create mode 100644 landing/docs/megamart.md create mode 100644 landing/docs/monacomotors.md create mode 100644 landing/docs/realestate.md delete mode 100644 landing/docs/schema.md create mode 100644 server/datasets/prompt-description.dat diff --git a/landing/docs/Introduction-To-Databases/004-basic-syntax.md b/landing/docs/SQL-101/old/004-basic-syntax.md similarity index 100% rename from landing/docs/Introduction-To-Databases/004-basic-syntax.md rename to landing/docs/SQL-101/old/004-basic-syntax.md diff --git a/landing/docs/Introduction-To-Databases/005-select.md b/landing/docs/SQL-101/old/005-select.md similarity index 100% rename from landing/docs/Introduction-To-Databases/005-select.md rename to landing/docs/SQL-101/old/005-select.md diff --git a/landing/docs/Introduction-To-Databases/006-where.md b/landing/docs/SQL-101/old/006-where.md similarity index 100% rename from landing/docs/Introduction-To-Databases/006-where.md rename to landing/docs/SQL-101/old/006-where.md diff --git a/landing/docs/Introduction-To-Databases/007-order-and-group-by.md b/landing/docs/SQL-101/old/007-order-and-group-by.md similarity index 100% rename from landing/docs/Introduction-To-Databases/007-order-and-group-by.md rename to landing/docs/SQL-101/old/007-order-and-group-by.md diff --git a/landing/docs/Introduction-To-Databases/008-insert.md b/landing/docs/SQL-101/old/008-insert.md similarity index 100% rename from landing/docs/Introduction-To-Databases/008-insert.md rename to landing/docs/SQL-101/old/008-insert.md diff --git a/landing/docs/Introduction-To-Databases/009-update.md b/landing/docs/SQL-101/old/009-update.md similarity index 100% rename from landing/docs/Introduction-To-Databases/009-update.md rename to landing/docs/SQL-101/old/009-update.md diff --git a/landing/docs/Introduction-To-Databases/010-delete.md b/landing/docs/SQL-101/old/010-delete.md similarity index 100% rename from landing/docs/Introduction-To-Databases/010-delete.md rename to landing/docs/SQL-101/old/010-delete.md diff --git a/landing/docs/Introduction-To-Databases/011-join.md b/landing/docs/SQL-101/old/011-join.md similarity index 100% rename from landing/docs/Introduction-To-Databases/011-join.md rename to landing/docs/SQL-101/old/011-join.md diff --git a/landing/docs/Introduction-To-Databases/012-sql-commnad-categories.md b/landing/docs/SQL-101/old/012-sql-commnad-categories.md similarity index 100% rename from landing/docs/Introduction-To-Databases/012-sql-commnad-categories.md rename to landing/docs/SQL-101/old/012-sql-commnad-categories.md diff --git a/landing/docs/Introduction-To-Databases/013-sub-queries.md b/landing/docs/SQL-101/old/013-sub-queries.md similarity index 100% rename from landing/docs/Introduction-To-Databases/013-sub-queries.md rename to landing/docs/SQL-101/old/013-sub-queries.md diff --git a/landing/docs/Introduction-To-Databases/014-unions.md b/landing/docs/SQL-101/old/014-unions.md similarity index 100% rename from landing/docs/Introduction-To-Databases/014-unions.md rename to landing/docs/SQL-101/old/014-unions.md diff --git a/landing/docs/Introduction-To-Databases/015-Keys-in-a-Relational Database.md b/landing/docs/SQL-101/old/015-Keys-in-a-Relational Database.md similarity index 100% rename from landing/docs/Introduction-To-Databases/015-Keys-in-a-Relational Database.md rename to landing/docs/SQL-101/old/015-Keys-in-a-Relational Database.md diff --git a/landing/docs/Introduction-To-Databases/016-Logical-operator-keywords.md b/landing/docs/SQL-101/old/016-Logical-operator-keywords.md similarity index 100% rename from landing/docs/Introduction-To-Databases/016-Logical-operator-keywords.md rename to landing/docs/SQL-101/old/016-Logical-operator-keywords.md diff --git a/landing/docs/Introduction-To-Databases/017-having-clause_aggregate-functions.md b/landing/docs/SQL-101/old/017-having-clause_aggregate-functions.md similarity index 100% rename from landing/docs/Introduction-To-Databases/017-having-clause_aggregate-functions.md rename to landing/docs/SQL-101/old/017-having-clause_aggregate-functions.md diff --git a/landing/docs/Introduction-To-Databases/018-essential-mysql-functions.md b/landing/docs/SQL-101/old/018-essential-mysql-functions.md similarity index 100% rename from landing/docs/Introduction-To-Databases/018-essential-mysql-functions.md rename to landing/docs/SQL-101/old/018-essential-mysql-functions.md diff --git a/landing/docs/Introduction-To-Databases/020-TCL-commands.md b/landing/docs/SQL-101/old/020-TCL-commands.md similarity index 100% rename from landing/docs/Introduction-To-Databases/020-TCL-commands.md rename to landing/docs/SQL-101/old/020-TCL-commands.md diff --git a/landing/docs/Introduction-To-Databases/index.md b/landing/docs/SQL-101/old/index.md similarity index 100% rename from landing/docs/Introduction-To-Databases/index.md rename to landing/docs/SQL-101/old/index.md diff --git a/landing/docs/SQL-101/old/prompt.dat b/landing/docs/SQL-101/old/prompt.dat new file mode 100644 index 0000000..2c86c71 --- /dev/null +++ b/landing/docs/SQL-101/old/prompt.dat @@ -0,0 +1,37 @@ +You are a Senior Java Developer and Database Expert. Your objective is to craft **incisive, high-impact schema documentation** for junior and mid-level Java developers. This isn't just a reference; it's a strategic resource to enable them to write robust, efficient code immediately. We're providing the essential knowledge, streamlined for maximum developer velocity. + +**Input:** You will an article that needs to be rewritten for my markdown SOP site about databases and sql 101. + +**Tone:** +* **Direct & Authoritative:** Present information with conviction. +* **Results-Driven:** Every statement highlights the practical utility or implication for application development. +* **Efficient:** Eliminate all unnecessary words. Deliver core information with precision. +* **Action-Oriented (Implicit):** The information itself should guide their actions, not explicit commands. +* **Clarity Above All:** Unambiguous language is paramount for understanding. + + + +## output formatting + + ** format as standard markdown + + ** sections should use "##" and not "**" + + ** dont seperate the table descriptions with "----" just go straight to the next table with no more shit in between. + + ** at the top add an "#" with a suggested name + + ** for any sql tables, make sure that the tables (markdown) are resized to contain the data inside them + +## rewrite rules + + ** whereever devdoji is mentioned, use "Java Team Six" + + ** where you see "Bobby Iliev" put "Software Shinobi" + + ** where you see "Bobby" put "Shinobi" + +--- + + + diff --git a/landing/docs/megamart.md b/landing/docs/megamart.md new file mode 100644 index 0000000..fa9edbc --- /dev/null +++ b/landing/docs/megamart.md @@ -0,0 +1,80 @@ +# Mega Mart Grocery + +## Schema Overview + +The `MEGA_MART_GROCERY` database underpins the core operations of a grocery retail system, managing product categories, customer information, employee details, and sales orders including individual order items. + +## Table Summary + +| Table Name | Primary Responsibility | +| :--------- | :--------------------- | +| `Categories` | Organizes products into distinct categories for efficient inventory management and customer Browse. | +| `Customers` | Stores comprehensive information about all registered customers. | +| `Employees` | Contains details of all employees involved in the grocery operations. | +| `OrderDetails` | Links products to specific orders, defining the quantity of each item purchased. | +| `Orders` | Records each customer order, including who placed it, who processed it, and when. | +| `Products` | Manages the catalog of all items available for sale within the grocery store. | +| `Shippers` | Stores information about the companies responsible for delivering orders. | +| `Suppliers` | Maintains details of all product suppliers. | + +----- + +## `Categories` Table + +This table defines the various categories under which products are grouped. It is essential for organizing the product catalog and enabling filtered searches within the application. + +| Column Name | Data Type | Description | +| :---------- | :-------- | :---------- | +| `CategoryID` | INT | Unique identifier for this entity. Used for all lookups and relationships. | +| `CategoryName` | VARCHAR(25) (Optional) | The name of the product category. | +| `Description` | VARCHAR(255) (Optional) | A brief explanation of the category. | + +## `Customers` Table + +This table holds the master data for all customers. It is crucial for order processing, customer relationship management, and personalized services. + +| Column Name | Data Type | Description | +| :---------- | :-------- | :---------- | +| `CustomerID` | INT | Unique identifier for this entity. Used for all lookups and relationships. | +| `CustomerName` | VARCHAR(50) (Optional) | The full name of the customer. | +| `ContactName` | VARCHAR(50) (Optional) | The name of the primary contact person for the customer. | +| `Address` | VARCHAR(50) (Optional) | The customer's street address. | +| `City` | VARCHAR(20) (Optional) | The city where the customer resides. | +| `PostalCode` | VARCHAR(10) (Optional) | The postal code for the customer's address. | +| `Country` | VARCHAR(15) (Optional) | The country where the customer resides. | + +## `Employees` Table + +This table stores information about the employees of the grocery store. This data is used to track who processed an order and for internal HR functions. + +| Column Name | Data Type | Description | +| :---------- | :-------- | :---------- | +| `EmployeeID` | INT | Unique identifier for this entity. Used for all lookups and relationships. | +| `LastName` | VARCHAR(15) (Optional) | The employee's last name. | +| `FirstName` | VARCHAR(15) (Optional) | The employee's first name. | +| `BirthDate` | DATETIME (Optional) | The employee's birth date. Map to `java.time.LocalDateTime` for modern date/time handling. | +| `Photo` | VARCHAR(25) (Optional) | File path or reference to the employee's photo. | +| `Notes` | VARCHAR(1024) (Optional) | General notes or additional information about the employee. | + +## `OrderDetails` Table + +This table captures the individual items within each order. It establishes a many-to-many relationship between orders and products, detailing quantities. + +| Column Name | Data Type | Description | +| :---------- | :-------- | :---------- | +| `OrderDetailID` | INT | Unique identifier for this entity. Used for all lookups and relationships. | +| `OrderID` | INT (Optional) | Establishes a relationship with `Orders.OrderID`. Essential for data integrity and joins. | +| `ProductID` | INT (Optional) | Establishes a relationship with `Products.ProductID`. Essential for data integrity and joins. | +| `Quantity` | INT (Optional) | The number of units of the product included in this order detail. | + +## `Orders` Table + +This table records each transaction made by customers. It links customers, employees, and shippers to specific orders, providing a complete overview of each sale. + +| Column Name | Data Type | Description | +| :---------- | :-------- | :---------- | +| `OrderID` | INT | Unique identifier for this entity. Used for all lookups and relationships. | +| `CustomerID` | INT (Optional) | Establishes a relationship with `Customers.CustomerID`. Essential for data integrity and joins. | +| `EmployeeID` | INT (Optional) | Establishes a relationship with `Employees.EmployeeID`. Essential for data integrity and joins. | +| `OrderDate` | DATETIME (Optional) | The date and time the order was placed. Map to `java.time.LocalDateTime` for modern date/time handling. | +| `ShipperID` | INT (Optional) | Establishes a relationship with `Shippers.ShipperID`. Essential for data integrity and joins. | diff --git a/landing/docs/monacomotors.md b/landing/docs/monacomotors.md new file mode 100644 index 0000000..328e6cd --- /dev/null +++ b/landing/docs/monacomotors.md @@ -0,0 +1,128 @@ +# Monaco Motors + +## Schema Overview + +The Monaco Motors database centralizes all critical business data, enabling efficient management of sales, customer information, vehicle inventory, and dealership operations. + +## Table Summary + +| Table Name | Primary Responsibility | +| :--------- | :--------------------- | +| `Customer` | Stores essential customer contact and identification details. | +| `Deal` | Records each vehicle sales transaction, linking customers, agents, vehicles, and insurance. | +| `Dealership` | Defines the various dealerships, associating them with distributors and geographic regions. | +| `Distributor` | Catalogs the vehicle distributors, providing their unique identifiers and names. | +| `Insurance` | Contains details about insurance policies associated with vehicle deals. | +| `Manager` | Manages information for dealership managers, including their assigned dealership and distributor. | +| `Region` | Maps geographic regions to their respective ZIP codes and names. | +| `Sales_Agent` | Houses details for sales agents, including their manager and assigned dealership. | +| `Vehicle` | Maintains the inventory of vehicles, capturing their specifications, dealership, and pricing. | + +## `Customer` Table + +This table stores comprehensive customer information, critical for sales tracking, communication, and relationship management. + +| Column Name | Data Type | Description | +| :---------- | :-------- | :---------- | +| `CustomerID` | CHAR(8) | Unique identifier for this entity. Used for all lookups and relationships. | +| `AgentID` | CHAR(8) | Establishes a relationship with `Sales_Agent.AgentID`. Essential for data integrity and joins. | +| `CustFirstName` | VARCHAR(15) | The customer's first name. | +| `CustLastName` | VARCHAR(15) | The customer's last name. | +| `PhoneNumber` | VARCHAR(12) | The customer's primary phone number. | +| `Email` | VARCHAR(40) | The customer's email address. | + +## `Deal` Table + +This table records every completed vehicle transaction, linking all involved entities and providing a historical record of sales. + +| Column Name | Data Type | Description | +| :---------- | :-------- | :---------- | +| `DealID` | CHAR(5) | Unique identifier for this entity. Used for all lookups and relationships. | +| `VehicleID` | CHAR(3) | Establishes a relationship with `Vehicle.VehicleID`. Essential for data integrity and joins. | +| `AgentID` | CHAR(8) | Establishes a relationship with `Sales_Agent.AgentID`. Essential for data integrity and joins. | +| `CustomerID` | CHAR(8) | Establishes a relationship with `Customer.CustomerID`. Essential for data integrity and joins. | +| `InsuranceID` | CHAR(5) (Optional) | Establishes a relationship with `Insurance.InsuranceID`. Essential for data integrity and joins. Mandates explicit `null` handling in Java code. | +| `DealDate` | DATE | The date the deal was closed. Map to `java.time.LocalDate` for modern date/time handling. | + +## `Dealership` Table + +This table defines each dealership within the Monaco Motors ecosystem, including its geographic and distribution affiliations. + +| Column Name | Data Type | Description | +| :---------- | :-------- | :---------- | +| `DealershipID` | CHAR(5) | Unique identifier for this entity. Used for all lookups and relationships. | +| `DistributorID` | CHAR(8) | Establishes a relationship with `Distributor.DistributorID`. Essential for data integrity and joins. | +| `RegionID` | CHAR(3) | Establishes a relationship with `Region.RegionID`. Essential for data integrity and joins. Part of a composite foreign key. | +| `RegionZIP` | CHAR(5) | Establishes a relationship with `Region.RegionZIP`. Essential for data integrity and joins. Part of a composite foreign key. | +| `DealershipName` | VARCHAR(40) | The official name of the dealership. | + +## `Distributor` Table + +This table lists all vehicle distributors that supply to Monaco Motors dealerships. + +| Column Name | Data Type | Description | +| :---------- | :-------- | :---------- | +| `DistributorID` | CHAR(8) | Unique identifier for this entity. Used for all lookups and relationships. | +| `DistributorName` | VARCHAR(40) | The name of the vehicle distributor. | + +## `Insurance` Table + +This table stores details about the insurance policies associated with vehicle deals, including policy types and renewal dates. + +| Column Name | Data Type | Description | +| :---------- | :-------- | :---------- | +| `InsuranceID` | CHAR(5) | Unique identifier for this entity. Used for all lookups and relationships. | +| `PolicyType` | VARCHAR(15) | Describes the type of insurance policy (e.g., "Full Coverage", "Liability"). | +| `RenewalDate` | DATE | The date the insurance policy is due for renewal. Map to `java.time.LocalDate` for modern date/time handling. | + +## `Manager` Table + +This table contains information about the managers overseeing dealerships, including their salary and bonus details. + +| Column Name | Data Type | Description | +| :---------- | :-------- | :---------- | +| `ManagerID` | CHAR(8) | Unique identifier for this entity. Used for all lookups and relationships. | +| `DealershipID` | CHAR(5) | Establishes a relationship with `Dealership.DealershipID`. Essential for data integrity and joins. | +| `DistributorID` | CHAR(8) | Establishes a relationship with `Distributor.DistributorID`. Essential for data integrity and joins. | +| `MngrFirstName` | VARCHAR(15) | The manager's first name. | +| `MngrLastName` | VARCHAR(15) | The manager's last name. | +| `MngrSalary` | DECIMAL(8,2) | The manager's annual salary. Map to `java.math.BigDecimal` for financial values to ensure precision. | +| `MngrBonus` | DECIMAL(8,2) (Optional) | The manager's annual bonus. Map to `java.math.BigDecimal` for financial values to ensure precision. Mandates explicit `null` handling in Java code. | + +## `Region` Table + +This table defines geographic regions by their ID, ZIP code, and descriptive name. + +| Column Name | Data Type | Description | +| :---------- | :-------- | :---------- | +| `RegionID` | CHAR(3) | Unique identifier for this entity, part of a composite primary key. Used for all lookups and relationships. | +| `RegionZIP` | CHAR(5) | The ZIP code associated with the region, part of a composite primary key. Used for all lookups and relationships. | +| `RegionName` | VARCHAR(15) | The descriptive name of the region (e.g., "EMEA", "APJ", "AMS"). | + +## `Sales_Agent` Table + +This table stores details for each sales agent, including their reporting manager and assigned dealership. + +| Column Name | Data Type | Description | +| :---------- | :-------- | :---------- | +| `AgentID` | CHAR(8) | Unique identifier for this entity. Used for all lookups and relationships. | +| `ManagerID` | CHAR(8) | Establishes a relationship with `Manager.ManagerID`. Essential for data integrity and joins. | +| `DealershipID` | CHAR(5) | Establishes a relationship with `Dealership.DealershipID`. Essential for data integrity and joins. | +| `AgentFirstName` | VARCHAR(15) | The sales agent's first name. | +| `AgentLastName` | VARCHAR(15) | The sales agent's last name. | +| `AgentSalary` | DECIMAL(9,2) | The sales agent's annual salary. Map to `java.math.BigDecimal` for financial values to ensure precision. | + +## `Vehicle` Table + +This table details the vehicle inventory, including specifications, pricing, and associated dealerships and distributors. + +| Column Name | Data Type | Description | +| :---------- | :-------- | :---------- | +| `VehicleID` | CHAR(3) | Unique identifier for this entity. Used for all lookups and relationships. | +| `DealershipID` | CHAR(5) | Establishes a relationship with `Dealership.DealershipID`. Essential for data integrity and joins. | +| `DistributorID` | CHAR(8) | Establishes a relationship with `Distributor.DistributorID`. Essential for data integrity and joins. | +| `Make` | VARCHAR(40) | The manufacturer of the vehicle. | +| `Model` | VARCHAR(40) | The specific model of the vehicle. | +| `BodyType` | VARCHAR(40) | The body style of the vehicle (e.g., "Coupe", "SUV", "Spyder"). | +| `ModelYear` | INT | The manufacturing year of the vehicle. | +| `Price` | DECIMAL(9,2) | The selling price of the vehicle. Map to `java.math.BigDecimal` for financial values to ensure precision. | diff --git a/landing/docs/realestate.md b/landing/docs/realestate.md new file mode 100644 index 0000000..65ebe57 --- /dev/null +++ b/landing/docs/realestate.md @@ -0,0 +1,111 @@ +# Local Real Estate + +## Schema Overview + +This database underpins a real estate application, managing properties, agents, firms, listings, and buyer preferences. It facilitates core operations from property management to agent-buyer matching. + +## Table Summary + +| Table Name | Primary Responsibility | +| :--------- | :--------------------- | +| `Property` | Defines the foundational details of all real estate holdings. | +| `House` | Stores specific attributes for residential properties. | +| `BusinessProperty` | Holds details unique to commercial real estate. | +| `Firm` | Manages real estate agencies. | +| `Agent` | Records information about real estate agents. | +| `Listing` | Links properties to agents for active sales. | +| `Buyer` | Captures detailed preferences for prospective property buyers. | +| `Work_With` | Establishes relationships between buyers and agents. | + +## `Property` Table + +This table serves as the supertype for all property listings, establishing a common base for houses and business properties. It is central to property identification and ownership tracking. + +| Column Name | Data Type | Description | +| :---------- | :-------- | :---------- | +| `address` | VARCHAR(50) | Unique identifier for this entity. Used for all lookups and relationships. | +| `ownerName` | VARCHAR(30) (Optional) | The name of the property's current owner. | +| `price` | INT (Optional) | The listed price of the property. Map to `java.lang.Integer` or `java.math.BigDecimal` for robust calculations. | + +## `House` Table + +Contains attributes specific to residential properties, extending the general `Property` information. This table enables detailed filtering and searching for house listings. + +| Column Name | Data Type | Description | +| :---------- | :-------- | :---------- | +| `address` | VARCHAR(50) | Establishes a relationship with `Property.address`. Essential for data integrity and joins. | +| `ownerName` | VARCHAR(30) (Optional) | The name of the house's current owner. Inherited from `Property`. | +| `price` | INT (Optional) | The listed price of the house. Inherited from `Property`. Map to `java.lang.Integer` or `java.math.BigDecimal` for robust calculations. | +| `bedrooms` | INT (Optional) | Number of bedrooms in the house. | +| `bathrooms` | INT (Optional) | Number of bathrooms in the house. | +| `size` | INT (Optional) | Square footage or similar size metric of the house. | + +## `BusinessProperty` Table + +Holds characteristics unique to commercial or business properties, differentiating them from residential listings. + +| Column Name | Data Type | Description | +| :---------- | :-------- | :---------- | +| `address` | VARCHAR(50) | Establishes a relationship with `Property.address`. Essential for data integrity and joins. | +| `ownerName` | VARCHAR(30) (Optional) | The name of the business property's current owner. Inherited from `Property`. | +| `price` | INT (Optional) | The listed price of the business property. Inherited from `Property`. Map to `java.lang.Integer` or `java.math.BigDecimal` for robust calculations. | +| `type` | CHAR(20) (Optional) | Categorization of the business property (e.g., 'office space', 'retail'). Represents an enumerated value. | +| `size` | INT (Optional) | Square footage or similar size metric of the business property. | + +## `Firm` Table + +Manages records for real estate agencies, providing organizational context for agents and listings. + +| Column Name | Data Type | Description | +| :---------- | :-------- | :---------- | +| `id` | INT | Unique identifier for this entity. Used for all lookups and relationships. | +| `name` | VARCHAR(30) (Optional) | The name of the real estate firm. | +| `address` | VARCHAR(50) (Optional) | The physical address of the firm. | + +## `Agent` Table + +Stores details for individual real estate agents, including their affiliation with firms. + +| Column Name | Data Type | Description | +| :---------- | :-------- | :---------- | +| `agentId` | INT | Unique identifier for this entity. Used for all lookups and relationships. | +| `name` | VARCHAR(30) (Optional) | The agent's full name. | +| `phone` | CHAR(12) (Optional) | The agent's contact phone number. | +| `firmId` | INT | Establishes a relationship with `Firm.id`. Essential for data integrity and joins, indicating the agent's employer. | +| `dateStarted` | DATE (Optional) | The date the agent started working at the firm. Map to `java.time.LocalDate` for modern date handling. | + +## `Listing` Table + +Links properties with the agents responsible for their sale, including listing-specific details. + +| Column Name | Data Type | Description | +| :---------- | :-------- | :---------- | +| `address` | VARCHAR(50) (Optional) | Establishes a relationship with `Property.address`. Essential for data integrity and joins. | +| `agentId` | INT (Optional) | Establishes a relationship with `Agent.agentId`. Essential for data integrity and joins, indicating the listing agent. | +| `mlsNumber` | INT | Unique identifier for this entity. Used for all lookups and relationships. This is the Multiple Listing Service number. | +| `dataListed` | DATE (Optional) | The date the property was listed. Map to `java.time.LocalDate` for modern date handling. | + +## `Buyer` Table + +Captures comprehensive search criteria and personal information for potential property buyers. + +| Column Name | Data Type | Description | +| :---------- | :-------- | :---------- | +| `id` | INT | Unique identifier for this entity. Used for all lookups and relationships. | +| `name` | VARCHAR(30) (Optional) | The buyer's full name. | +| `phone` | CHAR(12) (Optional) | The buyer's contact phone number. | +| `propertyType` | CHAR(20) (Optional) | The preferred type of property (e.g., 'house', 'not applied'). Represents an enumerated value. | +| `bedrooms` | INT (Optional) | The minimum number of bedrooms desired for a house. | +| `bathrooms` | INT (Optional) | The minimum number of bathrooms desired for a house. | +| `businessPropertyType` | CHAR(20) (Optional) | The preferred type of business property (e.g., 'office space', 'not applied'). Represents an enumerated value. | +| `minimumPreferredPrice` | INT (Optional) | The lowest acceptable price for a property. Map to `java.lang.Integer` or `java.math.BigDecimal` for robust calculations. | +| `maximumPreferredPrice` | INT (Optional) | The highest acceptable price for a property. Map to `java.lang.Integer` or `java.math.BigDecimal` for robust calculations. | + +## `Work_With` Table + +A junction table establishing many-to-many relationships between buyers and agents, enabling tracking of client assignments. + +| Column Name | Data Type | Description | +| :---------- | :-------- | :---------- | +| `buyerId` | INT (Optional) | Establishes a relationship with `Buyer.id`. Essential for data integrity and joins. | +| `agentId` | INT (Optional) | Establishes a relationship with `Agent.agentId`. Essential for data integrity and joins. | diff --git a/landing/docs/schema.md b/landing/docs/schema.md deleted file mode 100644 index 9dc597e..0000000 --- a/landing/docs/schema.md +++ /dev/null @@ -1,138 +0,0 @@ -# Monaco Motors Schema - -This document describes the schema of the MONACO_MOTORS database, which appears to be a system for managing a high-end car dealership. - -![Monaco Motors Schema](cover.png) - -The data includes information about customers, sales agents, managers, distributors, vehicles, deals, insurances, and regions. - -### Overview - -The Monaco Motors schema consists of the following tables: - -1. **Customer:** Stores customer information, including their ID, agent ID, first name, last name, phone number, and email. - -2. **Deal:** Stores information about deals made, including the deal ID, vehicle ID, agent ID, customer ID, insurance ID (optional), and deal date. - -3. **Dealership:** Stores information about dealerships, including their ID, distributor ID, region ID, region zip code, and dealership name. - -4. **Distributor:** Stores information about distributors, including their ID and name. - -5. **Insurance:** Stores information about insurance policies, including the ID, policy type, and renewal date. - -6. **Manager:** Stores information about managers, including their ID, dealership ID, distributor ID, first name, last name, salary, and bonus (optional). - -7. **Region:** Stores information about regions, including the ID, zip code, and name. - -8. **Sales_Agent:** Stores information about sales agents, including their ID, manager ID, dealership ID, first name, last name, and salary. - -9. **Vehicle:** Stores information about vehicles, including the ID, dealership ID, distributor ID, make, model, body type, model year, and price. - -## Customer Table - -Stores customer information, including their ID, agent ID, first name, last name, phone number, and email. - -| Column Name | Data Type | Description | -|-------------------|-----------|----------------------------------------------| -| CustomerID | char(8) | Unique identifier for the customer | -| AgentID | char(8) | Foreign key referencing Sales_Agent.AgentID | -| CustFirstName | varchar(15)| Customer's first name | -| CustLastName | varchar(15)| Customer's last name | -| PhoneNumber | varchar(12)| Customer's phone number | -| Email | varchar(40)| Customer's email address | - -## Deal Table - -Stores information about deals made, including the deal ID, vehicle ID, agent ID, customer ID, insurance ID (optional), and deal date. - -| Column Name | Data Type | Description | -|--------------|--------------------|---------------------------------------------------------| -| DealID | char(5) | Unique identifier for the deal | -| VehicleID | char(3) | Foreign key referencing Vehicle.VehicleID | -| AgentID | char(8) | Foreign key referencing Sales_Agent.AgentID | -| CustomerID | char(8) | Foreign key referencing Customer.CustomerID | -| InsuranceID | char(5) (optional) | Foreign key referencing Insurance.InsuranceID (optional) | -| DealDate | date | Date the deal was made | - -## Dealership Table - -Stores information about dealerships, including their ID, distributor ID, region ID, region zip code, and dealership name. - -| Column Name | Data Type | Description | -|----------------|--------------------|-----------------------------------------------------------| -| DealershipID | char(5) | Unique identifier for the dealership | -| DistributorID | char(8) | Foreign key referencing Distributor.DistributorID | -| RegionID | char(3) | Foreign key referencing Region.RegionID | -| RegionZIP | char(5) | Zip code of the region | -| DealershipName | varchar(40) | Name of the dealership | - -## Distributor Table - -Stores information about distributors, including their ID and name. - -| Column Name | Data Type | Description | -|----------------|--------------------|-------------------------------------------------| -| DistributorID | char(8) | Unique identifier for the distributor | -| DistributorName | varchar(40) | Name of the distributor | - -## Insurance Table - -Stores information about insurance policies, including the ID, policy type, and renewal date. - -| Column Name | Data Type | Description | -|----------------|--------------------|---------------------------------------------------------| -| InsuranceID | char(5) | Unique identifier for the insurance policy | -| PolicyType | varchar(15) | Type of insurance policy (e.g., Full Coverage, Liability) | -| RenewalDate | date | Date the insurance policy needs to be renewed | - -## Manager Table - -Stores information about managers, including their ID, dealership ID, distributor ID, first name, last name, salary, and bonus (optional). - -| Column Name | Data Type | Description | -|----------------|--------------------|-------------------------------------------------------------| -| ManagerID | char(8) | Unique identifier for the manager | -| DealershipID | char(5) | Foreign key referencing Dealership.DealershipID | -| DistributorID | char(8) | Foreign key referencing Distributor.DistributorID | -| MngrFirstName | varchar(15) | Manager's first name | -| MngrLastName | varchar(15) | Manager's last name | -| MngrSalary | decimal(8,2) | Manager's annual salary | -| MngrBonus | decimal(8,2) (optional) | Manager's annual bonus (optional) | - -## Region Table - -Stores information about regions, including the ID, zip code, and name. - -| Column Name | Data Type | Description | -|----------------|--------------------|-------------------------------------------------| -| RegionID | char(3) | Unique identifier for the region | -| RegionZIP | char(5) | Zip code of the region | -| RegionName | varchar(15) | Name of the region | - -## Sales_Agent Table - -Stores information about sales agents, including their ID, manager ID, dealership ID, first name, last name, and salary. - -| Column Name | Data Type | Description | -|----------------|--------------------|-------------------------------------------------------------| -| AgentID | char(8) | Unique identifier for the sales agent | -| ManagerID | char(8) | Foreign key referencing Manager.ManagerID | -| DealershipID | char(5) | Foreign key referencing Dealership.DealershipID | -| AgentFirstName | varchar(15) | Sales agent's first name | -| AgentLastName | varchar(15) | Sales agent's last name | -| AgentSalary | decimal(9,2) | Sales agent's annual salary | - -## Vehicle Table - -Stores information about vehicles, including the ID, dealership ID, distributor ID, make, model, body type, model year, and price. - -| Column Name | Data Type | Description | -|----------------|--------------------|-----------------------------------------------------------| -| VehicleID | char(3) | Unique identifier for the vehicle | -| DealershipID | char(5) | Foreign key referencing Dealership.DealershipID | -| DistributorID | char(8) | Foreign key referencing Distributor.DistributorID | -| Make | varchar(40) | Make of the vehicle | -| Model | varchar(40) | Model of the vehicle | -| BodyType | varchar(40) | Body type of the vehicle | -| ModelYear | int(11) | Model year of the vehicle | -| Price | decimal(9,2) | Price of the vehicle | diff --git a/server/datasets/prompt-description.dat b/server/datasets/prompt-description.dat new file mode 100644 index 0000000..d2da1f9 --- /dev/null +++ b/server/datasets/prompt-description.dat @@ -0,0 +1,61 @@ +You are a Senior Java Developer and Database Expert. Your objective is to craft **incisive, high-impact schema documentation** for junior and mid-level Java developers. This isn't just a reference; it's a strategic resource to enable them to write robust, efficient code immediately. We're providing the essential knowledge, streamlined for maximum developer velocity. + +**Input:** You will receive SQL DDL (Data Definition Language) for the schema. + +**Tone:** +* **Direct & Authoritative:** Present information with conviction. +* **Results-Driven:** Every statement highlights the practical utility or implication for application development. +* **Efficient:** Eliminate all unnecessary words. Deliver core information with precision. +* **Action-Oriented (Implicit):** The information itself should guide their actions, not explicit commands. +* **Clarity Above All:** Unambiguous language is paramount for understanding. + +## Documentation Structure: The Blueprint for Success + +# Document title: `[SCHEMA_NAME] Schema: + + ** Format ex: "MONACO_MOTORS Schema" -> "Monaco Motors Schema" + + ** include an cover image, similar to: +!["ALT TAG"]({SCHEMA_NAME}.png), generate a schema related alt tag. + +## Schema Overview + +** State the database's fundamental contribution to the application. + +## Table Summary + + * For each table, present its primary responsibility in a single, potent sentence. + + * Format as a table + + wrap the table name like this: `TableName` + +For every table in the schema, provide the following: + +## `[TABLE_NAME]` Table + +[Explanation of the table's specific function and its significance within the broader application context.] + +| Column Name | Data Type | Description | +| :---------- | :-------- | :---------- | +| [`ColumnName`] | [SQL_DataType] | [Concise, impactful description of its purpose and implications for Java mapping/logic.] | + + * **Data Type Nuances:** + * `[SQL_DataType]`: Specify the exact SQL data type (e.g., CHAR(8), VARCHAR(40), DECIMAL(8,2), INT, DATE, TIMESTAMP). + * ` (Optional)`: Clearly append this if the column allows NULL values. This mandates explicit `null` handling in Java code. + * **Description Focus:** + * **Primary Keys:** "Unique identifier for this entity. Used for all lookups and relationships." + * **Foreign Keys:** "Establishes a relationship with `[ReferencedTable].[ReferencedColumn]`. Essential for data integrity and joins." + * **Numeric Data:** "Map to `java.math.BigDecimal` for financial values to ensure precision." + * **Dates/Timestamps:** "Map to `java.time.LocalDate`, `LocalDateTime`, or `Instant` for modern date/time handling." + * **Enumerated Values:** If a column represents a fixed set of values (e.g., status), indicate this. "Represents the order's current state. Refer to `OrderStatusEnum` in the application for valid values." + * **Critical Constraints:** Mention any non-obvious unique constraints or business rules tied to a column. + +## output formatting + +format as standard markdown +sections should use "##" and not "**" + +dont seperate the table descriptions with "----" just go straight to the next table with no more shit in between. + +---