Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Modelling Books (with XDb2)

 
   Database Help (Home) -> Object-Oriented RSS
Next:  Question about converting 97db to 2003 db  
Author Message
neo55592

External


Since: Dec 06, 2004
Posts: 206



(Msg. 1) Posted: Mon Feb 07, 2005 10:59 am
Post subject: Modelling Books (with XDb2)
Archived from groups: comp>databases>object (more info?)

Following script for an experimental db models several books, each of
which can have various number of genres, authors, publishers, etc.
Sample query is shown near end. Downloadable db at
www.xdb2.com/example/ex110.asp

// Create items in directory to classify things.
(CREATE *book.item ~in = dir)
(CREATE *ISBN.item ~in = dir)
(CREATE *author.item ~in = dir)
(CREATE *publisher.item ~in = dir)

// Create genres known at design-time.
(CREATE *genre.item ~in = dir)
(CREATE *fiction.cls = genre)
(CREATE *non-fiction.cls = genre)
(CREATE *sci-fi.cls = genre)
(CREATE *mystery.cls = genre)
(CREATE *computer.cls = genre)
(CREATE *database.cls = genre)

// Create a book with 1 author, 1 publisher, 3 genres.
(CREATE *Intro to Database Systems.cls = book
& it.ISBN = +0-201-54229-X
& it.author = +C J Date
& it.publisher = +Addition-Wesley Publishing Co
& it.genre = non-fiction
& it.genre = computer
& it.genre = database)

// Create a book with 1 author, no ISBN and 1 publishers.
// Classify book in a new genre created on the fly.
(CREATE *Symbolic Logic.cls = book
& it.author = +Susanne Langer
& it.publisher = +Vintage Books
& it.publisher = +Dover Publications
& it.genre = non-fiction
& it.genre = (CREATE *logic.cls = genre))

// Create a book with 2 authors and 2 publishers.
// Classify book in 4 genres,
// 3 of which are created on the fly.
(CREATE *Godel Esher Bach.cls = book
& it.ISBN = +0-39-74502-7
& it.author = +Douglas Hofstadter
& it.author = +Albert Einstein
& it.publisher = +Vintage Books
& it.publisher = +IDG Books
& it.genre = non-fiction
& it.genre = (CREATE *math.cls = genre)
& it.genre = (CREATE *art.cls = genre)
& it.genre = (CREATE *music.cls = genre))

// Find books written by C J Date in database genre.
// Finds "Intro to Database Systems"
(SELECT *.cls=book & *.author=C J Date & *.genre=database)

 >> Stay informed about: Modelling Books (with XDb2) 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
oops help - Question 1:- Describe the following with the help of examples: 1)Generalization and its role in Inheritance. 2)abstract Classes 3)State Diagrams. 4)OMT and its impact in programming. 5)future of Object Oriented languages. Qusetion2: -Identify the..

Idempotent ODBMS iterators - I am building a client/server ODBMS in Java. It occurred to me that one way of helping to guarantee the consistency of the database was to ensure that all atomic requests were idempotent -- that is, that if a particular request is performed more than..

Help Understanding OODBMS' - <font color=purple> ;> 3) Are relationships recorded in the same way as in an RDB - 1:M and</font> <font color=purple> ;> M:M? I assume that program code has to place the IDs in a "table" to</font> ...

CfP Reminder: The Second Scala Workshop - Scala Days 2011 - The Second Scala Workshop ========================= Call for Papers --------------- Scala is a general purpose programming language designed to express common programming patterns in a concise, elegant, and type-safe way. It smoothly integrates..

CGVCVIP 2011 (Rome, Italy) - 1st call extension: until 28 .. - Apologies for cross-postings. Please send to interested colleagues and students -- CALL FOR PAPERS - Deadline for submissions (1st call extension): 28 March 2011 -- IADIS INTERNATIONAL CONFERENCE ON COMPUTER GRAPHICS, VISUALIZATION, COMPUTER VISION..
   Database Help (Home) -> Object-Oriented All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]