Relationship values duplicating

asked 2017-12-11 16:00:51 +0200

VHM gravatar image

updated 2020-10-23 01:09:07 +0200

Alex Kemp gravatar image


I am creating a database, for enroll register but I have some questions.

I attached the relationship between the tables.

What is supposed to do are: 1- Register of the student. 2- Register for a program. 3- Register for a semester. 4- Register for classes.

So, one student can register in one program. One program can have more than one semester. Each semester can have more than one classes.

What is happening is the data are duplicating. When we register the classes for the second semester, for example, they duplicate the information with the information from the first semester. For example: Semester 1
Class A 40 credits 40 hours Class B 40 credits 40 hours Class C 40 credits 40 hours

Semester 2 Class D 50 credits 50 hours CLass E 50 credits 50 hours Class F 50 credits 50 hours

The query view shows: Semester 1 Class A 40 credits 40 hours Class B 40 Credits 40 hours Class c 40 Credits 40 hours Class D 50 Credits 50 hours Class E 50 credits 50 hours Class F 50 credits 50 hours

So, all data is duplicated in each semester. When a look just the table information, the information is correct.

So, I don't know how to fix it. If anybody can help, I'll appreciate.

Thank you,

C:\fakepath\Screen Shot 2017-12-11 at 9.34.28 AM.png

(edit: activated screenshot)

edit retag flag offensive close merge delete


Hello, We have a problem here in that you specify a lot of information except probably the most important - the actual query statement itself. It appears the Data is not duplicated but rather the query result is incorrect. Please post the actual SQL for the query.

Ratslinger gravatar imageRatslinger ( 2017-12-11 18:03:11 +0200 )edit

Thank you for your answer. But probably your question brings the real problem because I didn't write any line in SQL for the query. I am not familiar with this, so, I will try to create some commands to filter that and if I don't get it I come back here later. Thank you.

VHM gravatar imageVHM ( 2017-12-11 23:24:29 +0200 )edit

@VHM Sorry for that now deleted comment. Was right reply on wrong question. As to your last comment, what then are you referring to in question stating The query view shows:? Queries ARE SQL.

Edit: You can get the actual SQL of the query if you right mouse click the query name & select Edit in SQL View....

Ratslinger gravatar imageRatslinger ( 2017-12-11 23:49:49 +0200 )edit

Thank you. It is working now. And I discovered a problem with a table and I fixed. Now it is working. Thank you.

VHM gravatar imageVHM ( 2017-12-18 16:07:24 +0200 )edit

I did not understand the explanation and I think I have the same issue.

I have 2 simple tables with one ralationship (for example first table with vegetable names and second table with variety names of the vegetables), I try to put all that in a query but it repeats every variety names for all vegetables names. It is like the query is not linking the correspondent VegetableID's.


Tullfish gravatar imageTullfish ( 2018-01-01 15:29:11 +0200 )edit

@Tullfish These situations are usually the result of incorrect joining of tables. As SQL statements can vary widely, if you are having problems joining the tables, please ask as a new question. Include the actual SQL statement used & what results are expected.

Ratslinger gravatar imageRatslinger ( 2018-01-01 16:16:01 +0200 )edit

Thanks, I think I just solved it. I had to re-create a relationship between my tables in the query. I tough relationship followed from the main relationship menu, but it seems it doesn't follow.

Tullfish gravatar imageTullfish ( 2018-01-01 18:12:16 +0200 )edit