Tuesday, June 15, 2010

Database Testing - SQL - Simple Queries Examples

Simple Queries:

1. List all the employee details

Select * from employee;

2. List all the department details

Select * from department;

3. List all job details

Select * from job;

4. List all the locations

Select * from location;

5. List out first name,last name,salary, commission for all employees

Select first_name, last_name, salary, commission from employee;

6. List out employee_id,last name,department id for all employees and rename employee id as "ID of the employee", last name as "Name of the employee", department id as "department ID"

Select employee_id " of the employee", last_name "name", department id as "department id" from employee;

7. List out the employees annual salary with their names only.

Select last_name, salary*12 "annual salary" from employee

No comments:

Post a Comment