![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I am having a problem creating a many-to-many-to-many type relationship. It |
|
I am having a problem creating a many-to-many-to-many type relationship. It works fine, but when I create a view to query it and test it, it does not generate the results I expected. You should not have expected it to work in the First Place. |
#3
| |||
| |||
|
|
I am having a problem creating a many-to-many-to-many type relationship. It works fine, but when I create a view to query it and test it, it does not generate the results I expected. Below if the DDL for the tables and the SQL for the view. Any help would be most appreciated. Many thanks in advance. Regards Keith |
#4
| |||
| |||
|
|
I am having a problem creating a many-to-many-to-many type relationship. It |
#5
| |||
| |||
|
|
I am having a problem creating a many-to-many-to-many type relationship. It works fine, .. No, you seem to have 5NF problems. You cannot create a true three-way relationship as a series of binary relationships; look up join-project normal forms. But you have a lot of other problems. 1) Why did you make everything NUMERIC(18,0)? Think about what an amazing thing that would be if reality was like that. 2) Why did you use IDENTITY instead of looking for real keys?? 3) Why didn't you follow ISO-11179 naming rules? Terrible prefixes, lack of any industry standards for columns, etc. 4) Why put physical history into the tables? There are tools for that. 5) Isn't a venue an attribute of a course? 6) What is the logical meaning of those XREF tables in terms of a logical data model? 7) What is a "_type_id"?? An attribute is either a type or it is an identifier, but never both. Again, you don't understand the differences between data and metadata, so you mix them in wreird ways. Your DDL ought to look more like this: CREATE TABLE IndividualCourses (ssn CHAR(9) NOT NULL REFERENCES Individuals (ssn) ON UPDATE CASCADE ON DELETE CASCADE, course_id CHAR(5) NOT NULL) REFERENCES Courses(course_id) ON UPDATE CASCADE ON DELETE CASCADE, PRIMARY KEY (ssn, course_id)); You need constraints, defaults, real keys, logical names, etc. Start over and get a book on data modeling. |
#6
| |||
| |||
|
|
Do not include DDL/source-code in usenet posts. People will try to correct your code instead of your broken logic. For best results do not even mention your `specific implementation'. Have fun with your new `toy', Timothy J. Bruce uniblab (AT) hotmail (DOT) com /RANT That's rather poor advice. What posters should do is present as simple a |
#7
| |||
| |||
|
|
Just from curiosity - and I don't claim to have any answer to this question myself - what primary key would you use for European students? The SSN doesn't exist, and students routinely study in a country which is not where they were born. Simon Don't use SSN, assign a unique student ID. |
#8
| |||
| |||
|
|
I am having a problem creating a many-to-many-to-many type relationship. It works fine, .. You cannot create a true three-way relationship as a series of binary relationships; look up join-project normal forms. |
#9
| |||
| |||
|
|
Just from curiosity - and I don't claim to have any answer to this question |
#10
| |||
| |||
|
|
Timothy J. Bruce wrote: [] Do not include DDL/source-code in usenet posts. People will try to correct your code instead of your broken logic. For best results do not even mention your `specific implementation'. Have fun with your new `toy', Timothy J. Bruce uniblab (AT) hotmail (DOT) com /RANT That's rather poor advice. What posters should do is present as simple a sample of the problem as possible, including standard SQL. Mentioning the specific tools and environment used would be helpful. |
![]() |
| Thread Tools | |
| Display Modes | |
| |