Received: from oxmail.ox.ac.uk (oxmail2.ox.ac.uk [163.1.2.1]) by hub.org (8.9.3/8.9.3) with ESMTP id FAA87784 for ; Wed, 16 Feb 2000 05:33:44 -0500 (EST) (envelope-from moray.mcconnachie@computing-services.oxford.ac.uk) Received: from ermine.ox.ac.uk ([163.1.2.13]) by oxmail.ox.ac.uk with esmtp (Exim 2.10 #1) id 12L1lZ-0005Qm-00; Wed, 16 Feb 2000 10:33:05 +0000 Received: from ermine.ox.ac.uk ([163.1.2.13] helo=moraypc ident=root) by ermine.ox.ac.uk with smtp (Exim 3.13 #1) id 12L1lZ-0003nL-00; Wed, 16 Feb 2000 10:33:05 +0000 Message-ID: <00da01bf7869$57d32da0$760e01a3@oucs.ox.ac.uk> From: "Moray McConnachie" To: "Chris" , "James Macken" Cc: References: <000801bf7860$ee1c7860$ad7d2bcb@jay> <38AA7601.16B5BCB6@bitmead.com> Subject: Re: [SQL] How to set up a simple relational database Date: Wed, 16 Feb 2000 10:34:02 -0000 Organization: Oxford University MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 > create table staff (name text, packageid int); > create table package (id int, amount text); > SELECT * from staff, package where staff.packageid=package.id; But that omits the "establish the relationship part", by which I suspect James means "ensure foreign key integrity". I must I admit I would like to see a simple exposition of that (using the refint package, presumably) for this example - or is it not worth it if 7.0 is bringing native foreign key integrity checks? > James Macken wrote: > > > > Can someone demonstrate for me how to set up a simple relational database > > using the psql interactive prompt and two tables.