You can design a "category-table", with an foreign-key on itself:
tbl_category
int id --primary key
int fk_parentCategory REFERENCES tbl_category.id --foreign key, can be null
char description
...
tbl_product
int id --primary key
int category --foreign key, can not be null
char name
...
The column fk_parentCategory
is an foreign-key, pointing on its own table (but a different category). It can also be null.
If null, it's a top-category. If not, its a subcategory.
You only have to care, that a category never points to itself. So the column id
must never have the same value as the column fk_parentCategory
.