Presentation by: Archana Jha
(NI1302/075/15)
Submitted to: Rani Ojha
 Any E-commerce
website data is their
product.
 Flipkart is an E-
commerce website
started in 2007 by
Bansal brothers.
 Now became India’s
most visiting online
shopping site.
 A pool of multiple
database which handled
by DBA using Sql and
NoSql databases.
 Requirement Analysis for database designing
using DBA’s perspective.
 Testing of Designed Database.
 Database for the “Product Section of Flipkart
Website.
Components of Flipkart Database:-
1. Customer Management
2. Product Management
3. Order Processing and Management
4. Shipment Management
5. Warehouse Management
6. Seller Management
7. Payment Management
REQUIREMENT 1:-
Products Should be categorized in Categories
and Sub-Categories
Cont…..
DBA Perspective:-
Creation of separate lookup tables with one
to one relationship for categories and sub-
categories.
Table Schema for Category:-
CREATE TABLE [dbo].
[M_Product_Category]( [Id] [bigint] IDENTITY(1,1) NOT NULL,
[Product_Type] [nvarchar](50) NOT NULL, [Description]
[nvarchar](100) NULL,
[Updated_By] [nvarchar](50) NULL,
[IsActive] [bit] NULL,
[Last_Updated_Date] [datetime] NULL)
Table Schema for Sub-Category:-
CREATE TABLE [dbo].
[M_Product_SubCategory]( [Id] [bigint] IDENTITY(1,1) NOT NULL,
[FK_Product_Id] [bigint] NOT NULL,
[Product_Sub_Category] [nvarchar](100) NULL,
[Description] [nvarchar](200) NULL,
[Updated_By] [nvarchar](50) NULL,
[Last_Updated_Date] [datetime] NULL,
[IsActive] [bit] NULL)
REQUIREMENT 2:-
1. Product which is getting sold could be in
KG, UNIT or LITRES or in Pound, etc...
2. Product can be sold in any kind of currency
like be it in $, be it in EURO or INR, etc…
DBA Perspective:-
Expecting very less amount of data in this
table for future so will just create two
separate lookups.
Table Schema for Unit Related:-
CREATE TABLE [dbo].
[M_Price_Decision_Factor]( [Id] [bigint] IDENTITY(1,1) NOT
NULL,
[Price_Decision_Factor] [nvarchar](50) NULL, [Description]
[nvarchar](500) NULL,
[Updated_By] [nvarchar](50) NULL,
[Last_Updated] [datetime] NULL, [IsActive] [bit] NULL)
Table Schema for Currency Related:-
CREATE TABLE [dbo].
[M_Currency_Domiance]( [Id] [bigint] IDENTITY(1,1) NOT NULL,
[Currency_Type] [nvarchar](50) NULL,
[Description] [nvarchar](200) NULL,
[Updated_By] [nvarchar](50) NULL,
[Last_Updated] [datetime] NULL,
[IsActive] [bit] NULL)
REQUIREMENT 3:-
1.Every product information should come up
with its seller’s information.
2. Generalization at seller level in order to
distinguish between different kind of sellers.
3. Every product information may contain
maximum 5 images.
DBA Perspective:-
1. Lookup table for seller category
2. Lookup table for sub-category of seller.
3. Lookup tables for pictures.
Table Schema for Seller Category:-
CREATE TABLE [dbo].
[M_Seller_Category]( [Id] [bigint] IDENTITY(1,1) NOT NULL,
[Seller_Category] [nvarchar](100) NULL,
[Description] [nvarchar](500) NULL,
[Last_Updated] [datetime] NULL,
[Updated_By] [nvarchar](100) NULL,
[IsActive] [bit] NULL)
Table Schema for Sub-Seller Category:-
CREATE TABLE [dbo].
[M_Seller_SubCategory]( [Id] [bigint] IDENTITY(1,1) NOT NULL,
[FK_Seller_Id] [bigint] NULL,
[Seller_Sub_Category] [nvarchar](50) NULL,
[Description] [nvarchar](200) NULL,
[Updated_By] [nvarchar](50) NULL,
[Last_Updated] [datetime] NULL,
[IsActive] [bit] NULL)
Table Schema for Picture Category:-
CREATE TABLE [dbo].
[M_Product_Image_Details]( [Id] [bigint] IDENTITY(1,1) NOT
NULL,
[FK_Product_Id] [bigint] NOT NULL,
[Product_Image_1] [nvarchar](300) NULL,
[Product_Image_2] [nvarchar](300) NULL,
[Product_Image_3] [nvarchar](300) NULL,
[Updated_By] [nvarchar](50) NULL,
[Last_Updated] [datetime] NULL,
[IsActive] [bit] NULL)
REQUIREMENT 4:-
1. A product can have multiple varients and for
each varient product, price will differ.
2. A Product can have discount.
DBA Perspective:-
DBA proposed schema for product details
Table Schema for Varient Category:-
CREATE TABLE [dbo].
[M_Product_Varients]( [Id] [bigint] IDENTITY(1,1) NOT NULL,
[Varient_Name] [nvarchar](50) NULL,
[Varient_Description] [nvarchar](100) NULL,
[Updated_By] [nvarchar](50) NULL,
[Last_Update] [datetime] NULL,
[IsActive] [bit] NULL)
Table Schema for Values of Varient Category:-
CREATE TABLE [dbo].
[Product_Varient_Value]( [Id] [bigint] IDENTITY(1,1) NOT NULL,
[FK_Varient_Id] [bigint] NULL,
[Varient_Value] [nvarchar](50) NULL,
[Description] [nvarchar](max) NULL,
[Updated_By] [nvarchar](50) NULL,
[Last_Updated_Date] [datetime] NULL,
[IsActive] [bit] NULL)
The final query will be as follows:-
SELECT
Product.Product_Name, Product.Description, Product.Price, Product.SKU,
Product_Varient_Value.Varient_Value,Seller.Seller_Sub_Category,
Currency.Currency_Type,Price_Decision.Price_Decision_Factor,
Product.Availability_Count, Product.Percentage_Discount,
Product.Special_Offer_Price,Product.Special_Offer_Minimum_Quantity,
Product.Special_Offer_Maximum_Quantity,Product.Special_Offer_Discount_Factor,
Product.Minimum_Allowed_Buy_Quantity,Product.Maximum_Allowed_Buy_Quantity,
Subcategory.Product_Sub_Category,M_Product_Category.Product_Type FROM Product
INNER JOIN Product_Varient_Value ON Product.FK_Product_Varient =
Product_Varient_Value.Id Inner Join M_Seller_SubCategory Seller ON
Seller.Id=Product.FK_Seller_Id inner join M_Currency_Domiance Currency on
Currency.Id=Product.FK_Currency_Dominance inner join M_Price_Decision_Factor
Price_Decision ON Price_Decision.Id=Product.FK_Price_Decision_Factor inner join
M_Product_SubCategory Subcategory ON
Subcategory.Id=Product.FK_Product_Subcategory inner join M_Product_Category
M_Product_Category ON M_Product_Category.Id=Subcategory.FK_Product_Id Where
Product.IsActive=1
By this presentation we conclude that a DBA
has to manage all database in different-
different multiple lookups and all these
lookups are connected with foreign keys. It
not only helpful to manage database in an
appropriate manner, also reduce time of
query execution and provide all necessary
information to user in a short period.
Flipkart product management database model with dba perspective

