Database Tutorial

Course Tutorial Site

Site Admin

Lab #5 : Querying Data

with 4 comments

This lab works on developing the students understanding of the syntax to query data from tables through joins, where the tables are constrained by FOREIGN KEY database-level constraints.

Written by michaelmclaughlin

January 31st, 2010 at 3:56 pm

Posted in

4 Responses to 'Lab #5 : Querying Data'

Subscribe to comments with RSS or TrackBack to 'Lab #5 : Querying Data'.

  1. Should the ADDRESS_ID column in the TELEPHONE table be a foreign key type? It references the address table, but it is blank in the type field.

    Dane Christiansen

    2 Feb 10 at 8:00 pm

  2. Dane,

    This is the note above the table: “The TELEPHONE table contains an ADDRESS_ID column without a foreign key constraint. This isn’t an omission. The business rule in this type of case is that you may have a telephone number or an address for customers. That means a row in the TELEPHONE table may not have a relationship immediately to the ADDRESS table. The absence of the constraint makes the column optional, which means it has a 0..1 cardinality.”

    I think that it answers your question. It will require an outer join because it may be null.

    michaelmclaughlin

    2 Feb 10 at 8:49 pm

  3. I think that in the individual objectives it is supposed to be MYSQL and not ORACLE.

    Brandon Dye

    19 May 10 at 5:13 pm

  4. Yes, you’re right. It’s fixed now.

    michaelmclaughlin

    21 Jun 10 at 10:04 pm

Leave a Reply