Design help - Newbie

A

Andy

Hi

I'm designing a database, but need some help on a design isue.
I have a table with all users in our business, and one table with all our
applications. What I have to do is somehow show all applications a user has
access to. In other words User A has access to application 1, application 2
and applicaton3, but user B has access to application 1 and application 4.
How do I solve this with tables?

/Andy
 
N

Nikos Yannacopoulos

Andy,

You are describing a classic many-to-many relationship between users and
apps. The way to handle this is through a third table, with one field
UserID (foreign key, linked to the Users table) and one field
ApplicationID (foreign key linked to the Applications table).
This table (tblUserApplications, for instance...) will have as many
records per user as the apps the user has, and, at the same time, as
many records per application as the users that use it.
Qurying the table for a particular UserID will give you the answer.

HTH,
Nikos
 
Top