![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On 6/24/2010 2:00 PM, Darren New wrote:
> Basically, I have a bunch of entries in a database. Call em movies. Each
> is tagged with a collection of arbitrary tags: release date, studio,
> genre, etc. There's no specific collection of tags, but each tag is
> either present or absent, with no other associated value.
>
> Now I want to represent groups of movies. I want to be able to say, for
> example, movies that are from Warner Brothers, and that have arabic *or*
> french subtitles, but aren't rated R, that are out on DVD or out on VHS,
> ...
>
> So, basically, I want to be able to express a fairly general boolean
> equation on an arbitrary collection of variables and store it as a SQL
> table.
>
> However, I haven't been able to figure out the google terms that might
> actually give me something other than a tutorial for using the boolean
> type in SQL.
>
SELECT *
FROM Movies
WHERE Publisher = "Warner Brothers"
AND Language IN("Arabic","French")
AND Rating != "R"
AND Media IN("DVD","VHS")
Something like that. Also, Google "SQL JOIN" if your data is spread
across multiple tables.
--
http://isometricland.com
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
SharkD wrote:
> Something like that. Also, Google "SQL JOIN" if your data is spread
> across multiple tables.
Err, no. The point of my question was that I don't know it's ratings,
publishers, etc. All I know is that there are tags.
Think of (say) ID3 tags, or arbitrary user tags. I know how to store that in
SQL. I want to know how to make arbitrary queries against the data. Or,
rather, how best to represent arbitrary queries.
Or, in other words, what would you use to store
WHERE Publisher = "Warner Brothers"
AND Language IN("Arabic","French")
AND Rating != "R"
AND Media IN("DVD","VHS")
into relational tables rather than a stored procedure?
--
Darren New, San Diego CA, USA (PST)
C# - a language whose greatest drawback
is that it's best implementation comes
from a company that doesn't hate Microsoft.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On 6/25/2010 6:03 PM, Darren New wrote:
> Err, no. The point of my question was that I don't know it's ratings,
> publishers, etc. All I know is that there are tags.
>
> Think of (say) ID3 tags, or arbitrary user tags. I know how to store
> that in SQL. I want to know how to make arbitrary queries against the
> data. Or, rather, how best to represent arbitrary queries.
>
> Or, in other words, what would you use to store
>
> WHERE Publisher = "Warner Brothers"
> AND Language IN("Arabic","French")
> AND Rating != "R"
> AND Media IN("DVD","VHS")
>
> into relational tables rather than a stored procedure?
>
You want to store the results into a new table? I think SELECT INTO does
that.
--
http://isometricland.com
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Am 26.06.2010 00:03, schrieb Darren New:
> Or, in other words, what would you use to store
>
> WHERE Publisher = "Warner Brothers"
> AND Language IN("Arabic","French")
> AND Rating != "R"
> AND Media IN("DVD","VHS")
>
> into relational tables rather than a stored procedure?
Exactly that string, I suppose.
Make a first query to retrieve the desired WHERE clause, then generate
another query with that clause to retrieve the actual data.
(I'd probably leave out the "WHERE" itself though.)
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
SharkD wrote:
> You want to store the results into a new table? I think SELECT INTO does
> that.
No. I want to store the *query* into a table.
--
Darren New, San Diego CA, USA (PST)
C# - a language whose greatest drawback
is that it's best implementation comes
from a company that doesn't hate Microsoft.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
clipka wrote:
> Make a first query to retrieve the desired WHERE clause, then generate
> another query with that clause to retrieve the actual data.
Except I don't know what the column names are. And I want to store "or"s and
"and"s, with parens and such.
--
Darren New, San Diego CA, USA (PST)
C# - a language whose greatest drawback
is that it's best implementation comes
from a company that doesn't hate Microsoft.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On 6/25/2010 10:55 PM, Darren New wrote:
> clipka wrote:
>> Make a first query to retrieve the desired WHERE clause, then generate
>> another query with that clause to retrieve the actual data.
>
> Except I don't know what the column names are. And I want to store "or"s
> and "and"s, with parens and such.
>
I think a relational database system is the wrong tool to use in this
case... Just use it to store the data *after* it has been processed and
normalized.
--
http://isometricland.com
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
SharkD wrote:
> I think a relational database system is the wrong tool to use in this
> case... Just use it to store the data *after* it has been processed and
> normalized.
Well, except I want to re-run the query whenever things change.
But yes, I'm coming to the conclusion that there's no good way to represent
this. On the other hand, since I have no requirements either, I'm not too
worried yet.
--
Darren New, San Diego CA, USA (PST)
C# - a language whose greatest drawback
is that it's best implementation comes
from a company that doesn't hate Microsoft.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Kevin Wampler
Subject: Re: Representing satisfiability in SQL relations
Date: 26 Jun 2010 17:32:24
Message: <4c2671e8$1@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Coincidently, I just ran across this:
http://github.com/sanity/Athena
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Kevin Wampler wrote:
> Coincidently, I just ran across this:
>
> http://github.com/sanity/Athena
Very cool. Thanks! I'll have to suck that down and see if it has good ideas
I can use. :-)
--
Darren New, San Diego CA, USA (PST)
C# - a language whose greatest drawback
is that it's best implementation comes
from a company that doesn't hate Microsoft.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |