Updated Microsoft SQL Certification 70-461 Exam Dumps

70-461 Querying Microsoft SQL Server 2012 is one of the three exams(70-461,70-462,70-463) for MCSA: SQL Server 2012/2014 certification, which validates your skills and knowledge in writing queries. We have updated Microsoft SQL Certification 70-461 Exam Dumps with 232 exam questions and answers to ensure you complete Microsoft SQL Certification 70-461 exam successfully.

Check free demo of Updated Microsoft SQL Certification 70-461 Exam Dumps now. You will find the most updated 70-461 exam dumps is valuable.

1. You use a Microsoft SQL Server database that contains a table.

The table has records of web requests as shown in the exhibit. (Click the Exhibit button.)

Your network has three web servers that have the following IP addresses:

- 10.0.0.1

- 10.0.0.2

- 10.0.0.3

You need to create a query that displays the following information:

- The number of requests for each web page (UriStem) grouped by the web server (ServerIP) that served the request

- A column for each server

Which Transact-SQL query should you use?

2. DRAG DROP

You develop a Microsoft SQL Server database for a sales ordering application.

You want to create a report that displays the increase of order quantities over the previous year for each product.

You need to write a query that displays:

- Product name,

- Year of sales order,

- Sales order quantity, and

- Increase of order quantity over the previous year.

Which three Transact-SQL segments should you use to develop the solution? To answer, move the appropriate Transact-SQL segments from the list of Transact-SQL segments to the answer area and arrange them in the correct order.

3. You develop a Microsoft SQL Server database that contains a table named Employee, defined as follows:

You need to create a view that contains two computed columns representing the month and the year of the [HireDate] of each Employee.

Which function should you use?

4. You administer a Microsoft SQL Server database named ContosoDb.

The database has the following schema collection:

The database has a table named ReceivedPurchaseOrders that includes an XML column named PurchaseOrder by using the above schema.

You need to set the requiresApproval attribute of the XML documents to false if they contain more than 50 items.

Which Transact-SQL query should you run?

5. DRAG DROP

Your Microsoft SQL Server database contains tables as shown below.

You have tables that were created by running the following Transact-SQL statements:

The Product table contains 10,000 records. The maximum ProductID is 11,000.

There are 12 rows in the Category table. The maximum CategoryID is 12.

The Product table contains at least one product in every category.

Data in the tables was accidently modified. To correct this, you need to make some updates directly to the tables. You issue several statements.

Which result or results will you obtain for each Transact-SQL statement? To answer, drag the appropriate results to the correct Transact-SQL statements. Each result may be used once. More than once, or not at all. You may need to drag the split bar between panes or scroll to view content.

6. DRAG DROP

You develop an application that uses data from a Microsoft SQL Server database.

Your application experiences blocking problems.

You need to enable row versioning and you want connections to have row versioning enabled by default.

How should you complete the Transact-SQL statement? To answer, drag the appropriate command to the correct positions. Each command may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.

7. DRAG DROP

You are a developer for a Microsoft SQL Server database. You need to write a stored procedure that performs several operations in the most efficient way possible.

Which operator or operators should you use? To answer, drag the appropriate operators to the correct operations. Each operator may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.

8. You develop a database application for Microsoft SQL Server and Microsoft Azure SQL Database.

You need to raise an exception and transfer execution to a CATCH block.

You need to ensure that the exception returns output in the following format:

Msg 51000, Level 16, State 1, Line 1

The record does not exist.

Which Transact-SQL statement should you run?

9. DRAG DROP

You develop a database application for Microsoft SQL Server 2012 and Microsoft Azure SQL Database.

You create a table named Purchasing.vVendorWithAddresses as shown in the following table.

You write the following Transact-SQL (Line numbers are included for reference only.) 01 CREATE PROCEDURE

You need to add Transact-SQL statements at line 08 to ensure that GetVendorInStateNeighbors returns the names of vendors that are located in all states where the vendor specified in the @vendorname parameter has a location.

Which three Transact-SQL segments should you use to develop the solution? To answer, move the appropriate Transact-SQL segments from the list of Transact-SQL segments to the answer area and arrange them in the correct order.

10. A local bank uses a SQL Server database to manage accounts. You are developing a stored procedure that contains multiple Transact-SQL INSERT statements. The stored procedure must use transaction management to handle errors. You need to ensure that the stored procedure rolls back the entire transaction if a run-time occurs.

