🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.delphi.database
Article #179

Database Structure Help

#179
From: P Smith
Date: Sat, 25 Oct 2008 21:29
50 lines
2311 bytes
Hi all

Need some help if someone can take a look at this for me:

I'm writing a system which needs to select from a list of locations,
buildings and departments from 3 comboboxes, basically, three tables:

Locations:
LocationID	LocationName
------------	-----------------
1		Manchester
2		Birmingham
3		Chester


Buildings
BuildID		BuildName
--------		------------
1		Main
2		Works
3		Labs
4		HR

Departments
DeptID		DeptName
--------		------------
1		Shipping
2		Sales
3		Postal
4		Development

Probably about 200 or so locations and about 3,000 buildings and
departments. Each "ID" field is auto number. Each location can only
have a specific number of buildings and specified departments within
the buildings.

I have a complete list of locations, buildings and departments, so to
assign them the sites I'll need an intermediate table like this:

Site_Int
SiteID		BuildID		DeptID
-------		--------		--------	
1		2		1
1		3		2

Can someone suggest a better way I might do this?

Many thanks

P Smith
Technical Details
Message-ID: <md17g4hejkbe8gq4osbdqiau4p655buk98@4ax.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local02.nntp.dca.giganews.com!nntp.bt.com!news.bt.com.POSTED!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 115d96,a95056f439a3bff1,start
X-Google-Attributes: gid115d96,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local02.nntp.dca.giganews.com!nntp.bt.com!news.bt.com.POSTED!not-for-mail
NNTP-Posting-Date: Sat, 25 Oct 2008 16:29:31 -0500
From: P Smith <d_g_j@bootle.com>
Newsgroups: borland.public.delphi.database
Subject: Database Structure Help
Date: Sat, 25 Oct 2008 22:29:37 +0100
Message-ID: <md17g4hejkbe8gq4osbdqiau4p655buk98@4ax.com>
X-Newsreader: Forte Agent 3.1/32.783
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 50
X-Usenet-Provider: http://www.giganews.com
X-AuthenticatedUsername: NoAuthUser
X-Trace: sv3-gTBG4GAIWKAnLPNJkw6oaM7Zn5W9a/hfwIioBL8AnY83V4lOCcUE1omIdEwXqKKqIn1TRWmNEQYVa+7!mIkGwrnJtF/qpBkwoVQ5bzlvKGfP0WV6jme7jDfmmryeQdhUWCoG7wr89u8O/uxCXOmMMCJs0T5t!NMFE
X-Complaints-To: abuse@btinternet.com
X-DMCA-Complaints-To: abuse@btinternet.com
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.39