Coder Social home page Coder Social logo

supermarket-sales's Introduction

Supermarket-Sales

Analysis of supermarket branch sales from a database. The objective is to pass all the data from the source to a MySQL database and perform general analysis of the data.

Source

https://www.kaggle.com/datasets/aungpyaeap/supermarket-sales

The dataset is one of the historical sales of supermarket company which has recorded in 3 different branches for 3 months data.

Attribute information

Invoice id: Computer generated sales slip invoice identification number.

Branch: Branch of supercenter (3 branches are available identified by A, B and C).

City: Location of supercenters.

Customer type: Type of customers, recorded by Members for customers using member card and Normal for without member card.

Gender: Gender type of customer.

Product line: General item categorization groups - Electronic accessories, Fashion accessories, Food and beverages, Health and beauty, Home and lifestyle, Sports and travel.

Unit price: Price of each product in $.

Quantity: Number of products purchased by customer.

Tax: 5% tax fee for customer buying.

Total: Total price including tax.

Date: Date of purchase (Record available from January 2019 to March 2019).

Time: Purchase time (10am to 9pm).

Payment: Payment used by customer for purchase (3 methods are available - Cash, Credit card and Ewallet).

COGS: Cost of goods sold.

Gross margin percentage: Gross margin percentage.

Gross income: Gross income.

Rating: Customer stratification rating on their overall shopping experience (On a scale of 1 to 10).

Data modeling

To pass data from the csv file to a MySQL database, it's important to properly model the data. Data modeling is done up to fifth normal form (5NF). By using MySQL workbench the following schema was assigned and made a python script to automate data insertion.

schema

Branch and City are directly correlated, so just use the second one, which is less generic.

Customer Type and Gender are both related to customer that doesn't present data.

Tax and Total are redundant information for the database.

Date and Time are merged into datetime.

COGS and Gross Margin Percentage are directly correlated to Gross Income.

Analysis

The data is taken from the MySQL database called 'supermarket' and analyzed in general. In addition, total price is grouped by rating (k-means clustering) and also checked the trend of gross income per branch using time series and linear regression.

Note

This project is for educational proposals.

supermarket-sales's People

Contributors

aryelsoares avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.