Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Databases: Quick Question

Options
  • 08-11-2006 8:52pm
    #1
    Closed Accounts Posts: 5,240 ✭✭✭


    Right, just a quick question here with regards to the whole normalisation thing, its becoming the bain of my life.
    Here is one entity and its set of attributes:

    Project ( P_code, P_type, P_name, Start_date, End_date, No_contractors, Cust_num)

    Cust_num is the foreign key. Now are there any repeating groups in these attributes :confused: . If someone could explain this one im sure i could figure the rest out.

    Any help muchio appreciated lads
    Endo


Comments

  • Closed Accounts Posts: 7,230 ✭✭✭scojones


    I haven't done this in so long so do not assume what I say is right, because chances are it is not.

    Project( P_code, Contractor.Con_num, Customer.Cust_num)

    Project_details( Project.P_code, P_type, P_name, Start_date, End_date)

    Contractor(Con_num, Con_fname, Con_lname, Con_rank)

    Customer(Cust_num, Cust_fname, Cust_lname)

    Does that make any sense?

    Check this out http://www.serverwatch.com/tutorials/article.php/1549781


  • Registered Users Posts: 5,618 ✭✭✭Civilian_Target


    Project ( P_code, P_type, P_name, Start_date, End_date, No_contractors, Cust_num)

    Sounds to me like a college exercise, reminds me of Data Processing at college.

    How you normalise is a matter of opinion, you have to minimise the possibilities of putting in the same data twice, but there's a form called 3NF which is the most sensible and is quite achieveable using formulaic methods, but in the real world, intuition works better.

    I would say:
    Project(P_code,P_typeID,P_propsID,Cust_num)
    ProjectType(typeID,P_type,...)
    ProjectProps(propsID,P_name,Start_date,End_date,No_contractors)

    However, like sjones mentioned, you could have a seperate table for contractors. Note that in Project TypeID and PropsID are foreign keys connecting to typeID and propsID which are primary keys in their relevant tables


Advertisement