Skip to content

LishigaT/SQL-data-analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Task 4: SQL for Data Analysis

Objective:

  • Use SQL queries to extract and analyze data from an Ecommerce database.
  • Files in this Repository
  • sql_ecommerce4.sql - Contains database schema, sample data inserts, and SQL queries.
  • screenshots - Folder containing screenshots of query outputs.

Tools Used:

MySQL / PostgreSQL / SQLite (choose one depending on your setup)

Dataset Schema:

The database simulates an Ecommerce system with the following tables:

  • Customers (customer_id, name, email, city, country)
  • Products (product_id, product_name, category, price)
  • Orders (order_id, customer_id, order_date, status)
  • Order_Details (order_detail_id, order_id, product_id, quantity)

Steps to Run:

  1. Clone this repository:
  2. git clone
  3. cd

Open your SQL client (MySQL Workbench, pgAdmin, or SQLite Browser).

Import and run the SQL script:

SOURCE sql_ecommerce4.sql;

Verify tables and data:

SHOW TABLES;

SELECT * FROM Customers;

Queries Implemented

The SQL file includes:

SELECT, WHERE, ORDER BY, GROUP BY

INNER JOIN, LEFT JOIN, RIGHT JOIN

Subqueries

Aggregate functions (SUM, AVG)

Creating Views (Customer_Sales)

Index optimization

About

A simple data analysis using sql for a ecommerce data.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published