Re: why hierarchy?

From: Neo <neo55592_at_hotmail.com>
Date: 1 Aug 2006 11:21:28 -0700
Message-ID: <1154456488.157200.103420_at_p79g2000cwp.googlegroups.com>


> www.intelligententerprise.com/db_area/archives/1999/991105/online2.jhtml;jsessionid=4J3MNANICW05WQSNDLRCKHSCJUNN2JVN
>
> The above article compares CODASYL Network to RM.

In the above article, an employee/salary/dept example is used to show that SQL for RMDB is easier than the queries for CODASYL Network Dbs. If someone is willing, I can show that dbd's is simpler than SQL to find specific things (vs things greater than, less than, avg of, etc) as the example is extended to meet new data requirements. Anyone willing to post the RM/SQL for comparision with dbd?

RMDB:

T_Emp (emp#, name, dept, salary);
Insert (123, john, finance, 100);
Insert (456, mary, safety, 200);

SELECT * FROM T_Emp WHERE (dept = safety) AND (salary = 200);

DBD:
(new 'emp#)
(new 'dept)
(new 'salary)

(new 'john 'employee)
(create (it) emp# (val+ '123))
(create (it) dept (val+ 'finance))
(create (it) salary (val+ '100))

(new 'mary 'empolyee)
(create (it) emp# (val+ '456))
(create (it) dept (val+ 'safety))
(create (it) salary (val+ '200))

(and (select employee instance *) (select * dept safety) (select *
salary 200)) Received on Tue Aug 01 2006 - 20:21:28 CEST

Original text of this message