Needs Help in DB Design

siamandm
BronzeLounger
Posts: 1211
Joined: 01 May 2016, 09:58

Needs Help in DB Design

Post by siamandm »

Hello All,
i would like to have a database to enter degrees for each subject per a student name, for example for the college of science we have several departments ( IT , biology , chemistry .... )
when i write a student name and choose a department i would like it show the subjects belong that department as shown below ,
Capture.PNG
i think this may be a wrong way ... could you please advise a better way design ?
many thanks
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78416
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Needs Help in DB Desgin

Post by HansV »

Can the same subject be taught in multiple departments? For example, mathematics might be taught in all science departments.
Best wishes,
Hans

siamandm
BronzeLounger
Posts: 1211
Joined: 01 May 2016, 09:58

Re: Needs Help in DB Design

Post by siamandm »

May be there is one or more subject taught in more than one department
Regards

User avatar
HansV
Administrator
Posts: 78416
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Needs Help in DB Design

Post by HansV »

Thanks, I'll get back to you.
Best wishes,
Hans

User avatar
HansV
Administrator
Posts: 78416
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Needs Help in DB Design

Post by HansV »

Here is a sample database. Look at Database Tools > Relationships to see how the tables are related.

There is an After Insert event procedure in frmStudent to create the grade records for a new student.

(The subjects and students are fictitious and just meant as examples)

A real-life database might be more complicated.
Education.zip
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

siamandm
BronzeLounger
Posts: 1211
Joined: 01 May 2016, 09:58

Re: Needs Help in DB Design

Post by siamandm »

Thanks alot and much appreciated

siamandm
BronzeLounger
Posts: 1211
Joined: 01 May 2016, 09:58

Re: Needs Help in DB Design

Post by siamandm »

HansV wrote:Here is a sample database. Look at Database Tools > Relationships to see how the tables are related.

There is an After Insert event procedure in frmStudent to create the grade records for a new student.

(The subjects and students are fictitious and just meant as examples)

A real-life database might be more complicated.
Education.zip
Dear Hans,
thanks a lot for the example,
i have tested but when i change the department the subjects are not changing accordingly , any advise please?
Regards

siamandm
BronzeLounger
Posts: 1211
Joined: 01 May 2016, 09:58

Re: Needs Help in DB Design

Post by siamandm »

siamandm wrote:
HansV wrote:Here is a sample database. Look at Database Tools > Relationships to see how the tables are related.

There is an After Insert event procedure in frmStudent to create the grade records for a new student.

(The subjects and students are fictitious and just meant as examples)

A real-life database might be more complicated.
Education.zip
Dear Hans,
thanks a lot for the example,
i have tested but when i change the department the subjects are not changing accordingly , any advise please?

for new student you can choose a department and you get the subjects accordingly , but after that when you change the department for already entered record the subjects are not changes
Regards

User avatar
HansV
Administrator
Posts: 78416
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Needs Help in DB Design

Post by HansV »

What would you like to happen when an existing student changes department? Should the grades for the "old" subjects be deleted, or should they remain?
Best wishes,
Hans

siamandm
BronzeLounger
Posts: 1211
Joined: 01 May 2016, 09:58

Re: Needs Help in DB Design

Post by siamandm »

Yes, should be deleted

Thanks a lot

User avatar
HansV
Administrator
Posts: 78416
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Needs Help in DB Design

Post by HansV »

See the attached version. I have now used the After Update event of the Department combo box.
Education.zip
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans