|
-
Oct 16th, 2005, 06:19 AM
#1
Thread Starter
Frenzied Member
prolog programming help
I have 3 tables with information as followed:
book(Code,Title,Author,Price,Format)
customer(Invoice,Initials,Surname,Street,Town)
order(Invoice,Code,Quantity).
So, for e.g, this is the query I use to to give me the title/author of a book which is available in hardback and paperback..
Code:
book(_,Title,Author,_,pbk),book(_,Title,Author,_,hbk).
This is the query used to return all the books in a price range 20-25..
Code:
book(Code,_,_,Price,_),Price >= 20,Price =< 25.
This is the query used to give details of customer who has ordered more than 1 copy of the same book
Code:
customer(Invoice,Initials,Surname,_,_),order(Invoice,_,Quantity),Quantity >= 2.
But im having trouble on one other query, i need to return the code,title and author of a book that has been ordered by atleast 2 customers.
Any suggesstions guys? thanks in advance.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|