SQL 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 3631
Q:

State one similarity and difference between WHERE Clause and HAVING Clause?

Answer

Similarity: Both WHERE and HAVING Clause filters out records based on one or more conditions.


Difference: WHERE Clause can only be applied to a static non-aggregated column whereas HAVING is needed for aggregated columns.

Report Error

View answer Workspace Report Error Discuss

Subject: SQL

1 3568
Q:

The SQL SELECT statement is capable of

A) Projection B) Selection
C) Protection & Security D) Both A & B
 
Answer & Explanation Answer: D) Both A & B

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: SQL
Exam Prep: AIEEE , Bank Exams , CAT
Job Role: Analyst , Bank Clerk , Bank PO

2 3479
Q:

Which command using Query Analyzer will give you the version of SQL server and operating system?

Answer

SELECT SERVERPROPERTY ('productversion'), SERVERPROPERTY ('productlevel') and SERVERPROPERTY ('edition').

Report Error

View answer Workspace Report Error Discuss

Subject: SQL

0 3124
Q:

What is a linked server in SQL server?

Answer

It enables SQL server to address diverse data sources like OLE DB similarly. It allows Remote server access and has the ability to issue distributed queries, updates, commands and transactions.

Report Error

View answer Workspace Report Error Discuss

Subject: SQL

0 3067
Q:

How can you find a PL/SQL block, if the cursor is open?

Answer

By use of %ISOPEN status variable.


 

Report Error

View answer Workspace Report Error Discuss

Subject: SQL

0 3008
Q:

What are the rules to use the ROWGUIDCOL property to define a globally unique identifier column?

Answer

Only one column can exist per table that is attached with ROWGUIDCOL property. One can then use $ROWGUID instead of column name in select list.

Report Error

View answer Workspace Report Error Discuss

Subject: SQL

0 2926
Q:

Embedded SQL is which of the following?

A) The process of making an application capable of generating specific SQL code on the fly. B) Hard-coded SQL statements in a trigger.
C) Hard-coded SQL statements in a program language such as Java. D) Hard-coded SQL statements in a procedure.
 
Answer & Explanation Answer: C) Hard-coded SQL statements in a program language such as Java.

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: SQL
Exam Prep: AIEEE , Bank Exams , CAT
Job Role: Analyst , Bank Clerk , Bank PO

2 2872