Search This Blog

Wednesday

SQL exam 70-461 questions and answers part 7



MS-SQL exam 70-461 questions and answers dumps find all part
QUESTION 81
You administer several Microsoft SQL Server 2012 database servers.
Merge replication has been configured for an application that is distributed across offices throughout a wide area network (WAN).
Many of the tables involved in replication use the XML and varchar (max) data types. Occasionally, merge replication fails due to timeout errors.
You need to reduce the occurrence of these timeout errors.
What should you do?
A. Set the Merge agent on the problem subscribers to use the slow link agent profile.
B. Create a snapshot publication, and reconfigure the problem subscribers to use the snapshot publication.
C. Change the Merge agent on the problem subscribers to run continuously.
D. Set the Remote Connection Timeout on the Publisher to 0.

  Ans: A

QUESTION 82
You administer a Microsoft SQL Server 2012 database that has Trustworthy set to on. You create a stored procedure that returns database-level information from Dynamic Management Views. You grant User1 access to execute the stored procedure.
You need to ensure that the stored procedure returns the required information when User1 executes the stored procedure. You need to achieve this goal by granting the minimum permissions required.
What should you do? (Each correct answer presents a complete solution. Choose all that apply.)
A. Create a SQL Server login that has VIEW SERVER STATE permissions. Create an application role and a secured password for the role.
B. Modify the stored procedure to include the EXECUTE AS OWNER statement. Grant VIEW SERVER STATE permissions to the owner of the stored procedure.
C. Create a SQL Server login that has VIEW SERVER STATE permissions. Modify the stored procedure to include the EXECUTE AS {newlogin} statement.
D. Grant the db_owner role on the database to User1.
E. Grant the sysadmin role on the database to User1.
Answer: BC



QUESTION 83
You use Microsoft SQL Server 2012 to develop a database application.
You need to implement a computed column that references a lookup table by using an INNER JOIN against another table.
What should you do?
A. Reference a user-defined function within the computed column.
B. Create a BEFORE trigger that maintains the state of the computed column.
C. Add a default constraint to the computed column that implements hard-coded values.
D. Add a default constraint to the computed column that implements hard-coded CASE statements.

Answer: A

QUESTION 84
You administer a Microsoft SQL Server 2012 server.
You plan to deploy new features to an application. You need to evaluate existing and potential clustered and non-clustered indexes that will improve performance.
What should you do?


A. Query the sys.dm_db_index_usage_stats DMV.
B. Query the sys.dm_db_missing_index_details DMV.
C. Use the Database Engine Tuning Advisor.
D. Query the sys.dm_db_missing_index_columns DMV.


Answer: C

QUESTION 84
You administer a Microsoft SQL Server database named Sales.
The database is 3 terabytes in size.
The Sales database is configured as shown in the following table. You discover that Sales_2.ndf is corrupt.
You need to recover the corrupted data in the minimum amount of time.
What should you do?

A. Perform a file restore.
B. Perform a transaction log restore.
C. Perform a restore from a full backup.
D. Perform a filegroup restore.
A



QUESTION 85
What is the difference between the simple CASE expression and the searched CASE expression?
A. The simple CASE expression is used when the database recovery model is simple, and the searched CASE expression is used when it's full or bulk logged.
B. The simple CASE expression compares an input expression to multiple possible expressions in the WHEN clauses, and the searched CASE expression uses independent predicates in the WHEN clauses.
C. The simple CASE expression can be used anywhere in a query, and the searched CASE expression can be used only in the WHERE clause.
D. The simple CASE expression can be used anywhere in a query, and the searched CASE expression can be used only in query filters (ON, WHERE, HAVING).
Answer: B

QUESTION 86
Why is it important to use standard SQL code when possible and know what is standard and what isn't? (Choose all that apply.)
A. It is not important to code using standard SQL.
B. Standard SQL code is more portable between platforms.
C. Standard SQL code is more efficient.
D. Knowing what standard SQL code is makes your knowledge more portable.

Answer: BD


QUESTION 87
Which of the following is not a violation of the relational model?

A. Using ordinal positions for columns
B. Returning duplicate rows
C. Not defining a key in a table
D. Ensuring that all attributes in the result of a query have names

Answer: D

