[Courses] [Postgresql] Week 5: Even More SQL

Julie Pichon julie.pichon at gmail.com
Tue Feb 26 17:33:15 UTC 2008


Hi,

On 07/01/2008, Michelle Murrain <michelle at murrain.net> wrote:
>  **Assignments**
>
>  You wanted to sponsor a screening of the film "The Golden Compass" at a
>  theatre in NY. What SQL statement would you use to find all of the
>  people who had bought that book who lived in NY?
>
>  Create your own set of related tables. Try inner and outer joins. What
>  have you learned.
>
>  Extra credit:
>
>  What's a cross join, and when would that be useful?
>  What's a full outer join?

I've posted on Moodle the statements for the schema of the example, if
anyone wants to try their hand at crafting SQL queries on actual data
but doesn't have the time/energy to set up all the tables first.

I was wondering if anyone could provide an example where a CROSS JOIN
would be useful? I've read the Postgres doc (
http://www.postgresql.org/docs/8.2/static/queries-table-expressions.html
) and understand how it *could* be useful but I fail to come up with a
real life, practical example.

Regards,

Julie


More information about the Courses mailing list