MCQs > IT & Programming > Microsoft SQL Server MCQs > Basic Microsoft SQL Server MCQs

Basic Microsoft SQL Server MCQ

1.

What will be the output of the following SQL query? SET SHOWPLAN_TEXT ON GO SELECT * FROM abcsite.abctable GO

Answer

Correct Answer: It will show the query plan and the estimated cost of running

Note: This Question is unanswered, help us to find answer for this one

2.

Which of the following "insert queries" will be inserted in the XML field?
The creation query of the table is:
CREATE TABLE Branches(recordID int, description XML)

Answer

Correct Answer: INSERT Into Branches(recordID, description) VALUES(1, '<log><application>Sales</application><description>The connection timed out.</description></log>')

Note: This Question is unanswered, help us to find answer for this one

3.

Consider the following tables:

Customers
- - - - - - - -
Customerid
Customername
Address

Orders
- - - - -
Orderid
Customerid
Orderdate
Comments
What will be the query to fetch Customername and 1st Orderdate for order placed by each customer?

Answer

Correct Answer: Select Customers.Customername,(Select Min(Orderdate) From Orders Where Customers.Customerid=Orders.Customerid) From Customers

Note: This Question is unanswered, help us to find answer for this one

4.


Which of the following commands will be used to see the structure of the table named 'salary'?

Answer

Correct Answer: sp_help salary

Note: This Question is unanswered, help us to find answer for this one

5.


We are creating Stored Procedure in Database and using "sp_" prefix in its name. Which of the following statements is correct in accordance with the performance of the Stored Procedure execution?

Answer

Correct Answer: The prefix will slow down the execution as the prefix is reserved for system stored procedures

Note: This Question is unanswered, help us to find answer for this one

6.


The commands GRANT and REVOKE are examples of :

Answer

Correct Answer: DCL (Data Control Language)

Note: This Question is unanswered, help us to find answer for this one

7.


What exactly is the Full-Text Catalog?

Answer

Correct Answer: The Full-Text catalog is an index for searching specific keywords

Note: This Question is unanswered, help us to find answer for this one

8.


Consider the following table "Students":

Students

- - - - - -

Name                Hobbies

John                Driving

Miller                Fishing

David               Writing

Robert              Singing

What will be the output of the following query?

Select Substring(Hobbies,3) From students Where name= "john"

Answer

Correct Answer: It will give an error

Note: This Question is unanswered, help us to find answer for this one

9.


Why are Joins generally better than the Correlated sub-query?

Answer

Correct Answer: The Correlated sub-query creates a nested loop

Note: This Question is unanswered, help us to find answer for this one

10.


Starting from the slowest, arrange the following operators in the order in which they produce results in "SQL WHERE" query.

1. >, >=, <, <=

2. <>

3. =

4. LIKE

Answer

Correct Answer: 4,1,2,3

Note: This Question is unanswered, help us to find answer for this one

11.


Which one of the following statements is correct?

Answer

Correct Answer: Both a and b are correct

Note: This Question is unanswered, help us to find answer for this one

12.


State whether True or False.

Triggers can be created in Assemblies.

Answer

Correct Answer: True

Note: This Question is unanswered, help us to find answer for this one

13.


What exactly is a Super key?

Answer

Correct Answer: A Super key is a column or a set of columns that uniquely identifies rows in a table

Note: This Question is unanswered, help us to find answer for this one

14.


__________ is a container that holds tables, views, procedures, functions and so on.

Answer

Correct Answer: Schema

Note: This Question is unanswered, help us to find answer for this one

15.


Which one of the following statements about Indexes is wrong?

Answer

Correct Answer: Indexes can only be implemented on integer datatypes

Note: This Question is unanswered, help us to find answer for this one

16.


Which of the following mechanisms is used by "ENCRYPTION by passphrase" to encrypt the data in the SQL SERVER 2005?

Answer

Correct Answer: DES (Data Encryption Standard)

Note: This Question is unanswered, help us to find answer for this one

17.


Which command is used to create User defined Data Type in the SQL SERVER 2005?

Answer

Correct Answer: sp_addtype
Create Type

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

18.


Which of the following is not a Data type in the SQL SERVER 2005?

Answer

Correct Answer: nsmallmoney

Note: This Question is unanswered, help us to find answer for this one

19.


Which is the best method to handle errors and deadlocks?

Answer

Correct Answer: Errors and deadlocks can be handled by using Try and Catch constructs

Note: This Question is unanswered, help us to find answer for this one

20.


Columns are called _____________ of a table in a relational model.

Answer

Correct Answer: Attributes

Note: This Question is unanswered, help us to find answer for this one

21.


What is the maximum storage capacity of XML data type in SQL SERVER 2005?

Answer

Correct Answer: 2GB

Note: This Question is unanswered, help us to find answer for this one

22.


Consider the following table:

Order

- - - - -

Orderid

Customerid

Orderdate

Comments

Select ISNULL (Comments, 'No comments') AS comments From Order

What will be the output of the above query?

Answer

Correct Answer: The output will be "No comments", when the database entry is Null

Note: This Question is unanswered, help us to find answer for this one

23.


The table Comments has an auto incremented column called "Commentid" and a "UserComments" column, both of which store the comments of the users visiting the site. What will be the correct query to display the latest comments first?

Answer

Correct Answer: Select usercomments From Comments Order by commentid desc

Note: This Question is unanswered, help us to find answer for this one

24.


Which of the following statements is wrong?

Answer

Correct Answer: Truncate retains the identity of the table

Note: This Question is unanswered, help us to find answer for this one

25.


We have a table named "Customer" which has a column named "Customerid" having datatype Integer. We need to fetch the output with column title: 'Customer id is (value of customerid from the table)'. What will be the query?

Answer

Correct Answer: Select 'Customer id is' + CAST(customerid AS varchar) From Customer

Note: This Question is unanswered, help us to find answer for this one

26.


Which of the following are correct?

Answer

Correct Answer: With DDL, you can create and remove tables, schemas, domains, indexes and views

Note: This Question is unanswered, help us to find answer for this one

27.


You have a table "engineers" with the following table structure:

enggid                int(4)

deptname            varchar(50)

salary                int(4)

You want to display the minimum and maximum salaries of the individual departments. Which of the following queries will fetch the desired results?

Answer

Correct Answer: select deptname, min(salary) as Minimum, max(salary) as Maximum from engineers group by deptname

Note: This Question is unanswered, help us to find answer for this one

28.


The - (Negative) and ~(Bitwise NOT) are examples of the _________ type of operators.

Answer

Correct Answer: unary

Note: This Question is unanswered, help us to find answer for this one

29.


What will the following query do?

Delete Orders

Answer

Correct Answer: It will remove all rows from the Orders Table

Note: This Question is unanswered, help us to find answer for this one

30.


Which one of the following statements regarding "views" is incorrect?

Answer

Correct Answer: A view cannot be derived from another view

Note: This Question is unanswered, help us to find answer for this one

31.


A table of employees has the following values for its salary field:

10000, 11000, 12000, 10000, 14000, 12000, 13000, 10000, 14000, 10000

What will the following query return?

Select distinct (salary) from employees

Answer

Correct Answer: 10000, 11000, 12000, 14000, 13000

Note: This Question is unanswered, help us to find answer for this one

32.


Which of the following statements regarding Trigger and Stored Procedures is correct?

Answer

Correct Answer: Triggers can call Stored Procedures but Stored Procedures cannot call Triggers

Note: This Question is unanswered, help us to find answer for this one

33.


What exactly is a Foreign key?

Answer

Correct Answer: A Foreign key is used to match columns in other tables

Note: This Question is unanswered, help us to find answer for this one

34.


State whether True or False.

The 'Having' clause can not be used when there is a 'Where' clause in the statement already.

Answer

Correct Answer: False

Note: This Question is unanswered, help us to find answer for this one

35.


State whether True or False.

You can send emails through the Database engine.

Answer

Correct Answer: True

Note: This Question is unanswered, help us to find answer for this one

36.


State whether True or False.

Many-to-One is a type of relationship in RDBMS.

Answer

Correct Answer: True

Note: This Question is unanswered, help us to find answer for this one

37.


Consider the following table structure of employees:

        empid                        int(4)

        deptname                  varchar(50)

        salary                        int(4)

Which query will be used to display the Department (deptname) that is giving the maximum salary?

Answer

Correct Answer: select deptname from employees where salary =(select max(salary) from employees)

Note: This Question is unanswered, help us to find answer for this one

38.


State whether True or False.

While using the Select query, the IN clause is a better choice than the EXIST clause.

Answer

Correct Answer: False

Note: This Question is unanswered, help us to find answer for this one

39.


Which edition of the SQL SERVER 2005 will best meet the following scenario?

A company has an online shopping website named www.shoppingxyz.com. It also has to handle its line of business portion. Its main server supports 4 CPUs and a multi-core processor.

Answer

Correct Answer: SQL SERVER 2005 Workgroup Edition

