How do I construct this table relationship in SQL Server? -
sorry, if rather basic question i'm sql server noob in need of help.
i have 2 types of loan providers, lender
, pingtree
.
both lender
, pingtree
can have relationship matchservice
, need able store id
.
at moment i'm struggling work out how can create relationship between them. demonstrate, i've created simple visual of want in real world (ringed in red) , think possible solution in sql server. in essence lender
, pingtree
have providerid
, id
stored in match
table
all advice appreciated.
if designing table use provider match table, , store common attributes in provider table. non-common attributes, create them name/value pair table can link provider id.
edit: added sample of data structure.
matchservice (key matchid + providerid)
|matchid |providerid| --------------------------- | 1 | 1 | | 2 | 1 | | 3 | 2 | | 4 | 1 |
provider (key providerid)
|providerid |providertype |providername |startdatetime | enddatetime | -------------------------------------------------------------------------- |1 |lender |stark ind. |1/1/2013 00:00|1/1/2014 00:00| |2 |pingtree |moneybags |1/1/2013 00:00|1/1/2014 00:00|
name/value pair table (for unique, key providerid + name)
| providerid | name | value | ------------------------------------------------------- | 1 | pointofcontact | tony stark | | 1 | contact phone number | 101-202-3456 | | 2 | customer service number | 402-123-4567 |
Comments
Post a Comment