This is a perfect example of the limitations of relational designs. What you need is a something that can model transitive hierarchies (If I'm in digital cameras, then I'm in cameras, and if I'm in cameras than I'm in electronics, and if I'm in electronics than I'm in Products, etc...) and self-describing schemas. What you basically want is RDF, or some variation of it.

The transitive hierarchies give you the ability to process queries like "Find me electronics" and know that a digital camera is a type of electronics. The self describing schema lets you add new types of products, categories, and attributes without redesigning your db. Also, this type of model lets you have sparse attributes without wasting space with null values.

You can store <id, property, value> triples in a three column table. On of those properties is a special "category" property that is transitive. You probably wan to precompute the closure since inferring it at query time involves an unknown number of SQL queries (or a recursive SQL query).

You could try an RDF store if you don't want to build the logic for this yourself (Something like Jena or Virtuoso). They generally take SPARQL queries (I think virtuoso will process SQL as well though).

I could babel about these types of data models for days, so just ask if there's some other info you want.