SQL question

From: Bernhard Nemec <nemec_at_mem.unibe.ch>
Date: 2000/05/09
Message-ID: <3917D70A.E382026D_at_mem.unibe.ch>#1/1


My database contains information about "samples" that are stored in "racks". Every "rack" has a capacity ("size"). The positions in a rack are numbered. A rack does not have to be filled in sequentially, i. e. there may be a sample at position 3 and one at position 11 while the rest of the rack remains empty.
I have the following tables:

SAMPLES(
ID:INTEGER NOT NULL,
RACK:INTEGER NOT NULL,
POSITION_IN_RACK: INTEGER NOT NULL
);

RACKS(
ID:INTEGER NOT NULL,
SIZE:INTEGER NOT NULL
);

My question: how can I retrieve a list of all free positions in a certain rack? I want to write an sql query with a resulting table of the form

FREEPOSITIONS(
RACK:INTEGER,
POSITION:INTEGER
);

Any hints are welcome.

Thanks,
Bernhard Received on Tue May 09 2000 - 00:00:00 CEST

Original text of this message