22bce20428 DBMS Lab4
22bce20428 DBMS Lab4
Name:- D.S.S.SASHANK
Reg No:- 22BCE20428
Slot:- L41 – L42
LAB-4
1) Display the bdate of all employee s in the format ‘DDthMonthYYYY’
SQL code:
OUTPUT:
SQL code:
OUTPUT:
3) Display the employee names having ‘salt lake’ in their address
SQL code:
OUTPUT:
SQL code:
OUTPUT:
SQL code:
OUTPUT:
6) Display the names of all the employees having supervisor with any of the
following SSN '987-65-4321', '123-45-6789'
SQL code:
SELECT firstName, lastName
FROM Employee
WHERE SupervisorSSN IN ('987-65-4321', '123-45-6789');
OUTPUT:
7) Display all the department names in upper case and lower case
SQL code:
SELECT
UPPER(DName) AS UpperCaseDepartmentName,
LOWER(DName) AS LowerCaseDepartmentName
FROM Department;
OUTPUT:
8) Display the first four characters and last four of the department names using
substring
function
SQL code:
SELECT
SUBSTRING(DName, 1, 4) AS FirstFourCharacters,
SUBSTRING(DName, -4) AS LastFourCharacters
FROM Department;
OUTPUT: