SQL QUERIES_From internet - Part I 1 SQL Interview Questions Display the dept information from department table select from dept 2 Display the details

SQL QUERIES_From internet - Part I 1 SQL Interview...

This preview shows page 1 - 2 out of 13 pages.

1 of 13 Part - I SQL Interview Questions 1.Display the dept information from department table. 2.Display the details of all employees. 3.Display the name and job for all employees. 4.Display name and salary for all employees. 5.Display employee number and total salary for each employee. 6.Display employee name and annual salary for all employees. 7.Display the names of all employees who are working in department number 10. select ename from emp where deptno=10; 8.Display the names of all employees working as clerks and drawing a salary more than 3000. select ename from emp where job=?CLERK? and sal>3000; 9.Display employee number and names for employees who earn commission. select empno, ename from emp where comm is not null and comm>0; 10.Display names of employees who do not earn any commission. 11.Display the names of employees who are working as clerk, salesman or analyst and drawing a salary more than 3000. 12.Display the names of employees who are working in the company for the past 5 years. 13.Display the list of employees who have joined the company before 30thJune 90 or after 31stdec 90. select * from emp where hiredate between ?30-jun-1990? and ?31-dec-1990?; 14.Display current date. 15.Display the list of users in your database (using log table). 16.Display the names of all tables from the current user. 17.Display the name of the current user. 18.Display the names of employees working in department number 10 or 20 or 40 or employees working as clerks, salesman or analyst. select ename from emp where deptno in (10,20,40) or job in (?CLERK?,?SALESMAN?,?ANALYST?); 19.Display the names of employees whose name starts with alphabet S. select ename from emp where ename like ?S%?; 20.Display employee names for employees whose name ends with alphabet. select ename from emp where ename like ?%S?; 21.Display the names of employees whose names have second alphabet A in their names. select ename from emp where ename like ?_S%?;
Image of page 1
Image of page 2

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture