Paper 1
Paper 1
Paper 1
1]
Which of the following Service Broker objects defines the content of the messages exchanged
between applications?
A.Contract
B.Message Type
C.Service
D.Queues
Q.2]
Jack is database developer in DoITnow, Inc,. He needs to store the details of one of the tables into an
XML file. What should he do?
Q.3]
John is creating a Web Service in SQL Server 2005. He wants that the name of the function, he needs
to host, should be”Calculate”. Which of the parameter of the CREATE ENDPOINT statement will
John use to accomplish this?
A.Webmethod
B.Schema
C.Path
D.Ports
Q.4]
James, a database developer of AdventureWorks has implemented Service Broker in the database.
He needs to send a message from one of the service to another. Which of the following protocol will
James use for that?
A.HTTP
B.SOAP
C.DIALOG
D.TCP
Q.5]
John is the database developer for AdventureWorks. He has been asked to implement Service
Broker in the database. Which of the following database objects will John not create to implement
Service Broker?
A.MESSAGE TYPE
B.QUEUE
C.SERVICE
D.ASSEMBLY
Q.6]
In which of the following situations will you implement managed code in your database?
A.When you need to perform data access and manipulation operations that can be done using T-
SQL statements.
B.When you need to create database objects, such as procedures, functions, or triggers.
C.When you need to implement complicated programming logic for which you can reuse the
functionality provided by the .NET base class libraries.
Q.7]
The production database of an organization stores the details of raw material used for the
production process in the Materials table. These details include the ProductID, Description, Unit,
QuantityOnHand, and ReorderLevel. It also stores the requests to be made for purchase of the raw
material in the PurchaseRequests table. In addition, the MaterialIssued table stores the details of
issue of raw material for production. According to the business requirement, whenever, a product is
issued for production, a record is added to the MaterialIssued table. At the same time, the
QuantityOnHand needs to be checked. If the QuantityOnHand reaches the ReorderLevel or below
that, a record should be inserted into the PurchaseRequests table.
James, a database developer, has created a stored procedure that needs to be executed whenever a
new record is inserted in the MaterialIssued table. In this procedure, the QuantityOnHand is
checked for the product that is issued and a record is inserted in the PurchaseRequests table.
However, he has identified that creating a procedure does not ensure that a request will be created
every time a material is issued. What should James do?
Q.8]
The production database of an organization stores the details of raw material used for the
production process in the Materials table. These details include the ProductID, Description, Unit,
QuantityOnHand, and ReorderLevel. It also stores the requests to be made for purchase of the raw
material in the PurchaseRequests table. In addition, the MaterialIssued table stores the details of
issue of raw material for production. According to the business requirement, whenever, a product is
issued for production, a record is added to the MaterialIssued table. At the same time, the
QuantityOnHand needs to be checked. If the QuantityOnHand reaches the ReorderLevel or below
that, a record should be inserted into the PurchaseRequests table.
James, a database developer, has created a batch of statements that inserts a record in the
MaterialIssued table. Next, it checks the QuantityOnHand for the product that is issued and then
inserts a record in the PurchaseRequests table, if required. However, he has identified that at times
a purchase request is not created even if the QuantityOnHand reaches below the ReorderLevel.
What should James do to solve this problem in an efficient way?
A.Create a procedure that contains all the statements given in the batch
B. Create an AFTER trigger that contains all the statements given in the batch
C.Create a transaction that contains all the statements given in the batch
D.Create a function that contains all the statements given in the batch
Q.9]
A university uses the StudentsRegistration application to store and manage the student details.
When a new student takes admission, the users enter the details of that student in a form. When the
form is submitted, the details are stored in four different tables.
You have created a batch of statements to perform data manipulation operations in all the tables
that store the student details. You have identified that for some of the students records are not
saved in all the tables. What should you do to solve this problem in an efficient way?
A.Create a procedure that contains all the statements given in the batch
B.Create an AFTER trigger for each statement to execute the next statement
C.Create a transaction that contains all the statements given in the batch
D.Create a function that contains all the statements given in the batch
Q.10]
The above statement generates an error. Identify the error and provide the solution.
Q.11]
Two AFTER triggers have been created for the DELETE operation on the Employee table as follows:
AFTER
DELETE
AS
AFTER
DELETE
AS
trgDelete1 is the first one to be created. You want to change the execution order of the above two
triggers so that trgDelete1 is executed after
executed:
However, the above statement results in an error. Identify the error and provide the solution.
Q.12]
Login Id of all the employees. Now, you are also required to display the Manager id and title of the
employees along with the existing employee details.
B. Create another procedure displaying the employee id, login id, manager id and title of all the
employees.
C. Alter the prcDisplayEmpDetails stored procedure to display the employee id, login id, manager id
and title of all the employees.
D. Create another procedure displaying the manager id and title of all the employees and call this
procedure from the prcDisplayEmpDetails stored procedure.
Q.13]
You have created the function, fx_Employee that accepts an employee id as a parameter and returns
the details of the department and shift for that employee?
RETURNS table
AS
RETURN (
SELECT *
FROM HumanResources.EmployeeDepartmentHistory
How will you execute the above function to display the details of the employee having 1 as
EmployeeID?
A. EXECUTE fx_Employee(1)
B. EXECUTE FUNCTION fx_Employee(1)
D. SELECT fx_Employee(1)
Q.14]
You need to display a report containing the employee ids of all the employees who work with a
specific manager. How will you implement this?
AS
BEGIN
END
AS
BEGIN
END
AS
BEGIN
AS
BEGIN
END
Q.15]
However, the above statement generates an error. Identify and determine which of the following
statement will display the desired output?
Q.16]
A view displaying the employee id, department id, login id and title of all the employees has been
defined as follows:
AS
FROM HumanResources.Employee e
JOIN HumanResources.EmployeeDepartmentHistory d
ON e.EmployeeID = d.EmployeeID
WHERE EmployeeID = 2
A. You cannot modify the data in two or more underlying tables through a view.
Q.17]
Which of the following database does not contains any user data or user metadata?
A.master database
B.model database
C.msdb database
D.Resources database
Q.18]
Which of the following Service Broker objects specifies the type of messages that will be exchanged
during a conversation?
A.Contract
B.Message Type
C.Service
D.Queues
Q.19]
Which of the following services allows you to gather data from various disparate sources and
collate at a single location?
A.Database Engine
B.Reporting Services
C.Analysis Services
D.Integration Services
Q.20]
Which of the following types of commands are used to allow the users access to use database
resources?
A.DCL
B.DDL
C.DML
D.DQL
Q.21]
Sam, a database developer needs to provide access to the data using Web services. Which of the
following feature will you implement in the database to achieve this?
Q.22]
Which index organizes data logically but does not store data physically?
A. NONCLUSTERED
B. CLUSTERED
C. UNIQUE
D. MULTI COLUMN
Q.23]
Statement A: Clustered indexes should be built on an attribute whose values are unique and do not
change often.
Q.24]
Statement A: The data of a view can be modified even if the modification affects more than one
underlying table.
Statement B: The user of a view cannot change a column that is the result of a calculation.
Which of the following option is true with respect to above statements?
Q.25]
The Employee table of an organisation contains a large amount of data. The first name of each
employee and their designation are required to create a report. However, it takes a long time to
execute the following query:
The Department table has a primary key defined on the Department ID column. Suggest the best
solution for faster data retrieval.
A. Create a non clustered index on EmpID field of the Department table and the Employee table.
B. Create a clustered index on EmpID field of the Employee table and a non clustered index on
EmpID field of the Department table.
C. Create a non clustered index on EmpID field of the Employee table and clustered index on EmpID
field of the Department table.
D. Create a clustered index on EmpID field of the Department table and the Employee table.
Q.26]
You are the database developer for Lucerne Publishing. You are designing a human resources
database that contains tables as Employee and Salary. On analyzing the past transactions, you have
noticed that the Employee table is often joined with the Salary table on the EmployeeID column.
Individual records in the Employee table are selected by social security number (SSN). An employee
list, in alphabetical order of last name and first name, is required on a routing basis.
You need to design the indexes for the tables while optimizing the performance of the indexes.
Which of the following syntax should you use?
Q.27]
Q.28]
Which magic table is used to store the updated rows, whenever an update trigger is fired?
A.Deleted table
B.Syscomments table
C.Sysobjects table
D.Inserted table
Q.29]
When a trigger is fired in response to the INSERT statement, how many magic tables are created?
A.One
B.Two
C.Three
D.Four
Q.30]
A trigger is a _____________.
B. stored procedure
C. function
D. transaction
Q.31]
Which of the following feature of CLR provides the ability of an application to interact with another
application written in a different programming language?
A.Security Management
C.Language Interoperability
D.Platform Independence
Q.32]
John needs to look for similar words or phrases in the database. Which of the following feature of
SQL Server 2005 will John use to accomplish it?
A.Full-text search
B.Service Broker
C.Replication
D.Notification Services
Q.33]
Statement A: Triggers fired in response to the DML statements, refer to two magic tables, Inserted
and Deleted..
Statement B: The magic tables are physical tables with structure different from the table on which
the trigger is defined.
Which of the following option is true with respect to the above statements?
Statement A: By default, SQL Server scans for the sessions that are waiting for a lock request in
order to detect the deadlock situation.
Which of the following option is true with respect to the above statements?
Q.35]
Statement A: The Shared(S) Lock mode is used for the operations that change or update the data.
Statement B: The Exclusive(X) Lock mode ensures that multiple updates can not be made to the
same resources at the same time.
Which of the following option is true with respect to above statements?
Q.36]
You are developing an application to manage the records of the Employees table, which has a
column named temp_emp. When the data in this column is no longer required, then the data is
remove it and a message is displayed as 'You have removed it successfully'.
Which method will you incorporate in your application to accomplish this requirement?
AFTER
UPDATE
AS
AFTER
DROP
AS
Print { You have removed it successfully}
AFTER
Alter
AS
AFTER
DELETE
AS
Q.37]
ON Project
FOR DELETE
AS
DELETE ProjectManager
ON t.Project_ID = d.Project_ID
B.A trigger named trgDeleteProject is created on the ProjectManager table and all the
corresponding records in the ProjectManager table are deleted whenever a row is deleted from the
ProjectManager table.
C.A trigger named trgDeleteProject is created on the Project table and all the corresponding records
in the Project table are deleted whenever a row is deleted from the ProjectManager table.
Q.38]
You are a database developer in Inpro, Inc. You have created a procedure in which you are creating
a a table to store some values that need to be processed during the execution of the procedure.
Before the end of execution of that procedure, the table is dropped. You want to monitor when the
table is created and dropped. For this, you have created the Audit table in which you insert a row
whenever the table is created or dropped.
A. Create an INSERT trigger that will insert rows in the Audit table whenever the table is created
and dropped.
B. Create an DDL trigger that will insert rows in the Audit table whenever the table is created and
dropped.
C.Create an DELETE trigger that will insert rows in the Audit table whenever the table is created
and dropped.
D.Create an INSERT trigger that will insert rows in the Audit table whenever the table is created
and a DELETE trigger whenever the table is dropped.
Q.39]
You are developing an application for RedSky Inc., which is in the process of expansion. The
application should display the formatted report of the status of positions available in the company.
You are required to create a procedure named prcGetPos that will return the position description
and the position requirement for a specific code passed as Pcode.
The Position table has iBudgetStrength column containing the details of budgeted strength for the
position and iCurrentStrength column containing the current strength of the manpower for the
required position.
Which of the following option is the correct way to assign value to the parameters, if the declaration
of the parameters is as follows:
FROM Position
B. SELECT vDescription=@Description,
iBudgetedStrength - iCurrentStrength=@RD
FROM Position
RD = iBudgetedStrength - iCurrentStrength
FROM Position
WHERE cPositionCode = Pcd
FROM Position
Q.40]
Smith is working as a database programmer in Horizon Corporation. He has been assigned a task to
create a query that will give the output of the procedure named prcDisplayEmployee if the
procedure exists. He has executed the following queries:
sp_helptext prcDisplayEmployee
However, the queries doesnot display the output. Which of the following query should be used by
him to accomplish the task?
A.sp_helpdb prcDisplayEmployee
exec prcDisplayEmployee
B.sp_helpdb prcDisplayEmployee
output prcDisplayEmployee
C.sp_helptext prcDisplayEmployee
exec prcDisplayEmployee
D.sp_helptext prcDisplayEmployee
show prcDisplayEmployee