Note: This Question is unanswered, help us to find answer for this one

40.


You have a table named "employees" with the following table structure:

empid                int(4)

deptname            varchar(50)

salary                int(4)

The following select query is executed on this table:

SELECT * FROM employees ORDER BY deptname DESC, salary DESC

What will be the output of the above query?

Answer

Correct Answer: Records will be shown with the deptname field and the salary field in the descending order

Note: This Question is unanswered, help us to find answer for this one

41.


Which functions does the following SQL QUERY perform?

DBCC CHECKIDENT ('table_name', RESEED, new_reseed_value)

Answer

Correct Answer: It checks the current identity field value of the specified table

Note: This Question is unanswered, help us to find answer for this one

42.


Which of the following are not Database Models?

Answer

Correct Answer: Composite model

Note: This Question is unanswered, help us to find answer for this one

43.


Examine the data in the EMPLOYEES table given below:

LAST_NAME  DEPARTMENT_ID  SALARY

Allen               10               3000

Miller               20               1500

King                20               2200

Davis               30                5000

Which of the following sub-queries work?

Answer

Correct Answer: SELECT * FROM employees where salary > (SELECT MIN(salary) FROM employees GROUP BY department_id)

Note: This Question is unanswered, help us to find answer for this one

44.


You have a table named 'employees', having the following structure.

empid int(4)

deptname varchar(50)

salary int(4)

And a view is created as follows:

create view viemployees as select * from employees

You want to insert a new row into the table having the following values:

empid=1010, deptname=HR, salary=10000.

Which of the following are the correct insert SQL queries?

Answer

Correct Answer: insert into employees values (1010, 'HR', 10000)

Note: This Question is unanswered, help us to find answer for this one

45.


Which of the following statements regarding "views" are incorrect?

Answer

Correct Answer: Data can be inserted into the table using its own view

Note: This Question is unanswered, help us to find answer for this one

46.


Which of the following operators perform pattern matching?

Answer

Correct Answer: %

Note: This Question is unanswered, help us to find answer for this one

47.


Which of the following are the SQL Transaction statements?

Answer

Correct Answer: ROLLBACK STATEMENT

Note: This Question is unanswered, help us to find answer for this one

48.


SQL SERVER 2005 provides a new feature to enable partitioning of the data in the database. But only those database objects can be partitioned which store data in the database. In accordance with the above statement, which of the following database objects can be partitioned?

Answer

Correct Answer: Table

Note: This Question is unanswered, help us to find answer for this one

49.


You have a table "engineers" with the following table structure:

enggid                int(4)

name                varchar(50)

salary                int(4)

You want to select the top 2 engineers in the decreasing order of their salaries, starting with the maximum salary. Which of the following SQL queries will fetch this data?

Answer

Correct Answer: SELECT TOP 2 * FROM engineers ORDER BY salary DESC

Note: This Question is unanswered, help us to find answer for this one

50.

What is the function of "DBCC CHECKDB" command?

Answer

Correct Answer: It checks the allocation of all the objects in the specified database

Note: This Question is unanswered, help us to find answer for this one

51.

Which of the following statements is correct?

Answer

Correct Answer: Modifications made in a table will be slower if the number of indexes is more

Note: This Question is unanswered, help us to find answer for this one

52.

State whether True or False.

A User Defined Function 'findsum' is to be created as follows:

Create function findsum(@x int, @y int)

As

Begin

Return(@x+@y)

End

But the SQL SERVER is unable to create the desired function and gives an error. The error can be removed by specifying the return type of the function

Answer

Correct Answer: True

Note: This Question is unanswered, help us to find answer for this one

53.

Which of the following is a database object?

Answer

Correct Answer: All of the above

Note: This Question is unanswered, help us to find answer for this one

54.

Which of the following statements is/are wrong?

Answer

Correct Answer: Both Primary key and Unique key don't allow NULL values

Note: This Question is unanswered, help us to find answer for this one

55.

Which of the following methods is used to backup the Transaction log on to a secondary database in order to backup and recover data in a synchronized manner?

Answer

Correct Answer: Using Log Shipping

Note: This Question is unanswered, help us to find answer for this one

56.

Which data type in the SQL SERVER 2005 converts itself into the type of data that is inserted into it?

Answer

Correct Answer: sql_variant

Note: This Question is unanswered, help us to find answer for this one

57.

Which query will be used for a particular column of a table, if 'Reading' is to be replaced by 'Writing'?

Answer

Correct Answer: Update [Table Name] set [Field Name]= (replace([Field Name],'Reading','Writing'))

Note: This Question is unanswered, help us to find answer for this one

58.

You want to select a row using cursors in the table 'qlist'. Which of the following statements DECLARES a cursor 'qselect' to perform the desired operation?

Answer

Correct Answer: DECLARE qselect CURSOR FOR SELECT * FROM qlist

Note: This Question is unanswered, help us to find answer for this one

59.

Consider the following query:

Select name from employees where name like "%_n_"

Which names will be displayed?

Answer

Correct Answer: Names containing n as the second last letter

Note: This Question is unanswered, help us to find answer for this one

60.

Which of the following is not an Aggregate function?

Answer

Correct Answer: LEN()

Note: This Question is unanswered, help us to find answer for this one

61.

Which level of data abstraction describes the data that is stored in the database and their corresponding relationships?

Answer

Correct Answer: Logical Level

Note: This Question is unanswered, help us to find answer for this one

62.

Which of the following SQL queries correctly selects the rows from the table "employees" that have NULL value in the "salary" column?

Answer

Correct Answer: SELECT * FROM employees WHERE salary is null

Note: This Question is unanswered, help us to find answer for this one

63.

Which of the following is the new sample database in the SQL SERVER 2005?

Answer

Correct Answer: AdventureWorks

Note: This Question is unanswered, help us to find answer for this one

64.

State whether True or False.

The plus (+) and minus (-) operators cannot be used to perform increment/decrement operations on datetime and smalldatetime values.

Answer

Correct Answer: False

Note: This Question is unanswered, help us to find answer for this one

65.

You have two tables emp_1 and emp_2, having the following data:

Table emp_1

Name                Date

Robert               1/5/2008

John                    1/6/2008

Michael                1/7/2008

Rachael                1/10/2008

Joey                    1/10/2008

Table emp_2

Name                Date

Lewis                1/05/2008

David                1/07/2008

George               1/11/2008

Jerry                 1/12/2008

Monica                1/12/2008

The following query is run in the Query Analyzer:

SELECT Date FROM emp_1

EXCEPT

SELECT Date FROM emp_2

What will be the result of the query?

Answer

Correct Answer: 1/6/2008, 1/10/2008

Note: This Question is unanswered, help us to find answer for this one

66.

Which among the following are the new datatypes introduced in the SQL Server 2005?

Answer

Correct Answer: varchar (max)

Note: This Question is unanswered, help us to find answer for this one

67.

Which clause will be used to extract data from Tables A and B having a similar structure but no relation between themselves?

Answer

Correct Answer: Union All

Note: This Question is unanswered, help us to find answer for this one

68.

Which of the following is not a type of Database backup in the SQL SERVER 2005?

Answer

Correct Answer: Partial backup

Note: This Question is unanswered, help us to find answer for this one

69.

State whether True or False.

The "text" and "ntext" data type can store character based data. These data types can be used in joins

Answer

Correct Answer: False

Note: This Question is unanswered, help us to find answer for this one

70.

Which of the following operators will be evaluated first in the following statement?

Select (salary+40^2*30/5) from employees

Answer

Correct Answer: ^

Note: This Question is unanswered, help us to find answer for this one

71.

Suppose e1 and e2 denote two decimal expressions with precisions p1 and p2 and scales s1 and s2, respectively. What is the result precision of the following operation on the two expressions?

 

Answer

Correct Answer: p1 - s1 + s2 + max(6, s1 + p2 + 1)

Note: This Question is unanswered, help us to find answer for this one

72.

In which of the following statements can TOP clause be used in SQL Server 2008?

Answer

Correct Answer: Only SELECT, INSERT, UPDATE, MERGE, DELETE

Note: This Question is unanswered, help us to find answer for this one

73.

 Which of the following commands is used to start the Resource Governor in SQL Server 2008?

Answer

Correct Answer: ALTER Resource Governor Reconfigure

Note: This Question is unanswered, help us to find answer for this one

74.

 Analyze the following code snippet for creating a stored procedure in SQL Server 2008:

CREATE PROCEDURE Person.GetEmployees

@LastName nvarchar(50),

@FirstName nvarchar(50)

AS

SET NOCOUNT ON

SELECT FirstName, LastName, JobTitle, Department

FROM Person.EmployeeDepartment

WHERE FirstName = @FirstName AND LastName = @LastName

GO

Which of the following is a valid code to execute the GetEmployees stored procedure?

Answer

Correct Answer: All of the above

Note: This Question is unanswered, help us to find answer for this one

75.

 Analyze the following permissions:

