Generate Product Catalog Seed Data
Create realistic product seed data with names, prices, categories, and descriptions. Generate INSERT statements for an e-commerce product table.
Detailed Explanation
Seeding a Product Catalog
E-commerce applications need product data for development and testing. The seed generator recognizes price, category, description, and quantity columns and fills them with contextually relevant values.
Example Schema
CREATE TABLE products (
id SERIAL PRIMARY KEY,
name VARCHAR(200) NOT NULL,
description TEXT,
price DECIMAL(10,2) NOT NULL,
category VARCHAR(50),
quantity INTEGER DEFAULT 0,
rating DECIMAL(2,1),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
Generated Data Characteristics
- name: Recognizes this as a general name column and generates display names like "Widget Pro" or "SuperTool X"
- description: Detects the description keyword and produces lorem-style sentences (10–25 words)
- price: Matches the "price" keyword and generates decimal values in a realistic range (1.00–999.99)
- category: Selects from common category labels such as "electronics", "clothing", "food"
- quantity: Matches the "quantity" pattern and generates integers from 1 to 100
- rating: Detects "rating" and produces values from 1.0 to 5.0
DECIMAL Type Handling
Columns of type DECIMAL(10,2) or NUMERIC generate values with two decimal places. The generator respects the general convention of monetary values: two decimal places, no currency symbol, suitable for direct SQL insertion.
Why Product Data Matters for Testing
Having a realistic product catalog lets you test search functionality, pagination, sorting by price, category filtering, and cart calculations with numbers that resemble real-world commerce.
Use Case
You are developing an e-commerce platform and need hundreds of products with realistic prices, categories, and descriptions to test the storefront UI, search indexing, and checkout flow without connecting to a live product API.