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

avatar image

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

avatar image

Grant Fritchey ♦♦
137k 20 47 81

(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

avatar image

David Wimbush
10.7k 31 34 44

(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.

Follow this question

By Email:

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



Answers and Comments

SQL Server Central

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



asked: Mar 25, 2010 at 03:44 AM

Seen: 3776 times

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

Copyright 2018 Redgate Software. Privacy Policy