1.ALTER permission on the database.

2.CONTROL permission in the database.

3.ALTER ANY SCHEMA permission and CREATE XML SCHEMA COLLECTION permission in the database.

Which of the above permissions is/are required to create an XML SCHEMA COLLECTION?

Answer

Correct Answer: 1 or 2 or 3

Note: This Question is unanswered, help us to find answer for this one

76.

A local temporary stored procedure name can contain a maximum of __________ characters

Answer

Correct Answer: 116

Note: This Question is unanswered, help us to find answer for this one

77.

FILESTREAM storage is best used when the BLOB file sizes average 1MB or higher.

Answer

Correct Answer: CREATE VIEW permission in database

Note: This Question is unanswered, help us to find answer for this one

78.

Which of the following statements using GROUP BY clause are allowed in SQL Server 2008?

Answer

Correct Answer: SELECT Column1 + Column2 FROM Table GROUP BY Column1, Column2

Note: This Question is unanswered, help us to find answer for this one

79.

Which of the following is used to comment a portion of an SQL Server 2008 script?

Answer

Correct Answer: Double dash (--)

Note: This Question is unanswered, help us to find answer for this one

80.

Which of the following is the correct precedence order of the data types in SQL Server 2008?

1.xml

2.text

3.bigint

4.image

5.float

6.datetime

Answer

Correct Answer: 1,6,5,3,2,4

Note: This Question is unanswered, help us to find answer for this one

81.

Which of the following queries is used to rename a database in SQL Server 2008?

Answer

Correct Answer: sp_renamedb oldname,newname

Note: This Question is unanswered, help us to find answer for this one

82.

The output of a Transact SQL query using the GROUPING function of SQL Server 2008 is of __________ return type.

Answer

Correct Answer: tinyint

Note: This Question is unanswered, help us to find answer for this one

83.

What should a computed column be marked as so that SQL Server Database Engine can physically store values in a table?

Answer

Correct Answer: PERSISTED

Note: This Question is unanswered, help us to find answer for this one

84.

Which of the following is a valid code to remove the key used to encrypt a database using Transparent Data Encryption algorithm?

Answer

Correct Answer: DROP DATABASE ENCRYPTION KEY
DROP DATABASE ENCRYPTION KEY

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

85.

Analyze the following data types and schemas:

1.The SQL Server system data type.

2.The default schema of the current user in the current database.

3.The dbo schema in the current database.

In which order does the SQL Server Database Engine refer to type_name when a type_schema_name is NOT specified while creating a table in SQL Server 2008?

Answer

Correct Answer: 2,3,1

Note: This Question is unanswered, help us to find answer for this one

86.

Which of the following code snippets causes only partition number 1 to be rebuilt while changing the compression of a partitioned table?

Answer

Correct Answer: ALTER TABLE Table1 REBUILD PARTITION = 1 WITH (DATA_COMPRESSION = NONE) GO

Note: This Question is unanswered, help us to find answer for this one

87.

What happens to the audit records if a failure to write the Audit event does NOT trigger the SQL Server instance to shut down?

Answer

Correct Answer: Audit events are buffered in memory until they can be flushed to the target.

Note: This Question is unanswered, help us to find answer for this one

88.

Which of the following namespaces is used to manage the audit configuration programmatically in SQL Server 2008?

Answer

Correct Answer: Microsoft.SqlServer.Management.Smo

Note: This Question is unanswered, help us to find answer for this one

89.

Which of the following default passwords is used by sqlcmd if -P option is used at the end of the command prompt without a password?

Answer

Correct Answer: NULL

Note: This Question is unanswered, help us to find answer for this one

90.

The login timeout when you try to connect to a server must be a number between __________.

Answer

Correct Answer: 0 and 65534

Note: This Question is unanswered, help us to find answer for this one

91.

Which of the following permissions is required to drop a stored procedure in SQL Server 2008?

Answer

Correct Answer: Either b or c

Note: This Question is unanswered, help us to find answer for this one

92.

What is the default precision of the TIME data type in SQL Server 2008?

Answer

Correct Answer: 7 digits

Note: This Question is unanswered, help us to find answer for this one

93.

Which of the following commands is used to run a Transact-SQL script file by using sqlcmd?

Answer

Correct Answer: sqlcmd -S myServer\instanceName -i C:\newScript.sql

Note: This Question is unanswered, help us to find answer for this one

94.

Which of the following commands is used to connect to a named instance of SQL Server using the sqlcmd utility of SQL Server?

Answer

Correct Answer: sqlcmd -S myServer\instanceName

Note: This Question is unanswered, help us to find answer for this one

95.

Which of the following is the correct order of steps to be followed while using the Transparent Data Encryption security feature of SQL Server 2008?

Answer

Correct Answer: 1. Create a master key. 2. Create or obtain a certificate protected by the master key. 3. Create a database encryption key and protect it by the certificate. 4. Set the database to use encryption.

Note: This Question is unanswered, help us to find answer for this one

96.

Which of the following values specifies that each instance of the XML data type in column_name can contain multiple top-level elements?

Answer

Correct Answer: CONTENT

Note: This Question is unanswered, help us to find answer for this one

97.

What is the maximum number of columns that can be combined into a single composite index key?

Answer

Correct Answer: 16

Note: This Question is unanswered, help us to find answer for this one

98.

Which of the following data types can be specified as SPARSE?

Answer

Correct Answer: nchar

Note: This Question is unanswered, help us to find answer for this one

99.

What is the name of the default instance installed by SQL Server 2008 Express in your computer?

Answer

Correct Answer: sqlexpress

Note: This Question is unanswered, help us to find answer for this one

100.

Which of the following is a valid syntax of the ALTER SERVER AUDIT statement used to enable a server audit?

Answer

Correct Answer: ALTER SERVER AUDIT <audit_name> WITH (STATE=ON)

Note: This Question is unanswered, help us to find answer for this one

101.

What range is supported by the TIME data type in SQL Server 2008?

Answer

Correct Answer: 00:00:00.0000000 through 23:59:59.9999999

Note: This Question is unanswered, help us to find answer for this one

102.

Which of the following roles is required to connect to a Central Management Server?

Answer

Correct Answer: ServerGroupReaderRole

Note: This Question is unanswered, help us to find answer for this one

103.

Which of the following clauses of SQL Server 2008 avoids enforcing a constraint when repeated inserts are performed?

Answer

Correct Answer: NOT FOR REPLICATION

Note: This Question is unanswered, help us to find answer for this one

104.

Analyze the following code snippet:

DECLARE @myDate DATETIME2

SELECT @myDate = '2009/10/08 12:35:29.2348 +12:15'

SELECT @myDate AS '@myDate'

What is the output of the above code?

Answer

Correct Answer: 2009-10-08 12:35:29.2348000

Note: This Question is unanswered, help us to find answer for this one

105.

Which of the following stored procedures is used to delete data from the management data warehouse of a Data Collector?

Answer

Correct Answer: core.sp_purge_data

Note: This Question is unanswered, help us to find answer for this one

106.

Which of the following is the default authentication mode for sqlcmd in SQL Server 2008?

Answer

Correct Answer: Windows Authentication

Note: This Question is unanswered, help us to find answer for this one

107.

Multiple CHECK constraints can be applied to a single column and a single CHECK constraint can be applied to multiple columns in SQL Server 2008.

Answer

Correct Answer: True

Note: This Question is unanswered, help us to find answer for this one

108.

Analyze the following command:

-o "C:\Folder\<file_name>"

Which of the following statements is true if a file with the file name specified in the above command already exists?

Answer

Correct Answer: The file is overwritten.

Note: This Question is unanswered, help us to find answer for this one

109.

Which of the following features of SQL Server 2008 enables you to limit the memory used by incoming application requests?

Answer

Correct Answer: Resource Governor

Note: This Question is unanswered, help us to find answer for this one

110.

Which of the following is a valid code to change the index created on a column of a table to page compression?

Answer

Correct Answer: ALTER INDEX Index_Product ON Table1 REBUILD WITH ( DATA_COMPRESSION = PAGE ) GO

Note: This Question is unanswered, help us to find answer for this one

111.

PRIMARY KEY constraint defaults to __________ index.

Answer

Correct Answer: Clustered

Note: This Question is unanswered, help us to find answer for this one

112.

What amount of storage is required by a date variable in SQL Server 2008?

Answer

Correct Answer: 3 bytes

Note: This Question is unanswered, help us to find answer for this one

113.

What is the default precision of the date data type in SQL Server 2008?

Answer

Correct Answer: 10 digits

Note: This Question is unanswered, help us to find answer for this one

114.

What is the default timeout for login to sqlcmd while you try to connect to a server?

Answer

Correct Answer: 8 seconds

Note: This Question is unanswered, help us to find answer for this one

115.

Which of the following is a valid code to delete a clustered index with a PRIMARY KEY constraint in SQL Server 2008?

Answer

