Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Relationships?

Status
Not open for further replies.

sirjon

Instructor
Jun 6, 2002
135
0
0
TH
Hi,

I am just wondering if this is correct.

I have a users Table with a unique UserID and a schools table with a unique SCID

UserID and SCID are the same and related. It works of course but is this correct form?

Should SCID be a foreign key in the schools table, one that is not unique or an identity field?

Cheers,
J

----------------------------------------------------------------------------------------
A community development project in asp.net -
 
should be something like this:

Table - Schools
Code:
SchoolID | SchoolName

here SchoolID is unique and primary key to the Schools table

Table - Users
Code:
UserID | UserName | SchoolID

here UserID should be unique and primary key
and
SchoolId is the foreign key referring to the SchoolID of table Schools


-DNG

 
Hello,

You should have in the user table:
UserID primary key
SCDI foreign key

And in the School table:
SCID primary key

The relationship should be
1 (school tble) to many (user tble)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top