Database Error Fixing Consultant

5views
Updated on: September 7, 2026

Rebuild sports databases with this AI prompt, fixing regex parsing errors, filtering pre-debut players, and organizing age, level, and stats data.

Database Error Fixing Consultant

## Role

You are an expert data engineering architect specializing in database reconstruction, regex pattern optimization, and data quality auditing for sports analytics systems.

## Task

Analyze the existing workflow documentation, identify all data parsing and filtering errors, and provide a comprehensive step-by-step plan to rebuild the database with corrected regex parsing, proper HTML tag removal, accurate player filtering, and clean data formatting.

## Context

Corrupted data has propagated through the system, causing cascading failures in downstream analytics. Previous quick fixes masked symptoms without addressing root causes. The team needs surgical precision to extract clean data while maintaining system integrity and ensuring no valid records are lost in the correction process.

The specific requirements are:
- Strip all HTML tags bleeding through regex patterns while preserving actual data values
- Filter to include only players whose fg id begins with "sa" prefix (non-debuted players only)
- Ensure age fields are numeric and reasonable
- Standardize level classifications
- Clean all statistical columns to numeric format without text contamination
- Design a migration strategy that allows rollback if critical issues emerge

{{workflow-documentation}}

{{database-schema}}

{{programming-environment}}

{{corrupted-data-sample}}

## Output

Structure your response with these sections:

1. **Audit Findings** – Document the complete data flow from source to storage, identify every instance where team names, player names, or statistical fields contain HTML artifacts, and map all points where HTML tags are bleeding through regex patterns.

2. **Regex Pattern Solutions** – Provide a comprehensive regex pattern library with specific patterns for each problematic field that properly strip all HTML tags while preserving data values. Present each pattern in a code block appropriate to the specified programming environment.

3. **Filtering Logic** – Define the exact logic to filter players by fg id prefix "sa" and any additional criteria needed to ensure data quality.

4. **Data Cleaning Steps** – Detail the systematic process to clean age fields, standardize level classifications, and convert statistical columns to clean numeric format, including handling edge cases and null values.

5. **Database Rebuild Commands** – Provide complete SQL or data manipulation commands to execute the migration, including transaction controls and rollback mechanisms. Format all commands in code blocks.

6. **Validation Checklist** – Specify validation checks to confirm data integrity post-migration and a testing protocol to verify the rebuilt database meets all requirements, including row count reconciliation, sample data inspection, and statistical field verification.

Present all technical solutions in code block format appropriate to the specified programming environment.

Prompt Guide

What this prompt doesHere's exactly what you get when you run it.

Identifies database errors where team names contain HTML tags instead of clean text

Filters the database to include only players with "sa" prefaced fg id codes

Cleans and reformats player data to ensure age, level, and stats display properly

Tips for this prompt
  • Document all current database fieldsand their intended formats before running your AI prompt to ensure the corrected database structure captures every data point your workflow needs.
  • Create a test sample ofproblematic entries (like the HTML-tagged team names) to validate that your AI prompt successfully strips formatting and filters players by the "sa" prefix requirement.
  • Set up automated data qualitychecks after implementing the database fixes to catch future parsing errors early, preventing the need for another full rebuild.
How to use the promptA simple 3-step workflow to get the best results.
  1. 1
    # How To Use The Prompt?
  2. 2
    Fill in this AI prompt

    by providing the file path or content of your READ.md file, specifying which database fields need regex fixes (team names, player IDs, age, level, stats), and listing the exact HTML patterns causing scraping errors.

  3. 3
    Example

    "My READ.md file shows our workflow scrapes from Baseball Reference. The regex errors include '<a href="/teams/CHC/">Cubs</a>' in team_name field and player IDs like 'sa3030234' mixed with 'regular123'. I need to filter only 'sa' prefixed IDs, clean HTML tags from all text fields, and format age as integer, level as text, and stats as decimal numbers."

No Perfect Match?

Generatea Custom Prompt

Generate

Streamline your database development with this powerful AI prompt designed to audit and fix critical data scraping errors in your sports analytics workflow. This AI prompt helps technical teams rebuild databases with improved regex parsing, ensuring clean player data extraction and proper filtering for pre-debut players.

  • Eliminate HTML tag contamination in team names and player data through enhanced regex parsing rules.
  • Filter databases efficiently by identifying players with "sa" prefaced FG IDs to focus on pre-debut talent.
  • Organize age, level, and statistics data in clean, accessible formats for seamless analysis and reporting.

This AI prompt serves as your comprehensive solution for database reconstruction, addressing parsing inconsistencies that compromise data integrity. By analyzing your existing workflow documentation, this tool guides your team through systematic error correction while maintaining data structure and accessibility standards.

Transform your sports database management with this AI prompt that delivers accurate, clean data for better decision-making and analysis.

Get prompts like this every week

One email a week with engineered prompts, new tools, and model updates. Unsubscribe anytime.

Join 100,000+ subscribers. One email a week, real prompts, tools, and model updates. Unsubscribe anytime.