Correct Answer: ALTER TABLE Production.ProductCost DROP CONSTRAINT PK_Product WITH (ONLINE = ON) GO

Note: This Question is unanswered, help us to find answer for this one

116.

Windows Security log can be specified as a target for Audit in SQL Server 2008.

Answer

Correct Answer: True

Note: This Question is unanswered, help us to find answer for this one

117.

How many groupings are generated when CUBE is used with the GROUP BY clause of SQL Server 2008?

Answer

Correct Answer: 2^n (n= number of expressions in the element list passed to CUBE)

Note: This Question is unanswered, help us to find answer for this one

118.

Which of the following features of SQL Server 2008 evaluates servers for compliance with a set of predefined conditions and prevents making undesirable changes to servers?

Answer

Correct Answer: Policy-Based Management

Note: This Question is unanswered, help us to find answer for this one

119.

Which of the following statements is true if you create a global temporary table in SQL Server 2008 and specify a FOREIGN KEY with the CREATE TABLE command?

Answer

Correct Answer: The table is created without the FOREIGN KEY constraint and a warning message is returned.

Note: This Question is unanswered, help us to find answer for this one

120.

Which of the following evaluation modes of Policy-Based Management CANNOT be automated in SQL Server 2008?

Answer

Correct Answer: On demand

Note: This Question is unanswered, help us to find answer for this one

121.

The regular identifiers of SQL Server 2008 may contain a range of _____________ characters.

Answer

Correct Answer: 1 to 128

Note: This Question is unanswered, help us to find answer for this one

122.

What is the default value of the SORT_IN_TEMPDB clause of the relational_index_option specified at the time of creation of an index on a table in SQL Server 2008?

Answer

Correct Answer: OFF

Note: This Question is unanswered, help us to find answer for this one

123.

Which of the following is used by SQL Server 2008 Management Studio to execute scripts in regular mode in the Query Editor?

Answer

Correct Answer: Microsoft .NET Framework SqlClient

Note: This Question is unanswered, help us to find answer for this one

124.

Analyze the following code snippet:

DECLARE @myTime TIME(4) = '02:02:02.234567 +01:01'

SELECT @myTime AS '@myTime'

What is the output of the above code?

Answer

Correct Answer: 02:02:02.2346

Note: This Question is unanswered, help us to find answer for this one

125.

Which of the following commands is used to save the output to a text file after you run a Transact-SQL script using sqlcmd?

Answer

Correct Answer: sqlcmd -S myServer\instanceName -i C:\myScript.sql -o C:\new.txt

Note: This Question is unanswered, help us to find answer for this one

126. User defined data type columns can be designated with ROWGUIDCOL.

Answer

Correct Answer: False

Note: This Question is unanswered, help us to find answer for this one

127.

What is returned by NULLIF if the two expressions that it compares are NOT equal?

Answer

Correct Answer: It returns the first expression.

Note: This Question is unanswered, help us to find answer for this one

128.

An identifier denoting a global temporary object in SQL Server 2008 starts with a ______ sign.

Answer