QUESTION 88
You are maintaining a Microsoft SQL Server database that stores order information for an online store
website. The database contains a table that is defined by the following Transact-SQL statement:
You need to ensure that purchase order numbers are used only for a single order.
What should you do?

A. Create a new CLUSTERED constraint on the PurchaseOrderNumber column.
B. Create a new UNIQUE constraint on the PurchaseOrderNumber column.
C. Create a new PRIMARY constraint on the PurchaseOrderNumber column.
D. Create a new FOREIGN KEY constraint on the PurchaseOrderNumber column.


Correct Answer: B

QUESTION 89
You are developing a database in SQL Server 2012 to store information about current employee project assignments.
You are creating a view that uses data from the project assignment table. You need to ensure that the view does not become invalid if the schema of the project assignment table changes.
What should you do?

A. Create the view by using an account in the sysadmin role.
B. Add a DDL trigger to the project assignment table to re-create the view after any schema change.
C. Create the view in a new schema.
D. Add a DDL trigger to the view to block any changes.

Correct Answer: B

QUESTION 90
You are maintaining a Microsoft SQL Server database. You run the following query:
---
You need to ensure that the query performs returns the results as quickly as possible.
Which action should you perform?

A. Add a new index to the ID column of the Person table.
B. Add a new index to the EndDate column of the History table.
C. Create a materialized view that is based on joining data from the ActiveEmployee and History tables.
D. Create a computed column that concatenates the GivenName and SurName columns.

Correct Answer: A

Monday

SQL exam 70-461 questions and answers part 6


MS-SQL exam 70-461 questions and answers dumps
QUESTION 61
As part of a new enterprise project, you're designing a new table to store financial transactions. This table could eventually store millions of rows and so storage space is very important.
One of the columns in the table will store either a 1 or 0 value.
Which data type would be most appropriate?
A. bit
B. tinyint
C. numeric
D. float

QUESTION 62
You are developing a database that will contain price information. You need to store the prices that include a fixed precision and a scale of six digits. Which data type should you use?
A. Float
B. Money
C. Smallmoney
D. Numeric

Correct Answer:  

QUESTION 63
which of the following conversions is NOT allowed either implicitly or explicitly using CONVERT OR CAST?
A. varchar to decimal
B. decimal to bit
C. date to varchar
D. datetime to text

QUESTION 64
Your manager has asked you to design a new table and enforce rules for the type of information that can be stored in a particular column. The information must match a particular pattern e.g. a number between 1 and 7. This checking must be performed during insert or update operations.
Which parameter should you use when you create the column?
A. CHECK
B. DEFAULT
C. Foreign Key
D. Primary Key
Answer: A

QUESTION 65
Complete the missing word below:
A ___ is a special kind of stored procedure that executes automatically when a user attempts the specified data-modification statement on the specified table.
A. Constraint
B. DLL
C. View
D. Trigger
Answer: 
QUESTION 66
You administer a Microsoft SQL Server 2012 database that contains a table named OrderDetail. You discover that the NCI_OrderDetail_CustomerID non-clustered index is fragmented. You need to reduce fragmentation. You need to achieve this goal without taking the index offline.
Which Transact-SQL batch should you use?

A. CREATE INDEX NCI_OrderDetail_CustomerID ON OrderDetail.CustomerID WITH DROP
EXISTING
B. ALTER INDEX NCI_OrderDetail_CustomerID ON OrderDetail.CustomerID REORGANIZE
C. ALTER INDEX ALL ON OrderDetail REBUILD
D. ALTER INDEX NCI_OrderDetail_CustomerID ON OrderDetail.CustomerID REBUILD

Correct Answer:  

QUESTION 67
Your manager has asked you to check the index stats for a particular table called Address. You have executed the following query (see below) and it reported that the avg_fragmentation_in_percent is 15%. What should you do?
SELECT * FROM sys.dm_db_index_physical_stats (DB_ID(N'Test'), OBJECT_ID(N'Address'), NULL, NULL , 'DETAILED');
A. Run ALTER INDEX REBUILD WITH (ONLINE = ON)
B. Run ALTER INDEX REORGANIZE
C. Rebuild the table
D. Nothing, the index fragmentation is at a safe level
Answer:  

