Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • SQL Queries Used in DATA VALIDATION

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 9.73k
    Comment on it

    SQL means Structured Query Language and it is a standard language which is used for storing and manipulating the data in databases. In this tutorial we will learn some of the basic SQL queries used in data validation.

    Table Name – employee

    1. for selecting all the data from the table -
      select * from tablename


    2. Find the total number of records in a table-
      Select count (*) from emp where age >40


    3. How to get the results of a Query sorted in any order?
      SELECT empname, age, city FROM emptable ORDER BY empname


    4. To get the distinct entries from a table-
      SELECT DISTINCT empname FROM emptable


    5. Compare a part of the name rather than the entire name-
      SELECT * FROM people WHERE empname LIKE '%ab%'


    6. select first 5 records from a table-
      select top 5 * from em


    7. Select all record from emp where job not in SALESMAN  or CLERK.
      select * from emp where job not in ('SALESMAN','CLERK');


    8. records where ename starts with ‘S’ and its lenth is 6 char.
      select * from emp where ename like'S____';


    9. Records where ename may be any no of character but it should end with ‘R’
      select * from emp where ename like'%R';


    10. fetch monthly salary of each and every employee?
      select ename,sal/12 as monthlysal from emp;


 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: