#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2011
    Posts
    1
    Rep Power
    0

    Can i model composite attribute in separate table?


    Can i model composite attribute in separate table in ER Diagram? for example can separate address table be made? (because address is composite attribute), also can primary key be given another name in different table where it is placed as foreign key? please give answer with some reference..
  2. #2
  3. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,203
    Rep Power
    4279
    Originally Posted by sana86
    Can i model composite attribute in separate table in ER Diagram? for example can separate address table be made? (because address is composite attribute)
    you can if you want

    however, in almost all databases which i have seen that contain addresses, the address is an attribute, not a separate entity

    you will run into real trouble assigning an address primary key

    Originally Posted by sana86
    also can primary key be given another name in different table where it is placed as foreign key? please give answer with some reference..
    yes, of course it can

    reference: my 25 years experience with sql, which includes declaring foreign keys with all sorts of names
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

IMN logo majestic logo threadwatch logo seochat tools logo