Linh
Linh

Reputation: 1022

Unstructured database design

According to normal way, we design the table with fields. Example with an article the table can contain fields as follows: title, content, author.....

But how does everybody think if we add up some fields to a field?

Upvotes: 1

Views: 495

Answers (3)

Abe Miessler
Abe Miessler

Reputation: 85096

Your question is a bit confusing but if you are trying to hold multiple values in a field Mitch is right. If you REALLY have to do it you could use an XML column.

Here is a link to XML Support information for SQL Server 2005.

Upvotes: 0

egrunin
egrunin

Reputation: 25073

I think you mean:

MyTable
-------
int FieldA
int FieldB
int FieldSum

Where FieldSum is a calculated field, defined as the sum of FieldA and FieldB.

Is that correct?

Or do you mean changing this:

MyTable
-------
char LicensePlate
char Make
char Model

to this:

MyTable
-------
char LicensePlate
char MakeAndModel

In that case: why?

Upvotes: 0

Mitch Wheat
Mitch Wheat

Reputation: 300719

Holding multiple values in a column is a bad idea. It breaks 1st Normal form.

Upvotes: 3

Related Questions