By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,263 Members | 1,577 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,263 IT Pros & Developers. It's quick & easy.

Trouble with creating one to many relationship between tables

P: 2
Going back to school is easier said than done..

This was posted to an older thread earlier but I don't think it got any attention. Your help is appreciated

Professor requires we create a simple database and specified what are to be the primary keys and relationships etc.
I have created the four tables and established the neccessary one to many and many to one relationships between primary keys in the tables with the exception of one which tells me the relationship is "indeterminate" (originally there was no unique index found for the referenced field of the primary table) I am trying to establish the relationship between two primary keys (as instructed).

Course
CLassID, pk
Name
Credit_Hours
Catalog_Description

(one to many relationship est. between ClassID and ClassID in the next Table)

ClassOffering
ClassID,pk
Section,pk
Professor
(More, etc)

(One to many relationship established okay here between ClassID to ClassID but trying to establish a one to many relationship between Section in the ClassOffering table to the Section in ClassStu table creates new tables "ClassStu_1, CLassStu_2"in the relationship diagram. What am I doing wrong?

ClassStu
CLassID,pk
Section,pk
StudentID,pk

(Many to one relationship created okay here between StudentID and StudentID in next table)

Student
StudentID,pk
Name
Major
Class
GPA
Nov 12 '09 #1

✓ answered by ajalwaysus

Your tables are not normalized so first thing you need to do is look over this article about Normalization.

I hope no one else just gives you the answer outright, because that would defeat the purpose of this class you are taking. But I do hope you can find use in this article.

-AJ

Share this Question
Share on Google+
6 Replies


Expert 100+
P: 266
Your tables are not normalized so first thing you need to do is look over this article about Normalization.

I hope no one else just gives you the answer outright, because that would defeat the purpose of this class you are taking. But I do hope you can find use in this article.

-AJ
Nov 13 '09 #2

MMcCarthy
Expert Mod 10K+
P: 14,534
Once you have read the article please feel free to ask any questions to clarify what you don't understand.

I would guess based on the structure you have laid out that your instructor is trying to teach you about the use of Join tables to break up a many to many relationship between two tables. However, read the article and see how you get on.

Mary
Nov 13 '09 #3

NeoPa
Expert Mod 15k+
P: 31,660
I see you haven't returned to respond. This is a shame as that article would be very helpful to you I'm sure.
@NicoleCartrette
That is one of the main reasons why posting your question in another member's thread is illegal here (See How to Ask a Question). We're not here to teach you manners, but we also need to protect our members from behaviour that is unacceptable.
Nov 15 '09 #4

P: 2
I have read the posted material and it is very informative but what I forgot to mention was the table names and fields were determined for us.

It should be a one to many relationship between the Section in the Class Offering table and section in the Class-Stu table according to his relationship diagram.
The "section" in the Class-Stu table must also be identified as a primary key. The "section" in the Class-Stu table is set to Yes (Allow duplicates) but I do not understand why it creates new tables (ClassStu_1, ClassStu_2) when his sample relationship diagram shows only a one to many relationship between the two original tables.
Is it related to referential integrity or cascading? I have tried many different things.

In response to your statement NeoPa that you are not here to teach people manners I posted my question on an existing thread because I believed my question be closely similar to that posed on the other thread.
Nov 16 '09 #5

Expert 100+
P: 266
@NicoleCartrette
I can understand why you did it, but that rule is there for your benefit as much as the thread owner's benefit. In the short time I have been part of this forum, I have seen many threads transform with the thread owner's needs (which is allowed since it is their thread), and those who post questions on someone else's thread don't get any attention. As you can see from this thread, your issue did not have the same outcome of the other thread you posted your question on, and if it did there would be no need for you to post your question in the first place.

It's all good, as long as we learn. =)

Welcome to Bytes.
-AJ
Nov 16 '09 #6

NeoPa
Expert Mod 15k+
P: 31,660
@NicoleCartrette
I'm pleased and a little surprised (perhaps I judged too quickly) that you have returned to respond. Particularly as I thought AJ's post was apposite and should help you.

As AJ has also explained quite well, it is generally to all parties benefit that new questions be posted in their own thread. Having said that, you are a new poster and it would be unreasonable to expect you either to know all our rules as well as we do, or to have given the matter as much consideration as we have before posting in another thread.

Welcome to Bytes!
Nov 16 '09 #7

Post your reply

Sign in to post your reply or Sign up for a free account.