You are on page 1of 2

Worksheet-1

Employee Table
Name Type Remark
EmpNo Number(5) Primary Key
First Name Varchar(10)
Last Name Varchar(10)
Designation Varchar(10)
DOJ Date
Salary Number(10)
Email Varchar(20)

I Table Creation
II Describe Table
III Insert Values into Table
IV Retrieve Table
V Queries
1. Display the Employee table.
Select * from employee;

2. Display distinct names in Employee table.


Select distinct firstname from employee;

3. Select the first name and last name from employees.


Select firstname, lastname from employee;

4. Calculate a salary increase of 500 and display with name, designation and salary.
Select firstname, designation, salary+500 from employee;

5. Calculate the annual salary and display with name, designation.


Select firstname, designation, salary*12 from employee;

6. Calculate a salary increase of 500 and display with name, designation and annual
salary.
Select firstname, designation, salary*12+500 from employee;

7. Display the first name in upper case


Select upper (firstname) from employee;

8. Display the last name in lower case


Select lower (lastname) from employee;

9. Update the employee’s Email to uppercase.


Update employee set email = upper(email);

10. Concatenate and display the first name and last name as Employee name.
Select firstname||lastname as employee_name from employee;

11. Display Employee details (name and designation) in the format ‘Stefan is a Business
Analyst’
Select firstname || ' is a ' || designation from employee;

12. Display the Employee name and salary in the format ‘Stefan monthly salary=50000’
select firstname || ' monthly salary = ' || salary from employee;

You might also like