2

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.?

3

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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