You are on page 1of 2

Epson Hackaton

DB Requirements

1. Create below tables


Notes: All tables must have the following info:
CreatedBy – information who is the user/application who inserted the data in the
table/s.
CreatedOn – autogenerated; date when the data was inserted.
UpdatedBy – information who is the user/application that updates the record in the
table/s.
UpdateOn – date when the record was updated.

All tables must have unique ID.

Table Name Description


User Save user details such as name, address, and
contact number. UserID (unique ID) will be
automatically generated (PK).
StoreVisitHistory Save all the date/time that the user has
visited the stores.

This table includes the following columns:


RecordID – unique ID.
UserID – User Identifier
Temperature – User temperature upon
entering the store.
Transaction_Tbl In this table all transactions will be stored.
Such as BusinessUnit, TransactionDate,
TransactionID, PosID, TransactionType, and
Transaction Total Amount
Sales_Tbl Save all sales records including BuzUnit,
TransactionID, PosID, Barcode, qty, price,
TotalAmount, and NetAmount

TotalAmount = Sum qty * price


NetAmount = Sum qty * price - discount
Product_Tbl Save all product information such as
Business Unit, Product name, barcode,
department
Stock_Tbl Saved Stock available for each product.
Tender_Tbl Save all transaction tenders. Business unit,
transactionid, posid, tendered and change.

Create Stored Procedure for insertion of data in above tables.


Stored Procedure Parameters
SaveUser @Name, @Address, @ContactNo,
@CreatedBy, @UpdatedBy, @UpdatedOn
SaveVisitHistory @UserID, @Temperature, @CreatedBy,
@CreatedDate, @UpdatedOn
SaveTransaction @BuzUnit, @TransDate, @TransId, @PosID,
@TransType, @TotalAmt, @CreatedBy,
@UpdatedBy, @UpdatedOn
SaveSales @BuzUnit, @TransID, @PosID, @Barcode,
@Qty, @Price, @Discount, @CreatedBy,
@UpdatedBy, @UpdatedOn
SaveProduct @BuzUnit, @ProdCode, @ProdDesc, @Dept,
@CreatedBy, @UpdatedBy, @UpdatedOn
SaveStock @BuzUnit, @ProdCode, @Stock,
@CreatedBy, @UpdatedBy, @UpdatedOn
SaveTender @BuzUnit, @TransID, @PosID, @TenderID,
@Change, @CreatedBy, @UpdatedBy,
@UpdateOn
GetProductList Stored procedure should return product list
(Product ID
,Business Unit
,Product Code
,Product Description
,Product Department
,Product Unit Price
,Product Stock
,)based on below parameters:
@BuzUnit, @ProdCode

You might also like