Correct Answer: Double number(##)

Note: This Question is unanswered, help us to find answer for this one

129.

What is the maximum value for the sum of the values of MIN_CPU_PERCENT and MIN_MEMORY_PERCENT for all the resource pools of SQL Server?

Answer

Correct Answer: 100

Note: This Question is unanswered, help us to find answer for this one

130.

The Server Audit object and the Server Audit Specification object of SQL Server 2008 share a __________ relationship.

Answer

Correct Answer: One-to-one

Note: This Question is unanswered, help us to find answer for this one

131.

Analyze the following code used to update a Common Table Expression:

USE demodb

GO

DECLARE @a TABLE (ID int, Value int);

DECLARE @b TABLE (ID int, Value int);

INSERT @a VALUES (1, 10), (2, 20);

INSERT @b VALUES (1, 100),(2, 200);

WITH cte AS (SELECT * FROM @a)

UPDATE cte

SET Value = b.Value

FROM cte AS a

INNER JOIN @b AS b ON b.ID = a.ID

SELECT * FROM @a

GO

What Will be the output of the above code?

Answer

Correct Answer: ID Value ----- ----- 1 100 2 200

Note: This Question is unanswered, help us to find answer for this one

132.

Columns marked with which of the following constraints/properties allow null values to be inserted in them?

Answer

Correct Answer: UNIQUE

Note: This Question is unanswered, help us to find answer for this one

133.

For which of the following data types can a COLLATE clause be applied?

Answer

Correct Answer: text

Note: This Question is unanswered, help us to find answer for this one

134.

Which of the following permissions are required to create a view in SQL Server 2008?

Answer

Correct Answer: CREATE VIEW permission in database

Note: This Question is unanswered, help us to find answer for this one

135.

Which of the following statements are true about FILESTREAM storage in SQL Server 2008?

Answer

Correct Answer: Transact-SQL can be used to SELECT, INSERT, UPDATE, DELETE FILESTREAM data.

Note: This Question is unanswered, help us to find answer for this one

136.

Which of the following spatial data types are used in SQL Server 2008?

Answer

Correct Answer: Geography

Note: This Question is unanswered, help us to find answer for this one

137.

Which of the following statements are true about the FILESTREAM argument of SQL Server 2008?

Answer

Correct Answer: If a table contains FILESTREAM data and the table is partitioned, the FILESTREAM_ON clause must be included.

Note: This Question is unanswered, help us to find answer for this one

138.

Which of the following counters are used to monitor compression of the whole instance of SQL Server?

Answer

Correct Answer: Page compression attempts/sec

Note: This Question is unanswered, help us to find answer for this one

139.

Which of the following are valid DATETIME functions in SQL Server 2008?

Answer

Correct Answer: SYSDATETIME()

Note: This Question is unanswered, help us to find answer for this one

140.

Which of the following formats are supported by the language_term argument while altering a full-text stoplist in SQL Server 2008?

Answer

Correct Answer: Integer

Note: This Question is unanswered, help us to find answer for this one

141.

Which of the following encryption algorithms are used by the Transparent Data Encryption security mechanism of SQL Server 2008?

Answer

Correct Answer: Advanced Encryption Standard(AES)

Note: This Question is unanswered, help us to find answer for this one

142.

Which of the following security features have been introduced in SQL Server 2008?

Answer

Correct Answer: Extensible Key Management

Note: This Question is unanswered, help us to find answer for this one

143.

Which of the following statements are true regarding row and page compression in SQL Server 2008?

Answer

Correct Answer: When a table or index is created, data compression is set to NONE, unless otherwise specified.

Note: This Question is unanswered, help us to find answer for this one

144.

Which of the following statements are true?

Answer

Correct Answer: IGNORE_DUP_KEY cannot be set to ON for XML indexes.

Note: This Question is unanswered, help us to find answer for this one

145.

Which of the following data types are supported by SQL Server 2008?

Answer

Correct Answer: date

Note: This Question is unanswered, help us to find answer for this one

146.

Which of the following options are available for the DATA_COMPRESSION clause specified for a table in SQL Server 2008?

Answer

Correct Answer: Page

Note: This Question is unanswered, help us to find answer for this one

147.

Which of the following rules must be followed for combining the result sets of two queries by using UNION?

Answer

Correct Answer: The number of columns must be same in all queries.

Note: This Question is unanswered, help us to find answer for this one

148.

Which of the following statements using GROUP BY clause are allowed in SQL Server 2008?Which of the following statements using GROUP BY clause are allowed in SQL Server 2008?

Answer

Correct Answer: Which of the following statements using GROUP BY clause are allowed in SQL Server 2008?

Note: This Question is unanswered, help us to find answer for this one

149. How many audit action groups are available for a server in SQL Server 2008 to perform different actions on audit data?


Answer

Correct Answer: 35

Note: This Question is unanswered, help us to find answer for this one

150. Which of the following options is used to change the value of the password variable and exit using sqlcmd?


Answer

Correct Answer: -Z

Note: This Question is unanswered, help us to find answer for this one

151. Which of the following Audit objects primarily describes the destination where the audit data of SQL Server 2008 gets stored?


Answer

Correct Answer: Server Audit object

Note: This Question is unanswered, help us to find answer for this one

152. Which of the following statements is NOT true about the UNIQUE constraint of SQL Server 2008?


Answer

Correct Answer: UNIQUE constraint cannot be referenced by a FOREIGN KEY constraint

Note: This Question is unanswered, help us to find answer for this one

153. Which of the following arguments of the fn_get_audit_file() function of SQL Server 2008 specifies the directory indicating the location and audit file set to be read?


Answer

Correct Answer: File_pattern

Note: This Question is unanswered, help us to find answer for this one

154. All MDX, DMX and XML/A errors are displayed in the Error List window of the SQL Server 2008. Management Studio.


Answer

Correct Answer: False 

Note: This Question is unanswered, help us to find answer for this one

155. Analyze the following code which uses the TOP clause of SQL Server 2008:

USE Person
GO
DECLARE @p AS int
SELECT @p=10
SELECT TOP(@p)
FROM Employee
GO

What Will be the output of the above code?


Answer

Correct Answer: An incorrect syntax error is displayed.

Note: This Question is unanswered, help us to find answer for this one

156. Which of the following compression features have been introduced in SQL Server 2008 that were NOT supported by SQL Server 2005?


Answer

Correct Answer: Data file level compression
Backup level compression 

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

157. What is the data type of the parameter "Audit_file_offset" of function "fn_get_audit_file()" in SQL Server 2008?


Answer

Correct Answer: nvarchar

Note: This Question is unanswered, help us to find answer for this one

158. Which of the following scripting options are available while creating a script using the shortcut menu from the Object Explorer in SQL Server 2008 Management Studio?


Answer

Correct Answer: CREATE INDEX To
UPDATE To 

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

159. Analyze the following code using wild card characters of SQL Server 2008:

SELECT Name
FROM person.employees
WHERE Name LIKE '[_]n'
GO

Which of the following values will be returned by the above code?


Answer

Correct Answer: _n

Note: This Question is unanswered, help us to find answer for this one

160. Which of the following methods can be specified for the lock escalation of a table in SQL Server 2008?


Answer

Correct Answer: ENABLE
AUTO
DISABLE

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

161. Which of the following options is NOT supported by the ON DELETE clause of a FOREIGN KEY constraint of SQL Server 2008?


Answer

Correct Answer: DELETE

Note: This Question is unanswered, help us to find answer for this one

162. What is the maximum number of processors that can be used in parallel plan execution using the MAXDOP option in SQL Server 2008?

Answer

Correct Answer: 64 processors

Note: This Question is unanswered, help us to find answer for this one

163. Each table in SQL Server 2008 can have up to ______ nonclustered indexes.

Answer

Correct Answer: 999

Note: This Question is unanswered, help us to find answer for this one

164. What is the default maximum precision of decimal data type in SQL Server 2008?


Answer

Correct Answer: 18

Note: This Question is unanswered, help us to find answer for this one

165. Which of the following features is used by SQL Server Audit to create and manage audits in SQL Server 2008?


Answer

Correct Answer: SQL DDL syntax

Note: This Question is unanswered, help us to find answer for this one

166. What is the return type of the value returned by @@DATEFIRST in SQL Server 2008?


Answer

Correct Answer: date

Note: This Question is unanswered, help us to find answer for this one

167. The AND operator displays a row if ANY conditions listed are true. The OR operator displays a row if ALL of the conditions listed are true


Answer

Correct Answer: False 

Note: This Question is unanswered, help us to find answer for this one

168. Which of the following constraints can be used to enforce the uniqueness of rows in a table?  


Answer

Correct Answer: PRIMARY KEY and UNIQUE constraints 

Note: This Question is unanswered, help us to find answer for this one

169. What is the correct SQL syntax for selecting all the columns where the "LastName" is alphabetically between (and including) "Hansen" and "Pettersen"?


Answer

Correct Answer: SELECT * FROM Persons WHERE LastName BETWEEN 'Hansen' AND 'Pettersen'

Note: This Question is unanswered, help us to find answer for this one

170. The sales database contains a customer table and an order table. For each order there is one   and only one customer, and for each customer there can be zero or more orders. How should primary and foreign key fields be placed into the design of this database?


Answer

Correct Answer: A primary key should be created for the customer_id field in the customer table and a foreign key should be created for the customer_id field in the order table

Note: This Question is unanswered, help us to find answer for this one

171. Which of the following is not a valid character datatype in SQL Server?


Answer

Correct Answer: VARTEXT 

Note: This Question is unanswered, help us to find answer for this one

172. What is the correct SQL syntax for returning all the columns from a table named "Persons" sorted REVERSE alphabetically by "FirstName"?



Answer

Correct Answer: SELECT * FROM Persons ORDER BY FirstName DESC

Note: This Question is unanswered, help us to find answer for this one

173. Consider the following queries:

1. select * from employee where department LIKE "[^F-M]%";
2. select * from employee where department = '[^F-M]%';

Select the correct option:



Answer

Correct Answer: Query 2 is perfectly correct

Note: This Question is unanswered, help us to find answer for this one

174. State which of the following are true


Answer

Correct Answer: Views are a logical way of looking at the physical data located in the tables

Note: This Question is unanswered, help us to find answer for this one

175. Examine the query:-

         select (2/2/4) from tab1;

where tab1 is a table with one row. This would give a result of:



Answer

Correct Answer: .25

Note: This Question is unanswered, help us to find answer for this one

176. What is the numeric range that is supported by the datatype tinyint?


Answer

Correct Answer: 0-255

Note: This Question is unanswered, help us to find answer for this one

177. Which of the following is/are not (a) valid binary datatype in SQL Server?


Answer

Correct Answer: BIT

Note: This Question is unanswered, help us to find answer for this one

178. Which of the following queries is valid?


Answer

Correct Answer: Select name from students group by subject, name;

Note: This Question is unanswered, help us to find answer for this one

179. Which one of the following correctly selects rows from the table myTable that have null in column column1?


Answer

Correct Answer: SELECT * FROM myTable WHERE column1 is null

Note: This Question is unanswered, help us to find answer for this one

180. The STUDENT_GRADES table has these columns:

STUDENT_ID        INT
SEMESTER_END        DATETIME
GPA                FLOAT


Which of the following statements finds the highest Grade Point Average (GPA) per semester?


Answer

Correct Answer: SELECT MAX(gpa) FROM student_grades WHERE gpa IS NOT NULL GROUP BY semester_end

Note: This Question is unanswered, help us to find answer for this one

181. Which of the following datatypes is not supported by SQL-Server?


Answer

Correct Answer: All are supported

Note: This Question is unanswered, help us to find answer for this one

182. Is the following statement true or false?

A column that allows NULLs requires more space to store a value.



Answer

Correct Answer: True

Note: This Question is unanswered, help us to find answer for this one

183. The IF UPDATE (column_name) parameter in a trigger definition will return
TRUE in case of an INSERT statement being executed on the triggered table:


Answer

Correct Answer: Yes

Note: This Question is unanswered, help us to find answer for this one

184. Sample Code

CREATE TABLE table1(
column1 varchar(50),
column2 varchar(50),
column3 varchar(50),
column4 varchar(50));

Which one of the following is the correct syntax for adding the column named "column2a" to the table shown above?


Answer

Correct Answer: ALTER TABLE table1 ADD column2a varchar(50);

Note: This Question is unanswered, help us to find answer for this one

185. Examine the description of the STUDENTS table:

STD_ID                INT
COURSE_ID        VARCHAR (10)
START_DATE        DATETIME
END_DATE        DATETIME


The aggregate functions valid on the START_DATE column are:


Answer

Correct Answer: COUNT(start_date)

Note: This Question is unanswered, help us to find answer for this one

186. Consider the following table structure of students:
        rollno        int
        name          varchar(20)
        course        varchar(20)

What will be the query to display the courses in which the number of students
enrolled is more than 5?



Answer

Correct Answer: Select course from students group by course having count(*) 5;

Note: This Question is unanswered, help us to find answer for this one

187. Consider the transaction:

        Begin Transaction
                Create table A ( x smallint ,  y smallint )
                Create table B ( p smallint , q smallint )

                Update A set x=600 where y > 700
                Update B set p=78 where q=99
            
                If @@ error != 0
                Begin
                        RollBack Transaction
                        Return
                End

        Commit Transaction
        
Select the correct option:



Answer

Correct Answer: It will report an error

Note: This Question is unanswered, help us to find answer for this one

188. What does BLOB stand for?


Answer

Correct Answer: Binary Large Object

Note: This Question is unanswered, help us to find answer for this one

189. What happens if you type the following statement at the T-SQL prompt?

SELECT getdate()



Answer

Correct Answer: It will print the current date

Note: This Question is unanswered, help us to find answer for this one

190. Which of the following are aggregate functions in SQL?


Answer

Correct Answer: Avg

Note: This Question is unanswered, help us to find answer for this one

191. Which of the following is an invalid statement for manipulation of binary data?



Answer

Correct Answer: displaytext

Note: This Question is unanswered, help us to find answer for this one

192. What does referential integrity (also called relational integrity) prevent?  


Answer

Correct Answer: One-to-many or many-to-many relationships between columns in a table 

Note: This Question is unanswered, help us to find answer for this one

193. Which one of the following must be specified in every DELETE statement?


Answer

Correct Answer: Table Name

Note: This Question is unanswered, help us to find answer for this one

194. Which of the following are false for batches (batch commands)?



Answer

Correct Answer: None of the statements in the batch is executed if there are any fatal errors<br>in the batch 

Note: This Question is unanswered, help us to find answer for this one

195. Examine the two SQL statements given below:

SELECT last_name, salary, hire_date FROM EMPLOYEES ORDER BY salary DESC

SELECT last_name, salary, hire_date FROM EMPLOYEES ORDER BY 2 DESC

What is true about them?



Answer

Correct Answer: The two statements produce identical results

Note: This Question is unanswered, help us to find answer for this one

196. Is it possible to insert several rows into a table with a single INSERT statement?


Answer

Correct Answer: Yes

Note: This Question is unanswered, help us to find answer for this one

197. You want to display the titles of books that meet the following criteria:

1. Purchased before November 11, 2002
2. Price is less than $500 or greater than $900

You want to sort the result by the date of purchase, starting with the most recently bought book.

Which of the following statements should you use?


Answer

Correct Answer: SELECT Book_title FROM books WHERE (price &lt; 500 OR price &gt; 900) AND purchase_date &lt; '11/11/2002' ORDER BY purchase_date DESC;

Note: This Question is unanswered, help us to find answer for this one

198. Which of the following statements are true?


Answer

Correct Answer: soundex(smith) is the same as soundex(smyth)

Note: This Question is unanswered, help us to find answer for this one

199. Which of the following statements are false?


Answer

Correct Answer: trim() function is used to remove leading and trailing spaces from a string

Note: This Question is unanswered, help us to find answer for this one

200. How can you view the structure of a table named "myTable" in SQL Server?


Answer

Correct Answer: sp_columns myTable

Note: This Question is unanswered, help us to find answer for this one

201. You should avoid the use of cursors because:



Answer

Correct Answer: Programs with cursors take more time to run, hence performance degrades

Note: This Question is unanswered, help us to find answer for this one

202. View the following Create statement:

1 Create table Pers
2(EmpNo Int not null,
3 EName Char not null,
4 Join Datetime not null,
5 Pay Smallmoney)

Which line contains an error?


Answer

Correct Answer: 4

Note: This Question is unanswered, help us to find answer for this one

203. Which of the following is not a column property?

Answer

Correct Answer: Default

Note: This Question is unanswered, help us to find answer for this one

204. A production house needs a sale report where total sale of the day is more than $20,000. Which of the following query should be used?

Answer

Correct Answer: select count(OrderDate),sum(amount) from orders group by OrderDate having sum(amount) 20000

Note: This Question is unanswered, help us to find answer for this one

205. What is the order of precedence among the following operators?

                        1 IN
                        2 NOT
                        3 AND
                        4 OR


Answer

Correct Answer: 1,2,3,4

Note: This Question is unanswered, help us to find answer for this one

206. Which of the following is not a global variable?


Answer

Correct Answer: @@colcount

Note: This Question is unanswered, help us to find answer for this one

207. Which of the following is not a valid Arithmetic operator in SQL Server?


Answer

Correct Answer: \

Note: This Question is unanswered, help us to find answer for this one

208. Which one of the following fields is the ideal candidate for the primary key in a student record base?  


Answer

Correct Answer: System generated ID 

Note: This Question is unanswered, help us to find answer for this one

209. Is the FROM clause necessary in every SELECT statement?


Answer

Correct Answer: No 

Note: This Question is unanswered, help us to find answer for this one

210. Choose the appropriate query for the Products table where data should be displayed primarily in ascending order of the ProductGroup column. Secondary sorting should be in descending order of the CurrentStock column.



Answer

Correct Answer: Select * from Products order by ProductGroup,CurrentStock DESC

Note: This Question is unanswered, help us to find answer for this one

211. What is the maximum value that can be stored for a datetime field?


Answer

Correct Answer: Dec 31, 9999

Note: This Question is unanswered, help us to find answer for this one

212. Which of the following options is correct about identity(seed, increment)?



Answer

Correct Answer: None of the above 

Note: This Question is unanswered, help us to find answer for this one

213. Which of the following statements about SQL Server comments is false?



Answer

Correct Answer: // is used for single line comments

Note: This Question is unanswered, help us to find answer for this one

214. Which of the following is not a control statement?


Answer

Correct Answer: do...while

Note: This Question is unanswered, help us to find answer for this one

215. Which of the following is/are true with reference to Triggers?


Answer

Correct Answer: Manipulating columns of datatype IMAGE / TEXT does not cause triggers to be executed

Note: This Question is unanswered, help us to find answer for this one

216. When designing a database table, how do you avoid missing column values for non-primary key columns?  


Answer

Correct Answer: Use DEFAULT and NOT NULL constraints

Note: This Question is unanswered, help us to find answer for this one

217. What is the correct order of clauses in the select statement?

1        select
2        order by
3        where
4        having
5        group by



Answer

Correct Answer: 1,3,5,4,2

Note: This Question is unanswered, help us to find answer for this one

218. A company has the following departments:

marketing, Designing, production, Packing

What will be the result of the following query?

select * from table where department < 'marketing';


Answer

Correct Answer: The query will return "Designing"

Note: This Question is unanswered, help us to find answer for this one

219. Study the situation described below and identify the nature of relationship?

Each student can enroll into more than one class. Each class can accommodate more than one student.



Answer

Correct Answer: M to N

Note: This Question is unanswered, help us to find answer for this one

220. Which of the following is the syntax for creating an Index?



Answer

Correct Answer: CREATE [UNIQUE] INDEX index_name ON tbl_name (index_columns) 

Note: This Question is unanswered, help us to find answer for this one

221. Which of the following is false with regards to sp_help?


Answer

Correct Answer: All of the above are true 

Note: This Question is unanswered, help us to find answer for this one

222. Select the correct option:



Answer

Correct Answer: Optimistic locking is a locking scheme handled by the server, whereas pessimistic locking is handled by the application developer

Note: This Question is unanswered, help us to find answer for this one

223. Consider the following two tables:

1.  customers( customer_id, customer_name)
2.  branch ( branch_id, branch_name )

What will be the output if the following query is executed:

    Select *, branch_name from customers,branch



Answer

Correct Answer: It will return the fields customer_id, customer_name, branch_id, branch_name, branch_name

Note: This Question is unanswered, help us to find answer for this one

224. A table has following values for its department field:

marketing, production, production, sales, NULL, NULL, Marketing, Null

What will the following query return:

Select distinct(department) from employees


Answer

Correct Answer: marketing, production, sales, NULL

Note: This Question is unanswered, help us to find answer for this one

225. Is this statement true or false:

A cursor is a pointer that identifies a specific working row within a set



Answer

Correct Answer: True

Note: This Question is unanswered, help us to find answer for this one

226. In which sequence are queries and sub-queries executed by the SQL Engine?



Answer

Correct Answer: sub sub query ; sub query ; prime query

Note: This Question is unanswered, help us to find answer for this one

227. Consider the following statements and pick the correct answer:

1. ceiling() - returns the smallest integer greater than or equal to the specified value
2. floor() - returns the largest integer less than or equal to the specified value



Answer

Correct Answer: Both 1 and 2 are true

Note: This Question is unanswered, help us to find answer for this one

228. ___________  is the highest level of a transaction isolation implemented by SQL Server.


Answer

Correct Answer: Serializable 

Note: This Question is unanswered, help us to find answer for this one

229. Examine the code given below:

SELECT employee_id FROM employees WHERE commission_pct=.5 OR salary > 23000

Which of the following statements is correct with regard to this code?


Answer

Correct Answer: It returns employees who have 50% commission rate or salary greater than $23,000

Note: This Question is unanswered, help us to find answer for this one

230. How can you change "Hansen" into "Nilsen" in the LastName column in the Persons
Table?


Answer

Correct Answer: UPDATE Persons SET LastName = 'Nilsen' WHERE LastName = 'Hansen'

Note: This Question is unanswered, help us to find answer for this one

231. What is wrong with the following query in accordance with performance?

SELECT * FROM [Table_Name] WHERE LOWER(Field_Name) = 'name'


Answer

Correct Answer: T-Sql is not case sensitive. Hence, the LOWER keyword is not required

Note: This Question is unanswered, help us to find answer for this one

232. Which of the following is not a Method call of .NET class for Assemblies in the SQL Server?


Answer

Correct Answer: Aggregate

Note: This Question is unanswered, help us to find answer for this one

233. Which of the following is not a logical operator?


Answer

Correct Answer: with 

Note: This Question is unanswered, help us to find answer for this one

234. Which of the following is not a relational operation?


Answer

Correct Answer: Extraction

Note: This Question is unanswered, help us to find answer for this one

235. What does DBCC stand for?

Answer

Correct Answer: Database Console Commands

Note: This Question is unanswered, help us to find answer for this one

236. SQL Server will create a unique nonclustered index, by default, when a primary key is created.

Answer

Correct Answer: False

Note: This Question is unanswered, help us to find answer for this one

237. Backup and restore history is stored in which database?

Answer

Correct Answer: msdb

Note: This Question is unanswered, help us to find answer for this one

238. Which data extents are backed up by a differential database backup?

Answer

Correct Answer: All data extents changed since the most recent full database backup

Note: This Question is unanswered, help us to find answer for this one

239. Which system database holds information on SQL Server Agent jobs?

Answer

Correct Answer: msdb

Note: This Question is unanswered, help us to find answer for this one

240. What is the benefit of using the TRY_CAST() function?

Answer

Correct Answer: If the cast to the desired data type fails, the result is NULL

Note: This Question is unanswered, help us to find answer for this one

241. How is FILESTREAM data stored?

Answer

Correct Answer: As files in a file-system directory

Note: This Question is unanswered, help us to find answer for this one

242. With automatic conflict resolution in peer-to-peer replication, which update wins the conflict?

Answer

Correct Answer: The one from the highest peer_originator_id

Note: This Question is unanswered, help us to find answer for this one

243. What does the ROLLBACK TRANSACTION statement do?

Answer

Correct Answer: Rolls back to the start of the outer transaction

Note: This Question is unanswered, help us to find answer for this one

244. Which clause allows you to filter the result of a column that has been aggregated?

Answer

Correct Answer: HAVING

Note: This Question is unanswered, help us to find answer for this one

245. What does CTE stand for?

Answer

Correct Answer: Common Table Expression

Note: This Question is unanswered, help us to find answer for this one

246. A table can have more than one primary key.

Answer

Correct Answer: False

Note: This Question is unanswered, help us to find answer for this one

247. A stored procedure can recursively call itself.

Answer

Correct Answer: True

Note: This Question is unanswered, help us to find answer for this one

248. In database mirroring, an instance can be a mirror in some mirroring sessions and a witness in other mirroring sessions.

Answer

Correct Answer: True

Note: This Question is unanswered, help us to find answer for this one

249. What are the three Transact-SQL statements that are related to authorization?

Answer

Correct Answer: GRANT, DENY, and REVOKE

Note: This Question is unanswered, help us to find answer for this one

250. In SQL Server 2012 and later versions, the sysadmin password requires at least 8 characters and which of the following character types?

Answer

Correct Answer: All of these

Note: This Question is unanswered, help us to find answer for this one

251. Which constraint type specifies that a column contains column values from another table?

Answer

Correct Answer: Foreign key

Note: This Question is unanswered, help us to find answer for this one

252. A member of the sysadmin role is allowed to perform which actions?

Answer

Correct Answer: Any action in SQL server

Note: This Question is unanswered, help us to find answer for this one

253. What is the order of precedence of ORDER BY and GROUP BY?

Answer

Correct Answer: GROUP BY then ORDER BY

Note: This Question is unanswered, help us to find answer for this one

254. A primary key can be created using a column that allows NULL values.

Answer

Correct Answer: False

Note: This Question is unanswered, help us to find answer for this one

255. To find all employees whose name ends with 'ith', complete this sql statement: "SELECT * FROM employees WHERE name " ...

Answer

Correct Answer: LIKE "%ith"

Note: This Question is unanswered, help us to find answer for this one

256. Which service is used to run scheduled jobs?

Answer

Correct Answer: SQL Server Agent Service

Note: This Question is unanswered, help us to find answer for this one

257. Which of the following statements prevents users from performing actions?

Answer

Correct Answer: DENY

Note: This Question is unanswered, help us to find answer for this one

258. True or false? Foreign keys always point to other tables.

Answer

Correct Answer: False

Note: This Question is unanswered, help us to find answer for this one

259. By default, SQL Server treats NULL as what data type

Answer

Correct Answer: INT

Note: This Question is unanswered, help us to find answer for this one

260. When retrieving data, which command may be used to rotate a set of column names from horizontal across the top to vertically, appearing as values among the result set

Answer

Correct Answer: UNPIVOT

Note: This Question is unanswered, help us to find answer for this one

261. Can you select the built in Server Roles for SQL Server from the list below?

Answer

Correct Answer: diskadmin

Note: This Question is unanswered, help us to find answer for this one

262. What does the EOMONTH function do?

Answer

Correct Answer: Adds the specified number of months to the input start date and then returns the last day of the month for the resulting date

Note: This Question is unanswered, help us to find answer for this one

263. The command DBCC CHECKDB allows you to do what?

Answer

Correct Answer: Check the average page density

Note: This Question is unanswered, help us to find answer for this one

264. What is a collection of zero or more continuous CircularString and/or LineString instances of either geometry or geography types called?

Answer

Correct Answer: CompoundCurve

Note: This Question is unanswered, help us to find answer for this one

265. Which of the following is not a valid data type in SQL Server 2012?

Answer

Correct Answer: smalldatetime2

Note: This Question is unanswered, help us to find answer for this one

266. What would be the output of following statement: Select * from tbl_Employee where Emp_Name=NULL

Answer

Correct Answer: Header without any data

Note: This Question is unanswered, help us to find answer for this one

267. Which of the following is not a valid string constant or hexadecimal constant?

Answer

Correct Answer: 'New York"

Note: This Question is unanswered, help us to find answer for this one

268. Can a unique key with not null constraint make it a primary key?

Answer

Correct Answer: FALSE

Note: This Question is unanswered, help us to find answer for this one

269. Which of the following standard reports will show you the fragmentation of the physical indexes?

Answer

Correct Answer: Index Physical Statistics

Note: This Question is unanswered, help us to find answer for this one

270. What is the name of the database that gets created in SQL Server 2012 when you create an "Integration Services Catalog"?

Answer

Correct Answer: SSISDB

Note: This Question is unanswered, help us to find answer for this one

271. The LAG analytic function is used in a ______ statement to compare values in the current row with values in a previous row.

Answer

Correct Answer: SELECT

Note: This Question is unanswered, help us to find answer for this one

272. Which of the following stores FileStream data?

Answer

Correct Answer: FileTable

Note: This Question is unanswered, help us to find answer for this one

273. You are querying a table that contains a field with the data type XML and need only rows that have a particular value in the XML data. Which of the following would not result in an error

Answer

Correct Answer: SELECT * FROM #table1 WHERE xml_field1.value('(/PageContent/Text)[1]', 'varchar(100)') LIKE '%smith%'

Note: This Question is unanswered, help us to find answer for this one

274. True or false? Intersection tables should have an autoincrement column as the primary index

Answer

Correct Answer: False

Note: This Question is unanswered, help us to find answer for this one

275. Which of the following relationships requires a reference table?

Answer

Correct Answer: Many to many

Note: This Question is unanswered, help us to find answer for this one

276. Which versions of SQL Server support table partitioning?

Answer

Correct Answer: Enterprise edition

Note: This Question is unanswered, help us to find answer for this one

277. Which of the following best describes the flow for the execution of a CLR stored procedure?

Answer

Correct Answer: Source code > Object code > Executable code > Procedure as database object

Note: This Question is unanswered, help us to find answer for this one

278. TRUE OR FALSE: Is it possible to execute a Stored Procedure in a UDF.

Answer

Correct Answer: False

Note: This Question is unanswered, help us to find answer for this one

279. Which of the following is used to change tracking?

Answer

Correct Answer: Use triggers or use change data capture (CDC)

Note: This Question is unanswered, help us to find answer for this one

280. Which of the following statements removes one or more previously granted or denied permissions?

Answer

Correct Answer: REVOKE

Note: This Question is unanswered, help us to find answer for this one

281. Which statement is allowed inside of a User Defined Function?

Answer

Correct Answer: DECLARE

Note: This Question is unanswered, help us to find answer for this one

282. True or False? You cannot execute dynamic SQL code from a function.

Answer

Correct Answer: True

Note: This Question is unanswered, help us to find answer for this one

283. "Unique Constraint" can be created on a column that accepts NULL

Answer

Correct Answer: True

Note: This Question is unanswered, help us to find answer for this one

284. All Database Backup/Restore Related information stored in which system database?

Answer

Correct Answer: MSDB

Note: This Question is unanswered, help us to find answer for this one

285. A relationship that identifies that a column contains primary key values from another table is referred as what?

Answer

Correct Answer: Foreign key

Note: This Question is unanswered, help us to find answer for this one

286. "SELECT name FROM t1 UNION SELECT name FROM t2 " is the same as "SELECT DISTINCT name FROM t1 UNION ALL SELECT DISTINCT name FROM t2"

Answer

Correct Answer: False

Note: This Question is unanswered, help us to find answer for this one

287. Which of the following is NOT an aggregate function in SQL Server?

Answer

Correct Answer: RANK

Note: This Question is unanswered, help us to find answer for this one

288. "SELECT UNIQUE city FROM customers" will return what data set?

Answer

Correct Answer: An error.

Note: This Question is unanswered, help us to find answer for this one

289. True or False? The EXEC keyword and the EXEC() function are equivalent to each other.

Answer

Correct Answer: False

Note: This Question is unanswered, help us to find answer for this one

290. Which of the following indices does NOT change the physical order of the rows in the table?

Answer

Correct Answer: Nonclustered Indices

Note: This Question is unanswered, help us to find answer for this one

291. Which statement adds a row to a table?

Answer

Correct Answer: INSERT INTO

Note: This Question is unanswered, help us to find answer for this one

292. "Primary Key" can only be created on a column that doesn't accept NULL

Answer

Correct Answer: True

Note: This Question is unanswered, help us to find answer for this one

293. Which of the following statements are related to transactions?

Answer

Correct Answer: All of these

Note: This Question is unanswered, help us to find answer for this one

294. Which clause would you use to perform conditional filtering on aggregate data in a query that uses "GROUP BY"?

Answer

Correct Answer: HAVING

Note: This Question is unanswered, help us to find answer for this one

295. What is CTE

Answer

Correct Answer: Common Table Expresssion

Note: This Question is unanswered, help us to find answer for this one

296. A sysadmin user is allowed to perform what actions?

Answer

Correct Answer: Any action in SQL server

Note: This Question is unanswered, help us to find answer for this one

297. What is a cursor in SQL Server?

Answer

Correct Answer: A special T-SQL construct used to iterate through the individual records returned by a query

Note: This Question is unanswered, help us to find answer for this one

298. Which is the slowest?

Answer

Correct Answer: TABLE scan

Note: This Question is unanswered, help us to find answer for this one

299. Which of the following acts as the Database Engine

Answer

Correct Answer: Both Windows security and SQL Server security

Note: This Question is unanswered, help us to find answer for this one

300. What is the default port number for SQL Server?

Answer

Correct Answer: 1433

Note: This Question is unanswered, help us to find answer for this one

301. What does the "IN" clause do?

Answer

Correct Answer: Compares a specified value against a list of values and is true if a match is found

Note: This Question is unanswered, help us to find answer for this one

302. In regard to SQL Server Mirroring - A server instance can be a partner in some sessions and a witness in other sessions.

Answer

Correct Answer: True

Note: This Question is unanswered, help us to find answer for this one

303. What does the Query Analyzer, or SQL Server Management Studio, tool do?

Answer

Correct Answer: All of these

Note: This Question is unanswered, help us to find answer for this one

304. What is the role of a processadmin user?

Answer

Correct Answer: Manages processes running in an instance of SQL Server

Note: This Question is unanswered, help us to find answer for this one

305. Differential backups do what?

Answer

Correct Answer: Copy only the information that has changed since the last full backup

Note: This Question is unanswered, help us to find answer for this one

306. In this statement, "SELECT * FROM employees e JOIN timesheets t ON t.employeeid = e.employeeid ", the JOIN term is the same as:

Answer

Correct Answer: INNER JOIN

Note: This Question is unanswered, help us to find answer for this one

307. Data Transformation Services do what?

Answer

Correct Answer: They provide an extremely flexible method for importing and exporting data between a Microsoft SQL Server and other formats

Note: This Question is unanswered, help us to find answer for this one

308. a FOREIGN KEY constraint can reference a UNIQUE constraint

Answer

Correct Answer: True

Note: This Question is unanswered, help us to find answer for this one

309. Which of the following is a benefit of SQL Server replication?

Answer

Correct Answer: All of these

Note: This Question is unanswered, help us to find answer for this one

310. What is the default isolation level in SQL Server?

Answer

Correct Answer: Read Commited

Note: This Question is unanswered, help us to find answer for this one

311. Which of the following statements will remove a UDF?

Answer

Correct Answer: DROP FUNCTION

Note: This Question is unanswered, help us to find answer for this one

312. Consider the following queries: A: select * from [tbl1] union select * from [tbl2]; B: select * from [tbl1] union all select * from [tbl2]; What is the difference between these two queries?

Answer

Correct Answer: Query A will return both result sets with duplicates removed; Query B will return both full result sets.

Note: This Question is unanswered, help us to find answer for this one

313. You can create index on views.

Answer

Correct Answer: True

Note: This Question is unanswered, help us to find answer for this one

314. What does COALESCE do?

Answer

Correct Answer: Evaluates the arguments in order and returns the current value of the first expression that initially does not evaluate to NULL.

Note: This Question is unanswered, help us to find answer for this one

315. Which transaction isolation level allows dirty reads?

Answer

Correct Answer: READ UNCOMMITED

Note: This Question is unanswered, help us to find answer for this one

316. Which of the following SQL Server 2012 date functions return a value of date and/or time data type from the given parts?

Answer

Correct Answer: All of these

Note: This Question is unanswered, help us to find answer for this one

317. The ________ data type can be used to store values of different data types at the same time, including numeric values, strings, and date values.

Answer

Correct Answer: SQL_VARIANT

Note: This Question is unanswered, help us to find answer for this one

318. Which of the following are not default database schemas?

Answer

Correct Answer: pte

Note: This Question is unanswered, help us to find answer for this one

319. What is the "WITH RECOMPILE" statement used for?

Answer

Correct Answer: Causes SQL Server to rebuild the query plan for a stored procedure on every call

Note: This Question is unanswered, help us to find answer for this one

320. Which of the following allows you to modify (update or delete) all values of the parent table?

Answer

Correct Answer: CASCADE

Note: This Question is unanswered, help us to find answer for this one

321. What is the name of the service that provides ETL capabilities for SQL Server for data import, data integration and data warehousing needs?

Answer

Correct Answer: SSIS

Note: This Question is unanswered, help us to find answer for this one

322. When creating indexes in SQL, what two main factors must be considered?

Answer

Correct Answer: Performance versus disk space

Note: This Question is unanswered, help us to find answer for this one

323. What is a "CROSS APPLY" used for?

Answer

Correct Answer: Performing joins between calculated sets

Note: This Question is unanswered, help us to find answer for this one

324. Which sql function finds the length of a string field?

Answer

Correct Answer: LEN

Note: This Question is unanswered, help us to find answer for this one

325. What is the default port of Microsoft SQL Server (for TCP)?

Answer

Correct Answer: 1433

Note: This Question is unanswered, help us to find answer for this one

326. In which context is the ROW_NUMBER() function valid?

Answer

Correct Answer: select ... ROW_NUMBER() over (partition by [group_val] order by [id]) as [row] ...;

Note: This Question is unanswered, help us to find answer for this one

327. True or False? Every row in a FileTable represents a file or a directory.

Answer

Correct Answer: True

Note: This Question is unanswered, help us to find answer for this one

328. When you are dealing with lots of NULL Values in columns,which datatype is better?

Answer

Correct Answer: Variable Length

Note: This Question is unanswered, help us to find answer for this one

329. To Improve stored procedure performance,which statement below is used to write beginning of SP?

Answer

Correct Answer: SET NOCOUNT ON

Note: This Question is unanswered, help us to find answer for this one

330. What does DBCC stand for?

Answer

Correct Answer: Database Consistency Commands

Note: This Question is unanswered, help us to find answer for this one

331. Which of the following SQL Server built-in functions is nondeterministic?

Answer

Correct Answer: GETDATE()

Note: This Question is unanswered, help us to find answer for this one

332. Given a table with the following schema: create table table1 (field1 int) The table contains 1000 records. What would the following sql statement result in: update top (100) table1 set field1 = 1

Answer

Correct Answer: Update the field1 column to the value 1 in only 100 records in the table

Note: This Question is unanswered, help us to find answer for this one

333. GETDATE() is a ....... function?

Answer

Correct Answer: Nondeterministic

Note: This Question is unanswered, help us to find answer for this one

334. Which Transact-SQL statement should you include at the beginning of a stored procedure to ensure that if the stored procedure raises a run-time error, the entire transaction is terminated and rolled back?

Answer

Correct Answer: SET XACT_ABORT ON

Note: This Question is unanswered, help us to find answer for this one

335. True or false? Adding TOP to a select always improves performance.

Answer

Correct Answer: False

Note: This Question is unanswered, help us to find answer for this one

336. A ________ is an alphanumerical, hexadecimal, or numberic constant.

Answer

Correct Answer: literal value

Note: This Question is unanswered, help us to find answer for this one

337. Which of the following storage options can be used to store LOBs and save storage?

Answer

Correct Answer: Both FILESTREAM and Sparse columns

Note: This Question is unanswered, help us to find answer for this one

338. In SQL Server 2012 introduces what new feature?

Answer

Correct Answer: Always On

Note: This Question is unanswered, help us to find answer for this one

339. Which of the following operators allows the specification of two or more expressions to be used for a query search?

Answer

Correct Answer: IN

Note: This Question is unanswered, help us to find answer for this one

340. Which of the following is not considered a Boolean Operator?

Answer

Correct Answer: IN

Note: This Question is unanswered, help us to find answer for this one

341. True or false: You can modify data in a table using a User Defined Function.

Answer

Correct Answer: False

Note: This Question is unanswered, help us to find answer for this one

342. Microsoft SQL Server 2012 includes TRY_CAST() Function, what is the advantage of using this function

Answer

Correct Answer: When casting to desired data type failed it will result NULL

Note: This Question is unanswered, help us to find answer for this one

343. Which of the following aggregate functions are supported by the Transact-SQL language?

Answer

Correct Answer: All of these are supported

Note: This Question is unanswered, help us to find answer for this one