Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r78503 - sandbox/icl/libs/xplore/br1/sqlbrowser
From: afojgo_at_[hidden]
Date: 2012-05-18 05:41:46


Author: jofaber
Date: 2012-05-18 05:41:45 EDT (Fri, 18 May 2012)
New Revision: 78503
URL: http://svn.boost.org/trac/boost/changeset/78503

Log:
Experiments with the DB
Binary files modified:
   sandbox/icl/libs/xplore/br1/sqlbrowser/objects1.db
Text files modified:
   sandbox/icl/libs/xplore/br1/sqlbrowser/TypeExtensibleDag.sql | 62 ++++++++++++++++++++++++++++-----------
   1 files changed, 44 insertions(+), 18 deletions(-)

Modified: sandbox/icl/libs/xplore/br1/sqlbrowser/TypeExtensibleDag.sql
==============================================================================
--- sandbox/icl/libs/xplore/br1/sqlbrowser/TypeExtensibleDag.sql (original)
+++ sandbox/icl/libs/xplore/br1/sqlbrowser/TypeExtensibleDag.sql 2012-05-18 05:41:45 EDT (Fri, 18 May 2012)
@@ -15,15 +15,15 @@
 create table Object (key integer primary key);
 create table Attribute (key integer primary key, refObjectType integer, name varchar);
 
-create table Field (key integer primary key, refObject integer, refAttribute integer, seqnum integer);
-
-create table VarCharField (refField integer primary key, value varchar);
-
-
 
 create table IntObject (refObject integer, refAttribute integer, value integer, primary key (refObject, refAttribute));
 create table VarCharObject (refObject integer, refAttribute integer, value varchar, primary key (refObject, refAttribute));
 
+//CL?
+create table Field (key integer primary key, refObject integer, refAttribute integer, seqnum integer);
+create table VarCharField (refField integer primary key, value varchar);
+create table IntField (refField integer primary key, value integer);
+
 
 
 
@@ -132,7 +132,23 @@
 select Object.key as Obj, VarCharObject.value as Name
 from Object
   inner join VarCharObject on VarCharObject.refObject = Object.key
-
+
+-- -----------------------------------------------------------------------------
+-- Named Objects 1:1 Attributes joined horizontally.
+select Object.key as Obj, Name.value as Name, YearOfCrea.value as YoC, Position.value as Pos, Duration.value as Dur
+from Object
+ inner join VarCharObject as Name on Name.refObject = Object.key and Name.refAttribute = 1
+ left outer join IntObject as YearOfCrea on YearOfCrea.refObject = Object.key and YearOfCrea.refAttribute = 2
+ left outer join VarCharObject as Duration on Duration.refObject = Object.key and Duration.refAttribute = 3
+ left outer join VarCharObject as Position on Position.refObject = Object.key and Position.refAttribute = 4
+
+-- -----------------------------------------------------------------------------
+-- Named Objects 1:1 Attributes joined horizontally.
+select Object.key as Obj, VarCharObject.refAttribute as Attr, VarCharObject.value as Value
+from Object
+ inner join VarCharObject on VarCharObject.refObject = Object.key
+
+
 -- -----------------------------------------------------------------------------
 -- Vertexes
 select Vertex.key as Vtx, Object.key as Obj, ObjectType.Name as Type , Attribute.Name as Attr,
@@ -190,18 +206,6 @@
   inner join VarCharObject as TrgName on Edge.refTargetVertex = TrgName.refObject
   left outer join IntObject on IntObject.refObject = Object.key
   
-
--- -----------------------------------------------------------------------------
--- Artists
-select Vertex.key as Vtx, Object.key as Obj, VarCharObject.value as Name, IntObject.value as YoBirth
-from Vertex
- inner join Object on Object.key = Vertex.refObject
- inner join VarCharObject on Object.key = VarCharObject.refObject and VarCharObject.refAttribute = 1
- inner join IntObject on Object.key = IntObject.refObject and IntObject.refAttribute = 2
-where
- Vertex.refObjectType = 1
-
-
 -- -----------------------------------------------------------------------------
 -- Edges 2.
 --
@@ -223,3 +227,25 @@
   inner join Object on Object.key = Vertex.refObject
   inner join VarCharObject on Object.key = VarCharObject.refObject
 
+
+-- -----------------------------------------------------------------------------
+-- Fields
+
+
+-- -----------------------------------------------------------------------------
+-- Artists
+select Vertex.key as Vtx, Object.key as Obj, VarCharObject.value as Name, IntObject.value as YoBirth
+from Vertex
+ inner join Object on Object.key = Vertex.refObject
+ inner join VarCharObject on Object.key = VarCharObject.refObject and VarCharObject.refAttribute = 1
+ inner join IntObject on Object.key = IntObject.refObject and IntObject.refAttribute = 2
+where
+ Vertex.refObjectType = 1
+
+
+-- -----------------------------------------------------------------------------
+-- Utils
+alter table VarCharObject add seqnum integer
+
+
+

Modified: sandbox/icl/libs/xplore/br1/sqlbrowser/objects1.db
==============================================================================
Binary files. No diff available.


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk