{"id":32701082,"url":"https://github.com/pabi1234810/data_analysis_zepto","last_synced_at":"2025-11-01T23:03:18.702Z","repository":{"id":313415957,"uuid":"1051335133","full_name":"pabi1234810/Data_Analysis_Zepto","owner":"pabi1234810","description":"A comprehensive SQL-based business intelligence solution for analyzing grocery store product data, inventory management, and pricing strategies. This project demonstrates end-to-end data analysis workflow from raw data exploration to actionable business insights.","archived":false,"fork":false,"pushed_at":"2025-09-05T21:23:36.000Z","size":94,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-05T23:25:12.057Z","etag":null,"topics":["analytics","csv","data-analysis","data-science","database","excel","kaggle","kaggle-dataset","mathematics","pgadmin4","sql","utf-8","zepto"],"latest_commit_sha":null,"homepage":"https://pabi1234810.github.io/Data_Analysis_Zepto/","language":null,"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/pabi1234810.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-05T20:11:41.000Z","updated_at":"2025-09-05T21:27:19.000Z","dependencies_parsed_at":"2025-09-05T23:25:40.436Z","dependency_job_id":"57931941-99e0-4cb3-b36b-9c00cb7db6b0","html_url":"https://github.com/pabi1234810/Data_Analysis_Zepto","commit_stats":null,"previous_names":["pabi1234810/data_analysis_zepto"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/pabi1234810/Data_Analysis_Zepto","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pabi1234810%2FData_Analysis_Zepto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pabi1234810%2FData_Analysis_Zepto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pabi1234810%2FData_Analysis_Zepto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pabi1234810%2FData_Analysis_Zepto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pabi1234810","download_url":"https://codeload.github.com/pabi1234810/Data_Analysis_Zepto/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pabi1234810%2FData_Analysis_Zepto/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":282216044,"owners_count":26633413,"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-01T02:00:06.759Z","response_time":61,"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":["analytics","csv","data-analysis","data-science","database","excel","kaggle","kaggle-dataset","mathematics","pgadmin4","sql","utf-8","zepto"],"created_at":"2025-11-01T23:01:24.594Z","updated_at":"2025-11-01T23:03:18.695Z","avatar_url":"https://github.com/pabi1234810.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zepto Grocery Store Data Analysis\r\n\r\n## Project Overview\r\n\r\nThis project demonstrates a complete SQL-based analysis workflow for grocery product data from Zepto. Follow this step-by-step guide to perform comprehensive data exploration, cleaning, and business intelligence analysis.\r\n\r\n## 🚀 Quick Start Guide\r\n\r\n### Step 1: Database Setup and Table Creation\r\n\r\n```sql\r\n-- Create the main table structure\r\nDROP TABLE IF EXISTS zepto;\r\n\r\nCREATE TABLE zepto (\r\n    sku_id SERIAL PRIMARY KEY,\r\n    category VARCHAR(120),\r\n    name VARCHAR(150) NOT NULL,\r\n    mrp NUMERIC(8,2),\r\n    discountPercent NUMERIC(5,2),\r\n    availableQuantity INTEGER,\r\n    discountedSellingPrice NUMERIC(8,2),\r\n    weightInGms INTEGER,\r\n    outOfStock BOOLEAN,\r\n    quantity INTEGER\r\n);\r\n\r\n-- Verify table creation\r\n\\d zepto;\r\n```\r\n\r\n**Expected Output:**\r\n```\r\nTable \"public.zepto\"\r\nColumn               | Type           | Collation | Nullable | Default\r\n---------------------|----------------|-----------|----------|--------\r\nsku_id              | integer        |           | not null | nextval('zepto_sku_id_seq'::regclass)\r\ncategory            | varchar(120)   |           |          |\r\nname                | varchar(150)   |           | not null |\r\n```\r\n\r\n---\r\n\r\n## 📊 Phase 1: Data Exploration Workflow\r\n\r\n### Step 2: Initial Data Assessment\r\n\r\n```sql\r\n-- Check total number of records\r\nSELECT COUNT(*) AS total_products FROM zepto;\r\n```\r\n```\r\ntotal_products\r\n--------------\r\n15847\r\n```\r\n\r\n```sql\r\n-- Preview first 10 records to understand data structure\r\nSELECT * FROM zepto LIMIT 10;\r\n```\r\n\r\n### Step 3: Data Quality Validation\r\n\r\n```sql\r\n-- Identify any null values across all columns\r\nSELECT \r\n    SUM(CASE WHEN name IS NULL THEN 1 ELSE 0 END) AS null_names,\r\n    SUM(CASE WHEN category IS NULL THEN 1 ELSE 0 END) AS null_categories,\r\n    SUM(CASE WHEN mrp IS NULL THEN 1 ELSE 0 END) AS null_mrp,\r\n    SUM(CASE WHEN discountPercent IS NULL THEN 1 ELSE 0 END) AS null_discounts,\r\n    SUM(CASE WHEN availableQuantity IS NULL THEN 1 ELSE 0 END) AS null_quantity\r\nFROM zepto;\r\n```\r\n\r\n### Step 4: Explore Product Categories\r\n\r\n```sql\r\n-- Get all unique categories and their product counts\r\nSELECT \r\n    category,\r\n    COUNT(*) AS product_count\r\nFROM zepto\r\nGROUP BY category\r\nORDER BY product_count DESC;\r\n```\r\n\r\n**Example Output:**\r\n```\r\ncategory                | product_count\r\n------------------------|-------------\r\nBaby Care              | 2845\r\nPersonal Care          | 1967\r\nHousehold Items        | 1654\r\nFruits \u0026 Vegetables    | 1432\r\nDairy \u0026 Eggs          | 1289\r\n```\r\n\r\n### Step 5: Stock Status Analysis\r\n\r\n```sql\r\n-- Analyze in-stock vs out-of-stock distribution\r\nSELECT \r\n    CASE \r\n        WHEN outOfStock = TRUE THEN 'Out of Stock'\r\n        ELSE 'In Stock'\r\n    END AS stock_status,\r\n    COUNT(sku_id) AS product_count,\r\n    ROUND((COUNT(sku_id) * 100.0 / (SELECT COUNT(*) FROM zepto)), 2) AS percentage\r\nFROM zepto\r\nGROUP BY outOfStock\r\nORDER BY product_count DESC;\r\n```\r\n\r\n---\r\n\r\n## 🧹 Phase 2: Data Cleaning Process\r\n\r\n### Step 6: Identify and Remove Invalid Data\r\n\r\n```sql\r\n-- Find products with zero pricing (invalid data)\r\nSELECT COUNT(*) AS zero_price_products\r\nFROM zepto\r\nWHERE mrp = 0 OR discountedSellingPrice = 0;\r\n```\r\n\r\n```sql\r\n-- Remove invalid pricing records\r\nDELETE FROM zepto WHERE mrp = 0;\r\n\r\n-- Verify deletion\r\nSELECT COUNT(*) AS remaining_products FROM zepto;\r\n```\r\n\r\n### Step 7: Currency Conversion (Paise to Rupees)\r\n\r\n```sql\r\n-- Check current price format (assuming data is in paise)\r\nSELECT name, mrp, discountedSellingPrice \r\nFROM zepto \r\nWHERE mrp \u003e 1000  -- High values indicate paise format\r\nLIMIT 5;\r\n```\r\n\r\n```sql\r\n-- Convert from paise to rupees\r\nUPDATE zepto\r\nSET mrp = mrp / 100.0,\r\n    discountedSellingPrice = discountedSellingPrice / 100.0;\r\n\r\n-- Verify conversion\r\nSELECT name, mrp, discountedSellingPrice \r\nFROM zepto \r\nLIMIT 5;\r\n```\r\n\r\n**After Conversion:**\r\n```\r\nname                    | mrp    | discountedSellingPrice\r\n------------------------|--------|----------------------\r\nOrganic Apples 1kg     | 299.00 | 249.00\r\nPremium Rice 5kg       | 850.00 | 680.00\r\n```\r\n\r\n---\r\n\r\n## 📈 Phase 3: Business Intelligence Analysis\r\n\r\n### Step 8: Top Value Products (Highest Discounts)\r\n\r\n```sql\r\n-- Find top 10 products with maximum discount percentages\r\nSELECT DISTINCT \r\n    name, \r\n    mrp,\r\n    discountedSellingPrice,\r\n    discountPercent,\r\n    (mrp - discountedSellingPrice) AS savings_amount\r\nFROM zepto\r\nORDER BY discountPercent DESC\r\nLIMIT 10;\r\n```\r\n\r\n**Business Insight:** *Identify products offering maximum customer value*\r\n\r\n### Step 9: High-Value Out-of-Stock Analysis\r\n\r\n```sql\r\n-- Premium products currently unavailable (potential revenue loss)\r\nSELECT DISTINCT \r\n    name,\r\n    category,\r\n    mrp,\r\n    (mrp * availableQuantity) AS potential_revenue_loss\r\nFROM zepto\r\nWHERE outOfStock = TRUE \r\n  AND mrp \u003e 300\r\nORDER BY potential_revenue_loss DESC\r\nLIMIT 15;\r\n```\r\n\r\n**Business Insight:** *Prioritize restocking high-value items*\r\n\r\n### Step 10: Category-wise Revenue Potential\r\n\r\n```sql\r\n-- Calculate estimated revenue per category\r\nSELECT \r\n    category,\r\n    COUNT(*) AS total_products,\r\n    SUM(availableQuantity) AS total_stock,\r\n    ROUND(SUM(discountedSellingPrice * availableQuantity), 2) AS potential_revenue,\r\n    ROUND(AVG(discountedSellingPrice), 2) AS avg_selling_price\r\nFROM zepto\r\nWHERE outOfStock = FALSE\r\nGROUP BY category\r\nORDER BY potential_revenue DESC;\r\n```\r\n\r\n**Example Output:**\r\n```\r\ncategory           | total_products | total_stock | potential_revenue | avg_selling_price\r\n-------------------|---------------|-------------|-------------------|------------------\r\nBaby Care         | 2456          | 45678       | 1,245,890.50     | 156.75\r\nPersonal Care     | 1834          | 38924       | 987,654.25       | 89.50\r\n```\r\n\r\n### Step 11: Premium Products with Low Discounts\r\n\r\n```sql\r\n-- High-value products with minimal discounts (pricing strategy analysis)\r\nSELECT DISTINCT \r\n    name, \r\n    category,\r\n    mrp, \r\n    discountPercent,\r\n    discountedSellingPrice,\r\n    CASE \r\n        WHEN discountPercent \u003c 5 THEN 'Premium Pricing'\r\n        WHEN discountPercent \u003c 10 THEN 'Conservative Discount'\r\n        ELSE 'Standard Discount'\r\n    END AS pricing_strategy\r\nFROM zepto\r\nWHERE mrp \u003e 500 \r\n  AND discountPercent \u003c 10\r\nORDER BY mrp DESC, discountPercent ASC;\r\n```\r\n\r\n### Step 12: Category Discount Performance\r\n\r\n```sql\r\n-- Top 5 categories by average discount percentage\r\nSELECT \r\n    category,\r\n    COUNT(*) AS product_count,\r\n    ROUND(AVG(discountPercent), 2) AS avg_discount,\r\n    ROUND(AVG(mrp), 2) AS avg_mrp,\r\n    ROUND(AVG(discountedSellingPrice), 2) AS avg_selling_price\r\nFROM zepto\r\nGROUP BY category\r\nHAVING COUNT(*) \u003e= 50  -- Categories with significant product count\r\nORDER BY avg_discount DESC\r\nLIMIT 5;\r\n```\r\n\r\n### Step 13: Value-for-Money Analysis (Price per Gram)\r\n\r\n```sql\r\n-- Best value products based on price per gram (products \u003e 100g only)\r\nSELECT DISTINCT \r\n    name, \r\n    category,\r\n    weightInGms,\r\n    discountedSellingPrice,\r\n    ROUND(discountedSellingPrice/weightInGms, 4) AS price_per_gram,\r\n    CASE \r\n        WHEN discountedSellingPrice/weightInGms \u003c 0.1 THEN 'Excellent Value'\r\n        WHEN discountedSellingPrice/weightInGms \u003c 0.5 THEN 'Good Value'\r\n        WHEN discountedSellingPrice/weightInGms \u003c 1.0 THEN 'Average Value'\r\n        ELSE 'Premium Pricing'\r\n    END AS value_category\r\nFROM zepto\r\nWHERE weightInGms \u003e= 100 \r\n  AND weightInGms IS NOT NULL\r\n  AND discountedSellingPrice \u003e 0\r\nORDER BY price_per_gram ASC\r\nLIMIT 20;\r\n```\r\n\r\n### Step 14: Product Weight Segmentation\r\n\r\n```sql\r\n-- Categorize products by weight for inventory management\r\nSELECT \r\n    CASE \r\n        WHEN weightInGms \u003c 100 THEN 'Mini (\u003c 100g)'\r\n        WHEN weightInGms \u003c 500 THEN 'Small (100-500g)'\r\n        WHEN weightInGms \u003c 1000 THEN 'Medium (500g-1kg)'\r\n        WHEN weightInGms \u003c 5000 THEN 'Large (1-5kg)'\r\n        ELSE 'Bulk (\u003e 5kg)'\r\n    END AS weight_category,\r\n    COUNT(*) AS product_count,\r\n    ROUND(AVG(discountedSellingPrice), 2) AS avg_price,\r\n    ROUND(AVG(discountPercent), 2) AS avg_discount\r\nFROM zepto\r\nWHERE weightInGms IS NOT NULL\r\nGROUP BY \r\n    CASE \r\n        WHEN weightInGms \u003c 100 THEN 'Mini (\u003c 100g)'\r\n        WHEN weightInGms \u003c 500 THEN 'Small (100-500g)'\r\n        WHEN weightInGms \u003c 1000 THEN 'Medium (500g-1kg)'\r\n        WHEN weightInGms \u003c 5000 THEN 'Large (1-5kg)'\r\n        ELSE 'Bulk (\u003e 5kg)'\r\n    END\r\nORDER BY \r\n    CASE \r\n        WHEN weight_category = 'Mini (\u003c 100g)' THEN 1\r\n        WHEN weight_category = 'Small (100-500g)' THEN 2\r\n        WHEN weight_category = 'Medium (500g-1kg)' THEN 3\r\n        WHEN weight_category = 'Large (1-5kg)' THEN 4\r\n        ELSE 5\r\n    END;\r\n```\r\n\r\n### Step 15: Inventory Weight Distribution\r\n\r\n```sql\r\n-- Total inventory weight per category (logistics planning)\r\nSELECT \r\n    category,\r\n    COUNT(*) AS product_types,\r\n    SUM(availableQuantity) AS total_units,\r\n    ROUND(SUM(weightInGms * availableQuantity) / 1000.0, 2) AS total_weight_kg,\r\n    ROUND(AVG(weightInGms), 2) AS avg_weight_per_product\r\nFROM zepto\r\nWHERE weightInGms IS NOT NULL \r\n  AND availableQuantity \u003e 0\r\nGROUP BY category\r\nORDER BY total_weight_kg DESC;\r\n```\r\n\r\n---\r\n\r\n## 🔍 Advanced Analytics\r\n\r\n### Step 16: Comprehensive Performance Dashboard\r\n\r\n```sql\r\n-- Create a comprehensive business summary\r\nWITH category_stats AS (\r\n    SELECT \r\n        category,\r\n        COUNT(*) as total_products,\r\n        SUM(CASE WHEN outOfStock = FALSE THEN 1 ELSE 0 END) as in_stock_products,\r\n        ROUND(AVG(discountPercent), 2) as avg_discount,\r\n        ROUND(SUM(discountedSellingPrice * availableQuantity), 2) as potential_revenue\r\n    FROM zepto\r\n    GROUP BY category\r\n),\r\noverall_stats AS (\r\n    SELECT \r\n        COUNT(*) as total_products,\r\n        ROUND(AVG(discountPercent), 2) as overall_avg_discount,\r\n        ROUND(SUM(discountedSellingPrice * availableQuantity), 2) as total_potential_revenue\r\n    FROM zepto\r\n)\r\nSELECT \r\n    cs.category,\r\n    cs.total_products,\r\n    cs.in_stock_products,\r\n    ROUND((cs.in_stock_products * 100.0 / cs.total_products), 2) as stock_availability_percent,\r\n    cs.avg_discount,\r\n    cs.potential_revenue,\r\n    ROUND((cs.potential_revenue * 100.0 / os.total_potential_revenue), 2) as revenue_contribution_percent\r\nFROM category_stats cs\r\nCROSS JOIN overall_stats os\r\nORDER BY cs.potential_revenue DESC;\r\n```\r\n\r\n---\r\n\r\n## 💡 Key Business Insights Generated\r\n\r\n### Inventory Management\r\n- **Stock Availability**: Track out-of-stock percentages by category\r\n- **High-Value Items**: Identify premium products needing immediate restocking\r\n- **Weight Distribution**: Optimize storage and logistics planning\r\n\r\n### Pricing Strategy\r\n- **Discount Effectiveness**: Analyze which discount ranges drive sales\r\n- **Value Positioning**: Identify products with best price-to-weight ratios\r\n- **Premium Products**: Track high-value, low-discount items\r\n\r\n### Revenue Optimization\r\n- **Category Performance**: Revenue potential by product category\r\n- **Product Mix**: Balance between volume and value products\r\n- **Promotional Opportunities**: Products suitable for discount campaigns\r\n\r\n---\r\n\r\n## 🎯 Next Steps After Analysis\r\n\r\n### 1. Create Automated Reports\r\n```sql\r\n-- Save frequently used queries as views\r\nCREATE VIEW top_discounted_products AS\r\nSELECT DISTINCT name, category, discountPercent, discountedSellingPrice\r\nFROM zepto\r\nORDER BY discountPercent DESC\r\nLIMIT 50;\r\n```\r\n\r\n### 2. Set Up Monitoring Queries\r\n```sql\r\n-- Weekly out-of-stock monitoring\r\nCREATE VIEW weekly_stock_alert AS\r\nSELECT category, name, mrp\r\nFROM zepto\r\nWHERE outOfStock = TRUE AND mrp \u003e 200\r\nORDER BY mrp DESC;\r\n```\r\n\r\n### 3. Export Results for Visualization\r\n```sql\r\n-- Export category performance for charts\r\n\\copy (SELECT category, SUM(discountedSellingPrice * availableQuantity) as revenue FROM zepto GROUP BY category ORDER BY revenue DESC) TO 'category_revenue.csv' CSV HEADER;\r\n```\r\n\r\n---\r\n\r\n## 🛠️ Technical Requirements\r\n\r\n- **Database**: PostgreSQL 12+ (or any SQL-compatible database)\r\n- **Tools**: pgAdmin, DBeaver, or command-line interface\r\n- **Skills**: Basic SQL knowledge, data analysis concepts\r\n\r\n## 📋 Project Checklist\r\n\r\n- [ ] Database setup and table creation\r\n- [ ] Data quality validation completed\r\n- [ ] Data cleaning operations executed\r\n- [ ] All 8 business intelligence queries run\r\n- [ ] Advanced analytics performed\r\n- [ ] Results exported for stakeholder review\r\n- [ ] Automated monitoring queries established\r\n\r\n---\r\n\r\n## 📝 Contributing\r\n\r\nWhen extending this analysis:\r\n1. Follow the same step-by-step approach\r\n2. Document business reasoning for new queries\r\n3. Include expected output examples\r\n4. Test with sample data first\r\n\r\n\r\n---\r\n\r\n*This README provides a complete workflow for grocery retail data analysis. Each step builds upon the previous one, creating a comprehensive business intelligence solution.*\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpabi1234810%2Fdata_analysis_zepto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpabi1234810%2Fdata_analysis_zepto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpabi1234810%2Fdata_analysis_zepto/lists"}