Which Transact-SQL statement should you add to the stored procedure?

11. DRAG DROP

You are the administrator for a heavily-used OLTP Microsoft SQL Server database.

You are troubleshooting performance issues seen when using stored procedures in the database. The database stores millions of orders across thousands of customers. Some of the customers have large numbers of orders, while others have only one order. You update the statistics and perform defragmentation of all tables and indexes, but two stored procedures still have issues when accessing data.

p_GetCustomer accepts @companyID as a parameter. From the results of profiling, you know that 90 percent of the calls use the @companyid value of 5, while the other 10 percent of calls are evenly distributed across another 10000 values. While viewing the execution plan, you discover that a non-clustered index seek is used.

p_GetShipDate accepts @orderID as a parameter and returns the ship date for that order. You discover that the execution plan is performing a scan on a non-clustered index that has orderID as the index key.

You need to add appropriate query hints to each stored procedure to improve the performance.

What should you do? To answer, drag the appropriate procedures to the correct hints. Each procedure may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.

12. You use Microsoft SQL Server to develop a database application. Your application sends data to a VARCHAR (50) variable named @var. You need to write a Transact-SQL statement that will return information on a successful or

unsuccessful cast to an integer in a table.

Which Transact-SQL statement should you run?

13. DRAG DROP

You are developer for a Microsoft Azure SQL Database instance.

You are creating a new stored procedure. The procedure must perform the following tasks in this order: -1. Update a table named OrderHistory. -2. Delete rows from a table named Orders. -3. Delete rows from a table named Customers. -4. Insert rows into a table named ProcessHistory.

You need to ensure that the procedure meets the following requirements:

-If either DELETE operation fails, the rest of operation must continue. -If either the UPDATE operation or the INSERT operation fails, the whole procedure should fail and no changes should be retained.

Which four Transact-SQL segments should you use to develop the solution? To answer, move the appropriate Transact-SQL segments from the list of Transact-SQL segments to the answer area and arrange them in the correct order.

14. CORRECT TEXT

You have a SQL Server database that contains all of the sales data for your company.

You need to create a query that returns the customers who represent the top five percent of the total actual sales.

Part of the correct Transact-SQL has been provided in the answer area below. Enter the code in the answer area that resolves the problem and meets the stated goals or requirements. You can add code within the code that has been provided as well as below it.

Use the Check Syntax button to verify your work. Any syntax or spelling errors will be reported by

line and character position.

15. CORRECT TEXT

You plan to deploy a stored procedure for a database named TICKETS.

You need to implement error handling for the stored procedure to ensure that the system-defined error messages are returned if an error occurs upon insert. Part of the correct Transact-SQL has been provided in the answer are below. Enter the code in the answer area that resolves the problem and meets the stated goals or requirements.

You can add code within the code that has been provided as well as below it.

Use the ‘Check Syntax’ button to verify your work. Any syntax or spelling errors will be reported by line and character position.

16. Note: This question is part of a series of questions that use the same set of answer choices. An answer choice may be correct for more than one question in the series.

You develop a database for a travel application. You create a view that displays details of events and

attractions. The names of the event and attractions are sorted alphabetically.

You need to sort the names in a case-sensitive, dictionary order.

What should you do?

17. Note: This question is part of a series of questions that use the same set of answer choices. An

answer choice may be correct for more than one question in the series.

You develop a database for a travel application. You need to design tables and other database objects.

You create the Historical_Events table.

You need to store dates by using the smallest possible storage size.

What should you do?

18. DRAG DROP

You develop a Microsoft SQL Server Database.

The database contains a table named Status that is defined by the following Transact-SQL statement:

There are thousands of rows in the Status table, with significant duplication of data in the Color column. Ninety percent of the rows in the table have Color="Red", and the remaining 10 percent have Color="Green".

You want to normalize the Color information in this table.

You create a table named Colors that is defined by the following DDL:

You populate the new Colors table by using the following Transact-SQL statement:

INSERT Colors (ColorName) SELECT DISTINCT Color FROM Status

You need to ensure that the following requirements are met:

- The Status table uses only colors that exist in the Colors table.

- Data redundancy in the Status table is reduced.

- Data integrity is enforced during the normalization process.

Which three Transact-SQL segments should you use to develop the solution? To answer, move the appropriate Transact-SQL segment from the list of Transact-SQL segments to the answer area and arrange them in the correct order.

