Re: Other attributes besides type,precision,scale
Date: 30 Mar 2005 18:17:43 -0800
Message-ID: <1112235463.840336.36140_at_z14g2000cwz.googlegroups.com>
Following script for an experimental db (XDb3) models companies/vendors with 0-to-many websites and websites with 0-to-many IP Addresses. Sample queries at end.
// Create types.
(CREATE type inst *company) (CREATE type inst *vendor) (CREATE type inst *website) (CREATE type inst *ipAddr)
// Create a company/vendor that doesn't have a website.
(CREATE company inst *compaq
& vendor inst it)
// Create a company/vendor that has a website.
(CREATE company inst *dell
& vendor inst it & it website *www.dell.com)
// Create a company/vendor that has two websites
// the first of which has two IP addresses.
(CREATE company inst *oracle
& vendor inst it & it website (CREATE website inst *www.oracle.com & it ipAddr +66.123.45.33 & it ipAddr +66.123.45.34) & it website *www.db.com)
// Find vendors that have a website.
// Finds dell and oracle.
(SELECT vendor inst *
& * website)
// Find companies whose website's ipAddr is 66.123.45.33.
// Finds oracle.
(SELECT company inst *
& * website (* ipAddr 66.123.45.33))
// Find oracle's websites' ipAddrs.
// Finds 66.123.45.33 and 66.123.45.34.
(SELECT (oracle website *) ipAddr *)
Received on Thu Mar 31 2005 - 04:17:43 CEST