Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 20th, 2012, 03:00 AM
chisoko_n chisoko_n is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2009
Posts: 77 chisoko_n User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 h 17 m 50 sec
Reputation Power: 4
Facebook
Relational database help

I am designing an application that uses a database to track students attendance for Saturday school programme for disadvantaged kids. I am using MS Access with the following information:

1. StudentTable: StudentID, SubjectID, StudentName, Surname, School etc
2. StudentAttendanceTable: StudentID, 1stTerm, 2ndTerm, 3rdTerm, 4thTerm
3. TutorTable: TutorID, Name, Surname, IDNumber, SubjectID
4. TutorAttendanceTable:,TutorID, 1stTerm, 2ndTerm, 3rdTerm, 4thTerm
5. SubjectTable: SubjectID, TutorID, SubjectName
6. StudentResultsTable: StudentID, Grade1, Grade2, Grade3, Grade4

I have set up a relational table where I want the following to happen:

1. A student can only pick one subject, have one attendance record, have one set of results
2. A tutor can only teach one subject, have one attendance record

Not sure how to attach the image properly, hopefully it shows else please tell me how
Attached Images
File Type: jpg ERD2.JPG (26.5 KB, 54 views)

Last edited by chisoko_n : September 20th, 2012 at 07:19 AM.

Reply With Quote
  #2  
Old September 20th, 2012, 04:34 AM
r937's Avatar
r937 r937 is offline
SQL Consultant
Click here for more information.
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 26,380 r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Months 1 Week 2 Days 7 h 51 m 4 sec
Reputation Power: 4140
1 we don't do homework assignments, but we will help if you have specific questions

2 you didn't ask a question
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book

Reply With Quote
  #3  
Old September 20th, 2012, 07:13 AM
chisoko_n chisoko_n is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2009
Posts: 77 chisoko_n User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 h 17 m 50 sec
Reputation Power: 4
Facebook
Quote:
Originally Posted by r937
1 we don't do homework assignments, but we will help if you have specific questions

2 you didn't ask a question


My problem is linking my tutors with the subjects in a one to one relationship. WHere if I delete my tutor, It will also delete the tutors subject or update. Instead I have a one to many relationships currently between my tutors table and my subjects table. I think it is a lot easier If you look at my ERD attached

Reply With Quote
  #4  
Old September 20th, 2012, 08:13 AM
r937's Avatar
r937 r937 is offline
SQL Consultant
Click here for more information.
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 26,380 r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Months 1 Week 2 Days 7 h 51 m 4 sec
Reputation Power: 4140
Quote:
Originally Posted by chisoko_n
Instead I have a one to many relationships currently between my tutors table and my subjects table.
um, no

if subjectid is the pk of subjects, then because tutorid is in that table, a subject can have only one tutor

and vicey versey

regardless of the infinity symbols on that diagram

mind you, getting the subject fk and tutor fk in their respective tables to work properly, that's going to be fun when you load the data...

Reply With Quote
  #5  
Old September 20th, 2012, 10:39 AM
jemagee jemagee is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2009
Posts: 41 jemagee User rank is Corporal (100 - 500 Reputation Level)jemagee User rank is Corporal (100 - 500 Reputation Level)jemagee User rank is Corporal (100 - 500 Reputation Level)jemagee User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 7 h 8 m 57 sec
Reputation Power: 9
If you can have multiple tutors work on multiple subjects than it's pretty easy to create a cross reference table Tutors_Subject

It has two columns

TutorID, SubjectID

each is a foreign key to the primary key in the respective table.

This way a subject can have multiple tutors and a tutor can tutor multiple subjects.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > Relational database help

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap