From: shaw@contrapunctus.net (Adam Shaw)
Newsgroups: comp.databases.oracle
Subject: sql question
Date: 10 Oct 2003 12:43:34 -0700
Organization: http://groups.google.com
Lines: 20
Message-ID: <961454d1.0310101143.4e56ec41@posting.google.com>
NNTP-Posting-Host: 168.229.245.86
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1065815014 1898 127.0.0.1 (10 Oct 2003 19:43:34 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 10 Oct 2003 19:43:34 +0000 (UTC)


Here's a SQL question a friend asked me recently...I came up with a
solution, but I'm not sure it's the ideal one, so let me know what
y'all think...

His database has a table of actors in it, a table of movies, and an
intermediate table ("casts") containing the keys from both. The tables
are roughly like this:

actors: ActorID,LastName,FirstName,etc.

movies: MovieID,Title,etc.

casts: ActorID,MovieID,CharacterLastName,etc.

He wanted to know, how can I select all movies with Robert DeNiro and
Joe Pesci in it?

How best to do it?

-ams

