Sunteți pe pagina 1din 19

Premium Provider of IT Certification Training Tools!

Sample Questions and Answers

Exam Code: 70-433


Exam Name
TS: Microsoft SQL Server 2008, Database Development
Visit http://www.selfexamengine.com/microsoft-70-433.htm to purchase complete product.

Disclaimer: Self Exam Engine is a well-established brand in IT certifications preparation


and test tools to ensure your success in Cisco Specialist, Microsoft MCTS Questions,
CompTIA A+, Oracle 11g DBA Certification Training, IBM, Citrix, Hitachi, HP and many
more!
Exam Name: TS: Microsoft SQL Server 2008, Database Development
Exam Type: Microsoft
Exam Code: 70-433 Total Questions 199

Question: 1
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Logo. The company uses SQL Server 2008
and all the company data is stored in the SQL Server 2008 database. This morning you receive
an e-mail from your company manager, in the e-mail, the manager asks you to create a table
which is named dbo.Devices. Five rows have to be inserted into the dbo.Devices table. After this,
Devised has to be returned for each of the rows. Of the following Transact-SQL batches, which
one should be used?

A. CREATE TABLE dbo.Widgets ( Fidgeted UNIQUEIDENTIFIER PRIMARY KEY, Widget Name


VARCHAR(25) );GOINSERT dbo.Widgets (Widget Name)VALUE ('Widget One'),('Widget
Two'),('Widget Three'),('Widget Four'),('Widget Five');SELECT SCOPE_IDENTITY();
B. CREATE TABLE dbo.Widgets ( Fidgeted INT IDENTITY PRIMARY KEY, Widget Name
VARCHAR(25) );GOINSERT dbo.Widgets (Widget Name)VALUES ('Widget One'),('Widget
Two'),('Widget Three'),('Widget Four'),('Widget Five');SELECT SCOPE_IDENTITY();
C. CREATE TABLE dbo.Widgets ( Widget UNIQUEIDENTIFIER PRIMARY KEY, Widget Name
VARCHAR(25));GOINSERT dbo.Widgets (Widget Name)OUTPUT inserted.WidgetID,
inserted.WidgetNameVALUES ('Widget One'),('Widget Two'),('Widget Three'),('Widget
Four'),('Widget Five');
D. CREATE TABLE dbo.Widgets ( Widget INT IDENTITY PRIMARY KEY, Widget Name
VARCHAR(25));GOINSERT dbo.Widgets (Widget Name)OUTPUT inserted.WidgetID,
inserted.WidgetNameVALUES ('Widget One'),('Widget Two'),('Widget Three'),('Widget
Four'),('Widget Five');

Answer: D

Question: 2
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Loxgo. The company uses SQL Server
2008 and all the company data is stored in the SQL Server 2008 database. The SQL Server has
identified many missing indexes. Now you have to build CREATE INDEX statements for all the
missing indexes. Which dynamic management view should be used?

A. sys.dm_db_index_usage_stats should be used


B. sys.dm_db_missing_index_group_stats should be used
C. sys.dm_db_missing_index_details should be used
D. sys.dm_db_missing_index_columns should be used

Answer: B

Question: 3
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Loxgo. The company uses SQL Server
2008 and all the company data is stored in the SQL Server 2008 database. Look at code
segment below:

DECLARE @Range Start INT = 0;


DECLARE @Range End INT = 8000;
DECLARE @Range Step INT = 1;
WITH Number Range(Item Value)
AS (SELECT Item Value
FROM (SELECT @Range Start AS Item Value) AS t
UNION ALL
SELECT Item Value + @Range Step
FROM Number Range

Page 1 of 91
Exam Name: TS: Microsoft SQL Server 2008, Database Development
Exam Type: Microsoft
Exam Code: 70-433 Total Questions 199

WHERE Item Value < @Range End)


SELECT Item Value
FROM Number Range
OPTION (MAXRECURSION 100)

Do you know the result of executing this code segment? Which result will be returned?

A. 101 rows will be returned with a maximum recursion error.


B. 10,001 rows will be returned with a maximum recursion error
C. 101 rows will be returned with no error
D. 10,001 rows will be returned with no error

Answer: A

Question: 4
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Loxgo. The company uses SQL Server
2008 and all the company data is stored in the SQL Server 2008 database. There is a table
named dbo.Sellings in the database. The table contains the following table definition:

CREATE TABLE [dbo].[Selling](


[Selling ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY CLUSTERED,
[Order Date] [date time] NOT NULL,
[Customer] [int] NOT NULL,
[SellingPersonID] [int] NULL,
[Comment Date] [date] NULL);

Since you notice that this query takes a long time to run, you start to examine the data. You find
that only 2% of rows have comment dates and the SellingPersonID is null on 10% of the rows
after the examination. So you have to improve the query performance. You have to create an
index which must save disk space when optimize the query. Of the following index, which one
should you choose?

A. CREATE NONCLUSTERED INDEX idx2 ON dbo.Selling (Comment Date, SellingPersonID)


INCLUDE(Customer)WHERE Comment Date IS NOT NULL
B. CREATE NONCLUSTERED INDEX idx2ON dbo.Selling (CustomerID)INCLUDE
(CommentDate,SellingPersonID);
C. CREATE NONCLUSTERED INDEX idx2ON dbo.Selling (SellingPersonID)INCLUDE
(CommentDate,CustomerID);
D. CREATE NONCLUSTERED INDEX idx2ON dbo.Selling (Customer)INCLUDE(Comment
Date)WHERE SellingPersonID IS NOT NULL

Answer: A

Question: 5
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Lox go. The company uses SQL Server
2008 and all the company data is stored in the SQL Server 2008 database which is named DB1.
There is a table named Bill in DB1. BillID is the primary key of the Bill table. By using the identity
property, it is populated. The Bill table and the BillLineItem are related to each other. In order to
increase load speed, all constraints are removed from the Bill table during a data load. But a row
with BillId = 10 was removed from the database when you removed the constraints. Therefore
you have to re-insert the row into the Bill table with the same BillId value. Of the following options,
which Transact-SQL statement should be used?

Page 2 of 91
Exam Name: TS: Microsoft SQL Server 2008, Database Development
Exam Type: Microsoft
Exam Code: 70-433 Total Questions 199

A. INSERT INTO Bill(BillID, ...VALUES (10, ...


B. SET IDENTITY_INSERT Billon; INSERT INTO Bill(BillID, ...VALUES (10, ...SET
IDENTITY_INSERT Bill OFF;
C. ALTER TABLEBill;ALTER COLUMN BillID int;INSERT INTO Bill(BillID, ...VALUES (10, ...
D. ALTER DATABASE DB1SET SINGLE_USER;INSERT INTO Bill(BillID, ...VALUES (10,
...ALTER DATABASE DB1SET MULTI_USER;

Answer: B

Question: 6
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Lox go. The company uses SQL Server
2008 and all the company data is stored in the SQL Server 2008 database. There are two tables
in the company database. One table is named Sub items which includes sub items for shoes,
hats and shirts. Another one is named Commodities which includes commodities only from the
Sub items shoes and hats.
Look at the following query:

SELECT s.Name, p.Name AS Commodity Name


FROM Sub items s
OUTER APPLY
(SELECT *
FROM Commodities pr
WHERE pr.SubitemID = s.SubitemID) p
WHERE s.Name IS NOT NULL;

Now you have to foretell what results the query produces. So what is the answer?

A. Name Commodity Name---------- --------------------Shoes Mountain Bike Shoes,Shoes Mountain


Bike Shoes, Shoes Racing Shoes, MShoes Racing Shoes, LHats Classic Hat, SHats Classic
Hat, MHats Classic Hat, LNULL Mountain Bike Shoes, NULL Mountain Bike Shoes, NULL
Racing Shoes, MNULL Racing Shoes, LNULL Classic Hat, SNULL Classic Hat, MNULL
Classic Hat, LShirts NULLNULL NULL
B. Name Commodity Name---------- --------------------Shoes Mountain Bike Shoes,Shoes Mountain
Bike Shoes,Shoes Racing Shoes, MShoes Racing Shoes, LHats Classic Hat, SHats Classic
Hat, MHats Classic Hat, L
C. Name Commodity Name---------- --------------------Shoes Mountain Bike Shoes,Shoes Mountain
Bike Shoes,Shoes Racing Shoes, MShoes Racing Shoes, LHats Classic Hat, SHats Classic
Hat, MHats Classic Hat, LShirts NULL
D. Name Commodity Name---------- --------------------Shoes Mountain Bike Shoes,Shoes Mountain
Bike Shoes,Shoes Racing Shoes, MShoes Racing Shoes, LHats Classic Hat, SHats
ClassicHat, MHats Classic Hat, Shirts NULLNULL NULL

Answer: C

Question: 7
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Loxgo. The company uses SQL Server
2008 and all the company data is stored in the SQL Server 2008 database. There are two tables
in the database of the company. The two tables are respectively named Selling’s and Selling
History. Historical selling data is stored in the Selling History table. On the Selling’s table, you
perform the configuration of Change Tracking. The minimum valid version of the Selling’s table is
10. There is selling data that changed since version 10. According to the company requirement, a
query has to be written to export only these data, including the primary key of deleted rows. Of
the following methods, which one should be use?

Page 3 of 91
Exam Name: TS: Microsoft SQL Server 2008, Database Development
Exam Type: Microsoft
Exam Code: 70-433 Total Questions 199

A. FROM Selling’s INNER JOIN CHANGETABLE (CHANGES Selling’s, 10) AS C ...


B. FROM Selling’s RIGHT JOIN CHANGETABLE (CHANGES Selling’s, 10) AS C ...
C. FROM Selling’s RIGHT JOIN CHANGETABLE (CHANGES Selling History, 10) AS C ...
D. FROM Selling’s INNER JOIN CHANGETABLE (CHANGES Selling History, 10) AS C ...

Answer: B

Question: 8
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Loxgo. The company uses SQL Server
2008 and all the company data is stored in the SQL Server 2008 database. There are two tables
in the database of the company. The two tables are respectively named Clients and Bills. Now
you get an e-mail from your company manager, you've been assigned a task that you have to
write a SELECT statement. The statement should output client and bill data as a valid and well-
formed XML document. You have to mix attribute and element based XML within the document.
But you think that it is not proper to use the FOR XML AUTO clause. You have to find the suitable
FOR XML clause. Of the following FOR XML statement, which one should be used? (choose
more than one)

A. FOR XML PATH should be used


B. FOR BROWSE should be used
C. FOR XML EXPLICIT should be used
D. FOR XML RAW should be used

Answer: A, C

Question: 9
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Lox go. The company uses SQL Server
2008 and all the company data is stored in the SQL Server 2008 database. There's a table
named Clients in the database. The Clients table contains an XML column which is named Client
Info. At present the Client table contains no indexes. Look at the WHERE clause below: WHERE
ClientInfo.exist ('/Client Demographic/@Age[.>="21"]') = 1 You use this clause in a query for
which indexes have to be created. Of the following Transact-SQL statements, which one should
be used?

A. CREATE PRIMARY XML INDEX PXML_IDX_ClientON Clients(Client Info);CREATE XML


INDEX SXML_IDX_Client ON Client(Client Info)USING XML INDEX PXML_IDX_ClientFOR
VALUE;
B. CREATE PRIMARY XML INDEX PXML_IDX_ClientON Clients(Client Info);CREATE XML
INDEX SXML_IDX_Client ON Client(Client Info)USING XML INDEX PXML_IDX_ClientFOR
PATH;
C. CREATE CLUSTERED INDEX CL_IDX_Client ON Clients(Cliental);CREATE PRIMARY XML
INDEX PXML_IDX_ClientON Clients(Client Info);CREATE XML INDEX
SXML_IDX_Client_Property ON Client(Client Info)USING XML INDEX PXML_IDX_ClientFOR
VALUE;
D. CREATE CLUSTERED INDEX CL_IDX_Client ON Clients(Client);CREATE PRIMARY XML
INDEX PXML_IDX_ClientON Clients(Client Info);CREATE XML INDEX SXML_IDX_Client ON
Client(Client Info)USING XML INDEX PXML_IDX_ClientFOR PATH;

Answer: D

Page 4 of 91
Exam Name: TS: Microsoft SQL Server 2008, Database Development
Exam Type: Microsoft
Exam Code: 70-433 Total Questions 199

Question: 10
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Lox go. The company uses SQL Server
2008 and all the company data is stored in the SQL Server 2008 database. There are two tables
in the company database. The two tables are respectively named Bill and Bill Data. Bill
information is stored in the two tables. The Bill table relates to the Bill Data table through the
BillID column of each table. In the Bill table there is a column which is named LatestModifiedDate.
If the related bill in the Bill Data table is modified, you must make sure that the
LatestModifiedDate column must reflect the data and time of the modification. So you have to
create a trigger. Of the following Transact-SQL statement, which one should be used?

A. CREATE TRIGGER [emendate] ON [Bill]AFTER UPDATE FOR REPLICATION AS UPDATE


[Bill] SET [LatestModifiedDate] = GETDATE() FROM inserted WHERE inserted.[BillID] =
[Bill].[BillID]
B. CREATE TRIGGER [uModDate] ON [Bill Details]INSTEAD OF UPDATE FOR
REPLICATIONAS UPDATE [Bill] SET [LatestModifiedDate] = GETDATE() FROM inserted
WHERE inserted.[BillID] = [Bill].[BillID];
C. CREATE TRIGGER [uModDate] ON [Bill Details] AFTER UPDATE NOT FOR REPLICATION
AS UPDATE [Bill] SET [LatestModifiedDate] = GETDATE() FROM inserted WHERE
inserted.[BillID] = [Bill].[BillID];
D. CREATE TRIGGER [uModDate] ON [Bill]INSTEAD OF UPDATE NOT FOR REPLICATIONAS
UPDATE [Bill] SET [LatestModifiedDate] = GETDATE() FROM inserted WHERE
inserted.[BillID] = [Bill].[BillID];

Answer: C

Question: 11
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Lox go. The company uses SQL Server
2008 and all the company data is stored in the SQL Server 2008 database. There's a table which
is named Essays. The Essays table contains two columns respectively named Essay Head and
Detail. The two columns all contain a full-text index. The word "technology" may be in column
Essay Head or in column Detail. You have to return row from the Essay table. Of the following
code segments, which one should be used?

A. SELECT * FROM Books WHERE FREETEXT(BookTitle,'computer')


B. SELECT * FROM Books WHERE FREETEXT(*,'computer')
C. SELECT * FROM Books WHERE Book Title LIKE '%computer%'
D. SELECT * FROM Books WHERE Book Title = '%computer%' OR Description = '%computer%'

Answer: B

Question: 12
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Lox go. The company uses SQL Server
2008 and all the company data is stored in the SQL Server 2008 database. Look at the following
query.

SELECT Addressed,
AddressLine1,
City,
Postal Code
FROM Person. Address
WHERE City = @city name
AND Postal Code = @postal code

Page 5 of 91
Exam Name: TS: Microsoft SQL Server 2008, Database Development
Exam Type: Microsoft
Exam Code: 70-433 Total Questions 199

You notice that for a particular set of parameter values, sometimes this query has an unstable
performance, sometimes it runs quickly while sometimes it executes slowly. You also notice that
in the Address table, 92 percent of the rows contain the same value for the city. You have to
improve the query performance. For the particular set of parameter values, you have to identify a
query hint which will optimize the query.
Which query hint should be used?

A. OPTIMIZE FOR should be used


B. FAST should be used
C. PARAMETERIZATION FORCED should be used
D. MAXDOP should be used

Answer: A

Question: 13
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Loxgo. The company uses SQL Server
2008 and all the company data is stored in the SQL Server 2008 database. Now you get an order
from the company manger. The company manager assigns a task to you that you have to
perform the configuration on the Service Broker, making it process messages within a single
database. You have completed three steps: CREATE MESSAGE TYPE; CREATE CONTRACT;
CREATE QUEUE. After the above three steps, you have to complete the confifuration. So what is
the next step?

A. CREATE ROUTE is the next step.


B. CREATE SERVICE is the next step
C. CREATE ENDPOINT is the next step
D. CREATE BROKER PRIORITY is the next step.

Answer: B

Question: 14
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Lox go. The company uses SQL Server
2008 and all the company data is stored in the SQL Server 2008 database. You manage a SQL
Server 2008 database of the company. Now you get an e-mail from your company manager, in
the e-mail, you have been assigned a task. You have to send e-mail from a stored procedure. But
when you start to perform this, you notice that that a MAPI client has not been installed. In the
following options, which system stored procedure should be used?

A. sysmail_start_sp should be used.


B. xp_sendmail should be used
C. xp_startmail should be used.
D. sp_send_dbmail should be used

Answer: D

Question: 15
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Lox go. The company uses SQL Server
2008 and all the company data is stored in the SQL Server 2008 database. Now you get an email
from your company, in the email, you're assigned a task. You have to configure Full-Text Search,
making it ignore specific words. So of the following Full-Text Search components, which one
should be used?

Page 6 of 91
Exam Name: TS: Microsoft SQL Server 2008, Database Development
Exam Type: Microsoft
Exam Code: 70-433 Total Questions 199

A. filter should be used


B. Thesaurus file should be used
C. Word breakers should be used.
D. Stop list should be used.

Answer: D

Question: 16
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Lox go. The company uses SQL Server
2008 and all the company data is stored in the SQL Server 2008 database. There is a table which
is named Item.
Look at the following location:
PS
SQLSERVER:\SQL\CONTOSO\DEFAULT\Databases\ReportServer\Tables\dbo.Inventory\Colum
ns>
At this location, you use the SQL Server Windows Power Shell provider to open a Microsoft
Windows Power Shell session. You have to query all the columns in Item table using the e SQL
Server Windows Power Shell provider. Of the following options, which cmdlet should be used?

A. Get-Child Item should be used


B. Get-Item Property should be used
C. Get-Item should be used
D. Get-Location should be used

Answer: A

Question: 17
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Lox go. The company uses SQL Server
2008 and all the company data is stored in the SQL Server 2008 database. Enterprise Edition
and all the company data is stored in the SQL Server 2008 database. There's a table named
Modifications. The data is the table is frequently modified. According to the company requirement,
you have to maintain a history of all data modifications, the type of modification and the values
modified also have to be kept. Of the following tracking methods, which one should you use?

A. C2 Audit Tracing
B. Change Data Capture
C. Database Audit
D. Change Track in

Answer: B

Question: 18
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Loxgo. The company uses SQL Server
2008 and all the company data is stored in the SQL Server 2008 database. You insert the
WorkerID of each Worker's manager in the Reports To column to document your company's
organizational hierarchy. You have to write a recursive query. The query should produce a list of
Workers and their manager and include the Worker's level in the hierarchy. You write the
following code segment. (Line numbers are used for reference only.)

1 WITH Worker List (WorkerID, Full Name, Manager Name, Level)


2 AS (

Page 7 of 91
Exam Name: TS: Microsoft SQL Server 2008, Database Development
Exam Type: Microsoft
Exam Code: 70-433 Total Questions 199

3
4)
5 SELECT WorkerID, Full Name, Manager Name, Level
6 FROM Worker List;
At line 3, which code segment should you insert?

A. SELECT WorkerID, Full Name, '' AS [ReportsTo], 1 AS [Level] FROM Worker WHERE
ReportsTo IS NULL UNION ALL SELECT emp.WorkerID, emp.FullNName mgr.FullName, 1 +
1 AS [Level] FROM Worker emp JOIN Worker mgr ON emp.ReportsTo = mgr.WorkerID
B. SELECT WorkerID, Full Name, '' AS [ReportsTo], 1 AS [Level] FROM Worker WHERE
ReportsTo IS NULL UNION ALL SELECT emp.WorkerID, emp.FullName, mgr.FullName,
mgr.Level + 1 FROM Worker List mgr JOIN Worker emp ON emp.ReportsTo = mgr.WorkerId
C. SELECT WorkerID, Full Name, '' AS [Reports To], 1 AS [Level] FROM Worker UNION ALL
SELECT emp.WorkerID, emp.FullName, mgr.FullName, 1 + 1 AS [Level] FROM Worker emp
LEFT JOIN Worker mgr ON emp.ReportsTo = mgr.WorkerID
D. SELECT WorkerID, Full Name, '' AS [ReportsTo], 1 AS [Level] FROM Worker UNION ALL
SELECT emp.WorkerID, emp.FullName, mgr.FullName, mgr.Level + 1 FROM Worker List mgr
JOIN Worker emp ON emp.ReportsTo = mgr.WorkerID

Answer: B

Question: 19
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Lox go. The company uses SQL Server
2008 and all the company data is stored in the SQL Server 2008 database. Sales information for
your company orders is stored in this database. According to the company requirement, a
common table expression (CTE) has to be implemented. In the options below, which code
segment should be used?

A. SELECT Year, Region, Total FROM (SELECT Year, Region, SUM(Order Total) AS Total
FROM Orders
GROUP BY Year, Region) AS [SalesByYear];
B. SELECT DISTINCT Year, Region, (SELECT SUM(Order Total) FROM Orders SalesByYear
WHERE
Orders. Year = SalesByYear.YEAR
AND Orders. Region = SalesByYear.Region) AS [Total] FROM Orders;
C. CREATE VIEW SalesByYear AS SELECT Year, Region, SUM(Order Total) FROM Orders
GROUP BY
Year, Region; GO SELECT Year, Region, Total FROM
SalesByYear;
D. WITH SalesByYear(Year,Region,Total) AS (SELECT Year, Region, SUM(Order Total) FROM
Orders
GROUP BY Year, Region) SELECT Year, Region, Total FROM
SalesByYear;

Answer: D

Question: 20
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Loxgo. The company uses SQL Server
2008 and all the company data is stored in the SQL Server 2008 database. Sales information for
your company orders is stored in this database. According to the requirement for marketing
analysis, your company wants you to identify the orders with the highest average unit price and
an order total greater than 8,000. There should be less than 30 orders in the list. Of the follow
queries, which one should you use?

Page 8 of 91
Exam Name: TS: Microsoft SQL Server 2008, Database Development
Exam Type: Microsoft
Exam Code: 70-433 Total Questions 199

A. SELECT TOP (30) o.SalesOrderId, o.OrderDate, outtalk, SUM(od.Qty * od.UnitPrice) /


SUM(od.Qty) AS
[AvgUnitPrice]FROM Sales.SalesOrderHeader o JOIN Sales.SalesOrderDetail
od ON o.SalesOrderId = od.SalesOrderId WHERE outtalk> 8000 GROUP BY o.SalesOrderId,
o.OrderDate,
outtalk ORDER BY Total DESC;
B. SELECT TOP (30) o.SalesOrderId, o.OrderDate, outtalk, (SELECT SUM(od.Qty *
od.UnitPrice) /
SUM(od.Qty) FROM Sales.SalesOrderDetail od WHERE o.SalesOrderId =
od.SalesOrderId) AS [AvgUnitPrice]FROM Sales.SalesOrderHeader nowhere outtalk > 8000
ORDER BY
outtalk DESC, AvgUnitPrice;
C. SELECT TOP (30) o.SalesOrderId, o.OrderDate, outtalk, SUM(od.QTY * od.UnitPrice) /
SUM(od.Qty)
AS [AvgUnitPrice]FROM Sales.SalesOrderHeader o JOIN
SALES.SalesOrderDetail od ON o.SalesOrderId = od.SalesOrderId WHERE outtalk> 8000
GROUP BY
o.SalesOrderId, o.OrderDate, outtalk ORDER BY AvgUnitPrice;
D. SELECT TOP (30) o.SalesOrderId, o.OrderDate, outtalk, (SELECT SUM(od.Qty *
od.UnitPrice) /
SUM(od.QTY) FROM Sales.SalesOrderDetail od WHERE o.SalesOrderId =
od.SalesOrderId) AS [AvgUnitPrice]FROM Sales.SalesOrderHeader o WHERE outtalk> 8000
ORDER BY
AvgUnitPrice DESC;

Answer: D

Question: 21
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Lox go. The company uses SQL Server
2008 and all the company data is stored in the SQL Server 2008 database. Now you manage a
SQL Server 2008 instance. The instance is configured to use the Latin1_General_CS_AS
collation. You use the statements below to create a database.
CREATE DATABASE TestDB COLLATE Estonian_CS_AS;
GO
USE TestDB;
GO
CREATE TABLE TestPermTab (Primary Key int PRIMARY KEY, Col1 nchar );
You implement a temporary table named #TestTempTab that uses the following code.
USE TestDB;
GO
CREATE TABLE #TestTempTab (Primary Key int PRIMARY KEY, Col1 nchar );
INSERT INTO #TestTempTab
SELECT * FROM TestPermTab;

You have to decide which collation will be assigned to #TestTempTab. In the options below,
which collation will be assigned?

A. Latin1_General_CS_AS
B. No-collation
C. Estonian_CS_AS
D. The collation selected by the Windows system locale of the server

Answer: A

Page 9 of 91
Exam Name: TS: Microsoft SQL Server 2008, Database Development
Exam Type: Microsoft
Exam Code: 70-433 Total Questions 199

Question: 22
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Lox go. The company uses SQL Server
2008 and all the company data is stored in the SQL Server 2008 database. Your company
assigns a task to you that you have to write a query. The query returns the sequential number of
a row within a partition of a result set by using a ranking function, the row starts at1 for the first
row in each partition. In order to accomplish this task, which Transact-SQL statement should you
use?

A. You should use RANK


B. You should use NTILE(10)
C. You should use ROW_NUMBER
D. You should use DENSE_RANK

Answer: C

Question: 23
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Lox go. The company uses SQL Server
2008 and all the company data is stored in the SQL Server 2008 database. There is a table which
is named Work Employee in the database. Now you get an order from your company manager, a
row in the Work Employee should be deleted. You're assigned this task. A transaction should be
written. The transaction should allow the database to be restored to the exact point the record
was deleted but the time of execution is not needed. Of the following queries, which one should
be used?

A. DECLARE @Candidate Name varchar(50) = 'Delete_Candidate'BEGIN TRANSACTION


@CandidateNameDELETE FROMWorkEmployee WHEREWorkEmployeeID = 10; COMMIT
TRANSACTION @Candidate Name;
B. BEGIN TRANSACTIONDELETE FROMWorkEmployeeWHEREWorkEmployeeID =
10;COMMIT
TRANSACTION;
C. BEGIN TRANSACTION WITH MARK N'Deleting a Job Candidate’; DELETE
FROMWorkEmployee
WHEREWorkEmployeeID = 10; COMMIT TRANSACTION
D. BEGIN TRANSACTION Delete Candidate WITH MARK DELETE FROMWorkEmployee
WHEREWorkEmployeeID = 10; COMMIT TRANSACTION Delete Candidate;

Answer: D

Question: 24
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Lox go. The company uses SQL Server
2008 and all the company data is stored in the SQL Server 2008 database. There is a table
named Employee. The table contains a clustered index on EmployeeID and a nvarchar column
named Family name. The Family name column has Russian and Korean characters.
You will use the following code segment to search by Surname.
IF @lang ='Russian'
SELECT PersonID, Surname
FROM Person
WHERE Surname = @Search Name COLLATE Cyrillic_General_CI_AS
IF @lang = 'Japanese'
SELECT PersonID, Surname
FROM Person

Page 10 of 91
Exam Name: TS: Microsoft SQL Server 2008, Database Development
Exam Type: Microsoft
Exam Code: 70-433 Total Questions 199

WHERE Surname = @Search Name COLLATE Japanese_CI_AS_KS


Now your company assigns a task to you. According to the company requirement, you have to
enable
SQL Server, making it perform an index seek for these queries.
What action should you perform?

A. An index should be created on the Surname column.


B. For each collation that needs to be searched, a computed column should be created. Then on
the Surname column, an index should be created
C. For each collation that needs to be searched, a computed column should be created. On each
computed column, an index should be created
D. For each collation that needs to be searched, a new column should be created. Then you
should copy the data from the Surname column. Create an index on each new column.

Answer: C

Question: 25
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Lox go. The company uses SQL Server
2008 and all the company data is stored in the SQL Server 2008 database. There're two tables in
the database. The two tables are respectively named Commodity Sort and CommoditySubSort.
According to the company requirement, a query should be written. A list of commodity sorts which
contain more than ten sub-sorts should be returned by the query. As the technical support, the
company assigns this task to you. You have to write this query. In the options below, which query
should be used?

A. SELECT [Name] FROM Commodity Sort c WHERE EXISTS (SELECT CommoditySortID


FROM
CommoditySubSort WHERE CommoditySortID= c.CommoditySortID
GROUP BY CommoditySortID HAVING COUNT(*) > 10)
B. SELECT [Name] FROM Commodity Sort c WHERE NOT EXISTS (SELECT CommoditySortID
FROM
CommoditySubSort WHERE CommoditySortID=
c.CommoditySortID GROUP BY CommoditySortID HAVING COUNT(*) > 10)
C. SELECT [Name] FROM CommoditySubSort WHERE CommoditySortIDIN ( SELECT
CommoditySortID
FROM Commodity Sort) GROUP BY [Name] HAVING COUNT(*) > 10
D. SELECT [Name] FROM CommoditySubSort WHERE CommoditySortIDNOT IN (SELECT
CommoditySortID FROM Commodity Sort) GROUP BY [Name] HAVING
COUNT(*) > 10

Answer: A

Question: 26
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Lox go. The company uses SQL Server
2008 and all the company data is stored in the SQL Server 2008 database. There're two columns
that are used to store data information by your company. The two columns are respectively
named Column1 and Column2. Column1 contains the data in local time, Column2 contains the
difference between local time and UTC time. According to the company requirement, this data
has to be stored in a single column. As the technical support, you have to accomplish this task.
Of the following data types, which one should you choose?

A. datetime2(5)
B. datetimeoffset

Page 11 of 91
Exam Name: TS: Microsoft SQL Server 2008, Database Development
Exam Type: Microsoft
Exam Code: 70-433 Total Questions 199

C. time
D. datetime2

Answer: B

Question: 27
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Loxgo. The company uses SQL Server
2008 and all the company data is stored in the SQL Server 2008 database. Now you receive an
e-mail from your company manager, in the e-mail, he wants a unique constraint to be created. As
the IT engineer, you are assigned this task. So you have to create a column which allows the
creation of a unique constraint. Of the following column definitions, which one can be used?
(choose more than one)

A. nvarchar(100) NULL
B. nvarchar(100) NOT NULL
C. nvarchar(max) NOT NULL
D. nvarchar(100) SPARSE NULL

Answer: A, B

Question: 28
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Lox go. The company uses SQL Server
2008 and all the company data is stored in the SQL Server 2008 database. There're two
partitioned tables respectively named Deal and Deal Detail. Now you get an order from your
company manager, according to his requirement, one of the partitions of the Transaction table
has to be archived to the Transaction History table. You have to accomplish this task. In the
options below, which method should be used?

A. ALTER PARTITION FUNCTION ... MERGE ...


B. ALTER PARTITION FUNCTION ... SPLIT ...
C. ALTER TABLE ... SWITCH ...
D. INSERT ... SELECT ...; TRUNCATE TABLE

Answer: C

Question: 29
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Lox go. The company uses SQL Server
2008 and all the company data is stored in the SQL Server 2008 database which is 5 GB. There's
a table named Selling Details in the database. You often perform the inserting and updating of the
Selling information. Today you get a report saying that in the Selling Details table, there happens
excessive page splitting. As the technical support, you must solve this problem, that is to say, you
have to minimize the chance of the page splitting. In the options below, which code segment
should you choose?

A. EXEC sys.sp_configure 'fill factor (%)', '60';


B. ALTER INDEX ALL ON Selling.SellingHistory REBUILD WITH (FILLFACTOR = 60);
C. UPDATE STATISTICS Selling.SellingHistory(Products) WITH FULLSCAN, NORECOMPUTE;
D. ALTER DATABASE Selling MODIFY FILE (NAME = Sellingdat3, SIZE = 10GB);

Answer: B

Page 12 of 91
Exam Name: TS: Microsoft SQL Server 2008, Database Development
Exam Type: Microsoft
Exam Code: 70-433 Total Questions 199

Question: 30
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Lox go. The company uses SQL Server
2008 and all the company data is stored in the SQL server 2008 database. According to the
business development, you are developing a new database, which will have two tables named
SallsBillItem and Goods contained. They are related to each other. Now you are assigned a task
to make sure that all goods referenced in the SalesBillItem table have a corresponding record in
the goods table. Which method would be used to accomplish this task?

A. DDL trigger would be used to accomplish this task


B. Foreign key constraint would be used to accomplish this task.
C. Primary key constraint would be used to accomplish this task.
D. DML trigger would be used to accomplish this task
E. JOIN would be used to accomplish this task

Answer: B

Question: 31
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Lox go. The company uses SQL Server
2008 and all the company data is stored in the SQL server 2008 database. You have a table
named Client. Now you are assigned a task to make sure that client data in the table not only
make the credit limit less than 10,000, but also make the credit limit zero when client identification
has not been verified. So which constraint would you check to accomplish this task?

A. ((Credulity = 0 AND Verified = 0) OR (Credulity BETWEEN 1 AND 10000 AND Verified = 1))
B. (Credulity BETWEEN 1 AND 10000)
C. (Verified = 1 AND Credulity BETWEEN 1 AND 10000)
D. ((Credulity = 0 AND Verified = 0) AND (Credulity BETWEEN 1 AND 10000 AND Verified =
1))
E. ((Verified = 1 AND Credulity BETWEEN 1 AND 10000) AND (Credulity BETWEEN 1 AND
10000
AND Verified = 1))

Answer: A

Question: 32
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Lox go. The company uses SQL Server
2008 and all the company data is stored in the SQL server 2008 database. A table that has the
GPS location of clients stored is being created to meet the business needs. Now you are asked to
make sure that the table allows you the following issues:

1. Calculate the distance between a client and the nearest store.


2. Identify clients within a specified sales boundary.

So of the data type below, which one would be used?

A. Nvarchar(max) would be used


B. Virginity(max) FILESTREAM would be used.
C. Algebra would be used
D. Geometry would be used.

Answer: D

Page 13 of 91
Exam Name: TS: Microsoft SQL Server 2008, Database Development
Exam Type: Microsoft
Exam Code: 70-433 Total Questions 199

Question: 33
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Lox go. The company uses SQL Server
2008 and all the company data is stored in the SQL server 2008 database. You have two tables
respectively named Bills and Bill Items as shown as the following:
From the table we can see the Bill Items is related to Bills by a foreign key that enables
CASCADE
DELETE.
Now you are asked to have all records removed from the Bills table.
Of the Transact-SQL statements below, which one would be used?

A. DROP FROM Bill Items statement would be used


B. DROP TABLE Bills statement would be used
C. DELETE FROM Bills statement would be used
D. TRUNCATE TABLE Bills statement would be used.
E. DELETE FROM Bill Items statement would be used.

Answer: C

Question: 34
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Lox go. The company uses
SQL Server 2008 and all the company data is stored in the SQL Server 2008 database. There
are two tables in the database. The two tables are respectively named Client and Selling Order.
There are Clients who has have never made any orders and Clients who only made purchases
with an Order Total less than 90. Now the company manager wants to view the list of these
Clients. So you have to identify all these Clients. Of the following options, which query should be
used?

A. SELECT *FROM Client WHERE 100 > (SELECT MAX(Order Total) FROM Selling Order
WHERE
Client.ClientID = SellingsOrder.ClientID)
B. SELECT *FROM Client WHERE 100 > ALL (SELECT Order Total FROM Selling Order
WHERE
Client.ClientID = SellingsOrder.ClientID)
C. SELECT *FROM Client WHERE 100 > SOME (SELECT Order Total FROM Selling Order
WHERE
Client.ClientID = SellingsOrder.ClientID)
D. SELECT *FROM Client WHERE EXISTS (SELECT SellingsOrder.ClientID FROM Selling
Order
WHERE Client.ClientID = SellingsOrder.ClientID AND
SellingsOrder.OrderTotal <= 100)

Answer: B

Question: 35
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Loxgo. The company uses SQL Server
2008 and all the company data is stored in the SQL server 2008 database. You have two tables
respectively named Clients and Bills. According to the business requirements, a list of each
Client's name and number of bills should be produced for clients that have placed at least one
Bill. Which query should be used to achieve this goal?

A. SELECT c.ClientName, SUM(o.BillID) AS [Bill Count] FROM Clients c JOIN Bills o ON


c.ClientID =

Page 14 of 91
Exam Name: TS: Microsoft SQL Server 2008, Database Development
Exam Type: Microsoft
Exam Code: 70-433 Total Questions 199

o.ClientID GROUP BY c.ClientName HAVING COUNT(unbilled) > 1


B. SELECT c.ClientName, COUNT(unbilled) AS [Bill Count] FROM Clients c JOIN Bills o ON
c.ClientId =
o.ClientId GROUP BY c.ClientName
C. SELECT c.ClientName, SUM(unbilled) AS [Bill Count] FROM Clients c JOIN Bills o ON
c.ClientID =
o.ClientID GROUP BY c.ClientName
D. SELECT COUNT(o.BillId) AS [Bill Count] FROM CLIENTS c JOIN BILLS o ON c.CLIENTID =
o.CLIENTID
E: SELECT c.ClientName, COUNT(o.BillID) AS [Bill Count] FROM Clients c JOIN Bills o ON
c.ClientID =
o.ClientID GROUP BY c.ClientName HAVING COUNT(o.BillID) > 1

Answer: B

Question: 36
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Loxgo. Now you are asked to use a code
segment to have the value 2.85 rounded to the nearest whole number, which code segment
would you select?

A. You would select ROUND (2.85, 1)


B. You would select ROUND (2.85, 0)
C. You would select ROUND (2.85, 2)
D. You would select ROUND (2.85, 1.0)
E. You would select ROUND (2.85, 2.0)

Answer: B

Question: 37
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Lox go. You have a table named Staff.
In order to identify the supervisor that each staff reports to, you write the following query:
SELECT e.StaffName AS [Staff Name],
s.StaffName AS [Supervisor Name]
FROM Staff e Now you are asked to make sure that a list of all staff and their respective
supervisor is returned by the query. So of the following join clauses, which one would be used to
complete the query?

A. LEFT JOIN Staff s ON e.StaffId = s.StaffId would be used to complete the query
B. INNER JOIN Staff s ON e.ReportsTo = s.StaffId would be used to complete the query.
C. LEFT JOIN Staff s ON e.ReportsTo = s.StaffId would be used to complete the query
D. RIGHT JOIN Staff s ON e.ReportsTo = s.StaffId would be used to complete the query
E. INNER JOIN Staff s ON e.StaffId = s.StaffId would be used to complete the query

Answer: C

Question: 38
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Lox go. The company uses SQL Server
2008 and all the company data is stored in the SQL server 2008 database. You have two tables
respectively named:
Sales and Sale Alters
Sales
SaleID 1 2 3 4

Page 15 of 91
Exam Name: TS: Microsoft SQL Server 2008, Database Development
Exam Type: Microsoft
Exam Code: 70-433 Total Questions 199

SaleName SaleA SaleB Sale SaleD


VendorID 0 1 1 0
Sale Alters
SaleID 1 2 3 5
Sale Name SaleA SaleB SaleC SaleE
VendorID 1 1 2 1
Then you execute the statement as the following:
MERGE Sales USING Sale Alters ON (Sales.SaleID = SaleAlters.SaleID)
WHEN MATCHED AND Sales.VendorID = A THEN DELETE
WHEN MATCHED THEN UPDATE SET Sales.SaleName = SaleAlters.SaleName
Sales.VendorID = SaleAlters.VendorID;

In order to identify the rows that will be displayed in the Sales table, which rows do you display?

A. SaleID 1 2 3 5
SaleName SaleA SaleB NewSaleC SaleE
VendorID 1 1 2 1
B. SaleID 1 2 3 4 5
SaleName SaleA SaleB NewSaleC SaleD SaleE
VendorID 1 1 2 0 1
C. SaleID 2 3
SaleName SaleB NewSaleC
VendorID 1 2
D. SaleID 2 3 4
SaleName SaleB NewSaleC SaleD
VendorID 1 2 0

Answer: D

Question: 39
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Lox go. The company uses SQL Server
2008 and all the company data is stored in the SQL server 2008 database. You have a table
named Sale. According to the business requirements, the sale prices should be increased by 15
percent for only the vendor named Hope Food shop, and then a list of the sales and updated
prices should be returned. So which code segment would be used to achieve this goal?

A. UPDATE Sale SET Price = Price * 1.15 SALE inserted.SaleName, inserted. Price WHERE
Sale.VendorName = ' Hope Food shop ' would be used to achieve this goal
B. UPDATE Sale SET Price = Price * 1.15, WHERE Sale.VendorName = ' Hope Food shop '
SALE
inserted.SaleName, inserted. Price would be used to achieve this goal.
C. UPDATE Sale SET Price = Price * 1.15, SaleName = SaleName WHERE Sale.VendorName =
' Hope Food shop ' would be used to achieve this goal
D. UPDATE Sale SET Price = Price * 1.15 SALE inserted.SaleName, deleted.Price WHERE
Sale.VendorName = ' Hope Food shop ' would be used to achieve this goal
E. UPDATE Sale SET Price = Price * 1.15 SaleName = SaleName
inserted.Price WHERE Sale.VendorName = ' Hope Food shop ' would be used to achieve this
goal.

Answer: A

Question: 40
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Loxgo. The company uses SQL Server

Page 16 of 91
Exam Name: TS: Microsoft SQL Server 2008, Database Development
Exam Type: Microsoft
Exam Code: 70-433 Total Questions 199

2008 and all the company data is stored in the SQL server 2008 database. You have two tables
and they are respectively named Salesman and Sales Zone. According to the business
requirements, you should use a Cartesian product that contains the data from the Salesman and
Sales Zone tables to create sample data. So of the following code segments, which one would be
used to achieve this goal?

A. SELECT p.SalesmanId, t.Name AS [Sales zone] FROM Sales. Salesman p CROSS JOIN
Sales.Saleszone t would be used to achieve this goal.
B. SELECT p.SalesmanId, t.Name AS [Sales zone] FROM Sales. Salesman p FULL JOIN
Sales.Saleszone t
ON p. SaleszoneId = t. SaleszoneId would be used to achieve this goal.
C. SELECT p.SalesmanId, t.Name AS [Sales zone] FROM Sales. Salesman p INNER JOIN
Sales.Saleszone t
ON p. SaleszoneId = t. SaleszoneId would be used to achieve this goal.
D. SELECT p.SalesmanId, t.Name AS [Sales zone] FROM Sales. Salesman p CROSS JOIN
Sales.Saleszone t
WHERE p. SaleszoneId = t. SaleszoneId would be used to achieve this goal

Answer: A

Question: 41
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Loxgo. The company uses SQL Server
2008 and all the company data is stored in the SQL server 2008 database. You have two tables
and they are respectively named Clients and Bills. According to the business requirements, data
of 30 days ago should be moved from Clients into Bills. Which code segment below would be
used to achieve this goal?

A. INSERT INTO Bill SELECT * FROM Client WHERE Record Date < DATEADD(D,-
30,GETDATE()) would be used to achieve this goal.
B. INSERT INTO Bill SELECT * FROM Client WHERE Record Date < DATEADD(D,-
30,GETDATE())
DELETE FROM Client would be used to achieve this goal
C. DELETE FROM Client OUTPUT deleted.* WHERE Record Date < DATEADD(D,-
30,GETDATE()) would be used to achieve this goal.
D. DELETE FROM Client OUTPUT DELETED.* INTO Bill WHERE Record Date <
DATEADD(D,-30,GETDATE()) would be used to achieve this goal

Answer: D

Question: 42
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Loxgo. The company uses SQL Server
2008 and all the company data is stored in the SQL server 2008 database. You are writing a
query, which returns a list of sales that have grossed more than $10,000.00 during the year 2007.
Meanwhile, the filter expression of SUM ([Order Details].Unit Price * [Order Details].Quantity) >
10000 should be inserted into the query. Of the clauses below, which one should be inserted into
this expression?

A. WHERE clause should be inserted into this expression


B. HAVING clause should be inserted into this expression
C. GROUP BY clause should be inserted into this expression
D. ON clause should be inserted into this expression
E. WHEN clause should be inserted into this expression

Page 17 of 91
Exam Name: TS: Microsoft SQL Server 2008, Database Development
Exam Type: Microsoft
Exam Code: 70-433 Total Questions 199

Answer: B

Question: 43
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Loxgo. The company uses SQL Server
2008 and all the company data is stored in the SQL server 2008 database. The following table is
named Products and the products data ordered by date of product and client name should be
returned. You should give each client a list of the most recent product at the first time. So of the
queries below, which one would be used?

A. SELECT Client Name, Products Date FROM Products ORDER BY Client Name, Products
Date DESC;
B. SELECT Client Name, Products Date FROM Products ORDER BY Client Name DESC;
C. SELECT Client Name, Products Date FROM Products ORDER BY Client Name DESC;
Products Date;
D. SELECT Client Name, Products Date FROM Products ORDER BY Client Name, Products
Date;
E. SELECT Client Name, Products Date FROM Products ORDER BY Products Date DESC,
Client Name

Answer: A

Question: 44
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Loxgo. The company uses SQL Server
2008 and all the company data is stored in the SQL server 2008 database. Now with a given
clause, you need to identify whether February will contain 29 days for a specified year. Which
object should be used to achieve this goal?

A. Table-valued function should be used to achieve this goal


B. Scalar-valued function should be used to achieve this goal.
C. DML trigger should be used to achieve this goal.
D. DDL trigger should be used to achieve this goal
E. Stored procedure should be used to achieve this goal

Answer: B

Question: 45
You are a database developer and you have many years experience in database development.
Now you are employed in a company which is named Loxgo. The company uses SQL Server
2008 and all the company data is stored in the SQL Server 2008 database. Your company utilizes
an application. The application uses stored procedures to pass XML to the database server.
There are large quantities of XML handles that are currently active in the database server. Since
the XML is not being cleared from SQL Server memory, you have to choose the system stored
procedure to flush the XML. Of the following Transact-SQL statements, which one should be
used?

A. sp_reserve_http_namespace
B. sp_xml_removedocument
C. sp_xml_preparedocument
D. sp_delete_http_namespace_reservation

Answer: B

Page 18 of 91

S-ar putea să vă placă și