Queries 2
Queries 2
5.Description of a Table
DESC 'your_table_name';
EDIT Rules:
7. matching records of column of one table to column of other table
Eg: Validate that the ID exists in DWH.L_SOURCE
SELECT SOURCE_ID FROM SchemaName.'your_table_name1' WHERE EXISTS (SELECT SOURCE_ID
FROM SchemaName.'your_table_name2');
18. Verify if the field ColumnName contains exact 10 digit number values
select ColumnName from TABLE_NAME where regexp_like(phone_number,'^[[:digit:]]
{10}$') ;
OR
select ColumnName from TABLE_NAME where REGEXP '^[0-9]{10}$';
19. Verify if the field ColumnName contains 1st digit of number as "0" or "1"
select ColumnName from TABLE_NAME where column_name LIKE '0%' OR column_name LIKE
'1%'
20. Verify if the field column_name contains last 7 digits numbers all zeroes
SELECT ColumnName FROM yourTableName WHERE ColumnName LIKE '___0000000';
21. Verify if the field column_name contains all 10 digit numbers same
select ColumnName from TABLE_NAME where REGEXP '^(\d)\1*$'; // change the
number "^(\d)\1*$" in this to verify for required digit
22. Verify if the field Email Address contains atleast one non-blank character
before '@' Character
SELECT ColumnName FROM yourTableName WHERE ColumnName LIKE '% @%';
24. The field shouldn't have valid date piror to "1900/01/01", if it is a piror
date then set field to null
SELECT column_name from yourTableName where date to char 19000101';
25. Verify if the field DOB contains valid date when compared to "SESSSTARTTIME"
SELECT *
FROM table_name
WHERE date_A >= date_B;
31. Verify the convert rule Trimmed // if all the records converted it will return
0 records
Select column_name from dwh.table_name
minus
Select trim(column_name) from stage.table_name;
32. In a single record one colum data is populated other column data is not
populated
Select column_name1, column_name2 from table_name where column_name1 is not null
and column_name2 is null;
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Query to check for En/Dy error in process monitor :