Re: 3NF question
Date: 10 Jan 2005 21:46:40 -0800
Message-ID: <1105422400.624110.88370_at_f14g2000cwb.googlegroups.com>
> Let's say I've got a table, named USERS: Id, Login, Pass, Descr ...
Below script (for experimental db) allows each user to have multiple loginIDs and each loginID to have multiple passwords and each login/password to have multiple descriptions.
// Create items in directory to classify things.
(CREATE *user.item ~in = dir)
(CREATE *login.item ~in = dir)
(CREATE *pwd.item ~in = dir)
(CREATE *descr.item ~in = dir)
// Create a user with 2 user names, // the first of which has one password, // the second of which has two passwords.
(CREATE *john.cls = user)
(CREATE it.login = +john1)
(CREATE (it.login=john1).pwd = +secret1)
(CREATE ((it.login=john1).pwd=secret1).descr = +comment1)
(CREATE it.login = +john2)
(CREATE (it.login=john2).pwd = +secret2a)
(CREATE ((it.login=john2).pwd=secret2a).descr = +comment2)
(CREATE (it.login=john2).pwd = +secret2b)
(CREATE ((it.login=john2).pwd=secret2b).descr = +comment2a1)
(CREATE ((it.login=john2).pwd=secret2b).descr = +comment2a2)
// Create user Mary,
// if login mary456 and pwd secret777 doesn't already exist.
(IF ((%.login=mary456).pwd=secret777)
T ()
E ((CREATE *mary.cls=user & it.login=+mary456)
(CREATE (mary.login=mary456).pwd=+secret777))
)
Received on Tue Jan 11 2005 - 06:46:40 CET