Showing posts with label suppose. Show all posts
Showing posts with label suppose. Show all posts

Monday, March 26, 2012

Relational Database design problem

Hi,

I have a very important question about the database design. Suppose that I have a table named as tblPerson with the following Fields.

tblPerson:
--------
PersonID
PersonName

And I have a another table that has the Person Credit card Information:

tblPersonCreditCard:
---------

CreditCardID
PersonID
CreditCardTypeID

And Another table which contains the type of creditcards:

tblCreditCardsType:
----------

CreditCardTypeID
CardName

NOTE: Suppose CreditCardTypeID 1 = "MasterCard", 2 = "Visa" , 3 = "platinum"

Now if a person suppose "john" has three credit cards then it will be stored as.

tblPersonCreditCard:
---------

CreditCardID PersonID CreditCardTypeID
1 1 1
2 1 2
3 1 3

Each if the number belong to one Field.

Which means that "john" has three credit cards

Now as u see that in tblPersonCreditCard john's id, which is 1 is repeating 3 time. how can I design a database in which the id does not repeat. I have heard that this can be done by using the bitwise operator but HOW.

thanks in advance,

AzamI don't see a problem with each record in tblPersonCreditCard including a foreign key to the credit card's owner. Is there some problem you're having with doing so?|||No i am not having any problem. But I just wanted to know that if there a better way of doing the same thing.|||There is no reason to do what you are attempting to do. To create a many-to-one relationship, you need to have a foreign key which will potentially repeat in the child table.|||I have heard that you can use some sort of the bit wise operator to store all the relationship of the person in a single field. I have no idea how ??|||I think you mean "bitmask", actually. Here'san article, if you're really interested.

Wednesday, March 7, 2012

Regular Backup co-exist with log-shipping (or SQL mirroring)

Suppose I have a 3rd party SQL backup software to backup my databases, can I also setup a stand-by server for log shipping?

I'm not sure if this is possible? If not, is SQL mirroring a choice instead of log shipping?

Thanks a lot!

The only restriction is that only one thread of log backups can exist.

So, if your 3rd-party backup software is also doing log backups, log shipping will not work.

Alternatively, you can do full backups with your 3rd-party software and log shipping will work just fine.

Mirroring has no such restrictions.

Regular Backup co-exist with log-shipping (or SQL mirroring)

Suppose I have a 3rd party SQL backup software to backup my databases, can I also setup a stand-by server for log shipping?

I'm not sure if this is possible? If not, is SQL mirroring a choice instead of log shipping?

Thanks a lot!

The only restriction is that only one thread of log backups can exist.

So, if your 3rd-party backup software is also doing log backups, log shipping will not work.

Alternatively, you can do full backups with your 3rd-party software and log shipping will work just fine.

Mirroring has no such restrictions.