You are on page 1of 9

LAB JOURNAL # 03

LOGICAL OPERATORS &


SINGLE ROW FUNCTIONS

Program: Software Engineering


Class: DBMS Lab
Submitted to: Ms.Iqra Basharat
Submitted by: Zain Ul Abdin Haider
Enrollment #: 01-131202-034

BAHRIA UNIVERSITY ISLAMABAD CAMPUS


Objective:
• Single Row Operators
• Logical Operators

Submitted On: 26 March 2022

Evaluation Marks:

Evaluated by Lab Engineer: Ms.Iqra Basharat


PART A - SINGLE ROW FUNCTIONS
LAB TASK # 01
Truncate and round off 25.67 to -2 decimal place from table dual.

LAB TASK 2
Display ename, salary and concatenated result of deptno and empno from table EMP where salary is
less than 2500 or job is equal to MANAGER.
LAB TASK 3
Display ename, job, and salary from table EMP where job is SALESMAN and job is PRESIDENT or salary is
greater than 1500.

LAB TASK 4
Display first 3 characters of ename, deptno and job from table EMP where second character of ename is
‘A’ and deptno is 30 or job is SALESMANS
LAB TASK 5
Right Append dollar sign to make salary 8 digit value and calculate remainder of annual salary from
monthly salary and rename it as REMAINDER where ename is KING and salary is greater than 1500 from
table EMP.

LAB TASK 6
Round 345.6665 upto 2 digits from table DUAL

PART B – WORKING WITH DATES

LAB TASK 1

Display the date, 15 days after today’s date using the DUAL table.
LAB TASK 2

Display the hire dates for all employees who started in 1982. Display the employee number, hire date,
and month started using the ROUND and TRUNC functions.

LAB TASK 3

List the name and hire date of all employees. The hire date must be appear in the following format:
“Seventh of February
LAB TASK 4

Write a query that displays enames with first letter capitalized and all other letters in lowercase, length
of enames and duration of employment for all employees whose enames start with J, A or N. Give each
column an appropriate label. Sort the results by the enames.

LAB TASK 5

For each employee, display the enames, hire date, salary and calculate the number of months between
today and the hire date, label this column Months Worked. Sort the results by the number of months
employed. Round the number of months up to the closest whole number.
LAB TASK 6

Create a query that displays enames, hire date and annual salaries with dollar sign at right side to make
it 10 digit. Convert the months_worked value of employees to char value and round it up to the nearest
whole month value.

LAB TASK 7

Display the names and hire dates of all the employees who joined on February 22, 1981.
LAB TASK 8

For all employees employed for fewer than 200 months, display the employee number, hire date,
number of months employed, six-month review date, first Friday after hire date, and last day of the
month when hired.

CONCLUSION

In this lab, we have learned to implement the single row functions. We also performed functions using
logical operators and worked with dates.

THANK YOU

You might also like