Informatics Practices

Mr. Sombuddha, an HR Manager in a multinational company "Star-X World", has created the following table to store the records of employees:

Table: Emp

EidENameDepartmentDOBDOJ
Star1DevSales1994-08-282020-02-14
Star2MelindaIT1997-10-152021-11-19
Star3RajAccounts1998-10-022019-04-02
Star4MichaelSales2000-02-172020-05-01
Star5SajalIT2001-12-052018-06-13
Star6JohnAccounts1995-01-032019-07-15
Star7JuliaSales1985-11-132020-08-19

Predict the output of the following queries that he has written:

(i) Select max(year(DOB)) from emp;

(ii) Select ENAME from emp where month(DOJ) = 11;

(iii) Select length(EName) from emp where Department = "IT";

SQL Queries

3 Likes

Answer

(i)

Output
+----------------+
| max(year(DOB)) |
+----------------+
|           2001 |
+----------------+

(ii)

Output
+---------+
| ENAME   |
+---------+
| MELINDA |
+---------+

(iii)

Output
+---------------+
| length(EName) |
+---------------+
|             7 |
|             5 |
+---------------+

Answered By

1 Like


Related Questions