Usenet.com

www.Usenet.com

Group Index

Comp Thread Archive from Usenet.com

<-- __Chronological__ --> <-- __Thread__ -->

Re: DBDesign Q2:



well,

i just can't image how these two can be used! can you continue your sample
and try to populate the tables with some sample data.

</wqw>

"David Portas" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> The following seems to match your business rules. Treat Department Manager
> as an attribute of the Department rather than the Employee.
>
> CREATE SCHEMA AUTHORIZATION dbo
>
> CREATE TABLE Employees (empno INTEGER PRIMARY KEY, deptno INTEGER NOT NULL
> REFERENCES Departments (deptno), UNIQUE (deptno, empno))
>
> CREATE TABLE Departments (deptno INTEGER PRIMARY KEY, deptname VARCHAR(20)
> NOT NULL UNIQUE, deptmanager_empno INTEGER NOT NULL, FOREIGN KEY (deptno,
> deptmanager_empno) REFERENCES Employees (deptno, empno))
>
> The usual caveat about design questions applies: it's very difficult to
give
> design advice online without the opportunity to research a particular
> situation in detail.
>
> -- 
> David Portas
> ------------
> Please reply only to the newsgroup
> --
>
>





<-- __Chronological__ --> <-- __Thread__ -->


Usenet.com



Please check out one of the premium Usenet Newsgroup Service Providers below for access to Usenet.