Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have several types of writings: articles, projects, reviews, etc.

I have a table containing paragraphs (fields id (INT) and partext (TEXT)).

Each writing consists of several (ordered) paragraphs. So a description of a writing is a table consisting of fields id, seq (sequential number of the paragraph in the writing), par (the ID of the paragraph).

My question: Should I create a table for each kind of writings (individual tables for articles, projects, reviews, etc.) or create one table with ENUM field specifying whether it is an article, project, review, etc.?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

Create one table to house all of the writing types, and use a foreign key relationship to a type table.

The most dominant reason to do this is because what happens when you want to add another writing type (say, "dictionary")? You'd have to add another table, and most likely alter application code.

Not fun, and a bad design. Go with one table and a type field.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.