Re: sql views for denomalizing

From: Marshall Spight <marshall.spight_at_gmail.com>
Date: 30 Jul 2005 15:18:58 -0700
Message-ID: <1122761938.009981.11650_at_o13g2000cwo.googlegroups.com>


dawn wrote:
>
> Querying for all students currently taking a math course who are not
> math majors is non-trivial in SQL (due to the negation along with
> multiple 1 to many relationships, if I'm thinking clearly) and would be
> trivial in both datatrieve and pick:
>
> list students with courseDept = "Math" and with every major <> "Math"

Ha! I've been trying to get examples of the value of MV out of you for ages, and at last you slip up and reveal one!

Let me make sure I understand this: students have many courses; courses have a courseDept; students have many majors; majors is a string. Yes? So if we represented this in SQL, we'd use three tables, Students, Courses (with FK to Students, and with a courseDept) and Majors (with FK to Students, and major.) The Pick version of this would have a multivalued attribute major inside Students, and also a multivalued attribute inside Student that listed the courses that student was taking. Please correct or confirm.

This seems like a really good example query to study.

Marshall Received on Sun Jul 31 2005 - 00:18:58 CEST

Original text of this message