19. DRAG DROP

You use Microsoft SQL Server client tool to develop a Microsoft Azure SQL Database instance to support an e-commerce application.

The database consists of a Product table, a Store table, and a StoreProduct table as shown in the exhibit. (Click the Exhibit button.)

You need to write a trigger that meets the following requirements:

- Stores are not physically deleted, but are marked as deleted.

- When a store is deleted, the products that are sold in that store are marked as discontinued.

Which four Transact-SQL segments should you use to develop the solution? To answer, move the appropriate Transact-SQL segments from the list of Transact-SQL segments to the answer area and arrange them in the correct order.

Exhibit

20. HOTSPOT

You have a database that contains the following related tables:

You create a view named OrderSummary by using the following Transact-SQL statement: For each of the following statements, select Yes if the statement is true. Otherwise, select No.

21. You use a Microsoft Azure SQL DataBase instance. The instance contains a table named Customers that has columns named Id, Name, and IsPriority.

You need to create a view named VwPriorityCustomers that:

- returns rows from Customer that have a value of True in the IsPriority column, and

- does not allow columns to be altered or dropped in the underlying table.

Which Transact-SQL statement shoul you run?

22. DRAG DROP

You use a Microsoft Azure SQL Database instance named ContosoDb. ContosoDb contains a table named Customers that has existing records.

The Customers table has columns named Id and Name.

You need to create a new column in the Customer table named Status that allows null values and sets the value of the Status column to Silver for all existing records.

Which three Transact-SQL segments should you use to develop the solution? To answer, move the appropriate Transact-SQL segments from the list of Transact-SQL segments to the anwer area and arrange them in the correct order.

23. You administer a Microsoft SQL Server instance that will support several databases.

You need to ensure that every new database created has a data type named postalcode that contains the

same attributes.

What should you do?

24. DRAG DROP

You administer a SQL Server database that tracks sales that are made by sales persons.

The database contains a table that is defined by the following Transact-SQL statements:

You have the following requirements:

- accept a datetime value for the query month

- return a list of salespeople IDs who have sales in the query month or before the query month

- compare sales with sales quota for salespeople who have a sales quota

- display year-to-date sales for salespeople that do not have a sales quota

How should you complete the stored procedure? To answer, drag the appropriate Transact-SQL segments to the correct locations. Each Transact-SQL segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.

25. DRAG DROP

You are creating queries for a shopping cart application.

You have the following requirements:

- Query1 must list products where less than 100 units have been sold in total.

- Query2 must list products where more than 10 units have been sold in a single order.

You need to identify the correct sub-queries to complete the outer queries that you have written.

Which Transact-SQL statement or statements should you use? To answer, drag the appropriate SQL statements to the correct locations. Each SQL statement may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.

26. You are working with a table that has an XML column that contains information about books. Each book may have an associated price. You need to write a query that returns each author on a separate row in XML format.

Which XML method should you use?

27. DRAG DROP

A database contains tables as shown in the exhibit. (Click the Exhibit button.)

Customer who are inactive are moved from the Customers table to the InactiveCustomers table. Any orders for inactive customers are removed from the Orders table.

You write the following SELECT statement to return all the inactive customers:

SELECT CustomerId FROM InactiveCustomers

You need to extend the SELECT statement to include customers who do not have any orders.

Which four Transact-SQL segments should you use to develop the solution? To answer, move the appropriate Transact-SQL segments from the list of Transact-SQL segments to the answer area and arrange them in the correct order.

28. You develop a Microsoft SQL Server database.

The database contains a table defined by the following Transact-SQL statement:

All regions have more than one employee.

You need to write a query to find the employee with the highest SalesYTD in each region with the following result set:

- First Name

- Last Name

- Region

- Sales YTD

Which Transact-SQL query should you run?

A)

B)

C)

D)

29. You administer a Microsoft SQL Server database that contains a table named Products.

In a bit column named Discontinued, a value of 1 indicates a product is inactive, and a value of 0

indicates the product is active.

You need to create a view that returns a column with a full product status description.

Which expression should you use to define the column?

30. DRAG DROP

You develop a Microsoft SQL Server database that supports an e-commerce website.

You create a table defined by the following Transact-SQL statement:

You need to create a reusable function that will remove all carriage return characters from all the text values.

