inventory management
inventory management
AIM
To creating case study using any of the real life database application for
inventory management for e-mart grocery the daily report of the grocery shop.
DESCRIPTION
The entity supplier ,order has binded with stock,product entities with
foreign key.
All the entities are normalized and reduce duplicacy of records.
We have to implement indexing on each tables of inventory
management for faster query execution.
1. First Normal Form (1NF): This is the most basic level of normalization. In 1NF,
each table cell should contain only a single value, and each column should have a
unique name. The first normal form helps to eliminate duplicate data and
simplify queries.
2. Second Normal Form (2NF): 2NF eliminates redundant data by requiring that
each non-key attribute be dependent on the primary key. This means that each
column should be directly related to the primary key, and not to other columns.
3. Third Normal Form (3NF): 3NF builds on 2NF by requiring that all non-key
attributes are independent of each other. This means that each column should
be directly related to the primary key, and not to any other columns in the same
table.
4. Boyce-Codd Normal Form (BCNF): BCNF is a stricter form of 3NF that ensures
that each determinant in a table is a candidate key. In other words, BCNF
ensures that each non-key attribute is dependent only on the candidate key.
5. Fourth Normal Form (4NF): 4NF is a further refinement of BCNF that ensures
that a table does not contain any multi-valued dependencies.
6. Fifth Normal Form (5NF): 5NF is the highest level of normalization and involves
decomposing a table into smaller tables to remove data redundancy and
improve data integrity.
CREATE TABLE Products (
ProductID INT PRIMARY KEY,
ProductName VARCHAR(50),
Category VARCHAR(50),
Price DECIMAL(10,2)
);
Query OK, 0 rows affected (0.16 sec)
mysql> desc Products;
mysql>INSERT INTO Stock (ProductID, Quantity )VALUES (1, 100), (2, 50),(3, 200),
(4, 75),(5, 150),(6, 25),(7, 100),(8, 80),(9, 30), (10, 20);
Query OK, 10 rows affected (0.01 sec)
select *from Stock;
mysql> INSERT INTO Customers (CustomerID, CustomerName, Address, Phone)VALUES
(1, 'John','kk nagar', '555-1234'),(2, 'Jane','jk nagar', '555-5678'), (3, 'Bob', 'jj nagar', '555-
4321'),(4, 'Sara','mn nagar', '555-8765'),(5, 'Mike','ss nagar', '555-9876'), (6, 'Emily','rr nagar',
'555-2468'), (7, 'David','st nagar', '555-1357'),(8, 'Rachel','vo nagar', '555-3691'), (9, 'Tom','sk
nagar', '555-8024'),(10, 'Megan','ms nagar', '555-7410');
Query OK, 10 rows affected (0.02 sec)
select *from Customers;
mysql> SELECT *FROM Products WHERE Category = 'Fruit' AND Price BETWEEN 1.00
AND 5.00;
Error report -
ORA-20010: You cannot do manipulation
ORA-06512: at "HARINI.TRIGG1", line 2
ORA-04088: error during execution of trigger 'HARINI.TRIGG1'