Sql Server Interview Questions and Answers (1758) - Page 76

Give example of NChar Function?

Select NChar(65);

Output:-
A


Select NChar(66);

Output:-
B


It is just opposite of ASCII function.
What is return type of NChar Function?

Return type of NChar function is always NChar(1).
How to get the Date Part of a Date/Time Value?

Just write below query to get date part:-
SELECT CAST(FLOOR(CAST(GETDATE() AS FLOAT)) AS DATETIME) AS 'Date Part';


OUTPUT
2015-05-16 00:00:00.000

How to get the Time Part of a Date/Time Value?

Write below query:-

SELECT GETDATE() as col1,CAST(CAST(GETDATE() AS FLOAT) - FLOOR(CAST(GETDATE() AS FLOAT)) AS DATETIME) as col2;


col1
2015-04-07 15:32:28.100
col2
1900-01-01 15:32:28.097

How to retrieve All Tables and Number of Rows on Sql Server.

Write below query:-
SELECT OBJECT_NAME(Object_id) As TableName, SUM(Rows) As TotalRows

FROM sys.partitions
WHERE OBJECTPROPERTY(Object_id, 'IsUserTable') = 1 AND Index_ID IN (0,1)
GROUP BY OBJECT_NAME(Object_id)
ORDER BY TableName;

Which of the following statements is true concerning sub-queries in Sql Server?

NOTE: This is objective type question, Please click question title for correct answer.
A UNION query is which of the following?

NOTE: This is objective type question, Please click question title for correct answer.
In employee table, Change the designation of Retail and Sales manager designation as Sales Manager Designation Manages(Retail and Sales) Manager(Production) Manager(Marketing) Manager(Shipping and Receiving) Manager(Shipping and Receiving) Manager(Marketing) Manager(Retail and Sales)

Answer:
The designation can be changed using below update statement. CHARINDEX() function will Searches an expression for another expression (Retail and Sales) and returns its starting position, Stuff() function inserts a string (Sales) into another string (designation column). It also deletes a specified length of characters in the first string at the start position and then inserts the second string into the first string at the start position.

update employee set designation = Stuff(designation ,CHARINDEX('retail and sales',designation),16,'Sales') from employee where designation like '%retail and sales%'

What are sub reports in SQL Server Reporting Services and how to create them ?

A sub report is like any other reports which can be called in main report and can be generate through main report. Parameters can be passed from main report to sub report and basis of that report can be generated.
What is the purpose of ETL process in DW?

Extract Transform and Load is a process in data warehousing that involves:
1. Extracting data from outside/multiple sources
2. Transforming it to fit operational needs (which can include quality levels)
3. Loading it into the end target (database, data mart or data warehouse)
What is meant by Total Quality Management (TQM) in data warehousing?

Total Quality management is to improve customer satisfaction by having continual improvement of all aspects of the organization. TQM uses strategy, data, and effective communication to integrate the quality principles into the culture and activities of the organization
What is meant by Joining Process in data warehousing?

In ETL process, the Transformation step involves/requires joining data from several sources, generating aggregates, deriving new calculated values...
ETL stands for ?

NOTE: This is objective type question, Please click question title for correct answer.
Which of the following is Transient data in data warehouse?

NOTE: This is objective type question, Please click question title for correct answer.
Which of the following relationship suits for Star Schema?

NOTE: This is objective type question, Please click question title for correct answer.
Which of the following is the EXTRACT process?

NOTE: This is objective type question, Please click question title for correct answer.
Found this useful, bookmark this page to the blog or social networking websites. Page copy protected against web site content infringement by Copyscape

 Interview Questions and Answers Categories