Which four Transact-SQL segments should you use to develop the solution? To answer, move the appropriate Transact-SQL segments from the list of Transact-SQL segments to the answer area and arrange them in the correct order.

31. You administer a Microsoft SQL Server database named Orders. Orders is highly active OLTP system used for e-commerce.

Performance on the database has degraded over the past few months as the volume of data has increased, and now users report the application is unusable.

You need to identify the cause of the performance problem.

Which Transact-SQL statement should you run?

32. DRAG DROP

You need to create a cursor that meets the following requirements:

- Executes as quickly as possible.

- Reflects all data changes made to the table while scrolling.

Which five Transact-SQL statements should you use to develop the solution? To answer, move the appropriate Transact-SQL segments from the list of Transact-SQL segments to the answer are and arrange them in the correct order.

33. DRAG DROP

You administer a Microsoft Azure SQL Database instance.

You are troubleshooting a number of stored procedures that use transactions.

-p_ModifyCustomer modifies customer records in the database. Processes that uses these records must receive a copy of the record as it exists at the beginning of the transaction, and the procedure must not block these processes.

-p_GetOrders is used to retrieve orders for a customer. While the transaction is running, no other process should be able to read the same data, and no other transaction should be able to modify the data until the transaction completes.

-p_ShipOrders is run once per day to batch orders into shipping criteria. While this transaction is running, no other transaction should be allowed to insert data into the range of orders being modified.

You need to choose the appropriate transaction isolation level for each stored procedure. The transaction must meet the need while providing the highest level of concurrency and performance.

Which isolation levels should you use? To answer, drag the appropriate isolation levels to correct stored procedures. Each isolation level may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.

34. DRAG DROP

You administer a Microsoft SQL Server database that contains a table named Customer defined by the following Transact-SQL statement:

The SalesRep column contains the SQL Login name of the user designated as the customer’s sales rep.

You need to create at trigger that meets the following requirements:

- A customer’s CreditLimit can only be changed by the customer’s SalesRep.

- CreditLimit cannot be increased by more than 50 percent in any single update.

If an UPDATE statement causes either of these business rules to be violated, the entire UPDATE statement should be rolled back.

In addition, the trigger must handle single-row and multi-row update statements and should execute in the most efficient manner possible.

How should you complete the trigger? To answer, drag the appropriate Transact-SQL segments to the correct locations. Each Transact-SQL segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.

35. You develop a Microsoft SQL Server database that contains tables as shown in the exhibit. (Click the Exhibit button.)

You need to retrieve a list of clients for whom there is no corresponding information in the Projects table.

Which Transact-SQL statements should you run?

A)

B)

C)

D)

36. Note: This question is part of series of questions that use the same or similar answer choices. An answer choice may be correct for more than one question in the series. Each question is independent of the other questions in the series. Information and details provided in a question apply only to that question.

You administer a Microsoft SQL Server database.

The database contains a table named Employee.

Part of the Employee table is shown in the exhibit. (Click the Exhibit button.)

Unless stated above, no columns in the Employee table reference other tables.

Confidential information about the employees is stored in a separate table named EmployeeData.

One record exists within EmployeeData for each record in the Employee table.

You need to assign the appropriate constraints and table properties to ensure data integrity and

visibility.

Which column in the Employee table should be referenced in a one-to-one relationship by the EmployeeData table?

37. You use a Microsoft SQL Server database.

You want to create a table to store files.

You need to ensure that the following requirements are met:

- The files must include information about the directory structure.

- The files must be accessible in SQL Server.

- The files must be in a folder that is accessible directly by using Windows Explorer.

Which Transact-SQL statement should you run?

A)

B)

C)

D)

38. DRAG DROP

You administer a Microsoft SQL Server database named ContosoDb. ContosoDb contains a table named Suppliers and an indexed view named VWLocalSuppliers, both of which were created by using the following Transact-SQL statement: You need to change the data type of the Code column in the Suppliers table to nvarchar(50).

Which four Transact-SQL segments should you use to develop the solution? To answer, move the appropriate Transact-SQL segments from the list of Transact-SQL segments to the answer area and arrange them in the correct order.

39. You develop a Microsoft SQL Server database named ContosoDb. ContosoDb contains a table named Employess that was created by using the following Transact-SQL statement:

You need to create a view that allows the insertion of new records into the Employees table by using the view.

40. The Agent table of a Microsoft SQL Server database contains several million rows. The database uses the SQL_Latin1_General_Cp1_CS_AS collation.

