type
Post
Created date
Nov 10, 2022 01:03 AM
category
Data Science
tags
Data Warehousing
status
Published
Language
English
From
School
summary
slug
password
Author
Jason Ching Yuen Siu
Priority
Featured
Featured
Cover
Origin
Type
URL
Youtube
Youtube
icon
1. Duplicate Problem
SELECT student_id, COUNT(*) as duplicate_Student_records FROM dw.student GROUP BY student_id HAVING COUNT (*) >1;
CREATE TABLE student AS SELECT DISTINCT * FROM dw.student;
2. Relationship Problem
SELECT * FROM <<table 1>> WHERE <<FK>> NOT IN (SELECT <<PK>> FROM <<table 2>>);
DELETE FROM <<table 1>> WHERE <<FK>> NOT IN (SELECT <<PK>> FROM <<table 2>>);
Case study

3. Inconsistent Values
Inconsistent values can be different in units, codes or different precisions such as two different attributes conflict to each other
For example: Cable Television case study - Workshop activity week 4 Error: Contract Start Time > Contract End Time
SELECT * FROM contract WHERE starttime > endtime
DELETE FROM contract WHERE starttime > endtime;
4. Incorrect Values
Incorrect values can be incorrect spelling, attributes fall outside the correct data range, illogical value of the attribute or incorrect data type
SELECT * FROM charter WHERE char_distance < 0;
DELETE FROM charter WHERE char_distance <0;
5. Null Value Problems
SELECT * FROM major WHERE major_name IS NULL;
DELETE FROM major WHERE major_name IS NULL;
- Author:Jason Siu
- URL:https://jason-siu.com/article/135380fd-07ef-4ff3-a329-632c3b4ce2c6
- Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!
Relate Posts