Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Databases: Quick Question

  • 08-11-2006 08: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, Registered Users 2 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