Proper Table Structure?

G

Gary Hull

I have a table called tblClass

It has two fields’ guidClass, and Class.

guidClass is an Autonumber Primary Key


Example A: guidClass Class
1 Red Class 1
2 Red Class 2
3 Red Class 3




Since the Class field will never be duplicated do I need the auto number
field?


Would this work better?

Esample B: guidClass
Red Class 1
Red Class 2
Red Class 3



The school has Class that alternate by days, Red Day, Blue Day, and
there are 4 classes per Day. So there would be 4 classes on Red Day and
4 Classes on Blue Day.

I am interested knowing which is the proper Example A, or B
 
G

Gary Hull

I have a table called tblClass

It has two fields’ guidClass, and Class.

guidClass is an Autonumber Primary Key
Example A:
guidClass Class
1 Red Class 1
2 Red Class 2
3 Red Class 3




Since the Class field will never be duplicated do I need the auto
number field?


Would this work better?

Example B: guidClass
Red Class 1
Red Class 2
Red Class 3



The school has Class that alternate by days, Red Day, Blue Day, and
there are 4 classes per Day. So there would be 4 classes on Red Day
and 4 Classes on Blue Day.

I am interested knowing which is the proper Example A, or B

Sorry Wordwrap Confused the Examples

Example A:
guidClass Class
1 Red Class 1
2 Red Class 2
3 Red Class 3

Example B:
guidClass
Red Class 1
Red Class 2
Red Class 3
 
M

Marshall Barton

Gary said:
I have a table called tblClass

It has two fields’ guidClass, and Class.

guidClass is an Autonumber Primary Key


Example A: guidClass Class
1 Red Class 1
2 Red Class 2
3 Red Class 3




Since the Class field will never be duplicated do I need the auto number
field?


Would this work better?

Esample B: guidClass
Red Class 1
Red Class 2
Red Class 3



The school has Class that alternate by days, Red Day, Blue Day, and
there are 4 classes per Day. So there would be 4 classes on Red Day and
4 Classes on Blue Day.

I am interested knowing which is the proper Example A, or B


Both ways are "proper".

Its a question of whether you are an advocate of natural
keys or if you prefer surrogate keys. Natural keys adhere
to "pure" relational database theory, while surrogate keys
are usually easier to deal with, especially when frequently
used as foreign keys. Either way, the candidate natural key
should be a unique index.

I, and many other Jet users, prefer the simplicity of
autonumber primary keys. I haven't used anyof them, but I
think there are some database engines that do not provide an
autonumber feature, so, if you plan to migrate your database
to other database platforms, that could be a deciding
factor.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top