Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: database correctly?
On Sun, 13 Apr 2003 12:38:19 GMT, "Danny Stollé" <d.stolle_at_info.inf>
wrote:
>I have this small problem which drives me crazy (already)
>
>having an employees table which inholds the employee_nr and employee_nm
>having a reports table which holds report properties, but also inholds the
>creator, controler, releasor and the beneficiary who holds a copy of the
>report.
>
>now all of the persons are employees of the company so they all are having
>an employee_nr.
>
>now ....
>
>is it better to have 4 tables which are the connection tables between the
>employees and the reports table? like: table_creators, table_controlers,
>table_releasors, table_beneficiaries?
>
>would it be database correctly (i don't think so, but it questions me) to
>have this contruction:
>if you only have one creator, controler and one releasor both fields in the
>report table and not constraining as a foreign key to the employees table
>and because there are more beneficiaries a table between the reports and
>beneficiaries table?
>
>the problem would be that the table won't be consistant anymore; while the
>first theorie is more consistant and better to manage. but what about the
>indexes? won't i get to many indexes on both table reports and employee
>(because more tables are in this database). whats maximum advisable on one
>field of one table?
>
>am i theoretically correctly?
>
>thanx in advance,
>Danny
>
If there are 4 n:m relationships between reports and employees you
*must* have 4 junction tables.
Ithere are only 1:n relationships from employees to reports, there are
4 foreign keys from reports to employees and you shouldn't have 4
junction tables.
You might also consider to do 2 things:
- buy a decent book about normalization
- obviously English is not your native language, your post is a bit
incomprehensible. My gut feeling is you are Dutch, so you might
consider to post this in Dutch again.
Sybrand Bakker, Senior Oracle DBA
To reply remove -verwijderdit from my e-mail address Received on Sun Apr 13 2003 - 08:29:31 CDT
![]() |
![]() |