Flipkart product management database model with dba perspective

  • 1.
    Presentation by: ArchanaJha (NI1302/075/15) Submitted to: Rani Ojha
  • 2.
     Any E-commerce websitedata is their product.  Flipkart is an E- commerce website started in 2007 by Bansal brothers.  Now became India’s most visiting online shopping site.  A pool of multiple database which handled by DBA using Sql and NoSql databases.
  • 3.
     Requirement Analysisfor database designing using DBA’s perspective.  Testing of Designed Database.  Database for the “Product Section of Flipkart Website.
  • 4.
    Components of FlipkartDatabase:- 1. Customer Management 2. Product Management 3. Order Processing and Management 4. Shipment Management 5. Warehouse Management 6. Seller Management 7. Payment Management
  • 5.
    REQUIREMENT 1:- Products Shouldbe categorized in Categories and Sub-Categories
  • 7.
  • 8.
    DBA Perspective:- Creation ofseparate lookup tables with one to one relationship for categories and sub- categories. Table Schema for Category:- CREATE TABLE [dbo]. [M_Product_Category]( [Id] [bigint] IDENTITY(1,1) NOT NULL, [Product_Type] [nvarchar](50) NOT NULL, [Description] [nvarchar](100) NULL, [Updated_By] [nvarchar](50) NULL, [IsActive] [bit] NULL, [Last_Updated_Date] [datetime] NULL)
  • 9.
    Table Schema forSub-Category:- CREATE TABLE [dbo]. [M_Product_SubCategory]( [Id] [bigint] IDENTITY(1,1) NOT NULL, [FK_Product_Id] [bigint] NOT NULL, [Product_Sub_Category] [nvarchar](100) NULL, [Description] [nvarchar](200) NULL, [Updated_By] [nvarchar](50) NULL, [Last_Updated_Date] [datetime] NULL, [IsActive] [bit] NULL)
  • 10.
    REQUIREMENT 2:- 1. Productwhich is getting sold could be in KG, UNIT or LITRES or in Pound, etc... 2. Product can be sold in any kind of currency like be it in $, be it in EURO or INR, etc…
  • 11.
    DBA Perspective:- Expecting veryless amount of data in this table for future so will just create two separate lookups. Table Schema for Unit Related:- CREATE TABLE [dbo]. [M_Price_Decision_Factor]( [Id] [bigint] IDENTITY(1,1) NOT NULL, [Price_Decision_Factor] [nvarchar](50) NULL, [Description] [nvarchar](500) NULL, [Updated_By] [nvarchar](50) NULL, [Last_Updated] [datetime] NULL, [IsActive] [bit] NULL)
  • 12.
    Table Schema forCurrency Related:- CREATE TABLE [dbo]. [M_Currency_Domiance]( [Id] [bigint] IDENTITY(1,1) NOT NULL, [Currency_Type] [nvarchar](50) NULL, [Description] [nvarchar](200) NULL, [Updated_By] [nvarchar](50) NULL, [Last_Updated] [datetime] NULL, [IsActive] [bit] NULL)
  • 13.
    REQUIREMENT 3:- 1.Every productinformation should come up with its seller’s information. 2. Generalization at seller level in order to distinguish between different kind of sellers.
  • 15.
    3. Every productinformation may contain maximum 5 images.
  • 16.
    DBA Perspective:- 1. Lookuptable for seller category 2. Lookup table for sub-category of seller. 3. Lookup tables for pictures. Table Schema for Seller Category:- CREATE TABLE [dbo]. [M_Seller_Category]( [Id] [bigint] IDENTITY(1,1) NOT NULL, [Seller_Category] [nvarchar](100) NULL, [Description] [nvarchar](500) NULL, [Last_Updated] [datetime] NULL, [Updated_By] [nvarchar](100) NULL, [IsActive] [bit] NULL)
  • 17.
    Table Schema forSub-Seller Category:- CREATE TABLE [dbo]. [M_Seller_SubCategory]( [Id] [bigint] IDENTITY(1,1) NOT NULL, [FK_Seller_Id] [bigint] NULL, [Seller_Sub_Category] [nvarchar](50) NULL, [Description] [nvarchar](200) NULL, [Updated_By] [nvarchar](50) NULL, [Last_Updated] [datetime] NULL, [IsActive] [bit] NULL)
  • 18.
    Table Schema forPicture Category:- CREATE TABLE [dbo]. [M_Product_Image_Details]( [Id] [bigint] IDENTITY(1,1) NOT NULL, [FK_Product_Id] [bigint] NOT NULL, [Product_Image_1] [nvarchar](300) NULL, [Product_Image_2] [nvarchar](300) NULL, [Product_Image_3] [nvarchar](300) NULL, [Updated_By] [nvarchar](50) NULL, [Last_Updated] [datetime] NULL, [IsActive] [bit] NULL)
  • 19.
    REQUIREMENT 4:- 1. Aproduct can have multiple varients and for each varient product, price will differ. 2. A Product can have discount.
  • 20.
    DBA Perspective:- DBA proposedschema for product details
  • 22.
    Table Schema forVarient Category:- CREATE TABLE [dbo]. [M_Product_Varients]( [Id] [bigint] IDENTITY(1,1) NOT NULL, [Varient_Name] [nvarchar](50) NULL, [Varient_Description] [nvarchar](100) NULL, [Updated_By] [nvarchar](50) NULL, [Last_Update] [datetime] NULL, [IsActive] [bit] NULL)
  • 23.
    Table Schema forValues of Varient Category:- CREATE TABLE [dbo]. [Product_Varient_Value]( [Id] [bigint] IDENTITY(1,1) NOT NULL, [FK_Varient_Id] [bigint] NULL, [Varient_Value] [nvarchar](50) NULL, [Description] [nvarchar](max) NULL, [Updated_By] [nvarchar](50) NULL, [Last_Updated_Date] [datetime] NULL, [IsActive] [bit] NULL)
  • 25.
    The final querywill be as follows:- SELECT Product.Product_Name, Product.Description, Product.Price, Product.SKU, Product_Varient_Value.Varient_Value,Seller.Seller_Sub_Category, Currency.Currency_Type,Price_Decision.Price_Decision_Factor, Product.Availability_Count, Product.Percentage_Discount, Product.Special_Offer_Price,Product.Special_Offer_Minimum_Quantity, Product.Special_Offer_Maximum_Quantity,Product.Special_Offer_Discount_Factor, Product.Minimum_Allowed_Buy_Quantity,Product.Maximum_Allowed_Buy_Quantity, Subcategory.Product_Sub_Category,M_Product_Category.Product_Type FROM Product INNER JOIN Product_Varient_Value ON Product.FK_Product_Varient = Product_Varient_Value.Id Inner Join M_Seller_SubCategory Seller ON Seller.Id=Product.FK_Seller_Id inner join M_Currency_Domiance Currency on Currency.Id=Product.FK_Currency_Dominance inner join M_Price_Decision_Factor Price_Decision ON Price_Decision.Id=Product.FK_Price_Decision_Factor inner join M_Product_SubCategory Subcategory ON Subcategory.Id=Product.FK_Product_Subcategory inner join M_Product_Category M_Product_Category ON M_Product_Category.Id=Subcategory.FK_Product_Id Where Product.IsActive=1
  • 26.
    By this presentationwe conclude that a DBA has to manage all database in different- different multiple lookups and all these lookups are connected with foreign keys. It not only helpful to manage database in an appropriate manner, also reduce time of query execution and provide all necessary information to user in a short period.