Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2004
    Posts
    1

    Unanswered: Is it possible to make use of database relationships in a join?

    When you make a join, it may look something like this:

    SELECT Products.ProductName from Products, Categories
    WHERE Categories.CategoryName = 'Seafood' AND
    Products.CategoryID = Categories.CategoryID

    In this query you use 'Products.CategoryID = Categories.CategoryID' to give the relation between the two tables. But if you already added the relationships to your database, this should be known.

    My question is, why is it necessary to add the relation in the query when the relationships are already in the database? Is it somehow possible to ommit the relation in the query and make use of the relationships in the database.

    Kind regards,
    Iwan Rotteveel

  2. #2
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    Relationships (also known as Declarative Referential Integrity constraints) are not for DML operations, but rather for enforcement of data integrity that can be affected by DML should there be no DRI on related tables.
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

  3. #3
    Join Date
    Jul 2004
    Posts
    3
    thats a good note...

    Just so im clear, DDL as in INSERT, UPDATE, etc

    DML as in JOIN etc???

  4. #4
    Join Date
    Dec 2002
    Posts
    1,245
    No,

    DDL = Data Definition Language (CREATE, ALTER)

    DML = Data Manipulation Language (INSERT, UPDATE, SELECT, DELETE)

    Regards,

    hmscott

    Quote Originally Posted by Pace
    thats a good note...

    Just so im clear, DDL as in INSERT, UPDATE, etc

    DML as in JOIN etc???
    Have you hugged your backup today?

  5. #5
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    And lest we forget....

    DCL

    EDIT: Damn....some lexicon....
    Last edited by Brett Kaiser; 08-03-04 at 12:56.
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  6. #6
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Did you mean "at least" or "...and lest" ?

    -PatP

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •