0% found this document useful (0 votes)
5 views2 pages

Test 1

The document contains information about two tables: EmployeeInfo and EmployeePosition, detailing employee names, departments, and positions along with their respective salaries and joining dates. It also includes a series of SQL query requests aimed at retrieving specific data from these tables, such as employee names in uppercase, employee counts in departments, and filtering records based on various criteria. The queries cover a range of operations including data selection, string manipulation, and table creation.

Uploaded by

user.prayag2
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)
5 views2 pages

Test 1

The document contains information about two tables: EmployeeInfo and EmployeePosition, detailing employee names, departments, and positions along with their respective salaries and joining dates. It also includes a series of SQL query requests aimed at retrieving specific data from these tables, such as employee names in uppercase, employee counts in departments, and filtering records based on various criteria. The queries cover a range of operations including data selection, string manipulation, and table creation.

Uploaded by

user.prayag2
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/ 2

EmployeeInfo Table:

EmpI EmpFna EmpLna Departme Proje Gend


Address DOB
D me me nt ct er
Hyderabad(HY 01/12/19
1 Sanjay Mehra HR P1 M
D) 76
02/05/19
2 Ananya Mishra Admin P2 Delhi(DEL) F
68
01/01/19
3 Rohan Diwan Account P3 Mumbai(BOM) M
80
Hyderabad(HY 02/05/19
4 Sonia Kulkarni HR P1 F
D) 92
03/07/19
5 Ankit Kapoor Admin P2 Delhi(DEL) M
94

EmployeePosition Table:

EmpID EmpPosition DateOfJoining Salary


1 Manager 01/05/2024 500000
2 Executive 02/05/2024 75000
3 Manager 01/05/2024 90000
2 Lead 02/05/2024 85000
1 Executive 01/05/2024 300000

a. Write a query to fetch the EmpFname from the EmployeeInfo table in the upper
case and use the ALIAS name as EmpName.
b. Write a query to fetch the number of employees working in the department
‘HR’.
c. Write a query to get the current date.
d. Write a query to retrieve the first four characters of EmpLname from the
EmployeeInfo table.
e. Write a query to fetch only the place name(string before brackets) from the
Address column of EmployeeInfo table.
f. Write a query to create a new table that consists of data and structure copied
from the other table.
g. Write q query to find all the employees whose salary is between 50000 to 100000.
h. Write a query to find the names of employees that begin with ‘S’
i. Write a query to fetch all the records from the EmployeeInfo table ordered by
EmpLname in descending order and Department in the ascending order.
j. Write a query to fetch details of employees whose EmpLname ends with an
alphabet ‘A’ and contains five alphabets.
k. Write a query to fetch details of all employees excluding the employees with first
names, “Sanjay” and “Sonia” from the EmployeeInfo table.
l. Write a query to fetch details of employees with the address as “DELHI(DEL)”.
m. Write a query to display the first and the last record from the EmployeeInfo
table.

You might also like