Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> boolean logic expressed in RDBMS rows

boolean logic expressed in RDBMS rows

From: M.N. <balkanboy_at_hotmail.com>
Date: 10 May 2003 02:39:57 -0700
Message-ID: <955aa198.0305100139.17186dca@posting.google.com>


Hi all.

We do a lot of serverside Java (J2EE) programming and an issue has come up, so maybe there's a standard way of resolving this issue rather than trying to come up w/hacks or 'inventive' ways..

We have a user table which contains users who use the application, and each of these users has a skill set associated to them. E.g:

user



1 John
2 Mary
3 Doug

skill



4 Java
5 C++
6 Perl
7 PHP
8 Python

user_skill



user_id skill_id
1          4
1          5
2          6
2          7
2          8

So, if I wanted to query users w Java & C++ I'd specify skill = Java AND skill = C++ in my SQL query, or I could say "a user w/skill = "Java" AND (skill = Perl OR skill = PHP).

My question is - is there a 'standard' way to store the query criteria inside a table(s) of any shape or form and what would that table or tables look like?

We busted our heads thinking about the problem, and it turns out that it is rather _easy_ if you have to only AND or only OR between different skills, then basically you'd OR or AND every row from the table where your criteria is specified, _however_ what happens when you introduce GROUPINGS of criterias? How can you represent GROUPED criterias (in an particular order the user desires) in the form of rows in a standard sort of way (if there ever was one)?

Do you apply some boolean logic laws to reduce everything down to AND's and OR's? If yes, then how, or where can this information be looked up, cause I'm sure I'm not the first one to encounter this issue?

Any help would be truly appreciated.

Thank you.
M. Received on Sat May 10 2003 - 04:39:57 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US