Technology Questions

Q:

Write SQL Query to find second highest salary of Employee.

Answer

There are many ways to find second highest salary of Employee in SQL, you can either use SQL Join or Subquery to solve this problem. Here is SQL query using Subquery :


SELECT MAX(Salary) from Employee WHERE Salary NOT IN (select MAX(Salary) FROM Employee );

Report Error

View answer Workspace Report Error Discuss

Subject: SQL

2 3906
Q:

State the difference between View and Materialized View ?

Answer

The main differenc between View and Materialized View states that -


1. View means it stores the SQL statement in the database and let you use it as a table. Everytime you access the view, the SQL statement executes.


2. Materialized view means it stores the results of the SQL in table form in the database. SQL statement only executes once and after that everytime you run the query, the stored result set is used. Advantage include quick query results.

Report Error

View answer Workspace Report Error Discuss

6 3903
Q:

Explain storage qualifiers in C++

Answer

i.) Const - This variable means that if the memory is initialised once, it should not be altered by a program. 


ii.) Volatile - This variable means that the value in the memory location can be altered even though nothing in the program code modifies the contents. 


iii.) Mutable - This variable means that a particular member of a structure or class can be altered even if a particular structure variable, class, or class member function is constant.

Report Error

View answer Workspace Report Error Discuss

Subject: C++

1 3902
Q:

How to rebuild Master Database?

Answer

Master database is system database and it contains information about running server's configuration. When SQL Server 2005 is installed it usually creates master, model, msdb, tempdb resource and distribution system database by default. Only Master database is th one which is absolutely must have database. Without Master database SQL Server cannot be started. This is the reason it is extremely important to backup Master database.


To rebuild the Master database, Run Setup.exe, verify, and repair a SQL Server instance, and rebuild the system databases. This procedure is most often used to rebuild the master database for a corrupted installation of SQL Server.

Report Error

View answer Workspace Report Error Discuss

Subject: SQL

0 3899
Q:

How to write Regression test cases? What are the criteria?

Answer

Regression test cases are also based on the requirement documents. They are written more into detail and with every release (build), the testers need to do regression testing. The criteria for regression testing are; there should be no major defects while we do our smoke test and functional testing.

Report Error

View answer Workspace Report Error Discuss

Subject: QA Testing

0 3896
Q:

Write a c program for bubble sort.

Answer

#include<stdio.h>
int main(){

  int s,temp,i,j,a[20];

  printf("Enter total numbers of elements: ");
  scanf("%d",&s);

  printf("Enter %d elements: ",s);
  for(i=0;i<s;i++)
      scanf("%d",&a[i]);

  //Bubble sorting algorithm
  for(i=s-2;i>=0;i--){
      for(j=0;j<=i;j++){
           if(a[j]>a[j+1]){
               temp=a[j];
              a[j]=a[j+1];
              a[j+1]=temp;
           }
      }
  }

  printf("After sorting: ");
  for(i=0;i<s;i++)
      printf(" %d",a[i]);

  return 0;
}

Report Error

View answer Workspace Report Error Discuss

Subject: Web Technology

0 3895
Q:

What are the advantages of using friend classes?

Answer

- Friend classes are useful when a class wants to hide features from users which are needed only by another, tightly coupled class. 


- Implementation details can be kept safe by providing friend status to a tightly cohesive class.

Report Error

View answer Workspace Report Error Discuss

Subject: C++

0 3893
Q:

Can you explain how to insert an image in table in oracle?

Answer

Insert image into a table


Create the following table:


      create table pics_table (


      bfile_id number,


      bfile_desc varchar2(30),


      bfile_loc bfile,


      bfile_type varchar2(4))


      TABLESPACE appl_data


      storage (initial 1m next 1m pctincrease 0) 


Insert Query:


      INSERT INTO pics_table


      VALUES(4,'test image',bfilename('GIF_FILES','Test.JPG'),'JPEG'); 

Report Error

View answer Workspace Report Error Discuss

Subject: Oracle

2 3890