0

Hello, I'm writing my first model and I wonder if someone can make sure it will work for my project. My one concern is that I had a fan trap and my solution leads to a potential chasm trap.

The objects are going to be business listings. Business listings may have genres, may have a category, but will always have a section. Some sections have categories, some don't. That's the problem. I need to be able to query my database by object properties, category, section, and genre. I'm thinking that for sections with no category I can make a category named NONE but that doesn't seem like much of an elegant solution.

If someone could see if my model looks ok and if anyone has any advise it'd help me out a lot.

Attachments dd.png 4.34 KB
3
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by claudia12
0

I see the relationships, but don't see the actual columns.
In the business table, you need the columns GENRE_ID, CATEGORY_ID, and SECTION_ID.

For the businesses without categories, you can just set the column to be null.

0

Indeed the table business should have the following columns:

genre it can be null
section it can be null
category not null

A section can have:
no category
only one category

In this case is ok to add to the table section the field category and it can be NULL

What is the relation between category and section?


A section can have more than one category?
A category can belong to more than one section?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.