Sql Server Interview Questions and Answers Part 4

21. What is .MDF File?
.MDF is Master data file it contains the actual information corresponding to a table.
 
22. What is .LDF File?
      .LDF is a Log data file its contains the transaction information
 
23.Display the total salary being paid to all employees.
      select sum(sal)  as totalsalary from EMPTABLE;
 
24.Display the maximum, minimum and average salaries from EMPTABLE table.
       select max(sal),min(sal),avg(sal)   from EMPTABLE;
 
25.Display the maximum salary being paid to CLERK.
      select max(sal) from EMPTABLE where job='CLERK';
 
26.Display the maximum salary being paid to depart number 20.
       select max(sal) from EMPTABLE where deptno=20;
 
27.Display the minimum salary being paid to any SALESMAN.
       select min(sal) from EMPTABLE where job='SALESMAN';
 
28.Display the average salary drawn by MANAGERS.
       select avg(sal) from EMPTABLE where job='MANAGER';
 
29.Display the total salary drawn by ANALYST working in departs number 40.
       select sum(sal) from EMPTABLE where job='ANALYST' and deptno=40;
 
30.Display depart numbers and total number of employees working in each department.
       select deptno,count(deptno)from EMPTABLE  group by deptno;





Subscribe

Receive Quality Tutorials Straight in your Inbox by submitting your Email below:

Delivered by FeedBurner

Protected by Copyscape Duplicate Content Checker