Searching for "he"

Q:

What are defaults? Is there a column to which a default can’t be bound?

Answer

A default is a value which will be used by a column, if no value is supplied to that column while inserting data.


Yes, IDENTITY and TIMESTAMP columns are free from the bounds of default.

Report Error

View answer Workspace Report Error Discuss

Subject: SQL

Q:

What are user defined data-types and when do you use them?

Answer

User defined data-types in SQL is an extension to the base SQL server data-types by provision of a descriptive name.


We use them to format the database and segregate specific repetitions of rows and columns in the database.

Report Error

View answer Workspace Report Error Discuss

Subject: SQL

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

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

Q:

Describe the use of PL/SQL table?

Answer

PL/SQL tables are scalar arrays that can be referenced by a binary digit. They can be used to store values for later queries and calculations.

Report Error

View answer Workspace Report Error Discuss

Subject: SQL

Q:

What is the difference between JOIN and UNION?

Answer

SQL JOIN allows access to records of other table based on the given conditions between two tables.


Ex: If we are provided with the department ID of each employee, then we can use the department ID of the employee table to merge with the department ID of the department table to access department names.


UNION operation allows addition of 2 similar data sets to create a resulting set that contains all the data from the source data sets.


Ex: If we are provided with 2 employee tables of the same structure, we can UNION them to create a singular result that will contain all employee from both the table.

Report Error

View answer Workspace Report Error Discuss

Subject: SQL

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

Q:

How will you find the 3rd max salary in the employment table?

Answer

SELECT DISTINCT(salary) FROM emp as e1 


WHERE (3) = (SELECT COUNT(DISTINCT(salary)) FROM emp as e2  WHERE e1.salary <= e2.salary)

Report Error

View answer Workspace Report Error Discuss

Subject: SQL