views:

38

answers:

3

Hello;

I have design a magazine online and worry that is it the best approch or at least a good approch or no,the magazine contains articles+news in all subjects, i have one table for both articles+news ,but i would like to know that is this good or i must separate articles and news (it is clear that beside the main table there are several tables for categories ,tags,and photos and tables for relation between these tables)?

Thanks

A: 

I would say, that depends on your schema for the articles and news and how you create new ones.

If articles and news share the same columns (or the have most columns in common) you can use one table and just have a column that distinguishes between article and news.

For creating new entries: Do you have a single form in your backend where the author can decide wether the entry should be an article or a news entry?

If you have different forms because articles and news have different properties, you should consider to create separate tables.

Do you consider articles and news to be basically the same or do they have even different business logic?


Edit after comment:
I meant if you do something different with them like e.g. there is email notification if a new article is created. I assume you don't have that.
If they have the same properties, then there is no need to create an extra table.
Nevertheless, having two different tables might be a better choice if you make changes to your system in the future (e.g. one day you realize that you need other properties for articles that don't make sense for news).

Felix Kling
I manually fill the table for articles and news and both are the same in properties.Please let me about your mean ragarding "they have even different business logic"
A: 

See very similar question-answer here.

Damir Sudarevic
A: 

the best way to design a database schema is to think not in terms of tables, columns and rows, but in terms of sets and boolean functions. the sql terminology is hopelessly confusing.

just somebody