QUESTION 68
You need to write a new query that will return names from the employee table for people who are not part of the contractors table (the two tables share a unique id, similar to social security or NI number). Your query will use a sub query to check that the employee is not in the contractors table. How might you achieve this?
A. Use COALESCE
B. Use EXISTS
C. Use IS_MEMBER
D. Use EXP
Answer:  
QUESTION 69
You need to delete a stored procedure from the SQL Server 2012 database. The stored procedure is called MyProc. Which statement below is correct?

A. drop MyProc
B. delete procedure MyProc
C. delete MyProc
D. drop procedure MyProc
Answer:  

QUESTION 70
As part of a new HR project you're creating several stored procedures that will add logging information to the logs table. This logging information is very detailed and should contain carriage returns to make paragraphs more readable. How can you add carriage returns to text when inserting into a table?
A. Use CASE
B. Use CHAR
C. Use TEXTPTR
D. Use COS
Answer: B

61
62
63
64
65
66
67
68
69
70
A
D
D
A
D
B
B
B
D
B


QUESTION 71
SQL Server 2012 uses the standard four-part naming convention when referencing database objects. Which of the following is the correct example of the four-part naming?
A. server_name.schema_name.database_name.object_name
B. schema_name.object_name.server_name.database_name
C. object_name.server_name.schema_name.database_name
D. server_name.database_name.schema_name.object_name
Answer:



QUESTION 72
You're designing a new SQL Server 2012 query for the HR department. The query will find records from the persons table for people whose name starts with 'Ja'.
Which WHERE statement would be the correct choice?
A. where (name like 'Ja%')
B. where (name = 'Ja%')
C. where (name > 'Ja')
D. where (name like '%Ja%')
Answer:

QUESTION 73
You've created a standard stored procedure that's not a CLR procedure. This procedure has several parameters, some of which are output parameters.
Which of the following CANNOT be passed back as an output parameter from a stored procedure?
A. Text
B. image
C. Ntext
D. Any of these
Answer:

QUESTION 74
You're designing a new SQL Server 2012 table that will hold millions of records. The table will be used by a finance application to show historical transactions. The table only has 10 columns but it's vital that the table performs well.
How many primary keys should you create for the table for best performance?
A. 2
B. 10
C. 3
D. 1
Answer:

QUESTION 75
Your manager has asked you to design a new table and enforce rules for the type of information that can be stored in a particular column. The information must match a particular pattern e.g. a number between 1 and 7. This checking must be performed during insert or update operations. Which parameter should you use when you create the column?
A. CHECK
B. DEFAULT
C. Foreign Key
D. Primary Key
Answer:

QUESTION 76
What is missing from the T-SQL statement below for creating and using a cursor?
DECLARE mycursor CURSOR FOR SELECT * FROM Vendor FETCH NEXT FROM mycursor;

A. KEYSET
B. OPEN
C. STATIC
D. SCROLL
Answer
QUESTION 77
Which of the following is an example of a scalar subquery?

A. select max(price) from products
B. select sum(price) from products
C. select min(price) from products
D. All of these
Answer:
QUESTION 78
If you use the BEGIN TRANSACTION statement, then execute 2 insert statements and 2 delete statements what will happen if you execute ROLLBACK TRANSACTION?
A. Only the INSERT statements will be rolled back
B. All of the INSERTS and DELETES will be rolled back
C. Only the last INSERT and last DELETE statement will be rolled back
D. Only the DELETE statements will be rolled back
Answer:  

QUESTION 79
You're designing a new table that will hold information about medical records. Another table called documents contains a foreign key that references this table. To make sure information is cleaned up when a delete operation is performed, you've added an ON DELETE CASCADE statement to the foreign key relationship.
What will happen when a row is deleted from the medical records table?
A. Corresponding rows in the referenced table (documents) will be deleted
B. All the values that make up the foreign key are set to NULL in the documents table
C. All the values that comprise the foreign key are set to their default values in the documents table
D. Rows are deleted from the medical records table but the documents table is unchanged
Answer:  

QUESTION 80
What is wrong with the T-SQL batch statement below:
@find varchar(30);
SET @find = 'Man';
SELECT LastName FROM Person WHERE LastName = @find;
A. You can't use the @find parameter in a query
B. DECLARE is missing
C. Nothing, it's fine
D. You should use SELECT instead of SET
Answers
71
72
73
74
75
76
77
78
79
80
D
A
D
D
A
B
D
B
A
B