Re: Order & meaning in a proposition

From: Anthony W. Youngman <wol_at_thewolery.demon.co.uk>
Date: Wed, 21 Apr 2004 21:50:24 +0100
Message-ID: <vmncCgBQ6thAFwkw_at_thewolery.demon.co.uk>


In message <wEZcc.9262$zM5.3375_at_newssvr32.news.prodigy.com>, Eric Kaun <ekaun_at_yahoo.com> writes
>> And then the translation to XML is quite obvious too. Get SQL, ODBC, and
>the
>> relational 1NF, uh, hogwash out of the middle -- it only makes for extra
>> steps. --dawn
>
>And doing a report of, say, students listed beneath their majors wouldn't
>require much work if you've nested majors inside students?

Nope. Just do a BY.EXP MAJOR instead of a BY STUDENT :-)

>Or perhaps
>listing students and the prereqs for a major, which would then require that
>"major" be a first-class "entity"?

If I understand correctly, then MAJOR would be both a foreign key in the STUDENT FILE, and a primary key in its own FILE with an attribute of PREREQ. So you turn the STUDENT FILE into a sort of a tree with PREREQ as a leaf (basically by declaring PREREQ as a "virtual attribute") and you can now list all students with their prereqs, or all prereqs with a list of students who need them. It's even possible (if not that wise) to do that on the fly.

Incidentally, if MAJOR is an entity in its own right (as opposed to merely an attribute of STUDENT) the first query would best be done by making STUDENTS a virtual attribute of MAJOR. And if MAJOR has attributes of its own it should not be part of the STUDENT FILE, but if a student is going to graduate with several majors in different years, there's no problem (indeed you should) put MAJOR (the student attribute) and YEAR together in the STUDENT FILE.

Cheers,
Wol

-- 
Anthony W. Youngman - wol at thewolery dot demon dot co dot uk
HEX wondered how much he should tell the Wizards. He felt it would not be a
good idea to burden them with too much input. Hex always thought of his reports
as Lies-to-People.
The Science of Discworld : (c) Terry Pratchett 1999
Received on Wed Apr 21 2004 - 22:50:24 CEST

Original text of this message