- Customers (CustomerID, FirstName, LastName, Email, Address, City, State, ZipCode, LastModified)
- Products (ProductID, ProductName, Category, Description, Price, LastModified)
- Stores (StoreID, StoreName, Address, City, State, ZipCode, LastModified)
- Orders (OrderID, CustomerID, StoreID, OrderDate, TotalPrice, LastModified)
- OrderDetails (OrderID, ProductID, Quantity, Price, LastModified)
Use ChatGPT or any other data generation method to populate the CSV files with random data for each table. Ensure that the data is realistic and consistent with the schema.
• Create an S3 bucket in your AWS account. • Upload these CSV files to the S3 bucket.
• Create a Redshift cluster in your AWS account. • Configure the necessary security groups, network settings, and access permissions. • Use the Redshift COPY command to load the data from the S3 bucket into the Redshift tables. Ensure that the tables are created in Redshift with the same schema as in the csv file.
• Create a star schema for retail sales. • Write SQL queries to transform the data from the relational schema into a star schema using SCD Type 2. Perform the necessary data transformations to populate these tables with the appropriate historical changes using SCD Type 2. • Update and Insert (upsert) the updated data in the star schema using staging tables. • It is assumed that every table will have a directory in S3 and a new file will be uploaded each time there’s an update in the data. There will be a new file in S3 location.
Write SQL queries to extract insights from the transformed star schema. Top Selling Products: Find the top 10 best-selling products based on the total quantity sold. Include the product name, category, and the total quantity sold.
Determine the monthly sales trend by calculating the total sales revenue for each month in a given year. Sales Performance Comparison: Compare the sales performance of different stores by calculating the total sales revenue for each store. Rank the stores based on their sales revenue.
Analyze the seasonal sales patterns by calculating the total sales revenue for each quarter of a given year. Identify the quarter with the highest sales revenue. Average Order Value: Calculate the average order value by dividing the total sales revenue by the total number of orders. Analyze the average order value trends over time and identify any significant changes.
Analyze the sales performance based on store location by calculating the total sales revenue for each city or state
Dimesional Modelling Flow Diagram