You need to ensure that the following requirements are met:

- The values of the StateRefID column conform to the pattern of 3 uppercase letters followed by 5 numeric digits, such as “ABC12345”.

- The StateRefID values are unique within the Agent table.

- The values of all records that will be inserted or updated in the Agent table are correctly formatted.

- Exisitng rows are ignored

Which Transact-SQL statement should you run?

41. DRAG DROP

You are a Microsoft SQL Server client tools to develop a Microsoft Azure SQL Database database that supports an e-learning application.

The database consists of a Course table, a Subject table, and a CourseSubject table as shown in the exhibit. (Click the Exhibit button.)

You need to write a trigger that meets the following requirements: Subjects are not physically deleted, but are marked as deleted. When a subject is deleted, the courses that offer that subject are marked as discontinued.

Which four Transact-SQL segments should you use to develop the solution? To answer, move the

appropriate Transact-SQL segments from the list of Transact-SQL segments to the answer area

and arrange them in the correct order.

42. DRAG DROP

A database contains tables as shown in the exhibit. (Click the Exhibit button.)

Products that are discontinued are moved from the Products table to the DiscontinuedProducts table. Any orders for discontinued products are removed from the Orders table. You write the following SELECT statement to return all the discontinued products: SELECT ProductId FROM DiscontinuedProducts You need to extend the SELECT statement to include products who do not have any orders.

Which four Transact-SQL segments should you use to develop the solution? To answer, move the

appropriate Transact-SQL segments from the list of Transact-SQL segments to the answer area and arrange them in the correct order.

43. You are working with a table that has an XML column that contains information about books. Each

book may have an associated price.

You need to write with a query that returns the price of each book as a non-xml value.

Which XML method should you use?

44. You develop a Microsoft SQL Server 2012 server database that supports an application. The application contains a table that has the following definition:

CREATE TABLE Inventory

(ItemID int NOT NULL PRIMARY KEY,

ItemsInStore int NOT NULL,

ItemsInWarehouse int NOT NULL)

You need to create a computed column that returns the sum total of the ItemsInStore and ItemsInWarehouse values for each row.

Which Transact-SQL statement should you use?

45. You develop a Microsoft SQL Server 2012 database.

You create a view from the Orders and OrderDetails tables by using the following definition.

image001

You need to improve the performance of the view by persisting data to disk.

What should you do?

46. You develop a database for a travel application. You need to design tables and other database objects.

You create the Airline_Schedules table.

You need to store the departure and arrival dates and times of flights along with time zone information.

What should you do?

47. You develop a database for a travel application. You need to design tables and other database objects. You create a stored procedure. You need to supply the stored procedure with multiple event names and their dates as parameters.

What should you do?

48. CORRECT TEXT

You have a view that was created by using the following code:

You need to create an inline table-valued function named Sales.fn_OrdersByTerritory, which must meet the following requirements:

• Accept the @T integer parameter.

• Use one-part names to reference columns.

• Filter the query results by SalesTerritoryID.

• Return the columns in the same order as the order used in OrdersByTerritoryView.

Which code segment should you use? To answer, type the correct code in the answer area.

49. CORRECT TEXT

You have a database that contains the tables shown in the exhibit. (Click the Exhibit button.)

You deploy a new server that has SQL Server 2012 installed.

You need to create a table named Sales.OrderDetails on the new server. Sales.OrderDetails must meet the following requirements:

• Write the results to a disk.

• Contain a new column named LineItemTotal that stores the product of ListPrice and Quantity for each row.

• The code must NOT use any object delimiters.

The solution must ensure that LineItemTotal is stored as the last column in the table.

Which code segment should you use? To answer, type the correct code in the answer area.

50. CORRECT TEXT

You have a database that contains the tables shown in the exhibit. (Click the Exhibit button.)

You need to create a view named uv_CustomerFullName to meet the following requirements:

• The code must NOT include object delimiters.

• The view must be created in the Sales schema.

• Columns must only be referenced by using one-part names.

• The view must return the first name and the last name of all customers.

• The view must prevent the underlying structure of the customer table from being changed.

• The view must be able to resolve all referenced objects, regardless of the user's default schema.

Which code segment should you use? To answer, type the correct code in the answer area.

51. CORRECT TEXT

You have a database that contains the tables shown in the exhibit. (Click the Exhibit button.)

