|
-
October 27th, 2008, 12:31 PM
#1
Urgent Ques. in databse design!
hi all , i'll talk directly:
i have for ex. 4 tables , the main table is "Player" .
Suppose the following :
- every player has one or more weapons.
- every player has one or more mask (there is many typs of masks).
- every player has only 1 car, and 1 car takes 1 or more player.
---------------------
PLAYER
---------------------
- PlayerId ( int PK )
-name
-WeaponId
-MaskId
-CarId
- any other columns
---------------------
the weapon table
---------------------
WEAPON
---------------------
- WeaponId ( int PK )
-PlayerId
-weaponType
- any other columns
---------------------
the mask table
---------------------
MASK
---------------------
- MaskId ( int PK )
-PlayerId
-maskType
- any other columns
---------------------
the car table :
---------------------
CAR
---------------------
- CarId ( int PK )
-Cartype
- any other columns
---------------------
** the relations maybe as :
PLAYER (1)----->(many) WEAPON
PLAYER (1)----->(many) MASK
CAR (1)----->(many) PLAYER
** my ques. is : how can the foreign keys be done ? what it will be exactly ?
2nd : when and how i make more than one PK in one table ?
thx in advance...
Tareq
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|