Relationship values duplicating


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,

(edit: activated screenshot)

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.

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 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....

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

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 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.

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.