Re: DBDesign Q2:

From: Vlad Vissoultchev <wqweto_at_nospam.myrealbox.com>
Date: Thu, 27 Nov 2003 21:58:40 +0200
Message-ID: <ewV1pBStDHA.1884_at_TK2MSFTNGP10.phx.gbl>


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" <REMOVE_BEFORE_REPLYING_dportas_at_acm.org> wrote in message news:Bp6dna5zxsvBf1iiRVn-hQ_at_giganews.com...
> 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
> --
>
>
Received on Thu Nov 27 2003 - 20:58:40 CET

Original text of this message