All the records mentioned in the Sheet have been added in their respective table in SQLite database. using Querry.sql
Futher on going into questions Postman has been used to GET/ POST the records as per the requirements.
-
Create an API to perform operations on Sales, Product Master, and Branch Master to get required results -> It can be found on http://127.0.0.1:8000/JoinOperationAPI below is the image of Json records fetched from Postman with Date, ProductID, BranchID, Price, Quantity, ProductName, Category, BranchName, City column respectively.
-
Create an API and use Purchase Orders to calculate the following 2 things: a.) Add a column ‘lead time’: Lead time is the difference between the received date and the ordered date in days
-> This column has been fetched from API(http://127.0.0.1:8000/LeadTimeAPI) and in sql Querry both image of which can be found belowb.)Calculate lead time average for each Product ID-Branch ID-Supplier ID combination.
-> The below json records are in ProductID,BranchId,SupplierId,AvgLeadTime column wise respectively -
Create an API to insert a new Sales record Previous records in Sales Table (http://127.0.0.1:8000/sales)
New record Date Product ID Branch ID Price Quantity '2021-11-03', 1, 100, 10, 150 Added using POST method