{"id":31646582,"url":"https://github.com/mastermindromii/pan-number-validation-project-using-mysql","last_synced_at":"2025-10-07T05:54:53.365Z","repository":{"id":311325759,"uuid":"1043385904","full_name":"MasterMindRomii/PAN-Number-Validation-Project-using-MySQL","owner":"MasterMindRomii","description":"This project is designed to validate Indian PAN numbers using MySQL Workbench. It includes SQL scripts to clean, validate, and categorize PAN numbers as Valid or Invalid based on multiple business rules and regex patterns.","archived":false,"fork":false,"pushed_at":"2025-08-23T18:52:51.000Z","size":114,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-24T07:23:11.222Z","etag":null,"topics":["create-view","cte","function-sql","mysql","regex"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MasterMindRomii.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-23T18:35:52.000Z","updated_at":"2025-08-23T18:52:54.000Z","dependencies_parsed_at":"2025-08-24T08:12:03.677Z","dependency_job_id":"229fed2a-8ed5-449f-a53c-6c32c8c1574d","html_url":"https://github.com/MasterMindRomii/PAN-Number-Validation-Project-using-MySQL","commit_stats":null,"previous_names":["mastermindromii/pan-number-validation-project-using-mysql"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/MasterMindRomii/PAN-Number-Validation-Project-using-MySQL","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MasterMindRomii%2FPAN-Number-Validation-Project-using-MySQL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MasterMindRomii%2FPAN-Number-Validation-Project-using-MySQL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MasterMindRomii%2FPAN-Number-Validation-Project-using-MySQL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MasterMindRomii%2FPAN-Number-Validation-Project-using-MySQL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MasterMindRomii","download_url":"https://codeload.github.com/MasterMindRomii/PAN-Number-Validation-Project-using-MySQL/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MasterMindRomii%2FPAN-Number-Validation-Project-using-MySQL/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278728289,"owners_count":26035412,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["create-view","cte","function-sql","mysql","regex"],"created_at":"2025-10-07T05:54:51.889Z","updated_at":"2025-10-07T05:54:53.359Z","avatar_url":"https://github.com/MasterMindRomii.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🪪 PAN Number Validation Project using MySQL\n\nThis project is designed to **validate Indian PAN numbers** using **MySQL Workbench**.  \nIt includes SQL scripts to clean, validate, and categorize PAN numbers as **Valid** or **Invalid** based on multiple business rules and regex patterns.\n\n---\n\n## 📌 Project Overview\nThe **Permanent Account Number (PAN)** is a 10-character alphanumeric identifier issued by the Indian Income Tax Department.  \nTo ensure correctness of data, this project:\n- Cleans raw PAN number datasets\n- Identifies missing, duplicate, or incorrectly formatted PANs\n- Uses **custom MySQL functions** to detect invalid patterns (e.g., sequential/repeated characters)\n- Classifies PAN numbers into **Valid** and **Invalid**\n- Generates a **summary report** for quick insights\n\n---\n\n## 🛠️ Features\n- Data cleaning (trimming, uppercase conversion, duplicate removal)  \n- Validation rules (regex-based format checks)  \n- Custom MySQL functions for:\n- Detecting **adjacent character repetition**\n- Detecting **sequential characters**  \n- Creation of a **validation view** for quick results  \n- **Summary report** with counts of valid, invalid, and missing PANs  \n\n---\n\n## 📂 Dataset\nThe project assumes an input dataset with one column:\n\n| Column Name  | Description               |\n|--------------|---------------------------|\n| `pan_number` | Raw PAN numbers (string) |\n\nExample:\n\n| pan_number  |\n|-------------|\n| ABCDE1234F  |\n| xyz 1234p   |\n| AA1111AA1A  |\n| (NULL)      |\n\n---\n\n## 🧹 Data Cleaning Steps\n1. Handle missing data → Remove NULL or empty PAN numbers  \n2. Check duplicates → Identify duplicate PANs  \n3. Trim spaces → Remove leading/trailing spaces  \n4. Correct case → Convert to UPPERCASE  \n5. Create cleaned table → Store cleaned dataset  \n\n---\n\n## 🔎 Validation Logic\n### 1️⃣ Regex Format Rule\nPAN must match:\n\n\n^[A-Z]{5}[0-9]{4}[A-Z]$\n\n\n### 2️⃣ Custom Functions\n- **fn_check_adjacent_repetition()** → Ensures no two adjacent characters are the same  \n- **fn_check_sequence()** → Detects sequential patterns like `ABCDE`, `1234`  \n\n### 3️⃣ Final Categorization\n- **Valid PAN** → Matches regex + no repetition + no sequences  \n- **Invalid PAN** → Fails any rule  \n\n---\n\n## 📊 Outputs\n### View: `vw_valid_invalid_pans`\n| pan_number  | status      |\n|-------------|-------------|\n| ABCDE1234F  | Valid PAN   |\n| AAAAA1111A  | Invalid PAN |\n| XYZ1234P    | Invalid PAN |\n\n---\n\n### 📈 Summary Report Example\n| total_processed_records | total_valid_pans | total_invalid_pans | missing_incomplete_pans |\n|--------------------------|------------------|--------------------|--------------------------|\n| 10                       | 7                | 2                  | 1                        |\n\n---\n\n## 🚀 Usage Guide\n1. Clone this repository:\n   ```bash\n   git clone https://github.com/MasterMindRomii/PAN-Number-Validation-Project-using-MySQL.git\n\n🤝 Contribution\n\nPull requests are welcome! If you find issues or want to add new validation rules, feel free to fork and contribute.\n\n📜 License\n\nThis project is licensed under the MIT License.\n\n👨‍💻 Author\n\nRomi Gupta\n💼 Data Analyst | SQL | Power BI | Python | Excel\n📧 romigupta1875@gmail.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmastermindromii%2Fpan-number-validation-project-using-mysql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmastermindromii%2Fpan-number-validation-project-using-mysql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmastermindromii%2Fpan-number-validation-project-using-mysql/lists"}