You create a table that has the StudentCode, SubjectCode, and Marks columns to record mid-year marks for
students. The table has marks obtained by 50 students for various subjects. You need to ensure that the top
half of the students arranged by their average marks must be given a rank of 1 and the remaining students
must be given a rank of 2. Which Transact-SQL query should you use?
You create a table that has the StudentCode, SubjectCode, and Marks columns to record mid-year marks for
students. The table has marks obtained by 50 students for various subjects. You need to ensure that the
following requirements are met:
You create a table that has the StudentCode, SubjectCode, and Marks columns to record mid-year marks for
students. The table has marks obtained by 50 students for various subjects. You need to retrieve the students
who scored the highest marks for each subject along with the marks. Which Transact-SQL query should you
use?
You develop a Microsoft SQL Server 2012 database that contains a table named Customers. The Customers
table has the following definition:
You need to create an audit record only when either the MobileNumber or HomeNumber column is updated.
Which Transact-SQL query should you use?
You develop a Microsoft SQL Server 2012 database.
You create a view that performs the following tasks:
Joins 8 tables that contain up to 500,000 records each.
Performs aggregations on 5 fields.
The view is frequently used in several reports.
You need to improve the performance of the reports.
What should you do?
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.)
You develop 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:
You administer a database that includes a table named Customers that contains more than 750 rows. You
create a new column named PartitionNumber of the int type in the table. You need to assign a PartitionNumber
for each record in the Customers table. You also need to ensure that the PartitionNumber satisfies the following
conditions:
You use a Microsoft SQL Server 2012 database that contains a table named BlogEntry that has the following
columns:
Id is the Primary Key.
You need to append the "This is in a draft stage" string to the Summary column of the recent 10 entries based
on the values in EntryDateTime. Which Transact-SQL statement should you use?