Download Querying Microsoft SQL Server 2012-2014.selftestengine.70-461.2018-09-19.1e.130q.vcex

Download Exam

File Info

Exam Querying Microsoft SQL Server 2012/2014
Number 70-461
File Name Querying Microsoft SQL Server 2012-2014.selftestengine.70-461.2018-09-19.1e.130q.vcex
Size 11.96 Mb
Posted September 19, 2018
Downloads 206

How to open VCEX & EXAM Files?

Files with VCEX & EXAM extensions can be opened by ProfExam Simulator.

Purchase
Coupon: EXAM_HUB

Discount: 20%

 
 



Demo Questions

Question 1
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? 

  • A: SELECT Territory, Year, Profit,
    LEAD(Profit, 1, 0) OVER (PARTITION BY Territory ORDER BY Year) 
    AS PrevProfit 
    FROM Profits 
  • B: SELECT Territory, Year, Profit,
    LAG(Profit, 1, 0) OVER (PARTITION BY Year ORDER BY Territory) 
    AS PrevProfit 
    FROM Profits 
  • C: SELECT Territory, Year, Profit,
    LAG(Profit, 1, 0) OVER (PARTITION BY Territory ORDER BY Year) 
    AS PrevProfit 
    FROM Profits 
  • D: SELECT Territory, Year, Profit,
    LEAD(Profit, 1, 0) OVER (PARTITION BY Year ORDER BY Territory) 
    AS PrevProfit 
    FROM Profits



Question 2
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?

  • A: CROSS JOIN
  • B: CROSS APPLY
  • C: PIVOT
  • D: UNPIVOT



Question 3
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.)

  • A: SELECT CustomerID FROM Customer 
    WHERE TerritoryID <> SOME(SELECT TerritoryID FROM Salesperson)
  • B: SELECT CustomerID FROM Customer 
    WHERE TerritoryID <> ALL(SELECT TerritoryID FROM Salesperson)
  • C: SELECT CustomerID FROM Customer 
    WHERE TerritoryID <> ANY(SELECT TerritoryID FROM Salesperson)
  • D: SELECT CustomerID FROMCustomer 
    WHERE TerritoryID NOT IN(SELECT TerritoryID FROM Salesperson)



Question 4
You support a database structure shown in the exhibit.

  

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? 

  • A: SELECT SalesPerson.Name, Country, City,
    DatePart(yyyy, SaleDate) AS Year, Sum(Amount) AS Total 
    FROM Sale INNER JOIN SalesPerson 
    ON Sale.SalesPersonID = SalesPerson.SalesPersonID 
    GROUP BY GROUPING SETS((SalesPerson.Name, Country, City, 
    DatePart(yyyy, SaleDate)), (Country, City), (Country), ())
  • B: SELECT SalesPerson.Name, Country, City, 
    DatePart(yyyy, SaleDate) AS Year, Sum(Amount) AS Total 
    FROM Sale INNER JOIN SalesPerson 
    ON Sale.SalesPersonID = SalesPerson.SalesPersonID 
    GROUP BY CUBE(SalesPerson.Name, Country, City, DatePart(yyyy, SaleDate)) 
  • C: SELECT SalesPerson.Name, Country, City,
    DatePart(yyyy, SaleDate) AS Year, Sum(Amount) AS Total 
    FROM Sale INNER JOIN SalesPerson 
    ON Sale.SalesPersonID = SalesPerson.SalesPersonID 
    GROUP BY CUBE(SalesPerson.Name, DatePart(yyyy, SaleDate), City, Country) 
  • D: SELECT SalesPerson.Name, Country, City,
    DatePart(yyyy, SaleDate) AS Year, Sum(Amount) AS Total 
    FROM Sale INNER JOIN SalesPerson 
    ON Sale.SalesPersonID = SalesPerson.SalesPersonID 
    GROUP BY ROLLUP(SalesPerson.Name, DatePart(yyyy, SaleDate), City, 
    Country)



Question 5
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: Small money
  • D: Numeric



Question 6
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.) 

  • A: SELECT AccountHolderID
    FROM AccountHolder 
    WHERE CityID NOT IN (SELECT CityID FROM BranchMaster) 
  • B: SELECT AccountHolderID
    FROM AccountHolder 
    WHERE CityID <> ALL (SELECT CityID FROM BranchMaster) 
  • C: SELECT AccountHolderID
    FROM AccountHolder 
    WHERE CityID <> SOME (SELECT CityID FROM BranchMaster) 
  • D: SELECT AccountHolderID
    FROM AccountHolder 
    WHERE CityID <> ANY (SELECT CityID FROM BranchMaster)



Question 7
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 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. 
On which column in the Employee table should you create a unique constraint?

  • A: DateHired
  • B: DepartmentID
  • C: EmployeeID
  • D: EmployeeNum
  • E: FirstName
  • F: JobTitle
  • G: LastName
  • H: MiddleName
  • I: ReportsToID



Question 8
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. 
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?

  • A: DateHired
  • B: DepartmentID
  • C: EmployeeID
  • D: EmployeeNum
  • E: FirstName
  • F: JobTitle
  • G: LastName
  • H: MiddleName
  • I: ReportsToID



Question 9
You administer a Microsoft SQL Server 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? 

  • A:   WITH CTEDupRecords
    AS 
      ( 
        SELECT MIN(CreatedDateTime) AS CreatedDateTime, ProductName 
        FROM Products 
        GROUP BY ProductName 
        HAVING COUNT(*) > 1 
      ) 
      DELETE p 
      FROM Products p 
      JOIN CTEDupRecords cte ON cte.ProductName = p.ProductName 
      AND cte.CreatedDateTime >  p.CreatedDateTime 
  • B:   WITH CTEDupRecords
    AS 
      ( 
        SELECT MIN(CreatedDateTime) AS CreatedDateTime, ProductName 
        FROM Products 
        GROUP BY ProductName 
        HAVING COUNT(*) > 1 
      ) 
      DELETE p 
      FROM Products p 
      JOIN CTEDupRecords cte ON p.ProductName = cte.ProductName 
      AND p.CreatedDateTime > cte.CreatedDateTime 
  • C:   WITH CTEDupRecords
    AS 
      ( 
        SELECT MIN(CreatedDateTime) AS CreatedDateTime, ProductName 
        FROM Products 
        GROUP BY ProductName 
      ) 
      DELETE p 
      FROM Products p 
      JOIN CTEDupRecords cte ON p.ProductName = cte.ProductName 
  • D:   WITH CTEDupRecords
    AS 
      ( 
        SELECT MAX(CreatedDateTime) AS CreatedDateTime, ProductName 
        FROM Products 
        GROUP BY ProductName 
        HAVING COUNT(*) > 1 
      ) 
      DELETE Products 
      FROM Products p 
      JOIN CTEDupRecords cte ON p.ProductName = cte.ProductName



Question 10
You develop three Microsoft SQL Server 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?

  • A: USE Database2
  • B: EXECUTE AS OWNER
  • C: USE Database1
  • D: EXECUTE AS CALLER






CONNECT US


ProfExam
PROFEXAM WITH A 20% DISCOUNT

You can buy ProfExam with a 20% discount..

Get Now!


HOW TO OPEN VCEX AND EXAM FILES

Use ProfExam Simulator to open VCEX and EXAM files
ProfExam Screen



HOW TO OPEN VCE FILES

Use VCE Exam Simulator to open VCE files
Avanaset