Which Transact-SQL statements will fail?

You are the database developer for a customer service application. The database has the following table and view.
CREATE TABLE Tickets (TicketId int, Department varchar(200), Status varchar(200), IsArchived bit);
GO
CREATE VIEW SupportTickets (TicketId, Department, Status, IsArchived)
AS
SELECT t.TicketId, t.Department, t.Status,t.IsArchived FROM Tickets t
WHERE t.Department = ‘support’ AND t.IsArchived = 0
WITH CHECK OPTION;
GO
INSERT INTO Tickets VALUES (1, ‘support’, ‘open’,0), (2, ‘support’, ‘open’, 0), (3, ‘support’, ‘open’, 0);
GO
You are assigned to review another developer’s code. You need to verify that the entire code is functional. Which Transact-SQL statements will fail?
A. INSERT INTO Tickets VALUES (4, ‘sales’, ‘open’, 0), (5, ‘support’, ‘open’, 0), (6, ‘support’, ‘open’,1)
B. UPDATE Tickets SET IsArchived = 1 WHERE TicketId IN (1, 2, 3)
C. UPDATE SupportTickets SET IsArchived = 1 WHERE TicketId IN (1, 2, 3)
D. UPDATE SupportTickets SET Status = ‘closed’ WHERE TicketId IN (1, 2, 3)
E. INSERT INTO SupportTickets VALUES (4, ‘support’, ‘open’, 0), (5, ‘support’, ‘in progress’, 0), (6,’support’, ‘closed’, 0)
F. INSERT INTO Tickets VALUES (4, ‘support’, ‘open’, 0), (5, ‘support’, ‘in progress’, 0), (6, ‘support’,’closed’, 0)
G. INSERT INTO SupportTickets VALUES (4, ‘support’, ‘open’, 1), (5, ‘support’, ‘in progress’, 1), (6,’support’, ‘closed’, 1)
H. DELETE FROM SupportTickets WHERE TicketId IN (1, 2, 3)

microsoft-exams

Leave a Reply

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


The reCAPTCHA verification period has expired. Please reload the page.