0 votes
2.8k views
in General by (35.7k points)
closed by

Mr. Som, a HR Manager in a multinational company “Star-X world” has created the following table to store the records of employees: 

Table: Emp

Eid EName Department DOB DOJ
Star1 Ivan Sales 1994-08-28 2020-02-14
Star2 Melinda IT 1997-10-15 2021-11-19
Star3 Raj Accounts 1998-10-02 2019-04-02
Star4 Michael Sales 2000-02-17 2020-05-01
Star5 Sajal IT 2001-12-05 2018-06-13
Star6 John Accounts 1995-01-03 2019-07-15
Star7 Julia Sales 1985-11-13 2020-08-19

He has written following queries: 

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

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

Predict the output. 

OR 

Based on the table given above, help Mr. Som writing queries for the following task: 

i) To display the name of eldest employee and his/her date of birth. 

ii) To display the name of those employees whose joining month is May.

1 Answer

+1 vote
by (36.0k points)
selected by
 
Best answer

Mr. Som, a HR Manager in a multinational company “Star-X world” has created the following table to store the records of employees: Table: Emp

Eid EName Department DOB DOJ
Star1 Ivan Sales 1994-08-28 2020-02-14
Star2 Melinda IT 1997-10-15 2021-11-19
Star3 Raj Accounts 1998-10-02 2019-04-02
Star4 Michael Sales 2000-02-17 2020-05-01
Star5 Sajal IT 2001-12-05 2018-06-13
Star6 John Accounts 1995-01-03 2019-07-15
Star7 Julia Sales 1985-11-13 2020-08-19

Output: 

i) 2001 

ii) Melinda 

OR 

Queries: 

i) select ENAME,min(year(DOB)) from emp; 

ii) select ENAME from emp where month(DOJ)=5;

by (10 points)
correct answer for Q1) select max(year(DOB)) from emp;
will be 2021

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...