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

    Join Date
    Feb 2013
    Location
    kerala
    Posts
    72
    Rep Power
    2

    Normalization check


    Dear Developers,

    I have two tables 'A' and 'B'.

    A table has three fields.Listed below.

    one_id (primarykey)
    name
    address

    B table has three fields.

    two_id (primarykey)
    one_id (foreignkey)
    phone

    I set field name of foreingkey is same as field name of primarykey, is it correct to use same fieldname?

    Thanks
  2. #2
  3. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,172
    Rep Power
    4274
    yes, you can use the same column name, but you don't have to
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Location
    kerala
    Posts
    72
    Rep Power
    2
    Originally Posted by r937
    yes, you can use the same column name, but you don't have to

    I mean, field name of second table foreingkey is same as field name of first table primarykey, is it correct to use same fieldname?
  6. #4
  7. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,172
    Rep Power
    4274
    Originally Posted by Sarath_PHP
    is it correct to use same fieldname?
    yes, you can use the same column name, but you don't have to
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

IMN logo majestic logo threadwatch logo seochat tools logo