You need to create a query that calculates the total sales of each OrderId from the Sales.Details table.

The solution must meet the following requirements:

• Use one-part names to reference columns.

• Sort the order of the results from OrderId.

• NOT depend on the default schema of a user.

• Use an alias of TotalSales for the calculated ExtendedAmount.

• Display only the OrderId column and the calculated TotalSales column.

Which code segment should you use? To answer, type the correct code in the answer area.

52. You have a Microsoft SQL Server 2012 database that contains tables named Customers and Orders.

The tables are related by a column named CustomerID.

You need to create a query that meets the following requirements:

• Returns the CustomerName for all customers and the OrderDate for any orders that they have placed.

• Results must include customers who have not placed any orders.

Which Transact-SQL query should you use?

53. You create a stored procedure that will update multiple tables within a transaction.

You need to ensure that if the stored procedure raises a run-time error, the entire transaction is terminated and rolled back.

Which Transact-SQL statement should you include at the beginning of the stored procedure?

54. Your database contains two tables named DomesticSalesOrders and InternationalSalesOrders. Both tables contain more than 100 million rows. Each table has a Primary Key column named SalesOrderId. The data in the two tables is distinct from one another.

Business users want a report that includes aggregate information about the total number of global sales and total sales amounts.

You need to ensure that your query executes in the minimum possible time.

Which query should you use?

55. You are a database developer at an independent software vendor. You create stored procedures that contain proprietary code.

You need to protect the code from being viewed by your customers.

Which stored procedure option should you use?

56. You use a Microsoft SQL Server 2012 database.

You want to create a table to store Microsoft Word documents.

You need to ensure that the documents must only be accessible via Transact-SQL queries.

Which Transact-SQL statement should you use?

57. 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?

58. You develop a Microsoft SQL Server 2012 database. The database is used by two web applications that access a table named Products.

You want to create an object that will prevent the applications from accessing the table directly while still providing access to the required data.

You need to ensure that the following requirements are met:

- Future modifications to the table definition will not affect the applications' ability to access data.

- The new object can accommodate data retrieval and data modification.

You need to achieve this goal by using the minimum amount of changes to the existing applications.

What should you create for each application?

59. You develop a Microsoft SQL Server 2012 database.

You need to create a batch process that meets the following requirements: -Returns a result set based on supplied parameters. -Enables the returned result set to perform a join with a table.

Which object should you use?

60. You develop a Microsoft SQL Server 2012 database.

You need to create and call a stored procedure that meets the following requirements:

- Accepts a single input parameter for CustomerID.

- Returns a single integer to the calling application.

Which Transact-SQL statement or statements should you use? (Each correct answer presents part of the solution. Choose all that apply.)

61. You develop a Microsoft SQL Server 2012 database that contains a heap named OrdersHistorical.

You write the following Transact-SQL query:

- INSERT INTO OrdersHistorical

- SELECT * FROM CompletedOrders

You need to optimize transaction logging and locking for the statement.

Which table hint should you use?

62. You use a Microsoft SQL Server 2012 database that contains two tables named SalesOrderHeader and SalesOrderDetail.

The indexes on the tables are as shown in the exhibit. (Click the Exhibit button.)

You write the following Transact-SQL query:

You discover that the performance of the query is slow. Analysis of the query plan shows table scans where the estimated rows do not match the actual rows for SalesOrderHeader by using an unexpected index on SalesOrderDetail.

You need to improve the performance of the query.

What should you do?

63. Your database contains a table named Purchases. The table includes a DATETIME column named PurchaseTime that stores the date and time each purchase is made. There is a non-clustered index on the PurchaseTime column.

The business team wants a report that displays the total number of purchases made on the current day.

You need to write a query that will return the correct results in the most efficient manner.

Which Transact-SQL query should you use?

64. You develop a database for a travel application. You need to design tables and other database objects.

You need to store media files in several tables.

Each media file is less than 1 MB in size. The media files will require fast access and will be retrieved frequently.

What should you do?

65. You develop a database for a travel application. You need to design tables and other database objects.

You create a view that displays the dates and times of the airline schedules on a report.

You need to display dates and times in several international formats.

What should you do?

66. You are a database developer of a Microsoft SQL Server 2012 database.

You are designing a table that will store Customer data from different sources. The table will include a column that contains the CustomerID from the source system and a column that contains the SourceID.

A sample of this data is as shown in the following table.

