Tuesday, 22 September 2015

SQL Questions frequently asked in interviews for freshers based on Employee table|Sql Interview Questions

SQL Questions frequently asked in interviews for freshers based on Employee table .
Sql interview Questions for freshers ,all sql queries for the beginners ,sql Questions and Answers are given bellow . 
Sql Interview Questions
SQL Queries on Employee table EMP and Department Table DEPT :
EMP : Employee Table DEPT :Department Table
Q 1 : What is the Query for to Display all the information of the EMP  table?
Answer :  select * from emp;
the syntax for the selecting any table is Select * from (Table Name);
Q 2 : What is the Query for to Display unique Jobs from EMP table?
Answer :  select distinct job from emp;
 similar query for this Query is
    select unique job from emp;

Q 3 : What is the Query for to List out the emps in the asc order of their Salaries?
Answer :  select * from emp order by sal asc;
Q 4 : What is the Query for to List out the details of the emps in asc order of the Dptno's and desc of Jobs?
Answer :  select * from emp order by deptno asc,job desc;
Q 5 : What is the Query for to Display all the unique job groups in the descending order?
Answer :  select distinct job from emp order by job desc;
Q 6 : What is the Query for to Display all the details of all ‘Mgrs’ ?
 Answer :  Select * from emp where empno in ( select mgr from emp) ;
Q 7 : What is the Query for List the emps who joined before 1981?
Answer :  select * from emp where hiredate < (’01-jan-81’);
Q 8 : What is the Query for to List the Empno, Ename, Sal, Daily sal of all emps in the asc order of Annsal ?
Answer : select empno ,ename ,sal,sal/30,12*sal annsal from emp order by annsal asc;
Q 9 : What is the Query for to Display the Empno, Ename, job, Hiredate, Exp of all Mgrs ?
Answer : select empno,ename ,job,hiredate, months_between(sysdate,hiredate) exp from emp where empno in (select mgr from emp);
Q 10 : What is the Query for to List the Empno, Ename, Sal, Exp of all emps working for Mgr 7369 ?
 Answer : select empno,ename,sal,exp from emp where mgr = 7369;
Q 11 : What is the Query for to Display all the details of the emps whose Comm. Is more than their Sal ?
Answer :select * from emp where comm. > sal;
Q 12 : What is the Query for to List the emps in the asc order of Designations of those joined after the second half of 1981?

Answer :select * from emp where hiredate > (’30-jun-81’) and to_char(hiredate,’YYYY’) = 1981 order by job asc;
Q 13 : What is the Query for to List the emps along with their Exp and Daily Sal is more than Rs.100?
Answer :  select * from emp where (sal/30) >100;
Q 14 : What is the Query for to List the emps who are either ‘CLERK’ or ‘ANALYST’ in the Desc order ?
Answer :  select * from emp where job = ‘CLERK’ or job = ‘ANALYST’ order by job desc;
Q 15 : What is the Query for to List the emps who joined on 1-MAY-81,3-DEC-81,17-DEC-81,19-JAN-80 in asc order of seniority?
Answer :  select * from emp where hiredate in (’01-may-81’,’03-dec-81’,’17-dec-81’,’19-jan-80’) order by hiredate asc;
Q 16 : What is the Query for to List the emp who are working for the Deptno 10 or20 ?
Answer :  select * from emp where deptno = 10 or deptno = 20 ;
Q 17 : What is the Query for to List the emps who are joined in the year 81 ?
Answer :  select * from emp where hiredate between ’01-jan-81’ and ’31-dec-81’;
Q 18 : What is the Query for to List the emps who are joined in the month of Aug 1980 ?
Answer :  
select * from emp where hiredate between ’01-aug-80’ and ’31-aug-80’; (OR)
select * from emp where to_char(hiredate,’mon-yyyy’) =’aug-1980;
Q 19 : What is the Query for to List the emps Who Annual sal ranging from 22000 and 45000 ?
Answer :  select * from emp where 12*sal between 22000 and 45000;
Q 20 : What is the Query for to List the Enames those are having five characters in their Names ?
Answer :  select ename from emp where length (ename) = 5;
Tags: Sql Queries and Answers , Sql Queries on employee , Sql Queries asked in interview , All SQL Questions(Queries) frequently asked in interviews for fresher's based on Employee table, All Sql Queries on emp and dept tables wipro frequently asked Questions , employee table related queries , Sql Queries on dept table and employee tables ,frequently asked interview Questions on Sql Queries, Sql Queries for fresher's to crack the interview ,SQL PLUS Questions ,SQL Questions and answers for the frequently asked interviews, what is the query for the to display employee details , Interview Questions for freshers to crack their technical round.  

NOTE: Post your sql queries as a comments we will give answers as our best.

2 comments:

  1. Hi There,


    You make learning and reading addictive. All eyes fixed on you. Thank you being such a good and trust worthy guide.

    is there a cube function to get a hole column in excel(writing every item in one cell) from the data model in power pivot? and for this column (sellers) I need a distinct row.


    I read multiple articles and watched many videos about how to use this tool - and was still confused! Your instructions were easy to understand and made the process simple.


    Merci Beaucoup,
    Lisa

    ReplyDelete
  2. Sql Questions Frequently Asked In Interviews For Freshers Based On Employee Table >>>>> Download Now

    >>>>> Download Full

    Sql Questions Frequently Asked In Interviews For Freshers Based On Employee Table >>>>> Download LINK

    >>>>> Download Now

    Sql Questions Frequently Asked In Interviews For Freshers Based On Employee Table >>>>> Download Full

    >>>>> Download LINK

    ReplyDelete

 
Copyright © . MSBI SQL SERVER SSIS SSRS INTERVIEW TIPS - Posts · Comments
Theme Template by BTDesigner · Powered by Blogger