|
A typical table description is given with the free sample, a classical problem in today organisations : everybody want to have their newsletter for their users. To compose a newsletter, you need to associate differents pieces together like in a puzzle. |
create table news
(
id_news int(11) auto_increment,
title varchar(255),
date_edition date
);
|
create table news_article
(
id_news_article int(11) auto_increment,
id_news int(11),
html_text blob,
author varchar(255)
);
|
|
Suppose that the article is also an agglomerate of other entities, for example: many authors, many paragraph, many illustrations etc. (instead of beeing one html field and one author), then you need to have again sub-tables: news_article_author, news_article_paragraph, news_article_illustration and maybe news_article_weblinks. |
create table news_article_weblinks
(
id_news_article_weblinks
int(11) auto_increment,
id_news_article int(11),
url varchar(255),
anchor varchar(255)
);
|
... news_article_illustration
(
id_news_article_illustration
int(11) auto_increment,
id_news_article int(11),
file_name_sys varchar(255),
file_content blob,
file_size int(11)
);
|