x

data redundancy

How to find out the data redundancy,data integrity, data consistency using sql queries ??

more ▼

asked Mar 25, 2010 at 03:44 AM in Default

test gravatar image

test
1 1 1 1

(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first

Those are three radically different questions. Data redundancy means you're checking for duplication. In order to make that check, you need to determine what signifies a duplicate within the table to which you are referring. There's not a single query that will satisfy until you can define what makes a duplicate record.

To check for integrity is much easier. If you have proper primary and foreign keys in place prior to the data load, these will ensure data integrity, that's what they're meant to do. But if you don't have them, you simply need to query parent table to child table to ensure that any given child record has an associated parent record. Again, you'll need to define what represents a key up front (or an alternate key) and that depends on the needs of your system.

Finally data consistency is completely a business model. There is no way from a pure programming stand point to know that, for example, 'NY' and 'New York' are either incorrect or correct values for a given field unless someone has defined that the data must look a certain way. This is apart from the defintions within data integrity, but can actually be enforced through those means.

In short, you really need to define which of these questions you're trying to answer and specifically where within your own system you're having issues.

more ▼

answered Mar 25, 2010 at 09:21 AM

Grant Fritchey gravatar image

Grant Fritchey ♦♦
101k 19 21 74

(comments are locked)
10|1200 characters needed characters left

It depends on your data really. Do you have a specific problem you're stuck on?

more ▼

answered Mar 25, 2010 at 04:37 AM

David Wimbush gravatar image

David Wimbush
4.9k 28 30 34

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x7

asked: Mar 25, 2010 at 03:44 AM

Seen: 2684 times

Last Updated: Mar 25, 2010 at 04:51 AM