Sql transaction what can come after

37 Views Asked by At

Can you please tell me why c and d are the right answers here ? Thank you

Select the statements that can be used to complete the following SQL code block

BEGIN TRANSACTION
SELECT COUNT(*) FROM Enrollments WHERE Accepted = 1
UPDATE Enrollments SET Accepted = 1 WHERE CourseTitle = ’Data Base’

(a) END TRANSACTION (b) END (c) COMMIT (d) ROLLBACK TRANSACTION

1

There are 1 best solutions below

0
DevWithZachary On BEST ANSWER

Because those are the SQL key words that can be used to end a transaction

COMMIT will submit your transaction and end it.

While ROLLBACK will, as its name suggests roll the database back to how it was before the transaction was started.