0% found this document useful (0 votes)
21 views3 pages

Practical 3

The document outlines a practical assignment for a Database Management System course, focusing on various SQL functions related to employee data. It includes tasks such as formatting names, generating email addresses, calculating salary raises, and displaying hire dates with specific conditions. The assignment requires the use of a provided employee schema to perform these operations.

Uploaded by

22bce281
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views3 pages

Practical 3

The document outlines a practical assignment for a Database Management System course, focusing on various SQL functions related to employee data. It includes tasks such as formatting names, generating email addresses, calculating salary raises, and displaying hire dates with specific conditions. The assignment requires the use of a provided employee schema to perform these operations.

Uploaded by

22bce281
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Database Management System (2CS505CC23)

Practical No : 3

Aim : 1. Functions
 Numeric, Date, String and Conversion

Use the schema employees from prac_3.sql script (attached


with mail).

Do as directed:
1) Display the first name in lower case and last name in upper
case, for all employees whose employee number is in the range
between 80 and 150.
2) Generating new email address
a) For each employee, display the first name, last name, and
email address. The email address will be composed from the
first letter of first name, concatenated with the
three first letters of last name, concatenated
with @oracle.com.
b) For each employee, display the first name, last name, and
email address. The email address will be composed from the
first letter of first name, concatenated with the
three last letters of last name, concatenated
with @oracle.com.
3) For each employee, display the first name concatenated with
the last name, concatenated with hire date.
4) Display the last name for all employees where last name’s
length is greater than 8 characters.
5) For each employee, display the first name, last name, phone
number and a new phone number. In the new phone number,
replace all occurrences of 515 with 815.
6) For each employee, display first name, salary, salary after a
raise of 12%, salary after a raise of 12%, expressed as a whole
number, salary after a raise of 12%, round down to the
nearest whole number.
7) For each employee, display the first name, hire date, hire date
minus 10 days, hire date plus one month, and the day
difference between current date and hire date.
8) For each employee, display the first name, last name, hire
date, number of months he works in the company, and
number of years he works in the company.
9) For each employee, display the first name, hire date, and hire
date plus one year.
10) For each employee, display the first name, hire date, hire
date rounded up to the nearest year, and hire date rounded up
to the nearest month.
11) For each employee, display the first name, the day of his
hire date, and the year of his hire date.
12) Display the last name in upper case, the salary in format
model : ‘9,999.999’, and hire date in format model:
‘DD/MM/YYYY’, for all employees whose last name begins with
the letter D or K (without using like).
13) For each employee, display the first name, last name,
salary and commission percentage. If an employee doesn’t
earn a commission, display 0 instead of NULL.
14) For each employee, display the first name, last name,
salary and commission percentage. If an employee doesn’t
earn a commission, display “No Commission” instead of
NULL.
15) For each employee, display the first name, last name,
salary, and a salary grade based on these conditions :
a) if the salary is between 0 and 5000 – salary grade level
is A
b) if the salary is between 5001 and 15000 – salary grade
level is B
c) if the salary is between 15001 and 20000 – salary
grade level is C
d) for any other range – salary grade level is D
16) Display the first name, salary and round the salary to
thousands.
17) Display all the employees who joined in the month of
May.
18) Display the first word in job title.
19) Display the length of first name for employees whose
last name contains character ‘b’ after the third position.
(Without using like).
20) Display first name of the employees whose experience in
more than 5 years.

You might also like