POV-Ray : Newsgroups : povray.off-topic : Representing satisfiability in SQL relations Server Time
4 Sep 2024 03:20:40 EDT (-0400)
  Representing satisfiability in SQL relations (Message 11 to 20 of 20)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: SharkD
Subject: Re: Representing satisfiability in SQL relations
Date: 25 Jun 2010 17:36:41
Message: <4c252169$1@news.povray.org>
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

From: Darren New
Subject: Re: Representing satisfiability in SQL relations
Date: 25 Jun 2010 18:03:50
Message: <4c2527c6$1@news.povray.org>
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

From: SharkD
Subject: Re: Representing satisfiability in SQL relations
Date: 25 Jun 2010 19:57:30
Message: <4c25426a$1@news.povray.org>
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

From: clipka
Subject: Re: Representing satisfiability in SQL relations
Date: 25 Jun 2010 21:50:48
Message: <4c255cf8$1@news.povray.org>
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

From: Darren New
Subject: Re: Representing satisfiability in SQL relations
Date: 25 Jun 2010 22:54:44
Message: <4c256bf4$1@news.povray.org>
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

From: Darren New
Subject: Re: Representing satisfiability in SQL relations
Date: 25 Jun 2010 22:55:47
Message: <4c256c33$1@news.povray.org>
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

From: SharkD
Subject: Re: Representing satisfiability in SQL relations
Date: 25 Jun 2010 23:32:29
Message: <4c2574cd$1@news.povray.org>
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

From: Darren New
Subject: Re: Representing satisfiability in SQL relations
Date: 26 Jun 2010 01:53:14
Message: <4c2595ca$1@news.povray.org>
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

From: Kevin Wampler
Subject: Re: Representing satisfiability in SQL relations
Date: 26 Jun 2010 17:32:24
Message: <4c2671e8$1@news.povray.org>
Coincidently, I just ran across this:

http://github.com/sanity/Athena


Post a reply to this message

From: Darren New
Subject: Re: Representing satisfiability in SQL relations
Date: 26 Jun 2010 17:52:36
Message: <4c2676a4$1@news.povray.org>
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

<<< Previous 10 Messages Goto Initial 10 Messages

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.