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

Querying for Pilots Who Fly All Jets in dbd

 
   Database Forums (Home) -> Object-Oriented RSS
Next:  How to find persons who like red fruits or crunch..  
Author Message
neo55592

External


Since: Dec 06, 2004
Posts: 480



(Msg. 1) Posted: Fri Nov 17, 2006 12:19 pm
Post subject: Querying for Pilots Who Fly All Jets in dbd
Archived from groups: comp>databases>object (more info?)

This dbd example models pilots who fly jets.
Queries with selectAll find pilots who fly all jets.
For details, see www.dbfordummies.com/example/ex042.asp

(new 'fly 'verb)

(new 'jet1 'jet)
(new 'jet2 'jet)

(new 'pilot1 'pilot)
(create pilot1 fly jet1)

(new 'pilot2 'pilot)
(create pilot2 fly jet1)
(create pilot2 fly jet2)

(; Find pilots who fly all jets)
(; Finds pilot2)
(and (select pilot instance *)
(selectAll * fly (select jet instance *)))

(new 'jet3 'jet)
(new 'pilot3 'pilot)
(create pilot3 fly jet1)
(create pilot3 fly jet2)
(create pilot3 fly jet3)

(; Find pilots who fly all jets)
(; Finds pilot3)
(and (select pilot instance *)
(selectAll * fly (select jet instance *)))

(new 'red 'color)
(create jet1 color red)

(new 'green 'color)
(create jet2 color green)

(new 'blue 'color)
(new 'purple 'color)
(create jet3 color blue)
(create jet3 color purple)

(; Find pilots who fly all jets that are red)
(; Finds pilot1, pilot2 and pilot3)
(and (select pilot instance *)
(selectAll * fly (and (select jet instance *)
(select * color red))))

(; Find pilots who fly all jets that are green)
(; Finds pilot2 and pilot3)
(and (select pilot instance *)
(selectAll * fly (and (select jet instance *)
(select * color green))))

(; Find pilots who fly all jets that are blue and purple)
(; Finds pilot3)
(and (select pilot instance *)
(selectAll * fly (and (select jet instance *)
(select * color blue)
(select * color purple))))

(; Find pilots who fly all jets that are red or green)
(; Finds pilot2 and pilot3)
(and (select pilot instance *)
(selectAll * fly (and (select jet instance *)
(select * color (or red green)))))

(; Find pilots who fly all jets that are not red or green)
(; Finds pilot3)
(and (select pilot instance *)
(selectAll * fly (and (select jet instance *)
(select * color (not red green)))))

 >> Stay informed about: Querying for Pilots Who Fly All Jets in dbd 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
developing a Object Oriented Database -

Aggregation in FastObjects. How to define that in opt file? - Hello, I have theses java classes: - Course <<key>> code : short name : string gratingCurricular : set<Period> - Period <<key>> numPeriod : short anything: set<someThing> * For eac...

Help : How to manage stars in database ? - All, Any help would be gratefully appreciated. I have this trouble : In database in one column I have record like that : 000000001 0*6666**66 005555555 Stars could be anything between '0' and '9' So, if I look for this id : 0166662066, it would be..

How to get return type (Resultset) information from databa.. - Hai, For Example Below are two storeprocedures one returns resultset and other not, how get this information through programmatically. 1)CREATE PROCEDURE dbo.UpdateCustomers ( @CustomerID nchar(5), @CompanyName nvarchar(40), @ContactName..

Problems with sorting datas with db4o using orderderAscend.. - Hi, I have created a class "result" with several attributes. Then I have inserted approximately 10000 object result, stored in a yap file. I can get the data and display them. I'd like to know if it is possible, using the functions of db4o, t...
   Database Forums (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 ]