Solved

Please help normalise table for Access 2007

Posted on 2010-08-12
8
650 Views
Last Modified: 2012-05-10
Hi Experts,

Can you please help me create and normalise the following sample data.

Thanks
Ric
Sample-Data.jpg
0
Comment
Question by:RiCzN
8 Comments
 
LVL 9

Accepted Solution

by:
valkyrie_nc earned 250 total points
ID: 33421728
Three tables should do it:

STUDENT
Fields: StudentId (int), Name (varchar)

CLASS
Fields: ClassId (int), Title (varchar)

ATTENDANCE
Fields: ClassId, StudentId, ClassDate (datetime), Attended (char (Y/N) field)

hth

valkyrie_nc
0
 
LVL 12

Expert Comment

by:telyni19
ID: 33421825
To be fully normalized, you would want three tables.

Class Table:
ClassID  | ClassName
1        |  English
2        |  Math

Student Table:
StudentID    | StudentName
1         |  Adam
2         |  Billy
3        |  Cook

Attendance Table:
AttendanceID           | AttendanceDate          |   StudentID           |   ClassID     |   Present
1                              |    2/08/2010                 |      1                     |         1         |        N
2                              |    2/08/2010                 |      2                     |         1         |        Y
3                              |    2/08/2010                 |      3                     |         1         |        N
4                              |    2/08/2010                 |      1                     |         2         |        N
and so on...

This way you could store additional information about classes or students without compromising the table structure. You could use the first name as a student ID as you have in the sample data, but I don't recommend it, since you could have multiple students with the same first name, or even full name. Numerical IDs are generally more stable. So then in the database structure, you would link the StudentID and ClassID fields in the attendance table to their corresponding fields in the other two tables.

If you need a sample database, I can do that too, but a static picture of a spreadsheet is not exactly the easiest for data entry. Why not post the actual spreadsheet?
0
 
LVL 92

Expert Comment

by:Patrick Matthews
ID: 33421834
Slightly different, to make it easier to determine things like what % of class meetings a student actually attended:tblStudent---------------------------------------------------------StudentID (PK)StudentFNameStudentLNametblClasses---------------------------------------------------------ClassID (PK)ClassNametblClassMeetings---------------------------------------------------------ClassMeetingID (PK)ClassID                      (include unique index on ClassID, ClassDateTime)ClassDateTimetblAttendance---------------------------------------------------------AttendanceID (PK)ClassMeetingID         (include unique index on ClassMeetingID, StudentID)StudentID
0
 

Author Comment

by:RiCzN
ID: 33421875
Hi valkyrie_nc,

How would i place those tables in a form?  Would it be similar to the attached?
The problem with it is that i'll have to select every students (up to 30 students) every time there is a new date for the respective class.

Is there another way of setting it up?

Thanks
Ric
Current-Form.jpg
0
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 47

Assisted Solution

by:Dale Fye (Access MVP)
Dale Fye (Access MVP) earned 250 total points
ID: 33421919
Based upon your "current table structure" image in your previous post (http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_26398289.html), I think you have the about right, at least for that table.  
0
 

Author Comment

by:RiCzN
ID: 33421970
Thanks fyed for taking a look at it. Any ideas how i can take it further?
0
 
LVL 12

Expert Comment

by:telyni19
ID: 33422006
Form data entry is a different issue from entry of existing data. The original question asked for how to normalize existing data from a spreadsheet. For new data entry, here's another idea, particularly if you generally have good attendance. You could have a button with a bit of code for adding a new class date that would add a corresponding entry for each student and defaulting to attended, and then displaying those records in the subform where you could then uncheck the attendance checkbox for each student that did not attend that day. This would probably work best with matthewspatrick's setup with four tables, one for the class dates.
0
 

Author Comment

by:RiCzN
ID: 33422089
I was hoping to avoid coding like that as a solution. I just thought there would be a better way. I've created a subform within another subform but it just looks to unfriendly and too many things can go wrong.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now