ready for rewrite of content
All checks were successful
learn org at code.softwareshinobi.com/databases.softwareshinobi.com/pipeline/head This commit looks good
All checks were successful
learn org at code.softwareshinobi.com/databases.softwareshinobi.com/pipeline/head This commit looks good
This commit is contained in:
37
landing/docs/SQL-101/old/prompt.dat
Normal file
37
landing/docs/SQL-101/old/prompt.dat
Normal file
@@ -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"
|
||||
|
||||
---
|
||||
|
||||
|
||||
|
||||
80
landing/docs/megamart.md
Normal file
80
landing/docs/megamart.md
Normal file
@@ -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. |
|
||||
128
landing/docs/monacomotors.md
Normal file
128
landing/docs/monacomotors.md
Normal file
@@ -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. |
|
||||
111
landing/docs/realestate.md
Normal file
111
landing/docs/realestate.md
Normal file
@@ -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. |
|
||||
@@ -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.
|
||||
|
||||

|
||||
|
||||
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 |
|
||||
61
server/datasets/prompt-description.dat
Normal file
61
server/datasets/prompt-description.dat
Normal file
@@ -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:
|
||||
, 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.
|
||||
|
||||
---
|
||||
Reference in New Issue
Block a user