{"id":25929443,"url":"https://github.com/dkoh2018/sql_db","last_synced_at":"2026-05-05T10:34:15.653Z","repository":{"id":280387753,"uuid":"941817702","full_name":"dkoh2018/sql_db","owner":"dkoh2018","description":"ETL pipeline for processing LinkedIn company data: extracts JSON, normalizes, and stores in MySQL","archived":false,"fork":false,"pushed_at":"2025-03-18T06:20:49.000Z","size":1696,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-05T21:25:09.804Z","etag":null,"topics":["data-engineering","data-pipeline","etl","json","linkedin","mysql","sql"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dkoh2018.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2025-03-03T05:18:25.000Z","updated_at":"2025-03-18T06:20:52.000Z","dependencies_parsed_at":"2025-03-03T06:37:49.528Z","dependency_job_id":null,"html_url":"https://github.com/dkoh2018/sql_db","commit_stats":null,"previous_names":["dkoh2018/sql_db"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dkoh2018/sql_db","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkoh2018%2Fsql_db","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkoh2018%2Fsql_db/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkoh2018%2Fsql_db/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkoh2018%2Fsql_db/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dkoh2018","download_url":"https://codeload.github.com/dkoh2018/sql_db/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkoh2018%2Fsql_db/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27347660,"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-11-29T02:00:06.589Z","response_time":56,"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":["data-engineering","data-pipeline","etl","json","linkedin","mysql","sql"],"created_at":"2025-03-03T22:07:22.787Z","updated_at":"2025-11-29T11:04:02.432Z","avatar_url":"https://github.com/dkoh2018.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LinkedIn Company Data ETL System\n\n![Database](https://img.shields.io/badge/Database-MySQL-blue)\n![ETL](https://img.shields.io/badge/ETL-Pentaho-orange)\n![Python](https://img.shields.io/badge/Language-Python-green)\n\n## Overview\nThis repository contains an ETL (Extract, Transform, Load) pipeline for processing LinkedIn company profile data from JSON files and storing it in a normalized MySQL database. The system covers conceptual, logical, and physical design aspects to ensure data consistency and referential integrity.\n\n## Key Features\n- **Data Modeling**  \n  - Conceptual, Logical, and Physical diagrams (Crow's Foot notation, 3NF design).\n  - Focus on proper normalization principles to achieve Third Normal Form (3NF).\n- **Staging**  \n  - Loads raw JSON data into a staging database (`staging`) using Pentaho Data Integration.\n- **Transformation**  \n  - Normalizes data into intermediate tables, correcting inconsistencies and handling duplicates.\n- **Loading**  \n  - Moves transformed data into the final `company` database with proper constraints and relationships.\n\n## Technology Stack\n- **MySQL** for relational storage\n- **Pentaho Data Integration (Spoon)** for ETL workflows\n- **Python 3.x** for scripting and data manipulation\n- **JSON** as source format\n\n## Repository Structure\n```\nsql_db/\n├── README.md                     # This documentation\n├── instructions.md               # Setup and execution instructions\n├── normalization_script.py       # Python data processing script\n├── stage-json-to-table.ktr       # Pentaho transformation definition\n├── staging.sql                   # SQL schema and normalization queries\n└── company-profile/              # Source JSON data files\n    └── [company_*.json]          # Multiple company profile files\n```\n\n## Data Flow\n1. **Extract**  \n   - JSON files from the `company-profile` directory are identified and read.\n2. **Staging**  \n   - Using Pentaho Data Integration (Spoon), data is inserted into `staging` tables in MySQL.\n3. **Transform**  \n   - **Primary Method:** Run the SQL statements in `staging.sql` for normalization:\n     - First execute the table creation section to establish the schema\n     - Then execute the remaining transformation queries in order\n   - **Optional:** Execute the `normalization_script.py` only if additional custom logic is required.\n4. **Load**  \n   - Final normalized data is moved into the `company` database with enforced primary/foreign keys.\n\n## Getting Started\n\n### Prerequisites\n- MySQL Server 5.7+  \n- Pentaho Data Integration 8.0+  \n- Python 3.6+ (optional, only if using the Python script)  \n\n### Quick Setup\n1. **Clone** this repository.\n2. **Launch Pentaho** with the `./spoon` command.\n3. **Configure** database connections in Pentaho.\n4. **Run** the Pentaho transformation to load staging data.\n5. **Normalize** the data:\n   - Run the remaining SQL transformation querie after the first one:\n     ```bash\n     mysql -u \u003cuser\u003e -p \u003cdatabase\u003e \u003c staging_transformations.sql\n     ```\n   - Note: Python script is optional and only needed for specialized transformations.\n6. **Confirm** the final structure in the `company` database.\n\n## Example Query\n```sql\n-- Retrieve companies with their specialties\nSELECT c.name, GROUP_CONCAT(s.specialty_name) AS specialties\nFROM companies c\nJOIN company_specialties cs ON c.id = cs.company_id\nJOIN specialties s ON cs.specialty_id = s.id\nGROUP BY c.name;\n```\n\n## Additional Documentation\nSee [instructions.md](instructions.md) for more details on the SQL normalization process and how the ERD was developed to achieve proper 3NF design.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdkoh2018%2Fsql_db","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdkoh2018%2Fsql_db","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdkoh2018%2Fsql_db/lists"}