Is this Payment tables relations,and Normalizations are Correct??

  • Payment:

     

     

    I am not much known about making the database .its my first experience .I have done some work  but I want that some one check my work .Is it correct or not ? OR its relations and its primary keys are correct .please help me about payment data and check this .Is it payment data is fully normalized or Not?

    We make a Point of sale system for a mobiles. it’s a online application that’s keep all records in database.

    In Payment process we make seven tables that’s  are our entities in ERD such as

    • Payment: (it’s a main table)
    • Payment Types

     

    • Cash Payment
    • Security Payment
    • Invoice Payment
    • Bill Payment
    • CreditCardPayment
    • ChequePayment

    Payment table is the main table and that are linked with other tables.

    Some data types are bigint, and varchar

    ·        Payment Table :   (mobileNo,customerNo,paymentId,customerName,referenceNo,paymentBalance,payCode,payDescription,amount,cerditCardName,paymentDate)

    ·        PaymentTypes: (typeId,paymentId,typeName)

    ·        BillPayment: (paymentId,billPaymentDate,dealerCode,billBalance)

    ·        CashPayment: (paymentId,cashPaymentDate,cashReceipt,

    depositedInBank,cashInHand)

    ·        SecurityPayment: (paymentId,currentDeposit)

    ·        CerditCardPayment: (paymentId,expirationDate,authorizationCode)

    ·        InvoicePayment: (paymentId,invoiceBalance,invoicePaymentDate)

    ·        ChequePayment: (paymentId,locOut,bankName,branch)

     

    We make the relations are

    ·        chequePayment: primary key goes to the payment Table and make a Foreign key in payment Table.

    ·        In Payment Type Table we declare a “typeId “ is a primary key and “paymentId” is a composite Key because payment table relate to the payment types .payment types are “cashPayment,Billpayment,creditCardPayment”

    ·        CerditCardPayment: paymentId is the primary key in the cerditCardPayment and forigen key in the Payment table

    ·        cashPayment ,SecurityPayment ,billPayment,InvoicePayment are all have paymentID as a primary key and its  foreign key represent in the payment table.

     

     

  • Did you actually change anything in the structure from the last time you posted this?

    Repeated ideas from last time:

    Remove customerName, and put it in the Customer table.

    Move creditCardName to the CreditCard table (unless you really do need the credit card name on every payment for some reason).

    What is payDescription? Does it depend on payCode?

    OK, I think you kind of built your PaymentTypes table backwards. You should only have the typeId and typeName fields there. Then, in your payment table, add a payType field, which would be a foreign key referring back to the PaymentTypes table. Honestly, though, I don't think that's necessary. You can tell which type of payment it is, just by looking to see which of the various xxxPayment tables the paymentID shows up in. I would only add the paymentType field if you frequently sort and/or filter the Payment table based on type, without referencing any of the information in the xxxPayment tables.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply