Re: Data Redundancy

From: B Faux <nospam_at_nospam.net>
Date: Wed, 15 Feb 2006 20:28:20 GMT
Message-ID: <E9MIf.14911$tb3.5677_at_newssvr24.news.prodigy.net>


"cybose" <vtbose_at_gmail.com> wrote in message news:1140033241.584027.204230_at_f14g2000cwb.googlegroups.com...
>A Relation has the following two entities - Employee & Department.
>
> A snapshot of the data could be -
>
> Employee. Dept.
> A 001
> A 002
> A 003
> B 001
> B 005
> C 001
> C 002
> .
> .
> .
>
> An employee can belong to multiple departments and a department can
> have multiple employees. How can I model this with the least amount of
> redundancy ?
>

Cybose;

What's your platform? You wanna go with SQL (whose flavor), some DBMSs can model this quite easily with almost no redundancy, others make you repeat almost everything. And then you get to index the whole thing for ad hoc search.

In my world (MV), you would have an employee file (table) with a department attribute (row) that allows for an unlimited number of departments. Then you would also have a department file that would allow for an unlimited number of employees. The only cross-loaded data would be the employee ids in the department records and the department ids in the employee records. All of the other stuff that just pertains to the department or employee remains ONLY in its respective record and is extracted as needed from the other file using the appropriate id(s). Done...

But if you are using MySQL it may take more effort, but Disc is cheap why worry?

BFaux ;-) Received on Wed Feb 15 2006 - 21:28:20 CET

Original text of this message