| Author: Ankit 01 Oct 2008 | Member Level: Gold | Rating:    Points: 6 |
See in scenarion, create a table for category say "Category" where you have the CategoryId as primary Key and Category Name. Now Create another table for product say "Product" where have fields like ProductId(Primary Key), CategoryId(Foreign Key from Category Table) and product Description or any relevant field.
Now in this scenarion, first you need to enter data for Category and when you enter any product then select category first and then enter product.
In this way you can delete any product from Product table, but you will be able to delete category only in a condition when all corresponding productss has deleted from the product table.
|