For an example the current database has a category table, sub category table and a data table where each row has a relevant category_id and sub category id as foreign keys.