You need to ensure that the table has no duplicate CustomerID within a SourceID. You also need to ensure that the data in the table is in the order of SourceID and then CustomerID.

Which Transact- SQL statement should you use?

67. You have three tables that contain data for vendors, customers, and agents. You create a view that is used to look up telephone numbers for these companies.

The view has the following definition:

You need to ensure that users can update only the phone numbers by using this view.

What should you do?

68. You develop a Microsoft SQL Server 2012 database that contains tables named Employee and Person.

The tables have the following definitions:

Users are able to use single INSERT statements or INSERT...SELECT statements into this view.

You need to ensure that users are able to use a single statement to insert records into both Employee and Person tables by using the VwEmployee view.

Which Transact-SQL statement should you use?

69. You develop a Microsoft SQL Server 2012 database that contains a table named Products.

The Products table has the following definition:

You need to create an audit record only when either the RetailPrice or WholeSalePrice column is updated.

Which Transact-SQL query should you use?

70. A table named Profits stores the total profit made each year within a territory. The Profits table has columns named Territory, Year, and Profit.

You need to create a report that displays the profits made by each territory for each year and its previous year.

Which Transact-SQL query should you use?

71. You use Microsoft SQL Server 2012 database to develop a shopping cart application.

You need to rotate the unique values of the ProductName field of a table-valued expression into multiple columns in the output.

Which Transact-SQL operator should you use?

72. You administer a Microsoft SQL Server database that supports a shopping application.

You need to retrieve a list of customers who live in territories that do not have a sales person.

Which Transact- SQL query or queries should you use? (Each correct answer presents a complete solution. Choose all that apply.)

73. You support a database structure shown in the exhibit. (Click the Exhibit button.)

You need to write a query that displays the following details:

• Total sales made by sales people, year, city, and country

• Sub totals only at the city level and country level

• A grand total of the sales amount

Which Transact-SQL query should you use?

74. 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?

75. You administer a Microsoft SQL Server database that supports a banking transaction management application.

You need to retrieve a list of account holders who live in cities that do not have a branch location.

Which Transact-SQL query or queries should you use? (Each correct answer presents a complete solution. Choose all that apply.)

76. You administer a Microsoft SQL Server 2012 database. The database contains a table named Employee.

Part of the Employee table is shown in the exhibit. (Click the Exhibit button.)

Confidential information about the employees is stored in a separate table named EmployeeData. One record exists within EmployeeData for each record in the Employee table. You need to assign the appropriate constraints and table properties to ensure data integrity and visibility.

On which column in the Employee table should you create a unique constraint?

77. You administer a Microsoft SQL Server 2012 database. The database contains a table named Employee.

Part of the Employee table is shown in the exhibit. (Click the Exhibit button.)

Unless stated above, no columns in the Employee table reference other tables.

Confidential information about the employees is stored in a separate table named EmployeeData. One record exists within EmployeeData for each record in the Employee table.

You need to assign the appropriate constraints and table properties to ensure data integrity and visibility.

On which column in the Employee table should you use an identity specification to include a seed of 1,000 and an increment of 1?

78. You administer a Microsoft SQL Server 2012 database that includes a table named Products. The Products table has columns named ProductId, ProductName, and CreatedDateTime.

The table contains a unique constraint on the combination of ProductName and CreatedDateTime.

You need to modify the Products table to meet the following requirements:

-Remove all duplicates of the Products table based on the ProductName column. -Retain only the newest Products row.

Which Transact-SQL query should you use?

79. You develop three Microsoft SQL Server 2012 databases named Database1, Database2, and Database3. You have permissions on both Database1 and Database2.

You plan to write and deploy a stored procedure named dbo.usp_InsertEvent in Database3. dbo.usp_InsertEvent must execute other stored procedures in the other databases.

You need to ensure that callers that do not have permissions on Database1 or Database2 can execute the stored procedure.

Which Transact-SQL statement should you use?

80. You administer a Microsoft SQL Server 2012 database that has multiple tables in the Sales schema. Some users must be prevented from deleting records in any of the tables in the Sales schema. You need to manage users who are prevented from deleting records in the Sales schema.

You need to achieve this goal by using the minimum amount of administrative effort.

What should you do?


 

Real Windows 10 MD-100 Practice Test
Updated Windows Server 2016 70-740 Exam Dumps

Add a Comment

Your email address will not be published. Required fields are marked *