Path: dp-news.maxwell.syr.edu!spool.maxwell.syr.edu!drn.maxwell.syr.edu!news.maxwell.syr.edu!postnews.google.com!f14g2000cwb.googlegroups.com!not-for-mail
From: "Neo" <neo55592@hotmail.com>
Newsgroups: comp.databases.theory
Subject: Re: Suggestions for alternate UPDATE command syntax
Date: 3 Apr 2005 16:38:44 -0700
Organization: http://groups.google.com
Lines: 75
Message-ID: <1112571524.844216.286120@f14g2000cwb.googlegroups.com>
References: <1112559273.775580.158850@g14g2000cwa.googlegroups.com>
   <crl051hl2jebv6mdimberogotciikap9q7@4ax.com>
NNTP-Posting-Host: 66.201.10.117
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Trace: posting.google.com 1112571530 13278 127.0.0.1 (3 Apr 2005 23:38:50 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Sun, 3 Apr 2005 23:38:50 +0000 (UTC)
User-Agent: G2/0.2
Complaints-To: groups-abuse@google.com
Injection-Info: f14g2000cwb.googlegroups.com; posting-host=66.201.10.117;
   posting-account=0cgMYwwAAAB-QanOAkBSIgPTzjTIpbMh
Xref: dp-news.maxwell.syr.edu comp.databases.theory:30406

Following script demos XDb3 UPDATE command (shown near end).

// Create types.
(CREATE type inst *challenge  & dir item it)
(CREATE type inst *solution)
(CREATE type inst *person)
(CREATE type inst *author)
(CREATE type inst *database)
(CREATE type inst *version)
(CREATE type inst *hardware)
(CREATE type inst *cpu)
(CREATE type inst *speed)
(CREATE type inst *"memory size")
(CREATE type inst *"execution time")
(CREATE type inst *"download location")

// Create titles.
(CREATE type inst *title)
(CREATE title inst *contender)
(CREATE title inst *winner)
(CREATE title inst *loser)

// Create persons with default titles updated near end.
(CREATE person inst *neo
   & it title +contender)
(CREATE person inst *hugo
   & it title +contender)

// Create a challenge and its solutions for different hardware.
(CREATE challenge inst *"common ancestor report"
  & it solution (CREATE solution inst *"x#1a"
                  & it author neo
                  & it hardware (CREATE hardware inst *"dell server"
                                  & it cpu (CREATE cpu inst *"P II"
                                             & it speed +"500 Mhz"))
                  & it database (CREATE database inst *xdb1
                                  & it version +4.5.9)
                  & it "execution time" +"1.63 ms"
                  & it "download location"
                             +"www.xdb1.com/Example/Ex076.asp")
  & it solution (CREATE solution inst *"x#1b"
                  & it author neo
                  & it hardware (CREATE hardware inst *"pocket pc"
                                  & it cpu (CREATE cpu inst *"ARM"
                                             & it speed +"233 Mhz")
                                  & it "memory size" +"32 MB")
                  & it database xdb1
                  & it "execution time" +"6.56 ms")
  & it solution (CREATE solution inst *"rm#2"
                  & it author hugo
                  & it hardware (CREATE hardware inst *"desk top"
                                  & it cpu (CREATE cpu inst *"P III"
                                             & it speed +"1300 Mhz"))
                  & it database (CREATE database inst *"sql server"
                                  & it version +2000)
                  & it "execution time" +"11.0 ms"))

// Find neo solution's execution time on hardware with 500 Mhz CPU.
// Finds 1.63 ms.
(SELECT (solution inst *
         & * author neo
         & * hardware (* cpu (* speed "500 Mhz"))) "execution time" *)

// Find hugo's solution's execution time on hardware with 1300 Mhz CPU.
// Finds 11.0 ms.
(SELECT (solution inst *
         & * author hugo
         & * hardware (* cpu (* speed "1300 Mhz"))) "execution time" *)

// Update neo's title.
(UPDATE neo title contender > winner)

// Update hugo's title.
(UPDATE hugo title * > loser)

