CHANDIGARH UNIVERSITY
UNIVERSITY INSTITUTE OF COMPUTING
PROGRAM: MCA-LEET MM:10
SUBJECT: PYTHON PROGRAMMING TEST-2 TIME DURATION: 2 HOURS
SUBJECT CODE:CAT-760
Project Objective: As per the requirement from the client you are required to create a python
application as frontend and SqlLite/MySql as bachend for their inventory and sales maintenance.
Already the design team have completed the requirement design and you are expected the complete the
assigned modules.
Project Design:
Database Design: You are required to get the database ready using MySql/SqlLite
Task 1:
Create a table called TBL_STOCK with the given specification:
Column Name Type Description
Product_ID Varchar length 6 Primary Key
Product_Name Varchar length 20 Unique
Quauntity_On_Hand Number Should not be <0
Product_Unit_Price Number Should not be <0
ReOrder_Level Number Should not be <0
Create a table called TBL_SALES with the given specification
Column Name Type Description
Sales_ID Varchar length 6 Primary Key
Sales_Date Date
Product_ID Varchar length 6 Foreign key from TBL_STOCK
table
Quantity_Sold Number Should not be <0
Sales_Price_Per_Unit Number Should not be <0
Task 2
Enter sample records into TBL_STOCK table:
Product_ID Product_Name Quantity_On_Hand Product_Unit_Price ReOrder_Level
RE1001 REDMI Note 3 20 12000 5
Ip1002 Iphone 5 10 21000 2
PA1003 Panasonic P55 50 5500 5
Enter sample records into TBL_SALES table:
Sales_ID Sales_Date Product_ID Quantity_Sold Sales_Price_Per_Unit
RES1001 13-04-2020 RE1001 12 12750
IpS1002 12-04-2020 Ip1002 8 23450
PAS1003 11-04-2020 PA1003 23 5850
Application Design: Create a python application to manage the sales:
Create a python application to manage the sales and control the inventory.
Name of Module Usage
project.util Contains the class that establish the database connection
project.dao Contains the DAO classes that perform the real CRUD Operations
project.main Contains executable class with main program
Performs CRUD Operations.
Test cases:
1. Insert: If user inserting record in TBL_STOCK, then its corresponding entry must be in
TBL_SALES also.
2. Delete: If user trying to delete some entries from TBL_STOCK, then prompt message must
appear on console to inform user for delete its corresponding entry from TBL_SALES first.
3. Update: User is not allowed to update foreign key in TABL_SALES Table.
4. Corresponding datatypes and length should not be exceeded from mentioned limits. If user is
trying to do so, prompt message appears (Exception Handling)
5. Calculate how much profit a retailer earned on specific day.