• So P1 overlaps in Small / MidMarket Cloud Solutions?

    Gold and Silver - is this related to Partner? Or to the Service being provided?

    insert into partners ( 'P1','5/10/2013','2/6/2014','Gold Small and MidMarket Cloud Solutions ')

    insert into partners ( 'P1','7/14/2013','9/19/2014','Silver Small and MidMarket Cloud Solutions')

    Direct and EA - are these related to SKU Group or the Service being provided?

    insert into mastercompetency values('DIRECT','SKG1','Gold Cloud Productivity ')

    insert into mastercompetency values('DIRECT','SKG1','Silver Cloud Productivity ')

    insert into mastercompetency values('EA','SKG2','Gold Small and MidMarket Cloud Solutions ')

    insert into mastercompetency values('EA','SKG1','Silver Small and MidMarket Cloud Solutions ')

    I would spend effort on normalizing the tables first, then the query.

    This could be IN (Gold Cloud Productivity,Gold Small and MidMarket Cloud Solutions) OR (Silver Small and MidMarket Cloud Solutions ),

    or (MidMarket Cloud Solutions) Level IN (Gold,Silver) AND (Cloud Productivity AND Level = (Gold))

    depending on how you normalize the tables.

    If input data matches (Gold Cloud Productivity and Gold Small and MidMarket Cloud Solutions) OR

    (Silver Small and MidMarket Cloud Solutions ) that partner need be selected from input source data for payment

    To me, you have a Partners table, then one that may have many Partner / Services Provided, and a Services table.

    I'd probably go as far as Level (Gold, Silver) having a table too.

    Keys - are important. Things like Gold and Silver are more of a Description, and are subject to change.

    You need to be able to allow for flexibility in the future.